/* Needle In A Haystack, UI skin. Quiet, gold, out of the way. */

:root {
  --gold: #d9a125;
  --gold-hot: #ffd75e;
  --ink: #0b0d12;
  --paper: #f0e8d6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--paper);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
#app, canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }

/* ---------- full-screen layers ---------- */
#veil {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.92) 100%);
  opacity: 0; transition: opacity .5s ease;
}
#pulse {
  position: fixed; inset: 0; pointer-events: none; z-index: 6;
  box-shadow: inset 0 0 120px rgba(255,215,94,0);
}
#pulse.tick { animation: pulse-tick .22s ease-out; }
@keyframes pulse-tick {
  0%   { box-shadow: inset 0 0 90px rgba(255,215,94, var(--pulse-a, .25)); }
  100% { box-shadow: inset 0 0 140px rgba(255,215,94, 0); }
}

/* soft center-out warmth on a successful grab, a breath, not a flash */
#wash {
  position: fixed; inset: 0; pointer-events: none; z-index: 6;
  background: radial-gradient(circle at 50% 52%, rgba(255,215,94,.14), rgba(255,215,94,.05) 45%, transparent 70%);
  opacity: 0;
}
#wash.show { animation: wash-breathe .9s ease-out; }
@keyframes wash-breathe {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}
/* gold paper over everything, only drawn to while a burst is alive */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 11; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

#timer {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  font-size: 21px; letter-spacing: .08em; opacity: .85;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0,0,0,.9);
  animation: fade-in 1s ease both;
}

/* hot/cold bloom behind the crosshair: steel-blue far → golden furnace close */
#heat {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 230px; height: 64px;
  filter: blur(7px);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}
#heat.beat { animation: heat-beat .25s ease-out; }
@keyframes heat-beat {
  from { filter: blur(7px) brightness(2.2); }
  to   { filter: blur(7px) brightness(1); }
}

/* the needle crosshair, fills gold as you find needles */
#crosshair {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 150px; height: 7px;
  clip-path: polygon(0 50%, 2.5% 0, 97.5% 0, 100% 50%, 97.5% 100%, 2.5% 100%);
  background: rgba(240, 232, 214, .18);
  overflow: hidden;
  box-shadow: inset 0 0 5px var(--heat-c, transparent);
  filter: drop-shadow(0 0 var(--heat-r, 0px) var(--heat-c, transparent));
  transition: box-shadow .3s ease, filter .3s ease;
}
#needle-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-hot));
  transition: width .45s cubic-bezier(.2, .9, .25, 1.2);
}
#needle-notches {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent calc(10% - 1px),
    rgba(11,13,18,.55) calc(10% - 1px), rgba(11,13,18,.55) 10%);
}
#crosshair.flash { animation: xflash .5s ease; }
@keyframes xflash {
  0% { filter: brightness(1) drop-shadow(0 0 0 rgba(255,215,94,0)); }
  25% { filter: brightness(1.5) drop-shadow(0 0 10px rgba(255,215,94,.55)); }
  100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255,215,94,0)); }
}
#crosshair.done { background: rgba(255,215,94,.3); filter: drop-shadow(0 0 14px rgba(255,215,94,.7)); }

/* coins */
#coins {
  position: absolute; top: 26px; right: 32px;
  font-size: 32px; color: var(--gold-hot); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 11px;
  text-shadow: 0 2px 16px rgba(0,0,0,.9);
}
#coins::before {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-hot), var(--gold) 60%, #8a6410);
  box-shadow: 0 0 12px rgba(217,161,37,.6);
}
#coins.pop { animation: coin-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes coin-pop { 32% { transform: scale(1.22); } }

