/* 
OLD COLORS
#d188f7 - light purple
#a415ef - dark purple
f8b4b4 - light red
e3342f  - deep red
77DD77 - light green
228B22 - dark green
*/

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600&display=swap');


/* Reset some defaults */
body {
  margin: 0;
  padding: 0;
  font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
  background-color: #FDF5E8;
  color: #222;
  text-align: center;
  white-space: normal;   /* ✅ allow wrapping */
  overflow-x: hidden;    /* ✅ prevent sideways scroll if something still overflows */
  line-height: 1.2;

}


/* Headings */
h2 {
  margin: 0.4rem 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: #333;
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0.3rem auto;
  width: 80%;
}

/* Buttons */
button {
  background-color: #333;
  color: white;
  border: none;
  padding: 0.25rem 0.8rem;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
  margin: 0.2rem;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #000;
}

#rules{
  font-size: 1.15rem;
  margin: 0.2rem 0;
}

/* Score sections — force onto their own line */
#score_best{
  display: block;       /* ensures they sit on their own line */
  font-size: 0.95rem;
  margin: 0.2rem 0;
  color: #444;
}

#score_current {
  display: block;       /* ensures they sit on their own line */
  font-size: 2.0rem;
  margin: 0.2rem 0;
  color: #444;
}

#quoteContainer {
  min-height: 250px;
  height: auto;
}

#quote {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  max-width: 400px;
  width: 100%;
  margin: 0rem auto;
  padding: 0.5rem;

  /* base parchment look */
  background-color: #f9f1d3;
  background-image:
    url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAY'),
    linear-gradient(to bottom, rgba(0,0,0,0.03), transparent 25%, rgba(0,0,0,0.03));
  background-blend-mode: overlay, normal;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 0 0 5px rgba(255, 255, 240, 0.8),
    0 8px 16px rgba(0, 0, 0, 0.15);

  /* jagged, torn edges */
  clip-path: polygon(
    5% 0, 95% 0, 100% 5%,
    100% 95%, 95% 100%, 5% 100%,
    0 95%, 0 5%
  );

  /* text styles */
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.3;
  text-align: center;
  color: #4b3621;
}

#quote::before,
#quote::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.08),
    transparent 70%
  );
  filter: blur(4px);
  pointer-events: none;
}

#quote::before {
  top: 10px;
  left: 15px;
}

#quote::after {
  bottom: 10px;
  right: 15px;
}


/* Opening quote in top-left corner */
#quote::before {
  content: "“";
  font-size: 2.5rem;   /* slightly smaller for mobile */
  color: #ccc;
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  line-height: 1;
}

/* Closing quote in bottom-right corner */
#quote::after {
  content: "”";
  font-size: 2.5rem;
  color: #ccc;
  position: absolute;
  bottom: 0.2rem;
  right: 0.2rem;
  line-height: 1;
}


/* Bold labels */
b {
  color: #000;
}

#guess {
  /*margin-left: calc(50% - 100px);*/
  font-size: 25px;
  text-align: center;
}

#submit_button_text button {
  background-color: #222; /* light red */
  color: white;              /* text color */
  border: none;              /* remove default border */
  padding: 6px 12px;         /* some spacing */
  border-radius: 4px;        /* rounded corners */
  cursor: pointer;           /* pointer on hover */
  font-size: 14px;
}

#submit_button_text button:hover {
  background-color: #000; /* deeper red on hover */
}

#next_button_text button {
  background-color: #000; /* light red */
  color: white;              /* text color */
  border: none;              /* remove default border */
  padding: 6px 12px;         /* some spacing */
  border-radius: 4px;        /* rounded corners */
  cursor: pointer;           /* pointer on hover */
  font-size: 14px;
}

#next_button_text button:hover {
  background-color: #000; /* deeper red on hover */
}

#play_again_button_text button {
  background-color: #000; /* light red */
  color: white;              /* text color */
  border: none;              /* remove default border */
  padding: 6px 12px;         /* some spacing */
  border-radius: 4px;        /* rounded corners */
  cursor: pointer;           /* pointer on hover */
  font-size: 14px;
}

#play_again_button_text button:hover {
  background-color: #000; /* deeper red on hover */
}

#score_best {
  display: block;
  font-size: 1.2rem;
  margin: 0.5rem auto;       /* ✅ auto left/right centers it */
  color: #444;
  max-width: 400px;          /* ✅ limit width */
  text-align: center;        /* ✅ center text inside */
  cursor: pointer;           /* ✅ make it feel clickable */
  box-sizing: border-box;
}

