@font-face {
  font-family: "Noto Serif";
  src: url(../fonts/NotoSerif-Regular.ttf) format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  color-scheme: light dark;
  --color-black: #000;
  --color-gold: #e3b244;
  --color-gray: #75787a;
  --color-green: #75a268;
  --color-purple: #8e44ad;
  --color-red: #d9534f;
  --color-white: #fff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --font-serif: "Noto Serif", serif;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute only carries the UA's display:none, so any author
   display rule (e.g. display:flex on the modal, display:block on buttons)
   silently defeats it. This keeps hidden authoritative for every element. */
[hidden] {
  display: none !important;
}

@keyframes appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

body,
html {
  background-color: #f7f7f7;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--color-black);
}

body {
  padding-bottom: 2.25rem;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

.page {
  width: min(100%, 777px);
  margin-inline: auto;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
}

/* Top sticky header: puzzle label, verse quote, translation tag, reveal button */
.top-sticky {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #f7f7f7;
  padding: 0.75rem 0;
}

.frozen-card {
  background: var(--color-white);
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.top-sticky-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.puzzle-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}

#puzzle-label {
  color: var(--color-gray);
  text-transform: uppercase;
  word-spacing: 0.25em;
  text-align: center;
}

#daily-prev,
#daily-next {
  background: transparent;
  border: none;
  color: var(--color-gray);
  font-size: 1.4em;
  line-height: 1;
  width: auto;
  margin: 0;
  padding: 0.15em 0.55em;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

#daily-prev:disabled,
#daily-next:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (hover: hover) {
  #daily-prev:not(:disabled):hover,
  #daily-next:not(:disabled):hover {
    background: #eee;
  }
}

#verse-text {
  font-family: var(--font-serif);
  font-size: min(5vw, 1.5em);
  font-style: normal;
  color: inherit;
  margin: 0;
  padding: 0;
  text-align: center;
}

#verse-text::before {
  content: "\201C";
  color: #777;
  font-size: 3em;
  line-height: 0;
}

.translation-tag {
  display: block;
  text-align: center;
  font-size: 0.5em;
  color: #ddd;
  margin-top: 0.25rem;
}

.reveal-wrap {
  margin-top: 0.25rem;
  display: flex;
  justify-content: center;
}

#reveal-toggle {
  background: #f5f5f5;
  color: #666;
  font-size: 0.8em;
  width: auto;
  margin: 0;
  padding: 0.3em 0.6em;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
}

@media (hover: hover) {
  #reveal-toggle:hover {
    background: #eee;
    border-color: #ccc;
  }
}

/* Difficulty / score bar */
.stat-bar {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  background: var(--color-white);
  padding: 0.85rem max(2em, 10vw);
  border-top: 1px solid #eee;
}

#difficulty-label,
#score-label {
  font-weight: 700;
}

#difficulty-label::before {
  content: "Difficulty: ";
  color: var(--color-gray);
}

#score-label::before {
  content: "Score: ";
  color: var(--color-gray);
}

#score-label {
  color: var(--color-green);
}

.difficulty-easy {
  color: var(--color-green);
}

.difficulty-medium {
  color: var(--color-gold);
}

.difficulty-hard {
  color: var(--color-red);
}

/* Round titles / subtitles */
.round-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  margin: 0;
}

.round-subtitle {
  margin: 1rem;
  text-align: center;
}

/* Round 1/2 choice list: one shared bordered/rounded group */
.choice-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 0.5rem;
  overflow: hidden;
  line-height: 1.5em;
  margin-bottom: 1rem;
  animation: appear 0.5s ease-out;
}

.choice-list.interactive {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.choice-card {
  position: relative;
  padding: 1rem;
  border-bottom: 1px solid #bbb;
  background: var(--color-white);
  transition:
    color 0.5s,
    background 0.5s;
  overflow: hidden;
  cursor: pointer;
}

.choice-list .choice-card:last-child {
  border-bottom: 0;
}

.choice-card.correct {
  background: var(--color-green);
  color: var(--color-white);
  cursor: default;
}

.choice-card.incorrect {
  background: var(--color-gray);
  color: var(--color-white);
  cursor: default;
}

.choice-card.hinted {
  background: var(--color-gold);
  color: var(--color-black);
}

.choice-name {
  font-weight: 700;
  margin-right: 2.5rem;
}

.points-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--color-green);
  font-size: 0.85rem;
  font-weight: 700;
  animation: appear 0.5s ease-out;
}