/* the merchant's dialogue, click him to open, click to buy */
#npc-shop {
  position: absolute; left: 50%; bottom: 16%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  background: rgba(11,13,18,.75); border: 1px solid rgba(217,161,37,.4);
  border-radius: 14px; padding: 18px 24px; backdrop-filter: blur(5px);
  animation: shop-in .3s ease;
  pointer-events: auto; min-width: 280px;
}
@keyframes shop-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } }
#npc-shop .ns-title {
  font-style: italic; font-size: 13px; letter-spacing: .3em; margin-right: -.3em;
  text-transform: uppercase; color: var(--gold); opacity: .85; text-align: center;
  margin-bottom: 4px;
}
#npc-shop .ns-item {
  display: flex; align-items: baseline; gap: 12px; font-size: 16px;
  background: rgba(240,232,214,.06); border: 1px solid rgba(217,161,37,.25);
  border-radius: 9px; padding: 11px 16px; cursor: pointer;
  color: var(--paper); font-family: Georgia, serif; text-align: left;
  transition: all .15s ease;
}
#npc-shop .ns-item:hover { border-color: var(--gold-hot); background: rgba(217,161,37,.14); transform: translateY(-1px); }
#npc-shop .ns-item.owned { cursor: default; opacity: .55; }
#npc-shop .ns-item.owned:hover { border-color: rgba(217,161,37,.25); background: rgba(240,232,214,.06); transform: none; }
#npc-shop .s-name { font-style: italic; letter-spacing: .06em; }
#npc-shop .s-price { margin-left: auto; }
#npc-shop #ns-close {
  background: none; border: none; color: var(--paper); opacity: .55;
  font-family: Georgia, serif; font-style: italic; font-size: 14px;
  cursor: pointer; padding: 6px; margin-top: 2px;
}
#npc-shop #ns-close:hover { opacity: 1; color: var(--gold-hot); }
#npc-shop .s-price { color: var(--gold-hot); font-size: 14px; font-variant-numeric: tabular-nums; }
#npc-shop .s-price::after { content: ' ●'; font-size: 9px; color: var(--gold); }
#npc-shop .s-owned { display: none; color: var(--gold); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
#npc-shop .ns-item.owned .s-price, #npc-shop .ns-item.owned .k { display: none; }
#npc-shop .ns-item.owned .s-owned { display: inline-block; }
#npc-shop .ns-item.shake { animation: shake .3s ease; }

/* the sale: a bounce and a gold flare, the OWNED stamp slams down, the merchant beams */
#npc-shop .ns-item.bought { animation: bought-pop .65s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes bought-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.07); opacity: 1; border-color: var(--gold-hot);
         background: rgba(255,215,94,.28); box-shadow: 0 0 26px rgba(255,215,94,.55); }
  100% { transform: scale(1); }
}
#npc-shop .ns-item.bought .s-owned { animation: stamp .5s cubic-bezier(.2, 1.7, .4, 1) both; }
@keyframes stamp {
  0%   { transform: scale(2.4) rotate(-12deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
#npc-shop .ns-title.quip { color: var(--gold-hot); animation: quip-in .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes quip-in { from { transform: scale(.8); opacity: 0; } }

/* compass stays locked until the blower is bought, or for the whole run on hardcore */
#npc-shop .s-locked, #npc-shop .s-hc {
  display: none; margin-left: auto; font-style: italic; font-size: 12.5px;
  opacity: .6; letter-spacing: .04em;
}
#npc-shop .ns-item.locked { cursor: default; opacity: .55; }
#npc-shop .ns-item.locked:hover { border-color: rgba(217,161,37,.25); background: rgba(240,232,214,.06); transform: none; }
#npc-shop .ns-item.locked .s-price { display: none; }
#npc-shop .ns-item.locked .s-locked { display: inline; }
body.hardcore #npc-shop .ns-item.locked .s-locked { display: none; }
body.hardcore #npc-shop .ns-item.locked .s-hc { display: inline; }

/* the tally, rises out of the bar when a needle is claimed, then drifts away */
#found-count {
  position: absolute; left: 50%; top: calc(50% - 32px);
  transform: translateX(-50%) translateY(12px);
  font-size: 15px; letter-spacing: .2em; margin-right: -.2em;
  color: var(--gold-hot); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(0,0,0,.9);
  opacity: 0; white-space: nowrap;
  transition: opacity .3s ease-in, transform .3s ease-in;
}
#found-count.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
  transition: opacity .35s ease-out, transform .35s cubic-bezier(.2, 1.4, .35, 1);
}
#found-count.leave { opacity: 0; transform: translateX(-50%) translateY(-10px); }

/* temperature word under the crosshair, freezing → melting hot */
#temp {
  position: absolute; left: 50%; top: calc(50% + 26px);
  transform: translateX(-50%);
  font-style: italic; font-size: 15px; letter-spacing: .22em; margin-right: -.22em;
  text-shadow: 0 1px 10px rgba(0,0,0,.9);
  opacity: .9; white-space: nowrap;
  transition: opacity .3s ease;
}
#temp.dim { opacity: 0; }
#temp.pop { animation: temp-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes temp-pop {
  0% { transform: translateX(-50%) scale(.7); opacity: .2; }
  100% { transform: translateX(-50%) scale(1); opacity: .9; }
}