#score_best button {
  background-color: #333; /* light grey */
  color: white;              /* text color */
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#score_best button:hover {
  background-color: #000; /* dark grey on hover */
  color: white;              /* optional: invert text for contrast */
}

#score_best summary {
  max-width: 400px;
  cursor: pointer;
}

#score_best[open] summary {
  max-width: 400px;
  white-space: normal;   /* allow wrapping when expanded */
}


.floating-plus {
  position: absolute;
  color: #000;       /* green for positive */
  font-weight: bold;
  animation: floatUp 1s ease-out forwards;
  pointer-events: none; /* don’t block clicks */
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px);
  }
}

#pick_chapter {
  font-size: 16px;   /* or larger */
}

#chapter_buttons {
  display: flex;          /* lay out children in a row */
  justify-content: space-around; /* spread buttons evenly */
  align-items: center;
  width: 100vw;           /* full viewport width */
  margin: 0;              /* no margins */
  padding: 0.5rem;        /* optional padding */
  box-sizing: border-box; /* include padding in width */
}

hr {
  border: none;
  border-top: 1px solid black;
}

.responsive-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.responsive-img-short {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

#quote {
  font-family: 'Playfair Display', 'IM Fell English SC', Georgia, serif;
}

#backspace {
  /* enforce exact dimensions and remove default padding */
  width: 40px;
  height: 40px;
  font-size: 1.1rem;            /* small enough to fit */
}

.keypad button {
  /* enforce exact dimensions and remove default padding */
  width: 30px;
  height: 30px;
  padding: 0;
  box-sizing: border-box;

  /* circle styling */
  color: #000;                /* black font */
  background-color: #FDF5E8;    /* cream interior */
  border: 3px solid #000;       /* thick black ring */
  border-radius: 50%;           /* makes it a perfect circle */

  /* center the digit */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;               /* prevents text from stretching the height */

  /* typography & interactivity */
  font-size: 0.8rem;            /* small enough to fit */
  font-weight: 800; 
  cursor: pointer;
  transition: background-color 0.4s;
}

.keypad button:hover {
  background-color: #f9e1b9;    /* subtle hover effect */
}


.stat_text {
  font-size: 0.9rem;            /* small enough to fit */  
}

.stat_value {
  font-size: 1.5rem;            /* small enough to fit */  
}

/* the mask covers the entire container and intercepts pointer events */
.mask {
  position: absolute;
  inset: 0;                     /* top:0; right:0; bottom:0; left:0 */
  z-index: 10;                  /* above buttons inside the container */
  pointer-events: auto;         /* mask receives pointer events and blocks underlying items */
}

/* hide the mask when not blocking */
.mask.hidden {
  display: none;
}


summary {
  list-style: none; /* Removes default arrow in Firefox */
}

summary::-webkit-details-marker {
  display: none; /* Removes default arrow in Chrome/Safari */
}

summary::before {
  content: "";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.5s ease;
}

details[open] summary::before {
  transform: rotate(90deg); /* Rotates arrow when open */
}

.fake-button {
  background-color: #333;
  color: white;
  border: none;
  padding: 0.25rem 0.8rem;
  border-radius: 4px;
  font-size: 1.3rem;
  cursor: pointer;
  margin: 0.2rem;
  transition: background-color 0.2s ease;

  display: inline-block;
  border-radius: 4px;
  cursor: default;
  user-select: none;
}


@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.5s ease;
}


.stats-section {
  padding: 1rem;
  text-align: center;
}

.stats-table {
  margin: 0 auto;
  border-spacing: 30px 0;
}

.stat-value {
  font-weight: bold;
  font-size: 1.5rem;  
}



.bar-chart {
    margin: 0.5em auto;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    max-width: 400px;
    width: 100%;
    padding: 0.25em;
    box-sizing: border-box;
    background: transparent;
    color: #000;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
}

.bar-label {
    flex-shrink: 0;
    width: 150px;
    font-weight: 700;
    text-align: right;
    color: #000;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: transparent;
    border: 0px solid #000;
    border-radius: 0;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #000;
    border-radius: 0;
    transition: width 400ms ease;
}

.bar-value {
    flex-shrink: 0;
    font-weight: bold;
    font-size: 1.2rem;  
    width: 100px;
    text-align: left;
    color: #000;
    font-weight: 600;
}

@media (max-width: 360px) {
    .bar-label { width: 80px; font-size: 0.9rem; text-align: left; }
    .bar-value { width: 40px; font-size: 0.9rem; }
    .bar-track { height: 16px; }
}