.choice-name.look-indicator {
  font-weight: 400;
  margin-right: 0;
  text-align: center;
  animation: appear 0.5s ease-out;
}

.choice-reference,
.choice-description {
  /* Inherit color (not a fixed gray) so this reads dark on white cards and
     light on the green/gray/gold result cards. 0.85 (vs. the source site's
     0.8) keeps it clearly legible on the #75a268 correct-green card while
     still visibly secondary against black on white. */
  opacity: 0.85;
}

.choice-description {
  margin-top: 0.75rem;
}

/* Round 3 insert-puzzle */
.insert-puzzle {
  display: flex;
  flex-direction: column;
  width: 100%;
  line-height: 1.5em;
  margin-bottom: 1rem;
  animation: appear 0.5s ease-out;
}

.slot-card {
  position: relative;
  text-align: center;
  border: 1px solid #bbb;
  border-radius: 0.5rem;
  overflow: hidden;
  padding: 1rem;
  background: var(--color-white);
  cursor: pointer;
  transition:
    color 0.5s,
    background 0.5s;
}

.slot-card.correct {
  background: var(--color-green);
  color: var(--color-white);
  cursor: default;
}

.slot-card.incorrect {
  background: var(--color-gray);
  color: var(--color-white);
  cursor: default;
}

.slot-card.hinted {
  background: var(--color-gold);
  color: var(--color-black);
}

.insert-verse-text {
  padding: 1rem;
  font-family: var(--font-sans);
  line-height: 1.5em;
}

/* Hint button */
#hint-button {
  display: block;
  margin: 1rem auto;
  background: transparent;
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-weight: 700;
}

#hint-message {
  text-align: center;
  color: var(--color-gold);
  margin: 1rem 0;
}

/* Mode toggle (our own addition, kept understated): Daily|Practice as a
   centered either-or segmented control, Stats pinned to the far right */
#mode-toggle {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-white);
}

.mode-segment {
  display: inline-flex;
  border: 1px solid var(--color-gray);
  border-radius: 0.5rem;
  overflow: hidden;
}

.mode-segment button {
  background: transparent;
  border: none;
  color: var(--color-gray);
  padding: 0.4rem 1.25rem;
  font-size: 0.85rem;
}

.mode-segment button.active {
  background: var(--color-gray);
  color: var(--color-white);
}

#stats-button {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: 1px solid var(--color-gray);
  border-radius: 0.5rem;
  color: var(--color-gray);
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

#end-of-game {
  text-align: center;
  margin-top: 2rem;
}

#end-congrats {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

#end-reference {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

#daily-countdown {
  color: var(--color-gray);
  margin-top: 0.75rem;
  font-variant-numeric: tabular-nums;
}

#next-button {
  display: block;
  margin: 1rem auto;
  background: var(--color-green);
  color: var(--color-white);
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
}

#play-practice-button {
  display: block;
  margin: 1rem auto;
  background: var(--color-gold);
  color: var(--color-black);
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
}

/* Star rating (in-page end-of-game display) */
#end-stars {
  font-size: 1.75rem;
  color: var(--color-gold);
  letter-spacing: 0.15em;
  margin: 0.5rem 0;
}

/* Stats modal (Wordle-style completion popup) — the single stats surface */
#stats-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(90%, 360px);
  max-width: 360px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-white);
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 1.5rem;
  animation: appear 0.2s ease-out;
}

#modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--color-gray);
  line-height: 1;
  padding: 0.25rem;
}

#modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1rem;
}

.modal-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  text-align: center;
}

.modal-stat-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.modal-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-green);
}

.modal-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-gray);
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  margin: 1.5rem 0 0.75rem;
}

#star-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.star-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.star-row-label {
  width: 1.5rem;
  flex-shrink: 0;
  text-align: right;
  color: var(--color-gray);
  font-weight: 600;
}

.star-bar-track {
  flex: 1;
  display: flex;
}

.star-bar-fill {
  background: var(--color-gray);
  color: var(--color-white);
  text-align: right;
  padding: 0.15rem 0.4rem;
  border-radius: 0.15rem;
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 1.6rem;
}

.star-row-highlight .star-bar-fill {
  background: var(--color-green);
}

#clear-all-button {
  display: block;
  margin: 1.5rem auto 0;
  background: transparent;
  color: var(--color-red);
  border: 1px solid var(--color-red);
  border-radius: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
}

@media (hover: hover) {
  #clear-all-button:hover {
    background: var(--color-red);
    color: var(--color-white);
  }
}