#plusone {
  position: absolute; left: 50%; top: calc(50% - 64px);
  transform: translateX(-50%);
  font-size: 26px; color: var(--gold-hot);
  text-shadow: 0 2px 14px rgba(0,0,0,.8);
  opacity: 0;
}
#plusone.pop { animation: plus-pop .9s ease-out; }
@keyframes plus-pop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

#hint {
  position: absolute; bottom: 14%; left: 50%; transform: translateX(-50%);
  font-style: italic; font-size: 19px; letter-spacing: .06em;
  color: var(--paper); opacity: 0; transition: opacity .8s ease;
  text-shadow: 0 2px 16px rgba(0,0,0,.95);
}
#hint.show { opacity: .85; }

/* ---------- attract ---------- */
#attract {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
}
.title-block { margin-top: 13vh; text-align: center; animation: fade-in 2s ease both; }
#attract h1 {
  font-size: clamp(64px, 11vw, 150px);
  font-weight: 400; letter-spacing: .22em; margin-right: -.22em;
  text-shadow: 0 4px 40px rgba(0,0,0,.8);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { letter-spacing: .22em; opacity: .96; }
  50% { letter-spacing: .26em; opacity: 1; }
}
#attract .under {
  display: block; font-style: italic; font-size: clamp(17px, 2.2vw, 26px);
  color: var(--gold-hot); letter-spacing: .3em; margin-right: -.3em;
  margin-top: 6px; opacity: .9;
  text-shadow: 0 2px 20px rgba(0,0,0,.9);
}
.begin {
  margin-top: auto; margin-bottom: 14px;
  font-style: italic; font-size: 19px; letter-spacing: .14em;
  animation: begin-pulse 2.4s ease-in-out infinite;
  text-shadow: 0 2px 14px rgba(0,0,0,.9);
}
@keyframes begin-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* the mode switch: a pill with a sliding highlight, gold for normal, ember for hardcore */
#mode {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  width: min(400px, 92vw); padding: 4px; margin-bottom: 12vh;
  border: 1px solid rgba(217,161,37,.3); border-radius: 999px;
  background: rgba(11,13,18,.42); backdrop-filter: blur(5px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: fade-in 2s ease both;
}
#mode::before {   /* the highlight, slides to whichever half is chosen */
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 999px;
  background: rgba(217,161,37,.2); border: 1px solid rgba(255,215,94,.55);
  box-shadow: 0 0 18px rgba(255,215,94,.18), inset 0 0 12px rgba(255,215,94,.08);
  transition: transform .4s cubic-bezier(.2, .9, .25, 1.15), background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
body.hardcore #mode::before {
  transform: translateX(100%);
  background: rgba(255,107,69,.16); border-color: rgba(255,107,69,.7);
  box-shadow: 0 0 24px rgba(255,107,69,.3), inset 0 0 12px rgba(255,107,69,.1);
}
#mode .m-opt {
  position: relative; z-index: 1; appearance: none; background: none; border: 0;
  padding: 11px 12px 10px; color: var(--paper); font-family: Georgia, serif; text-align: center;
  cursor: pointer; opacity: .45; outline: none;
  transition: opacity .25s ease, color .25s ease;
}
#mode .m-opt:hover { opacity: .8; }
#mode .m-opt:focus-visible { opacity: .8; text-decoration: underline; text-underline-offset: 4px; }
#mode .m-opt.on { opacity: 1; }
#mode .m-opt.on[data-mode="normal"] .m-name { color: var(--gold-hot); }
#mode .m-opt.on[data-mode="hardcore"] .m-name { color: #ff7a56; text-shadow: 0 0 16px rgba(255,107,69,.5); }
#mode .m-name {
  display: block; font-style: italic; font-size: 15px; letter-spacing: .2em; margin-right: -.2em;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
}

/* hardcore: the crosshair goes cold and the temperature word is struck from the HUD */
body.hardcore #heat, body.hardcore #temp { display: none; }
#attract.leaving { animation: attract-out 1.2s ease forwards; pointer-events: none; }
@keyframes attract-out { to { opacity: 0; } }

