:root {
  --pine: #123b32;
  --pine-dark: #0b2b25;
  --pine-light: #1f5b4e;
  --cream: #fff9ec;
  --paper: #fffef8;
  --red: #d64045;
  --red-dark: #a92932;
  --gold: #e0a42e;
  --ink: #19362f;
  --muted: #697b73;
  --line: rgba(18, 59, 50, 0.16);
  --shadow: 0 24px 70px rgba(8, 42, 34, 0.18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(224, 164, 46, .10), transparent 24rem),
    radial-gradient(circle at 90% 70%, rgba(214, 64, 69, .08), transparent 28rem),
    var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.11'/%3E%3C/svg%3E");
  z-index: 20;
}

button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(224, 164, 46, .5); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.brand { display: flex; gap: 11px; align-items: center; color: var(--pine); text-decoration: none; font-size: .78rem; line-height: 1.05; letter-spacing: .08em; text-transform: uppercase; }
.brand strong { font-family: "Fraunces", serif; font-size: 1rem; letter-spacing: .01em; text-transform: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: white; font-size: 1.15rem; transform: rotate(12deg); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.day-chip { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.icon-button { width: auto; height: 42px; padding: 0 15px; border: 0; border-radius: 999px; background: var(--pine); color: white; font-size: 1.1rem; transition: .25s ease; }
.music-label { margin-left: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.icon-button:hover { transform: rotate(-7deg) scale(1.05); }
.icon-button .music-on { display: none; }
.icon-button[aria-pressed="true"] { background: var(--red); }
.icon-button[aria-pressed="true"] .music-off { display: none; }
.icon-button[aria-pressed="true"] .music-on { display: inline; }

.garland { position: fixed; left: 0; right: 0; top: -4px; display: flex; justify-content: space-around; z-index: 30; pointer-events: none; }
.garland::before { content: ""; position: absolute; left: -2%; right: -2%; top: 3px; height: 16px; border-bottom: 2px solid var(--pine); border-radius: 50%; }
.garland span { width: 9px; height: 15px; margin-top: 11px; border-radius: 50% 50% 45% 45%; background: var(--red); box-shadow: 0 0 12px var(--red); animation: twinkle 2.2s infinite alternate; }
.garland span:nth-child(2n) { background: var(--gold); box-shadow: 0 0 12px var(--gold); animation-delay: -.8s; }
.garland span:nth-child(3n) { background: #4f9c87; box-shadow: 0 0 12px #4f9c87; animation-delay: -1.4s; }
@keyframes twinkle { from { opacity: .45; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }

.snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .55; }
.snow::before, .snow::after { content: ""; position: absolute; inset: -100px 0 0; background-image: radial-gradient(circle, white 0 2px, transparent 2.5px); background-size: 76px 76px; animation: snowfall 14s linear infinite; }
.snow::after { background-size: 110px 110px; background-position: 30px 60px; opacity: .55; animation-duration: 22s; animation-delay: -6s; }
@keyframes snowfall { to { transform: translateY(152px) translateX(20px); } }

main { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 150px); margin: 0 auto; position: relative; z-index: 2; }
.screen { display: none; animation: screenIn .45s ease both; }
.screen.active { display: block; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } }

#welcomeScreen.active { display: grid; grid-template-columns: 1.04fr .96fr; column-gap: 7vw; align-items: center; padding: clamp(32px, 7vh, 80px) 0 42px; }
.eyebrow { color: var(--red-dark); font-size: .74rem; font-weight: 800; letter-spacing: .17em; }
.eyebrow span { display: inline-block; width: 30px; height: 1px; margin: 0 9px 3px 0; background: currentColor; }
.eyebrow.centered { text-align: center; }
.welcome-copy h1 { max-width: 690px; margin: 19px 0 24px; color: var(--pine); font-family: "Fraunces", serif; font-size: clamp(3.2rem, 6.4vw, 6.7rem); line-height: .91; letter-spacing: -.055em; }
.welcome-copy h1 em, h2 em { color: var(--red); font-style: italic; }
.intro { max-width: 580px; margin: 0 0 28px; color: #536a61; font-size: clamp(1rem, 1.5vw, 1.12rem); line-height: 1.7; }
.primary-button, .secondary-button { min-height: 50px; padding: 13px 24px; border-radius: 9px; font-weight: 700; border: 1px solid transparent; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.primary-button { color: white; background: var(--red); box-shadow: 0 10px 26px rgba(214, 64, 69, .22); }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--red-dark); box-shadow: 0 14px 28px rgba(214,64,69,.27); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.secondary-button { color: var(--pine); background: white; border-color: var(--line); }
.secondary-button:hover { transform: translateY(-2px); border-color: var(--pine); }
.microcopy { margin: 13px 0 0; color: #7b8983; font-size: .78rem; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-card { min-height: 500px; position: relative; display: grid; place-items: center; }
.paper { position: absolute; width: min(380px, 90%); aspect-ratio: .83; border-radius: 4px; background: var(--paper); box-shadow: var(--shadow); }
.paper-back { transform: rotate(8deg) translate(28px, 2px); background: var(--pine); display: grid; place-items: end center; color: rgba(255,255,255,.12); font-family: "Fraunces", serif; font-size: 9rem; }
.paper-front { transform: rotate(-4deg); padding: 38px 35px 20px; display: flex; flex-direction: column; justify-content: center; }
.paper-front svg { width: 100%; flex: 1; overflow: visible; }
.paper-front p { margin: 2px 0 0; text-align: center; font-family: "Fraunces", serif; font-style: italic; font-weight: 700; color: var(--pine); }
.tape { position: absolute; top: -19px; left: 50%; width: 96px; height: 36px; transform: translateX(-50%) rotate(3deg); background: rgba(224,164,46,.66); clip-path: polygon(4% 0, 100% 6%, 96% 100%, 0 91%); }
.sketch { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.green { stroke: #2d6e5d; }.brown { stroke: #795842; }.gold { stroke: var(--gold); }.red-line { stroke: var(--red); }.red { fill: var(--red); }.gold-fill { fill: var(--gold); }
.hero-stamp { position: absolute; z-index: 4; top: 10px; right: 1%; width: 82px; height: 82px; display: grid; place-content: center; text-align: center; border-radius: 50%; color: white; background: var(--red); font-size: .66rem; letter-spacing: .12em; transform: rotate(9deg); box-shadow: 0 9px 25px rgba(214,64,69,.28); }
.hero-stamp strong { font-family: "Fraunces", serif; font-size: 1.8rem; line-height: 1; letter-spacing: 0; }
.spark { position: absolute; z-index: 5; color: var(--gold); font-size: 2.7rem; animation: float 3s ease-in-out infinite alternate; }
.spark-one { left: -2%; top: 17%; }.spark-two { right: 4%; bottom: 6%; animation-delay: -1.2s; }
@keyframes float { to { transform: translateY(-14px) rotate(12deg); } }

.how-it-works { grid-column: 1 / -1; margin-top: 70px; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how-it-works article { display: flex; gap: 17px; padding: 25px 30px; border-right: 1px solid var(--line); }
.how-it-works article:last-child { border: 0; }
.how-it-works article > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; color: white; background: var(--pine); border-radius: 50%; font-family: "Fraunces", serif; font-weight: 700; }
.how-it-works strong { font-family: "Fraunces", serif; font-size: 1.05rem; }
.how-it-works p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

.setup-screen, .handoff-screen { padding: 4vh 0 8vh; }
.text-button { padding: 8px 0; border: 0; background: none; color: var(--pine); font-weight: 700; }
.setup-layout { margin: 25px auto 0; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); gap: 22px; align-items: stretch; }
.setup-layout.single-panel { display: block; max-width: 720px; }
.panel { width: min(670px, 100%); margin: 25px auto 0; padding: clamp(28px, 5vw, 58px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,248,.9); box-shadow: var(--shadow); }
.setup-layout .panel { width: 100%; margin: 0; }
.panel h2, .handoff-card h2, .results-screen > h2 { margin: 9px 0 12px; color: var(--pine); font-family: "Fraunces", serif; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -.035em; }
.panel > p { color: var(--muted); line-height: 1.6; }
.player-form { margin-top: 30px; }
.player-form label, .interpretation-card label { display: block; margin-bottom: 8px; font-weight: 700; font-size: .85rem; }
.player-form > input { margin-bottom: 16px; }
.edition-enter-button { width: 100%; }
.privacy-note { margin-top: 28px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; color: var(--pine); background: #f5f0e4; }.privacy-note > span { color: var(--red); }.privacy-note p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }.privacy-note strong { color: var(--pine); }
.input-row { display: flex; gap: 10px; }
.room-join-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input { width: 100%; min-height: 50px; padding: 13px 16px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; }
input::placeholder { color: #9aa7a2; }
.player-list { list-style: none; margin: 25px 0; padding: 0; display: grid; gap: 8px; }
.player-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; background: #f5f0e4; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.97); opacity: .5; } }
.player-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--pine); font-size: .75rem; font-weight: 700; }
.player-list strong { flex: 1; }
.player-online { margin-left: auto; display: flex; align-items: center; gap: 5px; color: #4b806d; font-size: .7rem; font-weight: 700; }
.player-online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #58b98f; }
.host-badge { padding: 3px 7px; border-radius: 999px; color: var(--red-dark); background: rgba(214,64,69,.09); font-size: .62rem; font-weight: 800; letter-spacing: .06em; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 20px; border-top: 1px solid var(--line); }
.setup-footer > span { color: var(--muted); font-size: .85rem; }

.room-panel { min-height: 570px; overflow: hidden; display: flex; flex-direction: column; border-radius: 18px; color: white; background: var(--pine); box-shadow: var(--shadow); }
.room-header { padding: 25px 25px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(255,255,255,.12); }
.room-header small { color: #c9ddd6; font-size: .67rem; font-weight: 800; letter-spacing: .13em; }
.room-header h3 { margin: 5px 0 0; color: white; font-family: "Fraunces", serif; font-size: 1.45rem; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #7de2a5; box-shadow: 0 0 0 5px rgba(125,226,165,.1); animation: livePulse 1.4s ease-in-out infinite alternate; }
@keyframes livePulse { to { box-shadow: 0 0 0 9px rgba(125,226,165,0); } }
.room-code { padding: 7px 10px; border: 1px dashed rgba(255,255,255,.3); border-radius: 7px; color: white; background: rgba(255,255,255,.07); text-align: left; }
.room-code span { display: block; color: #b7ccc5; font-size: .5rem; letter-spacing: .13em; }
.room-code strong { font-size: .78rem; letter-spacing: .08em; }
.room-share-actions { display: grid; justify-items: end; gap: 6px; }
.share-link-button { padding: 5px 8px; border: 0; border-radius: 5px; color: #e6f1ed; background: rgba(255,255,255,.1); font-size: .63rem; font-weight: 700; }
.share-link-button:disabled { cursor: not-allowed; opacity: .4; }
.room-members { min-height: 96px; padding: 17px 22px 14px; display: flex; align-items: center; gap: 12px; overflow-x: auto; border-bottom: 1px solid rgba(255,255,255,.12); }
.empty-room { margin: auto; color: #a9c0b8; font-size: .8rem; }
.member { min-width: 62px; text-align: center; position: relative; }
.member-avatar { width: 46px; height: 46px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; color: var(--pine); background: var(--avatar, #f3c968); font-family: "Fraunces", serif; font-weight: 900; border: 2px solid rgba(255,255,255,.85); }
.member-ready { position: absolute; top: 30px; right: 6px; width: 15px; height: 15px; display: grid; place-items: center; border: 2px solid var(--pine); border-radius: 50%; color: var(--pine); background: #7de2a5; font-size: .5rem; font-weight: 900; }
.member-name { display: block; max-width: 64px; overflow: hidden; text-overflow: ellipsis; color: #eef6f3; font-size: .68rem; white-space: nowrap; }
.chat-thread { flex: 1; min-height: 230px; max-height: 315px; padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: rgba(0,0,0,.08); }
.system-message { align-self: center; padding: 6px 11px; border-radius: 999px; color: #c4d5cf; background: rgba(255,255,255,.07); font-size: .67rem; text-align: center; }
.chat-message { max-width: 82%; align-self: flex-start; }
.chat-message.self { align-self: flex-end; text-align: right; }
.chat-message span { display: block; margin: 0 6px 4px; color: #a9c0b8; font-size: .62rem; }
.chat-message p { margin: 0; padding: 9px 12px; border-radius: 5px 13px 13px 13px; color: var(--ink); background: #fffaf0; font-size: .8rem; line-height: 1.4; text-align: left; }
.chat-message.self p { border-radius: 13px 5px 13px 13px; background: #f3c968; }
.chat-form { padding: 13px; display: grid; grid-template-columns: 1fr auto; gap: 7px; border-top: 1px solid rgba(255,255,255,.1); }
.chat-form select, .chat-form input, .chat-form button { min-height: 40px; border: 0; border-radius: 7px; }
.chat-form select { width: 100%; padding: 0 24px 0 8px; appearance: none; color: white; background: rgba(255,255,255,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center; font-size: .72rem; }
.chat-form input { min-width: 0; min-height: 40px; padding: 8px 10px; font-size: .78rem; }
.chat-form button { padding: 0 11px; color: white; background: var(--red); font-size: .7rem; font-weight: 700; }
.chat-form :disabled { cursor: not-allowed; opacity: .45; }
.local-room-note { margin: -5px 14px 10px; color: #8ba79d; font-size: .58rem; text-align: center; }

.daily-screen { padding: 4vh 0 8vh; }
.daily-hero { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.daily-hero h2 { margin: 8px 0 5px; color: var(--pine); font-family: "Fraunces",serif; font-size: clamp(2.7rem,6vw,5.5rem); line-height: .95; }
.daily-hero p:last-child { color: var(--muted); font-size: 1.05rem; }
.daily-day { width: 112px; height: 112px; flex: 0 0 112px; display: grid; place-content: center; text-align: center; border-radius: 50%; color: white; background: var(--red); box-shadow: 0 13px 30px rgba(214,64,69,.22); transform: rotate(4deg); }
.daily-day span,.daily-day small { font-size: .57rem; font-weight: 800; letter-spacing: .14em; }.daily-day strong { font-family: "Fraunces",serif; font-size: 2.45rem; line-height: 1; }
.daily-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; padding: 38px 0 22px; }
.daily-challenge-card,.edition-progress-card { min-height: 390px; padding: clamp(28px,5vw,50px); border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,248,.92); box-shadow: var(--shadow); }
.daily-challenge-card { text-align: center; }.challenge-illustration { width: 85px; height: 85px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--pine); font-size: 2.5rem; transform: rotate(-5deg); }
.daily-status { display: inline-block; color: var(--red-dark); font-size: .7rem; font-weight: 800; letter-spacing: .15em; }
.daily-challenge-card h3 { margin: 12px auto; max-width: 520px; color: var(--pine); font-family: "Fraunces",serif; font-size: clamp(1.8rem,4vw,3rem); line-height: 1.06; }
.daily-challenge-card p { max-width: 500px; margin: 0 auto 25px; color: var(--muted); line-height: 1.65; }
.progress-heading { display: flex; justify-content: space-between; gap: 10px; font-size: .7rem; letter-spacing: .1em; }.progress-heading strong { color: var(--red-dark); letter-spacing: 0; }
.notebook-progress { margin: 20px 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
.notebook-dot { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-family: "Fraunces",serif; font-size: .8rem; }.notebook-dot.active { color: white; border-color: var(--pine); background: var(--pine); }
.edition-progress-card > p { color: var(--muted); font-size: .82rem; line-height: 1.5; }.reveal-countdown { margin-top: 25px; padding: 18px; border-radius: 10px; color: white; background: var(--pine); }.reveal-countdown span,.reveal-countdown small { display: block; color: #bdd1ca; font-size: .65rem; letter-spacing: .1em; }.reveal-countdown strong { display: block; margin: 5px 0; font-family: "Fraunces",serif; font-size: 1.25rem; }
.registered-team { margin-top: 16px; color: var(--muted); font-size: .75rem; text-align: center; }
.spectator-live { padding: 17px; display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; border-radius: 14px; color: white; background: var(--pine); }.spectator-live div strong,.spectator-live div small { display: block; }.spectator-live div small { margin-top: 6px; color: #bad0c8; font-size: .7rem; }.spectator-live img { width: 100%; max-height: 170px; object-fit: contain; border-radius: 8px; background: white; }

.handoff-screen.active { min-height: 72vh; display: grid; place-items: center; }
.handoff-card { width: min(620px, 100%); padding: 46px 30px; text-align: center; }
.gift-icon { width: 94px; height: 82px; margin: 0 auto 24px; display: grid; place-items: center; color: white; background: var(--red); border-radius: 10px; box-shadow: 0 12px 25px rgba(214,64,69,.25); position: relative; font-size: 1.8rem; }
.gift-icon::before { content: ""; position: absolute; top: -13px; left: -5px; right: -5px; height: 17px; border-radius: 4px; background: var(--red-dark); }
.gift-icon::after { content: ""; position: absolute; inset: -13px 39px 0; background: var(--gold); }
.gift-icon span { position: relative; z-index: 1; }
.handoff-card > p:not(.eyebrow) { max-width: 430px; margin: 15px auto 25px; color: var(--muted); line-height: 1.6; }
.live-drawing { width: min(480px, 100%); margin: 0 auto 24px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 14px 38px rgba(18,59,50,.1); }
.live-drawing-label { margin: 1px 0 9px; color: var(--red-dark); font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.live-drawing-label span { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(214,64,69,.1); animation: livePulse 1s ease-in-out infinite alternate; }
.live-drawing img { display: block; width: 100%; aspect-ratio: 1.9; object-fit: contain; border-radius: 7px; background-color: #fffef9; background-image: linear-gradient(rgba(18,59,50,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(18,59,50,.03) 1px,transparent 1px); background-size: 22px 22px; }
.live-drawing small { display: block; margin-top: 8px; color: var(--muted); font-size: .7rem; }
.turn-progress { display: block; margin-top: 18px; color: var(--muted); font-size: .78rem; }

.play-screen { padding: 24px 0 60px; }
.play-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.play-header h2 { margin: 5px 0 0; font-family: "Fraunces", serif; font-size: clamp(1.8rem, 4vw, 3.25rem); letter-spacing: -.035em; color: var(--pine); }
.timer { width: 76px; height: 76px; flex: 0 0 76px; position: relative; display: grid; place-items: center; color: var(--pine); }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 5; }
.timer-track { stroke: rgba(18,59,50,.1); }
.timer-ring { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 194.78; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .2s; }
.timer strong { margin-top: -8px; font-family: "Fraunces", serif; font-size: 1.45rem; }
.timer span { position: absolute; top: 48px; font-size: .52rem; font-weight: 800; letter-spacing: .13em; }
.timer.urgent { color: var(--red); animation: pulse .7s infinite alternate; }
.timer.urgent .timer-ring { stroke: var(--red); }
@keyframes pulse { to { transform: scale(1.06); } }

.prompt-card { padding: 18px 24px; margin-bottom: 15px; display: flex; align-items: center; gap: 22px; border: 1px dashed rgba(214,64,69,.45); border-radius: 12px; background: rgba(214,64,69,.06); }
.prompt-card span, .reference-wrap > span { color: var(--red-dark); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.prompt-card strong { flex: 1; font-family: "Fraunces", serif; font-size: 1.35rem; }
.prompt-card small { color: var(--muted); }

.interpretation-card { display: grid; grid-template-columns: 180px 1fr; gap: 15px 24px; padding: 15px; margin-bottom: 15px; align-items: end; border-radius: 12px; color: white; background: var(--pine); }
.reference-wrap { grid-row: 1 / 3; }
.reference-wrap > span { display: block; margin-bottom: 7px; color: #f3c968; }
.reference-wrap img { width: 100%; height: 110px; object-fit: contain; border-radius: 7px; background: white; }
.interpretation-card label { margin: 0; align-self: end; color: #ecf2ef; }
.interpretation-card input { align-self: start; border: 0; }

.drawing-area { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 16px 50px rgba(18,59,50,.08); }
.canvas-toolbar { min-height: 62px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #f7f3e9; }
.colors, .tools { display: flex; align-items: center; gap: 8px; }
.color { width: 30px; height: 30px; border: 3px solid white; border-radius: 50%; background: var(--color); box-shadow: 0 0 0 1px rgba(18,59,50,.15); }
.color.selected { box-shadow: 0 0 0 2px var(--pine); transform: scale(.9); }
.tool-button { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--pine); background: white; font-size: .76rem; font-weight: 700; }
.tool-button.selected { color: white; background: var(--pine); }
.canvas-shell { position: relative; height: min(47vh, 450px); min-height: 300px; overflow: hidden; background-color: #fffef9; background-image: linear-gradient(rgba(18,59,50,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(18,59,50,.03) 1px, transparent 1px); background-size: 26px 26px; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-placeholder { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-4deg); pointer-events: none; color: rgba(18,59,50,.18); font-family: "Fraunces", serif; font-size: clamp(2rem, 5vw, 4rem); font-style: italic; }
.play-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 15px; }
.play-footer > span { color: var(--muted); font-size: .82rem; }

.results-screen { padding: 35px 0 80px; text-align: center; position: relative; }
.results-screen > h2 { margin-top: 10px; font-size: clamp(2.6rem, 6vw, 5.5rem); }
.result-subtitle { color: var(--muted); }
.comparison { width: min(920px, 100%); margin: 45px auto; display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; }
.result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 15px 45px rgba(18,59,50,.1); transform: rotate(-1.5deg); }
.last-result { transform: rotate(1.5deg); }
.result-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 17px; color: white; background: var(--pine); }
.result-label span { font-size: .67rem; font-weight: 800; letter-spacing: .13em; }
.result-label strong { font-family: "Fraunces", serif; }
.last-result .result-label { background: var(--red); }
.result-card img { display: block; width: 100%; aspect-ratio: 1.45; object-fit: contain; background: #fffef9; }
.result-card p { margin: 0; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.result-card p strong { display: inline-block; margin-top: 4px; color: var(--ink); font-family: "Fraunces", serif; font-size: 1.05rem; }
.versus { position: relative; z-index: 3; width: 62px; height: 62px; margin-left: -6px; display: grid; place-items: center; border: 5px solid var(--cream); border-radius: 50%; color: white; background: var(--gold); font-family: "Fraunces", serif; font-weight: 900; transform: rotate(-8deg); }
.journey-section { margin: 55px auto 35px; }
.journey-section h3 { font-family: "Fraunces", serif; font-size: 1.8rem; }
.journey { display: flex; justify-content: center; align-items: stretch; gap: 0; overflow-x: auto; padding: 20px 5px; }
.journey-item { min-width: 155px; max-width: 190px; position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; text-align: left; }
.journey-item:not(:last-child) { margin-right: 30px; }
.journey-item:not(:last-child)::after { content: "•••"; position: absolute; right: -29px; top: 50%; color: var(--gold); letter-spacing: 2px; }
.journey-item span { display: block; color: var(--muted); font-size: .7rem; }
.journey-item strong { display: block; margin-top: 5px; font-family: "Fraunces", serif; }
.journey-item img { width: 100%; height: 80px; margin-top: 9px; object-fit: contain; border-radius: 5px; background: #fffef9; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.reveal-grid { margin: 40px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; text-align: left; }.reveal-book { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }.reveal-book button { width: 100%; padding: 18px; display: flex; justify-content: space-between; border: 0; color: white; background: var(--pine); font-weight: 700; }.reveal-book-content { padding: 16px; display: grid; gap: 12px; }.reveal-step { padding: 10px; border-radius: 8px; background: #f7f3e9; }.reveal-step img { width: 100%; max-height: 170px; object-fit: contain; background: white; }.reveal-step span { display: block; color: var(--muted); font-size: .68rem; }.reveal-step strong { display: block; margin-top: 4px; font-family: "Fraunces",serif; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; background: var(--c); animation: confettiFall var(--d) ease-in var(--delay) forwards; transform: rotate(var(--r)); }
@keyframes confettiFall { to { transform: translate(var(--x), 90vh) rotate(620deg); opacity: .2; } }

footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 24px; display: flex; justify-content: center; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; position: relative; z-index: 2; }
.footer-star { color: var(--red); }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; padding: 11px 18px; color: white; background: var(--pine-dark); border-radius: 999px; box-shadow: var(--shadow); font-size: .82rem; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translate(-50%,0); opacity: 1; }

@media (max-width: 820px) {
  #welcomeScreen.active { grid-template-columns: 1fr; padding-top: 30px; }
  .welcome-copy { text-align: center; }
  .welcome-actions { justify-content: center; }
  .intro { margin-inline: auto; }
  .hero-card { margin-top: 35px; min-height: 460px; }
  .how-it-works { grid-template-columns: 1fr; margin-top: 30px; }
  .how-it-works article { border-right: 0; border-bottom: 1px solid var(--line); }
  .how-it-works article:last-child { border-bottom: 0; }
  .setup-layout { grid-template-columns: 1fr; }
  .room-panel { min-height: 520px; }
  .daily-grid { grid-template-columns: 1fr; }
  .reveal-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .topbar, main, footer { width: min(100% - 24px, 1180px); }
  .brand { font-size: .68rem; }.brand strong { font-size: .84rem; }.brand-mark { width: 34px; height: 34px; }
  .day-chip { display: none; }
  .welcome-copy h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .hero-card { min-height: 390px; }.paper { width: 285px; }.paper-front { padding: 28px 23px 15px; }.hero-stamp { right: 0; top: -3px; }
  .input-row { flex-direction: column; }.setup-footer { align-items: stretch; flex-direction: column; }.setup-footer .primary-button { width: 100%; }
  .room-join-actions { grid-template-columns: 1fr; }
  .daily-hero { align-items: flex-start; }.daily-day { width: 86px; height: 86px; flex-basis: 86px; }.daily-day strong { font-size: 1.8rem; }.spectator-live { grid-template-columns: 1fr; }.reveal-grid { grid-template-columns: 1fr; }
  .play-header { align-items: flex-start; }.play-header .eyebrow { display: none; }
  .prompt-card { align-items: flex-start; flex-direction: column; gap: 4px; }.prompt-card small { display: none; }
  .interpretation-card { grid-template-columns: 105px 1fr; gap: 8px 12px; }.reference-wrap img { height: 84px; }.interpretation-card label { font-size: .75rem; }
  .canvas-toolbar { align-items: flex-start; flex-direction: column; }.colors, .tools { width: 100%; justify-content: space-between; }.tool-button { flex: 1; padding-inline: 6px; }
  .canvas-shell { min-height: 330px; height: 44vh; }
  .play-footer { align-items: stretch; flex-direction: column; }.play-footer .primary-button { width: 100%; }.play-footer > span { text-align: center; }
  .comparison { grid-template-columns: 1fr; gap: 24px; }.versus { margin: -38px auto; }.result-card, .last-result { transform: rotate(0); }.result-card img { aspect-ratio: 1.5; }
  .journey { justify-content: flex-start; }
  footer { flex-wrap: wrap; gap: 7px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
