/* Numbered puzzles, You vs everyone, and the finish ribbons. Loaded after game.css. */

/* ---------- Heading link ---------- */
.puzzles-link {
  background: linear-gradient(180deg, #3a2215, #1e0f08);
  border-color: var(--brass);
  color: var(--brass-hi);
  box-shadow: inset 0 1px 0 rgba(231, 192, 106, .25), 0 3px 6px rgba(0, 0, 0, .5);
}

/* ---------- Ribbon across the top of the stub ---------- */
.stub-ribbon {
  position: relative;
  align-self: stretch;
  margin: -4px -8px 6px;
  padding: 7px 18px 4px;
  background: linear-gradient(180deg, #a3221b, var(--sign-red) 55%, var(--sign-red-deep));
  color: #ffe6b0;
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 211, 122, .55);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 220, 170, .35);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%);
}
.stub-ribbon[hidden] { display: none; }
.stub-ribbon[data-level="milestone"] { font-size: 18px; }
.result-stub.rise .stub-ribbon { animation: ribbon-unfurl .7s 1s cubic-bezier(.2, 1, .3, 1) both; }
@keyframes ribbon-unfurl {
  from { transform: scaleX(.2); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

/* ---------- Next action note ---------- */
.past-free-note {
  margin: -4px 0 0;
  text-align: center;
  color: var(--brass-hi);
  font-family: var(--marquee);
  font-size: 14.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .9;
}
.past-free-note[hidden] { display: none; }
.stub-links { flex-wrap: wrap; gap: 6px 18px; }

/* ---------- You vs everyone ---------- */
.vs-ticket[hidden] { display: none; }
.vs-ticket .ticket-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 24px 16px;
  text-align: center;
}
.vs-kicker {
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.vs-head {
  font-family: var(--slab);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.22;
  text-wrap: balance;
}
.vs-sub { margin: 0; font-size: 15.5px; line-height: 1.4; color: var(--ink-soft); }
.vs-ticket[data-state="loading"] .vs-head { opacity: .7; }
.vs-chart {
  width: 100%;
  height: 112px;
  margin: 24px 0 2px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
}
.vs-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; }
.vs-bar b { font-family: var(--slab); font-weight: 400; font-size: 15px; color: var(--ink-soft); }
.vs-fill {
  position: relative;
  min-height: 4px;
  border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, #c7ab78, #a98a55);
  box-shadow: inset 0 1px 0 rgba(255, 240, 196, .5);
  transform-origin: bottom;
}
.vs-ticket[data-state="ready"][data-anim="on"] .vs-fill { animation: vs-grow .7s cubic-bezier(.2, 1, .3, 1) both; }
.vs-bar:nth-child(2) .vs-fill { animation-delay: .04s; }
.vs-bar:nth-child(3) .vs-fill { animation-delay: .08s; }
.vs-bar:nth-child(4) .vs-fill { animation-delay: .12s; }
.vs-bar:nth-child(5) .vs-fill { animation-delay: .16s; }
.vs-bar:nth-child(6) .vs-fill { animation-delay: .2s; }
.vs-bar:nth-child(7) .vs-fill { animation-delay: .24s; }
@keyframes vs-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.vs-fill i {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -3px);
  font-style: normal;
  font-family: var(--marquee);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.vs-bar.mine .vs-fill {
  background: linear-gradient(180deg, #ffe08e, var(--brass-hi) 35%, var(--brass) 75%, var(--brass-lo));
  box-shadow: inset 0 1px 0 rgba(255, 248, 220, .8), 0 0 10px rgba(255, 196, 80, .7);
}
.vs-bar.mine:last-child .vs-fill { background: linear-gradient(180deg, #c8463c, var(--sign-red)); box-shadow: 0 0 8px rgba(200, 50, 40, .45); }
.vs-bar.mine b, .vs-bar.mine i { color: var(--ink); font-weight: 600; }
.vs-foot {
  width: 100%;
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(201, 149, 59, .55);
  display: flex;
  justify-content: space-between;
  font-family: var(--marquee);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.vs-foot b { font-weight: 600; color: var(--ink); }

/* ---------- Stats: overall rank ---------- */
.overall-rank {
  margin: 4px 0 14px;
  padding: 9px 12px 7px;
  border: 1px dashed rgba(138, 97, 36, .6);
  border-radius: 4px;
  text-align: center;
  font-family: var(--marquee);
  font-size: 15.5px;
  letter-spacing: .06em;
  color: var(--ink);
}
.overall-rank:empty { display: none; }

/* ---------- Puzzles list ---------- */
.puzzle-list { display: flex; flex-direction: column; }
.puzzles-free {
  display: grid;
  gap: 2px;
  margin: 0 0 10px;
  padding: 10px 14px 8px;
  border-radius: 4px;
  background: rgba(201, 149, 59, .16);
  text-align: center;
  font-size: 15.5px;
}
.puzzles-free b { font-family: var(--marquee); font-weight: 500; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; }
.puzzles-free span { color: var(--ink-soft); font-size: 14.5px; }
.puzzle-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 4px 2px;
  border-bottom: 1px solid rgba(201, 149, 59, .45);
  text-align: left;
  color: var(--ink);
}
.puzzle-row:active { background: rgba(201, 149, 59, .14); }
.pr-num { font-family: var(--slab); font-size: 18px; }
.pr-date { font-size: 16px; font-weight: 600; }
.pr-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 2px 12px 0;
  border-radius: 999px;
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.puzzle-row[data-kind="today"] .pr-status,
.puzzle-row[data-kind="unplayed"] .pr-status,
.puzzle-row[data-kind="playing"] .pr-status {
  border: 1.5px solid var(--brass-lo);
  background: linear-gradient(180deg, #f2d48a, var(--brass-hi) 30%, var(--brass) 70%, #a8782c);
  box-shadow: inset 0 1px 0 rgba(255, 240, 196, .7), 0 2px 4px rgba(0, 0, 0, .25);
}
.puzzle-row[data-kind="solved"] .pr-status { background: var(--enamel-correct); color: #eafff0; }
.puzzle-row[data-kind="missed"] .pr-status { background: var(--sign-red); color: #ffe6d6; }
.puzzle-row[data-kind="locked"] { color: var(--ink-soft); }
.puzzle-row[data-kind="locked"] .pr-status { border: 1px solid rgba(138, 97, 36, .6); color: var(--ink-soft); }
.lock { width: 14px; height: 14px; flex: none; }

.puzzles-lock {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 12px 0;
  padding: 14px 16px 16px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3a2215, #1e0f08);
  color: var(--cream);
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--brass), 0 4px 10px rgba(0, 0, 0, .25);
}
.puzzles-lock[hidden] { display: none; }
.puzzles-lock .lock { width: 22px; height: 22px; color: var(--brass-hi); }
.puzzles-lock strong { font-family: var(--slab); font-weight: 400; font-size: 20px; color: var(--brass-hi); }
.puzzles-lock p { margin: 0; font-size: 15.5px; line-height: 1.4; }
.puzzles-lock .brass-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: 16px; text-decoration: none; color: var(--ink); }
.puzzles-lock.nudge { animation: lock-nudge .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lock-nudge { 30% { transform: scale(1.03); box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 18px rgba(255, 211, 122, .6); } }

/* ---------- Big-moment streamers ---------- */
.puzzles-burst { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.puzzles-burst i {
  position: absolute;
  top: -24px;
  left: var(--x);
  width: calc(7px * var(--s));
  height: calc(16px * var(--s));
  border-radius: 1px;
  background: var(--brass-hi);
  box-shadow: 0 0 6px rgba(255, 211, 122, .5);
  animation: streamer var(--t) var(--d) cubic-bezier(.3, .2, .5, 1) both;
}
.puzzles-burst i[data-c="1"] { background: #fff1c4; }
.puzzles-burst i[data-c="2"] { background: #d23a2a; box-shadow: none; }
.puzzles-burst i[data-c="3"] { width: calc(9px * var(--s)); height: calc(9px * var(--s)); border-radius: 50%; background: radial-gradient(#fff, var(--bulb-warm) 45%, rgba(255, 211, 122, 0) 70%); box-shadow: none; }
@keyframes streamer {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--r)); opacity: 0; }
}
.celebrating-big .neon-sign { filter: drop-shadow(0 0 18px rgba(255, 170, 80, .75)); transition: filter .4s; }

@media (prefers-reduced-motion: reduce) {
  .result-stub.rise .stub-ribbon, .vs-ticket[data-state="ready"] .vs-fill, .puzzles-lock.nudge { animation: none; }
}
@media (max-width: 380px) {
  .vs-ticket .ticket-face { padding: 16px 16px 14px; }
  .vs-head { font-size: 20px; }
  .puzzle-row { grid-template-columns: 50px 1fr auto; gap: 8px; }
}

/* "Play #296 (yesterday)": the day sits small under the number so it fits half a row. */
.next-name-btn { line-height: 1.05; }
.next-name-full small {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: none;
  opacity: .8;
}

/* ---------- Speaker: on, off, or following the silent switch ---------- */
.icon-btn .sound-silent { display: none; }
.icon-btn.silent .sound-on { display: none; }
.icon-btn.silent .sound-silent { display: block; }
.icon-btn.silent { color: rgba(231, 192, 106, .82); }
.icon-btn.silent svg { width: 21px; height: 21px; }
.icon-btn.hinting { animation: speaker-call 1.1s ease-in-out 3; }
@keyframes speaker-call {
  50% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 0 5px rgba(255, 211, 122, .35), 0 0 18px rgba(255, 211, 122, .7); }
}
.sound-hint {
  position: absolute;
  z-index: 40;
  max-width: min(260px, calc(100vw - 16px));
  padding: 9px 14px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--brass);
  background: linear-gradient(180deg, #3a2215, #1e0f08);
  color: var(--brass-hi);
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 15.5px;
  letter-spacing: .08em;
  line-height: 1.25;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55), 0 0 14px rgba(255, 211, 122, .25);
  animation: hint-in .35s cubic-bezier(.2, 1, .3, 1) both;
  pointer-events: none;
}
.sound-hint::before {
  content: "";
  position: absolute;
  top: -8px;
  left: calc(var(--arrow, 50%) - 7px);
  width: 12px;
  height: 12px;
  background: #3a2215;
  border-left: 1.5px solid var(--brass);
  border-top: 1.5px solid var(--brass);
  transform: rotate(45deg);
}
@keyframes hint-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) {
  .icon-btn.hinting, .sound-hint { animation: none; }
}

/* ---------- Up next: the curtain call at the end of the finished page ---------- */
.upnext-ticket .ticket-face {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 24px 18px;
  text-align: center;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 211, 122, .35), rgba(255, 211, 122, 0) 60%),
    linear-gradient(180deg, #faf0d6, var(--cream) 50%, #ead7aa);
}
.upnext-bulbs {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
}
.upnext-bulbs i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(#fff, var(--bulb-warm) 45%, #c98a2a 75%);
  box-shadow: 0 0 6px rgba(255, 196, 80, .9);
  animation: upnext-chase 1.5s infinite;
}
.upnext-bulbs i:nth-child(3n + 2) { animation-delay: -.5s; }
.upnext-bulbs i:nth-child(3n + 3) { animation-delay: -1s; }
@keyframes upnext-chase { 0%, 100% { opacity: 1; } 50% { opacity: .35; box-shadow: none; } }
.upnext-kicker {
  margin-top: 4px;
  color: var(--sign-red);
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.upnext-title {
  margin: -2px 0 6px;
  font-family: var(--slab);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: .04em;
  color: var(--ink);
}
.upnext-play { min-height: 58px; white-space: normal; line-height: 1.1; padding: 4px 16px 0; }
.upnext-note {
  margin: -2px 0 4px;
  font-family: var(--marquee);
  font-size: 14.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.upnext-note[hidden] { display: none; }
.upnext-share { width: 100%; min-height: 48px; font-size: 17px; }
.upnext-clock {
  margin: 10px 0 0;
  font-family: var(--marquee);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.upnext-clock b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.upnext-tomorrow { margin: -4px 0 0; font-size: 16px; font-style: italic; color: var(--ink-soft); }
.upnext-top {
  margin-top: 4px;
  min-height: 40px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) { .upnext-bulbs i { animation: none; } }

/* ---------- Extras: Bonus name and the Named+ Long name ---------- */
.puzzles-extras { display: flex; flex-direction: column; margin: 0 0 12px; border-top: 1px solid rgba(201, 149, 59, .45); }
.puzzle-row.extra-row { grid-template-columns: 1fr auto; min-height: 60px; padding: 8px 2px; }
.pr-extra { display: grid; gap: 1px; }
.pr-extra b { font-family: var(--slab); font-weight: 400; font-size: 18px; }
.pr-extra span { font-size: 14.5px; line-height: 1.3; color: var(--ink-soft); }
.named-plus {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 8px 0;
  border: 1px solid rgba(138, 97, 36, .6);
  border-radius: 999px;
  font-family: var(--marquee);
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.locked-link { color: var(--ink-soft); }