/* today's board from the title screen, a glance without a run */
#lb-btn {
  position: absolute; top: 26px; right: 32px;
  appearance: none; background: none; border: 0; cursor: pointer; outline: none;
  font-family: Georgia, serif; font-style: italic; font-size: 13px;
  letter-spacing: .3em; margin-right: -.3em; text-transform: uppercase;
  color: var(--gold); opacity: .7; padding: 8px 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
  transition: opacity .25s ease, color .25s ease;
  animation: fade-in 2s ease both;
}
#lb-btn::before { content: '◆ '; font-style: normal; font-size: 9px; vertical-align: 2px; }
#lb-btn:hover, #lb-btn:focus-visible { opacity: 1; color: var(--gold-hot); }
body.touch #lb-btn { top: calc(14px + env(safe-area-inset-top)); right: calc(18px + env(safe-area-inset-right)); }
#lb {
  position: absolute; inset: 0; z-index: 1; cursor: default;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,13,18,.45); backdrop-filter: blur(2px);
  animation: fade-in .25s ease both;
}
#lb-panel {
  width: min(380px, 92vw); padding: 20px 24px 14px;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: rgba(11,13,18,.82); border: 1px solid rgba(217,161,37,.4);
  border-radius: 14px; backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(217,161,37,.08);
  animation: shop-in .3s ease;
}
#lb-panel .w-title { margin-top: 0; }
body.hardcore #lb-panel .w-title { color: #ff7a56; }
#lb-close {
  background: none; border: none; color: var(--paper); opacity: .55;
  font-family: Georgia, serif; font-style: italic; font-size: 14px;
  cursor: pointer; padding: 6px; margin-top: 2px;
}
#lb-close:hover { opacity: 1; color: var(--gold-hot); }

/* ---------- resume ---------- */
#resume {
  position: fixed; inset: 0; z-index: 20; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(11,13,18,.45); backdrop-filter: blur(2px);
}
#resume .quit {
  position: absolute; bottom: 30px; font-size: 13px; font-style: italic;
  opacity: .4; cursor: pointer; letter-spacing: .1em;
}
#resume .quit:hover { opacity: .9; color: var(--gold-hot); }

/* ---------- win: the merchant's card, but for bragging ---------- */
#win {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,12,.45);
  animation: win-in .8s ease .8s both;
}
@keyframes win-in { from { opacity: 0; } to { opacity: 1; } }
#win-card {
  width: min(420px, 92vw); padding: 22px 26px 20px;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: rgba(11,13,18,.82); border: 1px solid rgba(217,161,37,.4);
  border-radius: 14px; backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(217,161,37,.08);
  animation: shop-in .45s cubic-bezier(.2, .9, .25, 1.1) 1s both;
}
/* the shop's caption style, reused for every section */
.w-title {
  font-style: italic; font-size: 12px; letter-spacing: .3em; margin-right: -.3em;
  text-transform: uppercase; color: var(--gold); opacity: .85; text-align: center;
  margin-top: 6px;
}
#win-time {
  text-align: center; font-size: clamp(60px, 9vw, 84px); line-height: 1;
  color: var(--gold-hot); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(255,215,94,.35);
  animation: time-stamp .6s cubic-bezier(.2, 1.6, .4, 1) 1.25s both;
}
@keyframes time-stamp {
  0%   { transform: scale(2.2) rotate(-6deg); opacity: 0; }
  55%  { opacity: 1; text-shadow: 0 0 60px rgba(255,215,94,.9); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
#win-rank {
  align-self: center; font-style: italic; font-size: 14px; color: #1a1405;
  background: var(--gold-hot); border-radius: 999px; padding: 4px 14px;
  animation: stamp .5s cubic-bezier(.2, 1.7, .4, 1) both;
}
#win-quip { text-align: center; font-style: italic; font-size: 14px; opacity: .55; }

/* sign the board: an item row that happens to be a form */
#score-form {
  display: flex; gap: 10px; margin-top: 8px;
  background: rgba(240,232,214,.06); border: 1px solid rgba(217,161,37,.25);
  border-radius: 9px; padding: 8px 8px 8px 14px; align-items: center;
}
#score-form.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
#initials {
  flex: 1; min-width: 0; height: 38px; background: none; border: none; outline: none;
  color: var(--paper); font-family: Georgia, serif; font-size: 26px;
  letter-spacing: .35em; text-transform: uppercase;
}
#initials::placeholder { color: rgba(240,232,214,.25); }
#submit-score {
  height: 38px; padding: 0 18px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: #1a1405; font-family: Georgia, serif; font-style: italic; font-size: 14px;
  transition: all .15s ease; white-space: nowrap;
}
#submit-score:hover:not(:disabled) { background: var(--gold-hot); transform: translateY(-1px); }
#submit-score:disabled { opacity: .35; cursor: default; }

