:root {
  --pumpkin: #f47b20;
  --pumpkin-dark: #bd481c;
  --gold: #f4bd34;
  --cranberry: #a62635;
  --cranberry-dark: #671914;
  --cream: #fff7df;
  --paper: #fffdf7;
  --ink: #3f241c;
  --green: #557434;
  --shadow: 0 16px 42px rgba(78, 27, 14, .18);
  color-scheme: light;
  font-family: Inter, ui-rounded, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { color: var(--ink); background: var(--cream); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cranberry); }
.hidden { display: none !important; }

.autumn-page {
  background-color: #f9e5ad;
  background-image: linear-gradient(rgba(255, 248, 225, .22), rgba(255, 248, 225, .22)), url('./assets/thanksgivingbackground2.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.center-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: rgba(255, 253, 247, .96); border: 2px solid rgba(126, 54, 25, .12); border-radius: 24px; box-shadow: var(--shadow); }
.join-card, .login-card { width: min(100%, 470px); padding: 34px; text-align: center; }
.landing-stack { width: min(100%, 540px); display: grid; gap: 14px; }.landing-stack .join-card { width: 100%; }
.available-lobbies-card { width: 100%; padding: 24px 26px; overflow: hidden; }
.available-lobbies-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 4px 4px 10px; text-align: left; }
.available-lobbies-heading > div { min-width: 0; }
.available-lobbies-heading h2 { margin: 0; font-size: 1.25rem; line-height: 1.25; text-wrap: balance; }
.available-lobbies-heading .count-bubble { flex-shrink: 0; }
.available-lobbies-message { margin: 4px 4px 12px; color: #7b584a; font-size: .88rem; line-height: 1.45; text-align: left; }
.available-lobbies-list { margin-inline: 4px; }
.available-lobbies-list { display: grid; gap: 8px; }.lobby-choice { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; border: 1px solid #e5c38d; border-radius: 12px; padding: 10px 12px; color: var(--ink); background: #fff8e5; text-align: left; cursor: pointer; }.lobby-choice:hover, .lobby-choice.is-selected { border-color: var(--pumpkin); background: #ffedb9; box-shadow: 0 0 0 3px rgba(244,123,32,.12); }.lobby-choice strong { color: var(--cranberry-dark); }.lobby-choice span { grid-column: 1; color: #7b584a; font-size: .78rem; }.lobby-choice b { grid-column: 2; grid-row: 1 / span 2; padding: 6px 9px; border-radius: 999px; color: white; background: var(--pumpkin); font-size: .74rem; }
.hero-pumpkin { width: 150px; max-height: 130px; object-fit: contain; margin: -12px auto 4px; }
.turkey-mascot { filter: drop-shadow(0 7px 8px rgba(79, 28, 13, .18)); }
.eyebrow { margin: 0 0 5px; color: var(--cranberry); font-size: .76rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1; color: var(--cranberry-dark); }
h2 { color: var(--cranberry-dark); }
.lede { margin: 0 auto 24px; color: #745044; font-size: 1.06rem; line-height: 1.5; }
.stack-form { display: grid; gap: 9px; text-align: left; }
.stack-form label { margin-top: 5px; font-weight: 800; }
input { width: 100%; min-height: 52px; border: 2px solid #d8b88a; border-radius: 13px; background: #fff; padding: 10px 14px; color: var(--ink); font-size: 1.05rem; outline: none; }
input:focus { border-color: var(--pumpkin); box-shadow: 0 0 0 4px rgba(244, 123, 32, .18); }
#room { text-transform: uppercase; font-weight: 900; letter-spacing: .18em; }
.button { min-height: 44px; border: 0; border-radius: 12px; padding: 11px 17px; font-weight: 850; cursor: pointer; transition: transform .12s, filter .12s, opacity .12s; text-decoration: none; text-align: center; }
.button:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .46; }
.button-primary { color: white; background: linear-gradient(135deg, var(--pumpkin), #df551e); box-shadow: 0 7px 16px rgba(190, 67, 17, .23); }
.button-secondary { color: var(--cranberry-dark); background: #f6d878; }
.button-success { color: white; background: var(--green); }
.button-warning { color: #4e2600; background: #f3a62b; }
.button-danger { color: white; background: var(--cranberry); }
.button-light { color: var(--cranberry-dark); background: var(--cream); }
.button-ghost { color: white; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35); }
.button-large { min-height: 54px; font-size: 1.05rem; }
.music-is-on { color: #3b210e !important; border-color: #fff2ac !important; background: #ffd45d !important; }
.projector-music-unlock { position: fixed; left: 50%; bottom: 28px; z-index: 240; transform: translateX(-50%); min-height: 58px; border: 3px solid #fff2ac; border-radius: 999px; padding: 12px 24px; color: #3b210e; background: #ffd45d; font-size: clamp(1rem, 1.8vw, 1.45rem); font-weight: 950; cursor: pointer; box-shadow: 0 8px 30px rgba(35,10,7,.4); }
.form-error { min-height: 1.3em; margin: 1px 0; color: #a11828; font-weight: 700; }
.quiet-link { display: inline-block; margin-top: 22px; font-size: .9rem; font-weight: 700; }

/* Player */
.player-page { min-height: 100vh; background: linear-gradient(180deg, #fff1c4, #fffaf0 38%, #f6deaa); }
.player-header { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; min-height: 66px; padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right)); color: white; background: linear-gradient(120deg, var(--cranberry-dark), var(--cranberry)); box-shadow: 0 4px 15px rgba(83, 21, 15, .23); }
.player-header .eyebrow { color: #ffd975; font-size: .65rem; }
.player-header strong { display: block; max-width: 54vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-header-actions { display: flex; align-items: center; gap: 8px; }
.room-badge { padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.16); font-weight: 750; font-size: .8rem; }
.room-badge span { display: block; color: #ffdc76; font-size: 1rem; letter-spacing: .1em; }
.exit-game { min-height: 38px; border: 1px solid rgba(255,255,255,.55); border-radius: 9px; padding: 7px 10px; color: white; background: rgba(255,255,255,.12); font-size: .75rem; font-weight: 850; cursor: pointer; }
.exit-game:hover:not(:disabled) { background: rgba(255,255,255,.22); }.exit-game:disabled { opacity: .55; }
.game-info { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.58); border-radius: 50%; color: white; background: rgba(255,255,255,.14); font-family: Georgia, serif; font-size: 1.05rem; font-weight: 900; cursor: pointer; }
.player-main { width: min(100%, 650px); margin: 0 auto; padding: 16px 12px calc(32px + env(safe-area-inset-bottom)); }
.compact-card, .waiting-card { padding: 30px 22px; text-align: center; }
.compact-card h1, .waiting-card h1 { font-size: 2rem; }
.waiting-card { margin-top: clamp(10px, 8vh, 70px); }
.waiting-pumpkin { width: 124px; margin-bottom: 8px; }
.success-pill { display: inline-block; margin: 0 0 14px; padding: 7px 13px; border-radius: 999px; color: #31511a; background: #dfeab3; font-weight: 900; }
.waiting-dots { display: flex; justify-content: center; gap: 7px; margin-top: 24px; }
.waiting-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--pumpkin); animation: bob 1.25s infinite ease-in-out; }
.waiting-dots span:nth-child(2) { animation-delay: .15s; }.waiting-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-7px); opacity: 1; } }
.game-layout { display: grid; justify-items: center; gap: 10px; }
.game-topline { width: min(96vw, 560px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.game-topline > div { min-height: 52px; display: grid; place-content: center; text-align: center; border-radius: 13px; background: white; box-shadow: 0 4px 13px rgba(79,38,15,.10); }
.game-topline .label { display: block; color: #8a6251; font-size: .64rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.game-topline strong { color: var(--cranberry-dark); font-size: 1.15rem; }
.timer-chip { background: var(--cranberry-dark) !important; }.timer-chip .label { color: #f7c965 !important; }.timer-chip strong { color: white !important; }
.selection-help { margin: 2px 0; color: #7b584a; font-size: .83rem; text-align: center; }
.puzzle-grid { width: min(96vw, 560px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--grid-size, 10), minmax(0, 1fr)); gap: clamp(1px, .45vw, 4px); padding: clamp(4px, 1.2vw, 9px); border: 3px solid #c55822; border-radius: 14px; background: #d78232; box-shadow: 0 9px 24px rgba(89, 40, 13, .18); touch-action: none; user-select: none; }
.puzzle-cell { min-width: 0; min-height: 0; display: grid; place-items: center; border: 0; border-radius: clamp(2px, .8vw, 8px); color: #4d271c; background: #fffdf5; font-size: clamp(.62rem, 4.1vw, var(--cell-font, 1.55rem)); font-weight: 900; line-height: 1; box-shadow: inset 0 -2px rgba(116,62,29,.08); }
button.puzzle-cell { cursor: pointer; }
.puzzle-cell.selecting { color: white; background: var(--cranberry); transform: scale(.94); }
.puzzle-cell.tap-start { color: white; background: var(--pumpkin); outline: 3px solid rgba(110, 37, 19, .28); }
.puzzle-cell.found-cell { color: #2f1a12; background: color-mix(in srgb, var(--highlight) 68%, white); box-shadow: inset 0 0 0 2px var(--highlight); }
.selection-message { min-height: 1.3em; margin: 0; color: var(--cranberry); font-weight: 850; text-align: center; }
.word-bank { width: min(96vw, 560px); padding: 11px 13px 12px; border-radius: 15px; background: white; box-shadow: 0 7px 20px rgba(89, 40, 13, .11); }
.word-bank h2 { margin: 0 0 7px; font-size: .95rem; }
.word-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.word-item { display: grid; place-items: center; min-height: 33px; border-radius: 8px; background: #fff0c8; color: #64241b; font-size: clamp(.72rem, 3vw, .9rem); font-weight: 900; }
.word-item.found { color: #66705b; background: #e6e0cf; text-decoration: line-through; }
.finish-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(66, 15, 10, .82); backdrop-filter: blur(7px); }
.finish-celebration { width: min(92vw, 480px); padding: 28px 24px 25px; border: 4px solid #f5bf38; border-radius: 28px; color: var(--ink); background: linear-gradient(160deg, #fffdf7, #ffe7a6); text-align: center; box-shadow: 0 24px 80px rgba(46, 10, 7, .46); animation: celebrate-in .38s ease-out; }
.finish-turkey { width: min(230px, 62vw); max-height: 185px; object-fit: contain; margin: -10px auto 8px; }
.finish-celebration h2 { margin: 3px 0 10px; color: var(--cranberry-dark); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.2rem, 10vw, 3.6rem); }.finish-celebration p { margin-bottom: 12px; }
.finish-placement { color: var(--cranberry); font-size: clamp(1.65rem, 7vw, 2.5rem); font-weight: 950; }
.finish-celebration .button { width: 100%; margin-top: 5px; }
.player-standings { position: fixed; inset: 66px 0 0; z-index: 8; overflow-y: auto; padding: 22px max(14px, env(safe-area-inset-right)) calc(30px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); color: white; background-color: #4c120e; background-image: linear-gradient(rgba(66, 15, 10, .82), rgba(66, 15, 10, .9)), url('./assets/thanksgivingbackground.png'); background-size: cover; background-position: center; }
.player-standings-header { width: min(100%, 900px); display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 0 auto; padding-bottom: 15px; border-bottom: 2px solid rgba(255,208,92,.45); }
.player-standings-header h1 { margin: 0; color: white; font-size: clamp(2rem, 8vw, 3.5rem); }
.player-standings-placement { margin: 9px 0 0; color: #ffd465; font-size: clamp(1rem, 4vw, 1.35rem); font-weight: 900; }
.round-transition-message { margin: 10px 0 0; color: #fff3bd; font-size: clamp(.95rem, 3vw, 1.25rem); font-weight: 900; }
.player-standings-timer { flex: 0 0 auto; }
.player-standings-timer strong { font-size: clamp(2.5rem, 10vw, 4rem); }
.player-standings > .podium, .player-standings > .leaderboard-panel, .player-standings > .participants-panel { width: min(100%, 900px); margin-left: auto; margin-right: auto; }
.final-screen { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 22px; }
.final-overlay { position: fixed; inset: 0; z-index: 120; min-height: 100vh; overflow-y: auto; background: rgba(66, 15, 10, .9); backdrop-filter: blur(8px); }
.final-screen-card { width: min(94vw, 680px); max-height: calc(100vh - 36px); overflow-y: auto; padding: 26px; border: 4px solid var(--gold); border-radius: 28px; background: linear-gradient(160deg, #fffdf7, #ffe8a8); text-align: center; box-shadow: 0 24px 80px rgba(46, 10, 7, .46); animation: celebrate-in .38s ease-out; }
.final-turkey { width: min(190px, 48vw); max-height: 145px; object-fit: contain; margin: -8px auto 5px; }
.final-screen-card h1 { margin-bottom: 8px; font-size: clamp(2.3rem, 9vw, 4rem); }
.final-summary { margin-bottom: 18px; color: var(--cranberry); font-size: 1.08rem; font-weight: 900; }
.final-leaderboard { display: grid; gap: 8px; text-align: left; }
.final-leader-row { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(160px, auto) 72px; gap: 10px; align-items: center; min-height: 48px; padding: 8px 11px; border: 1px solid #ecd3a8; border-radius: 11px; background: rgba(255,255,255,.82); }
.final-leader-row.is-winner { border-color: #d6ad26; background: #fff1a9; box-shadow: 0 3px 12px rgba(121,75,8,.13); }
.final-leader-row b { color: var(--cranberry); }.final-leader-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.final-leader-row span { color: #755044; font-size: .82rem; font-weight: 750; }.final-leader-row em { color: var(--cranberry-dark); font-style: normal; font-weight: 950; text-align: right; white-space: nowrap; }
.final-countdown { margin: 17px 0 0; color: #765143; font-size: .88rem; font-weight: 800; }
.info-overlay { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 22px; background: rgba(46, 12, 9, .75); backdrop-filter: blur(6px); }.info-card { position: relative; width: min(92vw, 430px); padding: 28px 24px 20px; border: 3px solid var(--gold); border-radius: 22px; background: #fff9e8; box-shadow: 0 22px 70px rgba(45, 10, 7, .42); }.info-card h2 { margin-bottom: 12px; }.info-card p { color: #69483d; line-height: 1.5; }.info-close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: white; background: var(--cranberry); font-size: 1.3rem; cursor: pointer; }
@keyframes celebrate-in { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Moderator */
.dashboard { min-height: 100vh; background: rgba(255, 247, 222, .88); }
.dashboard-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px clamp(20px, 4vw, 54px); color: white; background: linear-gradient(120deg, #55140f, #9d2b2b); }
.dashboard-header h1 { margin: 0; color: white; font-size: clamp(2rem, 4vw, 3rem); }.dashboard-header .eyebrow { color: #ffd66c; }
.dashboard-brand { display: flex; align-items: center; gap: 14px; }.dashboard-mascot { width: 78px; max-height: 70px; object-fit: contain; filter: drop-shadow(0 5px 6px rgba(0,0,0,.2)); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.create-card { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; width: min(1100px, calc(100% - 40px)); margin: 40px auto; padding: 28px; }
.create-card h2, .create-card p { margin-bottom: 6px; }.small-pumpkin { width: 90px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(430px, 1.2fr); gap: 20px; width: min(1400px, calc(100% - 36px)); margin: 24px auto 48px; }
.dashboard-grid .card { padding: 22px; }
.answer-card { grid-column: 1 / -1; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }.status-pill, .private-badge, .count-bubble { display: inline-block; padding: 5px 10px; border-radius: 999px; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.status-pill { color: #6d2416; background: #f9dc83; }.private-badge { color: white; background: var(--cranberry); }.count-bubble { color: white; background: var(--pumpkin); vertical-align: middle; }
.qr-code { display: block; width: min(260px, 100%); margin: 0 auto 10px; border-radius: 16px; }
.join-link { overflow-wrap: anywhere; text-align: center; font-size: .83rem; }
.round-controls { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.round-settings { margin: 16px 0; padding: 15px; border: 1px solid #e8c999; border-radius: 15px; background: #fff8e5; }.round-settings h3 { margin: 0 0 12px; color: var(--cranberry-dark); }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; align-items: end; }.settings-grid label { display: grid; gap: 5px; color: #755044; font-size: .76rem; font-weight: 850; }.round-settings select, .round-settings input[type="number"] { width: 100%; min-height: 42px; border: 1px solid #d7b47d; border-radius: 9px; background: white; padding: 7px 9px; color: var(--ink); font: inherit; }.settings-grid .toggle-setting { grid-template-columns: auto 1fr; align-items: center; align-self: center; font-size: .9rem; }.toggle-setting input { width: 22px; min-height: 22px; margin: 0; accent-color: var(--cranberry); }.duration-input { display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; font-weight: 700; }.settings-summary { margin: 11px 0 0; color: var(--cranberry); font-size: .82rem; font-weight: 850; }
.projection-music-setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 0 0 12px; padding: 13px 14px; border: 1px solid #e3bf82; border-radius: 13px; background: #fff2c8; }.projection-music-setting div { min-width: 0; display: grid; gap: 3px; }.projection-music-setting strong { color: var(--cranberry-dark); }.projection-music-setting span { color: #755044; font-size: .78rem; line-height: 1.35; }.projection-music-setting .button { min-width: 105px; }
.action-message { min-height: 1.3em; margin: 10px 0 0; color: var(--cranberry); font-weight: 750; }
.dashboard-timer { text-align: right; }.dashboard-timer span { display: block; color: #806353; font-size: .78rem; }.dashboard-timer strong { color: var(--cranberry); font-size: 1.65rem; }
.players-list { display: grid; gap: 12px; max-height: 490px; overflow: auto; padding-right: 3px; }.empty-state { padding: 35px 15px; border: 2px dashed #dabf9d; border-radius: 13px; text-align: center; color: #866454; }
.progress-row { padding: 10px 12px; border: 1px solid #efd9b8; border-radius: 12px; background: #fffaf0; }.progress-row.is-finisher { border-color: #d5b34c; background: #fff3b8; }
.progress-row-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }.progress-row-top span { font-weight: 850; color: var(--cranberry); }
.progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #eadfc9; }.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pumpkin), var(--gold)); transition: width .25s; }
.answer-grid { width: min(620px, 92vw); margin: 0 auto; pointer-events: none; }.answer-grid .puzzle-cell { font-size: clamp(.9rem, 2.4vw, 1.55rem); }
.answer-cell { color: #2d140e; background: color-mix(in srgb, var(--highlight) 64%, white); box-shadow: inset 0 0 0 2px var(--highlight); }
.answer-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }.legend-word { padding: 6px 10px; border-radius: 999px; color: #341710; background: var(--legend-color); font-size: .8rem; font-weight: 900; }
.history-card { width: min(1100px, calc(100% - 36px)); min-width: 0; overflow: hidden; margin: 24px auto 48px; padding: 22px; }
.history-card .section-heading { align-items: center; }.history-message { margin: -4px 0 14px; color: #806353; }
.history-list { min-width: 0; display: grid; gap: 12px; }.history-entry { min-width: 0; overflow: hidden; border: 1px solid #e7c99b; border-radius: 14px; background: #fffaf0; }
.history-entry summary { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 16px; cursor: pointer; list-style-position: inside; }.history-entry summary:hover { background: #fff2cf; }
.history-entry-heading { min-width: 0; display: inline-grid; gap: 3px; margin-right: auto; overflow-wrap: anywhere; }.history-entry-heading strong { color: var(--cranberry-dark); }.history-entry-heading small { color: #806353; }
.history-winner { padding: 6px 10px; border-radius: 999px; color: #4a260d; background: #f6d878; font-size: .78rem; font-weight: 900; white-space: nowrap; }
.history-entry-body { min-width: 0; padding: 4px 16px 16px; border-top: 1px solid #ead6b7; }.history-settings { margin: 12px 0 5px; color: var(--cranberry); font-weight: 850; overflow-wrap: anywhere; }.history-words { margin: 0 0 13px; color: #806353; font-size: .84rem; line-height: 1.5; overflow-wrap: anywhere; }
.history-leaderboard { min-width: 0; display: grid; gap: 7px; }.history-result { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(110px, auto); gap: 10px; align-items: center; min-height: 42px; padding: 7px 11px; border-radius: 9px; background: white; }.history-result b { color: var(--cranberry); }.history-result strong, .history-result span { min-width: 0; overflow-wrap: anywhere; }.history-result span { color: #70483b; font-weight: 850; text-align: right; }.history-result.is-winner { background: #fff1ad; }

/* Projection */
.projection-page { min-height: 100vh; overflow-x: hidden; color: white; background-color: #4c120e; background-image: linear-gradient(rgba(66, 15, 10, .82), rgba(66, 15, 10, .88)), url('./assets/thanksgivingbackground.png'); background-size: cover; background-position: center; }
.projection-shell { min-height: 100vh; padding: clamp(26px, 4vw, 64px); }
.projection-page .eyebrow { color: #ffc64d; font-size: clamp(.8rem, 1.3vw, 1.15rem); }.projection-page h1, .projection-page h2 { color: white; }
.projection-lobby { width: min(1300px, 100%); margin: auto; }.projection-brand { display: flex; justify-content: center; align-items: center; gap: 25px; text-align: left; }.projection-brand img { width: clamp(130px, 15vw, 230px); }.projection-brand h1 { margin: 0; font-size: clamp(3rem, 7vw, 6.5rem); }
.projection-join { display: grid; grid-template-columns: minmax(280px, 430px) minmax(400px, 1fr); gap: clamp(35px, 6vw, 90px); align-items: center; width: min(1100px, 100%); margin: 25px auto; }.projection-qr { width: 100%; border: 12px solid #fff8e8; border-radius: 24px; }.projection-join p { margin: 0 0 12px; color: #ffcf58; font-size: clamp(2rem, 4.5vw, 4.8rem); font-weight: 950; }.projection-join span { display: block; margin-top: 10px; color: #f7d6ae; font-size: clamp(1rem, 1.8vw, 1.7rem); }.projection-join strong { display: block; max-width: 650px; overflow-wrap: anywhere; font-size: clamp(1rem, 1.6vw, 1.5rem); }.giant-code { display: block; color: #fff; font-size: clamp(4.5rem, 10vw, 9rem); line-height: 1; letter-spacing: .12em; text-shadow: 0 7px 0 #a52d2e; }
.projection-waiting { margin: 30px 0 0; color: #ffd664; font-size: clamp(1.5rem, 3vw, 2.6rem); font-weight: 850; text-align: center; }
.projection-header { display: flex; justify-content: space-between; align-items: end; gap: 35px; border-bottom: 3px solid rgba(255,208,92,.45); padding-bottom: 18px; }.projection-header h1 { margin: 0; font-size: clamp(3rem, 6vw, 6rem); }.projection-timer { text-align: right; }.projection-timer span { display: block; color: #ffcb52; font-size: clamp(1rem, 1.8vw, 1.6rem); font-weight: 900; text-transform: uppercase; }.projection-timer strong { font-variant-numeric: tabular-nums; font-size: clamp(4rem, 8vw, 8rem); line-height: .9; }
.projection-game > .round-transition-message { margin: 18px 0 -6px; color: #ffd465; text-align: center; font-size: clamp(1.3rem, 2.3vw, 2.2rem); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 28px auto; }.podium-card { min-height: 112px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 14px 18px; border: 2px solid rgba(255,255,255,.25); border-radius: 18px; background: rgba(255,255,255,.11); }.podium-card.place-1 { color: #351b12; background: #ffd659; }.podium-card.place-2 { color: #351b12; background: #e7e5db; }.podium-card.place-3 { color: #351b12; background: #e6a06c; }.podium-place { position: relative; width: clamp(72px, 7vw, 104px); height: clamp(72px, 7vw, 104px); display: grid; place-items: center; isolation: isolate; }.award-turkey::before { content: ''; position: absolute; inset: 3px; z-index: -1; border: 4px solid rgba(255,255,255,.72); border-radius: 50%; box-shadow: 0 4px 12px rgba(57,30,16,.22); }.award-turkey::after { content: ''; position: absolute; inset: 8px; z-index: 1; background: var(--award-metal); opacity: .36; mix-blend-mode: color; -webkit-mask: url('./assets/turkey.png') center / contain no-repeat; mask: url('./assets/turkey.png') center / contain no-repeat; pointer-events: none; }.award-turkey img { width: 90%; height: 90%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(53,27,13,.22)); }.place-1 .award-turkey { --award-metal: #ffc400; }.place-2 .award-turkey { --award-metal: #c7d0d9; }.place-2 .award-turkey img { filter: grayscale(.58) brightness(1.12) drop-shadow(0 3px 3px rgba(53,27,13,.22)); }.place-3 .award-turkey { --award-metal: #b66a35; }.place-3 .award-turkey img { filter: sepia(.35) saturate(.9) drop-shadow(0 3px 3px rgba(53,27,13,.22)); }.podium-rank { position: absolute; right: -2px; bottom: 0; z-index: 2; width: 1.7em; height: 1.7em; display: grid; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: #6f211c; font-size: clamp(.95rem, 1.5vw, 1.3rem); font-weight: 950; box-shadow: 0 2px 5px rgba(57,30,16,.3); }.podium-card strong { overflow: hidden; font-size: clamp(1.2rem, 2.1vw, 2.2rem); text-overflow: ellipsis; white-space: nowrap; }.podium-card time { font-size: clamp(1rem, 1.6vw, 1.5rem); font-weight: 900; }
.leaderboard-panel { padding: 22px clamp(18px, 3vw, 36px); border-radius: 24px; background: rgba(255, 250, 232, .96); color: var(--ink); }.leaderboard-panel h2 { margin-bottom: 16px; color: var(--cranberry-dark); font-size: clamp(1.6rem, 2.5vw, 2.5rem); }.leaderboard { display: grid; gap: 11px; }.leader-row { display: grid; grid-template-columns: 70px minmax(180px, 1fr) minmax(160px, 2fr) 150px; gap: 18px; align-items: center; min-height: 62px; padding: 8px 16px; border-radius: 13px; background: #fff7df; font-size: clamp(1rem, 1.8vw, 1.7rem); }.leader-rank { color: var(--cranberry); font-weight: 950; }.leader-name { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }.leader-count { text-align: right; color: var(--cranberry); font-weight: 900; }.leader-row .progress-track { height: 15px; }
.participants-panel { margin-top: 18px; padding: 18px clamp(18px, 3vw, 36px); border: 2px solid rgba(255, 203, 82, .45); border-radius: 20px; background: rgba(76, 18, 14, .82); }.participants-panel h2 { margin: 0 0 13px; color: #ffd465; font-size: clamp(1.25rem, 2vw, 2rem); }.participants-panel h2 span { display: inline-grid; min-width: 2em; min-height: 2em; place-items: center; margin-left: 8px; border-radius: 999px; color: #4c120e; background: #ffd465; font-size: .58em; vertical-align: middle; }.participants-list { display: flex; flex-wrap: wrap; gap: 10px; }.participant-chip { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 15px; border-radius: 999px; color: #3f241c; background: #fff7df; font-size: clamp(.95rem, 1.5vw, 1.35rem); font-weight: 850; }.participant-chip.is-offline { opacity: .65; }
.projection-final { width: min(1200px, 100%); margin: auto; text-align: center; }
.projection-final-turkey { width: clamp(150px, 18vw, 250px); max-height: 190px; object-fit: contain; }
.projection-final > h1 { margin: 6px 0 8px; color: #ffd45d; font-size: clamp(4rem, 9vw, 8.5rem); text-shadow: 0 6px 0 #7c201d; }
.projection-final-summary { color: white; font-size: clamp(1.35rem, 2.4vw, 2.4rem); font-weight: 900; }
.projection-final-board { margin-top: 24px; text-align: left; }
.projection-final-board .final-leader-row { min-height: 62px; font-size: clamp(1rem, 1.6vw, 1.5rem); }
.projection-final-countdown { margin: 20px 0 0; color: #ffd465; font-size: clamp(1rem, 1.5vw, 1.4rem); font-weight: 850; }
.projection-error { display: grid; place-content: center; min-height: 80vh; text-align: center; }.projection-error h1 { font-size: 4rem; }

@media (max-width: 850px) {
  .dashboard-header, .create-card { align-items: stretch; flex-direction: column; }
  .create-card { grid-template-columns: 1fr; text-align: center; }.small-pumpkin { margin: auto; }
  .dashboard-grid { grid-template-columns: 1fr; }.answer-card { grid-column: auto; }
  .projection-join { grid-template-columns: 1fr; text-align: center; }.projection-qr { width: min(65vw, 380px); margin: auto; }.giant-code { letter-spacing: .06em; }
  .podium { grid-template-columns: 1fr; }.leader-row { grid-template-columns: 45px 1fr 100px; }.leader-row .progress-track { display: none; }
}

@media (max-width: 520px) {
  .center-shell { padding: 13px; }.join-card, .login-card { padding: 26px 20px; }.hero-pumpkin { width: 125px; }.available-lobbies-card { padding: 18px; }.available-lobbies-heading { gap: 10px; padding: 2px 2px 9px; }.available-lobbies-heading h2 { font-size: 1.12rem; }.available-lobbies-message { margin-inline: 2px; }.available-lobbies-list { margin-inline: 2px; }
  .player-header { min-height: 46px; padding-block: 4px; }.player-header .eyebrow { margin-bottom: 1px; font-size: .52rem; }.player-header strong { font-size: .82rem; }.player-header-actions { gap: 4px; }
  .player-standings { top: 46px; padding: 14px 9px calc(20px + env(safe-area-inset-bottom)); }.player-standings-header { align-items: start; }.player-standings-header h1 { font-size: 1.85rem; }.player-standings-placement { font-size: .9rem; }.player-standings-timer span { font-size: .7rem; }.player-standings-timer strong { font-size: 2.1rem; }.player-standings .podium { gap: 8px; margin: 14px auto; }.player-standings .podium-card { min-height: 80px; padding: 8px 10px; }.player-standings .podium-place { width: 62px; height: 62px; }.player-standings .leaderboard-panel { padding: 14px 10px; border-radius: 15px; }.player-standings .leaderboard-panel h2 { margin-bottom: 10px; font-size: 1.3rem; }.player-standings .leader-row { min-height: 48px; padding: 6px 8px; font-size: .9rem; }.player-standings .participants-panel { margin-top: 12px; padding: 12px 10px; }.player-standings .participant-chip { min-height: 34px; padding: 6px 10px; font-size: .82rem; }
  .room-badge { padding: 3px 6px; font-size: .58rem; }.room-badge span { font-size: .74rem; }.exit-game { min-height: 28px; padding: 4px 6px; font-size: .62rem; }.game-info { width: 28px; height: 28px; font-size: .9rem; }
  .game-layout { --play-gap: 2px; --metric-height: 35px; --word-height: 20px; --word-gap: 2px; --word-padding: 4px; --word-font: clamp(.55rem, 2.45vw, .68rem); min-height: calc(100dvh - 56px - env(safe-area-inset-bottom)); align-content: space-evenly; }
  .game-layout.density-standard { --play-gap: 4px; --metric-height: 40px; --word-height: 24px; --word-gap: 3px; --word-padding: 6px; --word-font: clamp(.6rem, 2.65vw, .73rem); }
  .game-layout.density-relaxed { --play-gap: 7px; --metric-height: 44px; --word-height: 28px; --word-gap: 5px; --word-padding: 8px; --word-font: clamp(.64rem, 2.85vw, .8rem); }
  .word-list { grid-template-columns: repeat(4, 1fr); gap: var(--word-gap); }.word-item { min-height: var(--word-height); border-radius: 5px; font-size: var(--word-font); }.round-controls { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .player-main { padding: 2px 3px calc(4px + env(safe-area-inset-bottom)); }.game-layout { gap: var(--play-gap); }.puzzle-grid { width: min(99vw, max(210px, calc(100dvh - var(--compact-non-grid, 265px)))); padding: 2px; border-width: 2px; gap: 1px; }.game-topline, .word-bank, .finish-card { width: 99vw; }
  .game-topline { position: sticky; top: 46px; z-index: 9; gap: var(--play-gap); padding: 2px; border-radius: 0 0 9px 9px; background: rgba(255, 241, 196, .97); box-shadow: 0 4px 9px rgba(83, 21, 15, .10); backdrop-filter: blur(8px); }.game-topline > div { min-height: var(--metric-height); border-radius: 8px; }.game-topline .label { font-size: .5rem; }.game-topline strong { font-size: .88rem; }
  .word-bank { padding: var(--word-padding); border-radius: 8px; }.word-bank h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }.selection-message { min-height: .9em; font-size: .68rem; line-height: 1.1; }
  .history-card { width: calc(100% - 20px); padding: 16px; }.history-card .section-heading { align-items: stretch; flex-direction: column; }.history-entry summary { grid-template-columns: minmax(0, 1fr); align-items: stretch; }.history-winner { justify-self: start; white-space: normal; }.history-result { grid-template-columns: 38px minmax(0, 1fr); }.history-result span { grid-column: 2; text-align: left; }
  .final-screen { padding: 8px; }.final-screen-card { width: 100%; padding: 20px 13px; border-width: 3px; border-radius: 18px; }.final-turkey { width: 120px; max-height: 92px; }.final-leader-row { grid-template-columns: 34px minmax(0, 1fr) 60px; gap: 6px; }.final-leader-row span { grid-column: 2 / -1; grid-row: 2; }.final-leader-row em { grid-column: 3; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; } }