#board-wrap { display: flex; flex-direction: column; gap: 6px; }
/* .board: the row list, shared by the win card and the title screen's glance */
.board { display: flex; flex-direction: column; gap: 5px; }
.board .row {
  display: flex; align-items: baseline; gap: 12px; font-size: 15px;
  background: rgba(240,232,214,.06); border: 1px solid rgba(217,161,37,.18);
  border-radius: 9px; padding: 7px 14px;
  opacity: 0; animation: row-in .35s ease forwards;
}
.board .row:nth-child(1) { animation-delay: .05s } .board .row:nth-child(2) { animation-delay: .1s }
.board .row:nth-child(3) { animation-delay: .15s } .board .row:nth-child(4) { animation-delay: .2s }
.board .row:nth-child(5) { animation-delay: .25s } .board .row:nth-child(6) { animation-delay: .3s }
.board .row:nth-child(7) { animation-delay: .35s } .board .row:nth-child(8) { animation-delay: .4s }
.board .row:nth-child(9) { animation-delay: .45s } .board .row:nth-child(10) { animation-delay: .5s }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.board .row.me {
  color: var(--gold-hot); border-color: var(--gold-hot); background: rgba(255,215,94,.16);
  animation: row-in .35s ease forwards, bought-pop .65s cubic-bezier(.2, 1.5, .4, 1) .5s;
}
.board .rank { width: 26px; opacity: .45; font-size: 13px; font-variant-numeric: tabular-nums; }
.board .name { font-style: italic; letter-spacing: .2em; }
.board .ms { margin-left: auto; font-variant-numeric: tabular-nums; }
.board .empty { text-align: center; font-style: italic; opacity: .45; font-size: 14px; padding: 6px; }
#board-note, #lb-note { text-align: center; font-style: italic; font-size: 12px; opacity: .4; }
#board-note:empty, #lb-note:empty { display: none; }

/* brag: three chunky share rows, the star of the card */
#share-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* the portal build may not link out, so the brag row stays home */
body.gd #brag-title, body.gd #share-row { display: none; }
#share-row .share-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px 10px; cursor: pointer;
  background: rgba(240,232,214,.06); border: 1px solid rgba(217,161,37,.3);
  border-radius: 9px; color: var(--paper);
  font-family: Georgia, serif; font-style: italic; font-size: 13px;
  transition: all .15s ease;
}
#share-row .share-btn:hover { border-color: var(--gold-hot); background: rgba(217,161,37,.16); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
#share-row .ico { font-style: normal; font-size: 22px; line-height: 1; color: var(--gold-hot); font-family: Georgia, serif; }
#share-row .stamp {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--gold-hot); color: #1a1405; border-radius: 9px; font-size: 14px;
  opacity: 0; pointer-events: none;
}
#share-row .share-btn.copied .stamp { animation: stamp-hold 1.6s ease both; }
@keyframes stamp-hold {
  0%   { opacity: 0; transform: scale(1.6) rotate(-8deg); }
  15%  { opacity: 1; transform: scale(1) rotate(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

.win-row { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
#again {
  flex: 1; height: 44px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: #1a1405; font-family: Georgia, serif; font-style: italic; font-size: 17px;
  letter-spacing: .04em; transition: all .15s ease;
}
#again:hover { background: var(--gold-hot); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,215,94,.3); }
#home {
  background: none; border: none; color: var(--paper); opacity: .55;
  font-family: Georgia, serif; font-style: italic; font-size: 15px;
  cursor: pointer; padding: 8px 16px; transition: all .15s ease;
}
#home:hover { opacity: 1; color: var(--gold-hot); }

/* ---------- loading ---------- */
#load {
  position: fixed; inset: 0; z-index: 30; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease;
}
#load.done { opacity: 0; pointer-events: none; }
#load .bar-wrap { width: min(300px, 70vw); height: 3px; background: rgba(240,232,214,.1); border-radius: 2px; overflow: hidden; }
#load-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-hot)); transition: width .12s linear; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* no JavaScript: the words the crawler reads, set plainly on the ink */
.nojs {
  position: fixed; inset: 0; z-index: 40; background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center; font-style: italic; line-height: 1.5;
}
.nojs h1 { font-weight: 400; letter-spacing: .2em; color: var(--gold-hot); font-size: clamp(28px, 5vw, 48px); }
.nojs p { max-width: 560px; opacity: .8; }
