:root {
  color-scheme: light;
  --navy: #17253b;
  --navy-deep: #111d30;
  --navy-muted: #647083;
  --cream: #f7f5ef;
  --paper: #fffefa;
  --line: #e7e5df;
  --muted: #788294;
  --lime: #d3ef75;
  --mint: #e6f4bd;
  --coral: #f28a70;
  --blue: #a9c5e8;
  --shadow: 0 16px 48px rgba(23, 37, 59, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--navy);
  background:
    radial-gradient(ellipse at 10% 12%, rgba(211, 239, 117, .15), transparent 28rem),
    var(--cream);
}

button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(81, 131, 187, .5);
  outline-offset: 3px;
}

.page-shell { width: min(1160px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23, 37, 59, .1); }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--navy); text-decoration: none; font-weight: 850; font-size: 19px; letter-spacing: -.8px; }
.brand-light { color: #7d8794; font-weight: 550; }
.brand-mark { width: 25px; height: 25px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-7deg); }
.brand-mark i { border-radius: 3px; background: var(--lime); }
.brand-mark i:nth-child(2) { background: var(--coral); }
.brand-mark i:nth-child(3) { background: var(--blue); }
.brand-mark i:nth-child(4) { background: var(--navy); }
.topbar-note { display: inline-flex; align-items: center; gap: 8px; color: #737d8c; font-size: 12px; font-weight: 600; }
.privacy-dot, .connection-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #89b849; box-shadow: 0 0 0 3px rgba(137, 184, 73, .13); }
.main-content { min-height: calc(100vh - 142px); }
.footer { min-height: 60px; display: flex; justify-content: space-between; align-items: center; color: #89909a; font-size: 11px; border-top: 1px solid rgba(23, 37, 59, .09); }

.hero { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 8%; padding: 82px 0 77px; }
.hero-copy { max-width: 570px; }
.eyebrow, .section-label, .card-kicker { color: #818a96; font-size: 10px; font-weight: 800; letter-spacing: 1.55px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #677486; }
.eyebrow-star { font-size: 18px; color: #8eaa46; }
h1, h2, h3, p { margin-top: 0; }
.hero h1, .room-welcome h1, .game-welcome h1, .final-hero h1 { margin: 20px 0 18px; font-size: clamp(42px, 5vw, 64px); line-height: 1.03; letter-spacing: -3.2px; font-weight: 800; }
.hero h1 span, .room-welcome h1 span, .game-welcome h1 span { color: #8b969f; }
.hero-copy > p, .room-welcome > div:first-child > p { max-width: 450px; color: #737f8c; font-size: 15px; line-height: 1.75; }
.hero-points { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; color: #606d7c; font-size: 12px; font-weight: 650; }
.hero-points span { display: inline-flex; align-items: center; gap: 7px; }
.hero-points b { color: #91aa52; font-size: 15px; }

.home-card, .panel, .invite-card, .start-card, .waiting-card, .game-rule-card { background: var(--paper); border: 1px solid rgba(23, 37, 59, .075); border-radius: 12px; box-shadow: var(--shadow); }
.home-card { padding: 29px 31px 23px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.mini-bingo { width: 42px; height: 42px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; transform: rotate(7deg); }
.mini-bingo i { border-radius: 2px; background: #e8ebdf; }
.mini-bingo i:nth-child(2), .mini-bingo i:nth-child(5), .mini-bingo i:nth-child(9) { background: var(--lime); }
.mini-bingo i:nth-child(4) { background: var(--coral); }
.home-card h2 { margin: 17px 0 22px; font-size: 22px; line-height: 1.28; letter-spacing: -.8px; }
.home-form, .join-form { display: flex; flex-direction: column; }
.home-form label, .join-form label, .panel > label { margin: 0 0 7px; color: #667284; font-size: 11px; font-weight: 700; }
.home-form input, .join-form input, .bonus-control input { height: 43px; padding: 0 13px; border: 1px solid #e3e5e5; border-radius: 6px; outline: 0; color: var(--navy); background: #fff; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.home-form input:focus, .join-form input:focus, .bonus-control input:focus { border-color: #9eafbf; box-shadow: 0 0 0 3px rgba(137, 166, 192, .13); }
.home-form input::placeholder, .join-form input::placeholder { color: #aab1b9; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 14px; min-height: 43px; padding: 0 17px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 750; text-decoration: none; transition: transform .15s, background .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .46; cursor: not-allowed; }
.button-primary { background: var(--navy); color: #fff; }
.button-primary:hover:not(:disabled) { background: #243650; }
.button-dark { color: #fff; background: #263650; }
.button-dark:hover:not(:disabled) { background: #354964; }
.button-wide { width: 100%; }
.home-form .button { margin-top: 12px; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 21px 0 18px; color: #9aa2aa; font-size: 10px; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; flex: 1; background: #ecece8; }
.join-form label:not(:first-child) { margin-top: 12px; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-row input { min-width: 0; text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
.card-footnote { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; color: #87909b; font-size: 10px; }
.card-footnote .privacy-dot { width: 6px; height: 6px; }
.how-section { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; padding: 0 5px 70px; }
.how-section > div { position: relative; padding-top: 18px; border-top: 1px solid #dfe1d9; }
.step-number { color: #92aa58; font-size: 10px; font-weight: 800; letter-spacing: 1px; }
.how-section h3 { margin: 10px 0 5px; font-size: 14px; letter-spacing: -.2px; }
.how-section p { margin: 0; color: #7e8994; font-size: 12px; line-height: 1.65; }

.room-page { padding: 24px 0 64px; }
.room-topline { display: flex; align-items: center; justify-content: space-between; min-height: 29px; margin-bottom: 22px; }
.back-link { color: #727d8a; text-decoration: none; font-size: 11px; font-weight: 650; }
.back-link:hover { color: var(--navy); }
.connection { display: inline-flex; align-items: center; gap: 8px; color: #637d58; font-size: 10px; font-weight: 700; }
.connection.offline { color: #b15b48; }
.connection.offline .connection-dot { background: #d7785d; box-shadow: 0 0 0 3px rgba(215, 120, 93, .12); }
.connection.connecting .connection-dot { background: #d8a64d; box-shadow: 0 0 0 3px rgba(216, 166, 77, .12); }
.alert { display: flex; align-items: center; gap: 11px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.alert-error { color: #873e31; border-color: #efc7bc; background: #fff3ef; }
.alert-success { color: #526e3e; border-color: #d9e8c1; background: #f4f9e9; }
.alert-icon { flex: 0 0 19px; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(0, 0, 0, .06); font-size: 11px; font-weight: 800; }
.alert-close { margin-left: auto; padding: 0 3px; border: 0; background: transparent; color: inherit; font-size: 19px; cursor: pointer; }
.room-welcome { display: grid; grid-template-columns: 1fr 285px; align-items: center; gap: 50px; padding: 29px 0 39px; }
.room-welcome h1, .game-welcome h1 { margin: 14px 0 12px; font-size: clamp(38px, 4vw, 51px); letter-spacing: -2.5px; }
.room-welcome > div:first-child > p { max-width: 520px; margin-bottom: 0; font-size: 13px; }
.invite-card { padding: 18px 20px 16px; }
.invite-code { margin: 4px 0 11px; font-size: 33px; font-weight: 850; letter-spacing: 7px; }
.invite-card .button { min-height: 39px; font-size: 11px; }
.invite-hint { display: block; margin-top: 9px; color: #9099a1; font-size: 9px; line-height: 1.5; }
.lobby-layout, .game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 23px; align-items: start; }
.main-column, .side-column { display: flex; flex-direction: column; gap: 19px; min-width: 0; }
.panel { padding: 22px; box-shadow: 0 8px 26px rgba(23, 37, 59, .045); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 19px; line-height: 1.2; letter-spacing: -.75px; }
.section-label { font-size: 9px; letter-spacing: 1.45px; }
.panel-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #f1f5e6; color: #849b4e; font-size: 17px; }
.panel-description { margin: 12px 0 17px; color: #7a8591; font-size: 11px; line-height: 1.65; }
.pool-panel > label { display: flex; justify-content: space-between; margin-bottom: 7px; }
.label-hint { color: #a1a8ad; font-size: 10px; font-weight: 500; }
.pool-editor { display: block; width: 100%; min-height: 150px; resize: vertical; padding: 11px 12px; border: 1px solid #e6e8e5; border-radius: 6px; outline: 0; color: #4b5868; background: #fcfcf9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.75; }
.pool-editor:focus { border-color: #9eafbf; box-shadow: 0 0 0 3px rgba(137, 166, 192, .12); }
.pool-editor[readonly] { color: #74808a; background: #f6f7f4; }
.pool-meta { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0 10px; color: #929aa2; font-size: 9px; }
.pool-meta code { color: #617185; }
.button-outline { border-color: #dce1dc; color: #49596b; background: #fff; }
.button-outline:hover:not(:disabled) { background: #f6f8f2; }
.button-soft { color: #506546; background: #eff5dd; }
.button-soft:hover:not(:disabled) { background: #e6efcc; }
.button-quiet { color: #75808a; background: transparent; border-color: transparent; }
.button-quiet:hover:not(:disabled) { background: #f5f5f1; }
.button-small { min-height: 32px; padding: 0 10px; gap: 7px; font-size: 10px; }
.bonus-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 17px; margin-top: 17px; border-top: 1px solid #eeefeb; }
.bonus-row > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.bonus-row strong { font-size: 11px; }
.bonus-row small { color: #929aa2; font-size: 9px; font-weight: 500; }
.bonus-control { display: flex; align-items: center; gap: 6px; }
.bonus-control input { width: 55px; height: 31px; padding: 0 7px; text-align: center; font-size: 11px; }
.bonus-control > span { color: #89939d; font-size: 9px; }
.bonus-value { color: var(--navy); font-size: 16px; font-weight: 800; white-space: nowrap; }
.ready-summary { display: flex; align-items: center; gap: 9px; padding-top: 14px; margin-top: 15px; border-top: 1px solid #eeefeb; color: #75808b; font-size: 10px; }
.ready-summary strong { color: #506547; }
.ready-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef5df; color: #6f934c; font-size: 11px; font-weight: 800; }
.board-count, .people-count { padding: 6px 9px; border-radius: 6px; color: #667747; background: #f1f5e7; font-size: 12px; font-weight: 800; }
.board-count small, .people-count small { color: #8d9781; font-size: 9px; font-weight: 600; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.board-editor-grid, .live-board-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.edit-cell { min-width: 0; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 7px; border: 1px solid #e9ebe5; border-radius: 6px; background: #fbfcf8; transition: border-color .15s, background .15s; }
.edit-cell.has-word { border-color: #dbe5c4; background: #f9fbed; }
.cell-index { color: #a0a9a9; font-size: 8px; font-weight: 800; letter-spacing: .3px; }
.edit-cell select, .edit-cell input { width: 100%; min-width: 0; height: 27px; padding: 0 3px; border: 0; border-radius: 3px; outline: none; color: #4e5e6c; background: transparent; font-size: 9px; }
.edit-cell select { color: #75826d; }
.edit-cell select:focus, .edit-cell input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(142, 169, 91, .2); }
.edit-cell select option { font-size: 13px; }
.edit-cell input::placeholder { color: #a6afb4; }
.board-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 15px; border-top: 1px solid #eeefeb; }
.save-status { color: #9a7951; font-size: 10px; font-weight: 650; }
.save-status.saved { color: #63814f; }
.host-note, .waiting-card { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid #e4e9d8; border-radius: 8px; color: #7a8790; background: #f8faef; font-size: 10px; line-height: 1.6; }
.host-note > span:first-child { color: #8ea84c; font-size: 16px; }
.host-note strong, .waiting-card strong { color: #52634d; font-size: 11px; }
.start-card { padding: 15px; }
.start-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.start-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; color: #526b42; background: var(--lime); font-size: 15px; font-weight: 800; }
.start-card-top > div { display: flex; flex-direction: column; gap: 4px; }
.start-card-top strong { font-size: 11px; }
.start-card-top small, .waiting-card small { color: #8b949c; font-size: 9px; }
.start-card .button { min-height: 39px; }
.waiting-card { align-items: center; border-color: #e7e7e0; color: #78838b; background: #fbfbf8; }
.waiting-card > div { display: flex; flex-direction: column; gap: 4px; }
.waiting-card strong { color: #4e5d6b; }
.waiting-pulse, .live-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #91aa55; }
.waiting-pulse::after, .live-pulse::after { content: ""; position: absolute; inset: -4px; border: 1px solid currentColor; border-radius: 50%; opacity: .4; animation: pulse 1.8s ease-out infinite; }
.waiting-pulse { color: #91aa55; }
.player-list { margin-top: 17px; }
.player-row { display: flex; align-items: center; gap: 9px; min-height: 56px; padding: 6px 8px; border-top: 1px solid #f0f0ec; }
.player-row.is-me { margin: 0 -7px; padding-right: 8px; padding-left: 8px; border-radius: 6px; background: #f5f8ee; }
.player-row.is-leader .rank-number { color: #9ab649; }
.rank-number { width: 20px; color: #a2aab0; text-align: center; font-size: 9px; font-weight: 800; }
.avatar { flex: 0 0 28px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #536578; background: #e8edf0; font-size: 11px; font-weight: 750; }
.player-row:nth-child(3n+2) .avatar { color: #78684a; background: #f3ead7; }
.player-row:nth-child(3n) .avatar { color: #65704f; background: #eaf0d8; }
.player-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.player-info > strong { overflow: hidden; color: #36465a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.player-info > small { color: #929ba3; font-size: 9px; }
.player-info em { margin-left: 5px; color: #7b9850; font-size: 8px; font-style: normal; font-weight: 700; }
.host-tag { display: inline-block; margin-left: 5px; padding: 2px 4px; border-radius: 3px; color: #7d8f54 !important; background: #f0f4e3; font-size: 7px !important; font-weight: 800; }
.player-score { min-width: 32px; color: #243750; text-align: right; font-size: 13px; font-weight: 800; }
.player-score small { color: #99a0a5; font-size: 8px; }
.score-legend { display: flex; gap: 15px; padding-top: 13px; border-top: 1px solid #f0f0ec; color: #969ea4; font-size: 8px; }
.score-legend span { display: inline-flex; align-items: center; gap: 5px; }
.score-legend i { width: 7px; height: 7px; border-radius: 2px; background: #b8c982; }
.score-legend .legend-line { background: #ecaa91; }

.game-status { display: flex; align-items: center; gap: 8px; color: #718848; font-size: 9px; font-weight: 850; letter-spacing: 1px; }
.live-pulse { display: inline-block; color: #86a949; }
.room-code-small { color: #929ba2; font-weight: 600; letter-spacing: .3px; }
.game-welcome { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 12px 0 29px; }
.game-welcome h1 { margin-bottom: 0; }
.game-welcome-note { max-width: 240px; padding-left: 14px; border-left: 2px solid var(--lime); display: flex; flex-direction: column; gap: 5px; }
.game-welcome-note strong { font-size: 11px; }
.game-welcome-note span { color: #7e8994; font-size: 10px; line-height: 1.55; }
.score-total { color: var(--navy); font-size: 19px; font-weight: 850; }
.score-total small { color: #919ba1; font-size: 9px; }
.live-board-grid { gap: 8px; }
.live-cell { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; min-width: 0; min-height: 102px; padding: 9px; overflow: hidden; border: 1px solid #e8eae4; border-radius: 7px; color: #455668; background: #fafbf7; text-align: left; }
.live-cell.is-clickable { cursor: pointer; transition: transform .13s, border-color .13s, background .13s, box-shadow .13s; }
.live-cell.is-clickable:hover { transform: translateY(-2px); border-color: #bfd08f; background: #f6f9e9; box-shadow: 0 5px 14px rgba(50, 70, 30, .08); }
.live-cell:disabled { opacity: 1; }
.live-cell-index { color: #a0a9aa; font-size: 8px; font-weight: 800; }
.live-cell strong { display: -webkit-box; width: 100%; margin: 8px 0 4px; overflow: hidden; color: inherit; font-size: clamp(8px, .8vw, 10px); line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.live-cell strong { display: block; overflow: visible; }
.live-cell { height: auto; }
.size-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.size-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.size-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.size-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.size-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.edit-cell select, .edit-cell input { min-height: 34px; font-size: 12px; }
.cell-error { min-height: 1em; color: #a63e2c; font-size: 10px; }
.cell-points { color: #768554; font-size: 10px; line-height: 1.4; }
.edit-cell input { background: #fff; border: 1px solid #e6e9de; }
.final-hero h1 { overflow-wrap: anywhere; max-width: 100%; }
.edit-cell.duplicate { border-color: #ce705a; background: #fff2ec; }
.board-validation { min-height: 1.5em; margin: 12px 0 0; color: #a0523b; font-size: 11px; }
#board-size { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); background: white; }
.bingo-toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; width: min(390px, calc(100vw - 32px)); max-height: 50vh; overflow-y: auto; padding: 16px 20px; border: 1px solid #b8d36e; border-radius: 12px; color: #edf7d9; background: var(--navy); box-shadow: 0 12px 40px #17253b30; pointer-events: none; }
.bingo-toast.bingo-animate { animation: toast-enter .3s ease-out; }
.bingo-toast p { margin: 5px 0; font-size: 13px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.bingo-player { background: #edf4d8; }
.bingo-player .player-score { color: #658536; }
.bingo-player .player-score { font-weight: 900; }
.bingo-player.bingo-animate .player-score { animation: score-pop .6s ease-in-out 5; }
.bingo-board { outline: 2px solid #b3ce6b; outline-offset: 5px; border-radius: 7px; }
.live-cell.bingo-cell { border: 2px solid #8eac45; background: #dfedb4; }
.live-cell.bingo-cell.bingo-animate { animation: bingo-glow 1s ease-in-out 3; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes score-pop { 50% { transform: scale(1.25); } }
@keyframes bingo-glow { 50% { box-shadow: inset 0 0 0 3px #bedb72; } }
.phrases-panel { margin: 0 0 46px; }
.resume-room { margin: -20px 0 30px; }
.phrase-form { display: flex; align-items: flex-end; gap: 12px; }
.phrase-form > div { display: flex; flex-direction: column; gap: 7px; }
.phrase-text-field { flex: 1; min-width: 0; }
.phrase-form label { font-size: 11px; font-weight: 700; color: var(--navy-muted); }
.phrase-form input, .phrase-form select { min-height: 44px; border: 1px solid var(--line); padding: 10px 12px; border-radius: 6px; background: white; color: var(--navy); font-size: 14px; }
.phrase-feedback-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0; }
#phrase-feedback { margin: 0; color: #647d4d; font-size: 12px; line-height: 1.5; }
#phrase-feedback.phrase-error { color: #a63e2c; }
.phrase-list { list-style: none; padding: 0; margin: 0; max-height: 500px; overflow-y: auto; }
.phrase-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.phrase-label { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
.phrase-value { color: #61783f; font-size: 12px; font-weight: 800; white-space: nowrap; }
.site-login { display: grid; min-height: 100dvh; place-items: center; padding: 20px; }
.site-login .home-card { width: min(100%, 430px); }
.site-login p { line-height: 1.5; }
.site-login [role="alert"] { color: #a63e2c; }
.party-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; }
.party-controls label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.party-layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.party-emoji { position: fixed; font-size: 28px; white-space: nowrap; filter: drop-shadow(0 3px 4px #17253b35); animation: party-pop 3s ease-out both; }
.confetti-burst { position: absolute; inset: 0; overflow: hidden; }
.confetti-emoji, .confetti-piece { position: absolute; bottom: -30px; animation: confetti-flight 2s linear both; }
.confetti-emoji { font-size: clamp(24px, 5vw, 46px); line-height: 1; }
.confetti-piece { width: 7px; height: 12px; border-radius: 2px; }
.confetti-piece:nth-of-type(3n) { width: 9px; height: 9px; border-radius: 50%; }
.confetti-still > span { animation: none; transform: translate3d(var(--arc-x), var(--peak), 0) rotate(calc(var(--spin) * .15)); }
@keyframes confetti-flight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.5); }
  8% { opacity: 1; }
  44% { transform: translate3d(var(--arc-x), var(--peak), 0) rotate(calc(var(--spin) * .45)); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--end-x), -8vh, 0) rotate(var(--spin)) scale(.7); }
}
.party-toast { animation: party-toast-pop .5s cubic-bezier(.15, 1.5, .5, 1) both; }
@keyframes party-pop {
  0% { opacity: 0; transform: scale(.2) translateY(14px) rotate(-12deg); }
  15% { opacity: 1; transform: scale(1.3) translateY(-8px) rotate(6deg); }
  30% { transform: scale(1) translateY(0) rotate(-5deg); }
  50%, 75% { opacity: 1; transform: scale(1.1) translateY(-12px) rotate(5deg); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: scale(.9) translateY(-30px); }
}
@keyframes party-toast-pop { from { opacity: 0; transform: scale(.8) translateY(30px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (max-width: 680px) {
  .phrase-form { flex-wrap: wrap; }
  .phrase-text-field { flex-basis: 100%; }
  .phrase-form .button { flex: 1; }
  .phrase-list li { gap: 8px; }
}
.live-cell > small { color: #93a178; font-size: 8px; font-weight: 700; }
.live-cell.marked { border-color: #dce9b8; color: #51633d; background: #eff5dc; }
.live-cell.is-clickable { touch-action: manipulation; }
.live-cell.confirming-mark { border-color: #a26b23; background: #fff3d4; box-shadow: inset 0 0 0 1px #a26b23; }
.live-cell.confirming-mark > small { color: #754a16; }
.live-cell.marked .live-cell-index { color: #82945d; }
.mark-check { position: absolute; top: 6px; right: 7px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: #fff; background: #8caa4c; font-size: 10px; font-weight: 800; }
.live-score-strip { display: flex; align-items: center; justify-content: space-around; gap: 5px; padding: 14px 8px 0; margin-top: 17px; border-top: 1px solid #eeefeb; }
.live-score-strip > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.live-score-strip > div strong { font-size: 17px; }
.live-score-strip > div small { color: #929ba2; font-size: 8px; }
.live-score-strip > span { color: #c4c9c4; font-size: 12px; }
.live-score-strip .total-score strong { color: #6e8c3d; }
.game-rule-card { display: flex; align-items: flex-start; gap: 10px; padding: 14px; box-shadow: none; background: #f7f8ef; }
.rule-star { color: #90a951; font-size: 16px; }
.game-rule-card p { margin: 1px 0 0; color: #778273; font-size: 10px; line-height: 1.65; }
.game-rule-card strong { color: #556941; }
.button-finish { min-height: 40px; border: 1px solid #e6c6bd; color: #9b5344; background: #fff7f4; }
.button-finish:hover:not(:disabled) { background: #ffede7; }
.finished-status { color: #69798a; }
.final-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 34px 15px 40px; text-align: center; }
.final-star { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 13px; color: #687f3b; background: var(--lime); font-size: 24px; }
.final-hero h1 { margin: 11px 0 9px; font-size: clamp(35px, 5vw, 53px); letter-spacing: -2.4px; }
.final-hero > p { margin: 0; color: #7b8691; font-size: 12px; }
.final-layout { padding-top: 5px; }
.home-return { min-height: 42px; }
.loading-card { display: flex; justify-content: center; align-items: center; gap: 11px; min-height: 300px; color: #77838d; font-size: 12px; }
.spinner { width: 17px; height: 17px; border: 2px solid #dce2d3; border-top-color: #8ca34f; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }

@media (max-width: 900px) {
  .page-shell { width: min(100% - 42px, 760px); }
  .hero { gap: 5%; padding: 62px 0 58px; }
  .hero h1 { font-size: 51px; }
  .lobby-layout, .game-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 15px; }
  .panel { padding: 17px; }
  .room-welcome { grid-template-columns: 1fr 250px; gap: 28px; }
  .edit-cell { padding: 5px; }
  .edit-cell select, .edit-cell input { font-size: 12px; }
  .live-cell { min-height: 88px; padding: 7px; }
}

@media (max-width: 680px) {
  .page-shell { width: calc(100% - 32px); }
  .topbar { height: 66px; }
  .topbar-note { font-size: 10px; }
  .footer { gap: 10px; font-size: 9px; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 50px 0 49px; }
  .hero h1 { margin-top: 15px; font-size: clamp(43px, 11vw, 57px); letter-spacing: -2.7px; }
  .hero-copy > p { font-size: 13px; }
  .hero-points { gap: 12px; font-size: 10px; }
  .home-card { padding: 24px 22px 19px; }
  .how-section { grid-template-columns: 1fr; gap: 17px; padding-bottom: 42px; }
  .how-section > div { padding-top: 12px; }
  .how-section h3 { margin-top: 6px; }
  .room-page { padding-top: 15px; }
  .room-topline { margin-bottom: 15px; }
  .room-welcome { grid-template-columns: 1fr; gap: 19px; padding: 18px 0 24px; }
  .room-welcome h1, .game-welcome h1 { font-size: 39px; letter-spacing: -2px; }
  .room-welcome > div:first-child > p { font-size: 12px; }
  .invite-card { padding: 15px; }
  .invite-code { display: inline-block; margin: 7px 12px 0 0; font-size: 26px; }
  .invite-card .button { width: auto; vertical-align: middle; }
  .invite-hint { margin-top: 7px; }
  .lobby-layout, .game-layout { grid-template-columns: 1fr; }
  .main-column, .side-column { gap: 14px; }
  .side-column { order: 1; }
  .main-column { order: 0; }
  .lobby-layout .side-column { order: 0; }
  .lobby-layout .main-column { order: 1; }
  .panel { padding: 16px; }
  .board-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .edit-cell { min-height: 112px; gap: 4px; padding: 9px; }
  .edit-cell select, .edit-cell input { height: 36px; padding: 0 4px; font-size: 12px; }
  .cell-index { font-size: 9px; }
  .board-save-row { align-items: flex-start; }
  .board-save-row .button { white-space: nowrap; }
  .scoreboard-panel { order: 0; }
  .start-card, .waiting-card { order: 1; }
  .game-welcome { align-items: flex-start; flex-direction: column; gap: 15px; padding: 9px 0 22px; }
  .game-welcome-note { max-width: none; }
  .live-board-grid { gap: 5px; }
  .live-cell { min-height: 78px; padding: 6px; }
  .live-cell strong { font-size: 8px; }
  .live-cell > small { font-size: 7px; }
  .game-layout .side-column { order: 0; }
  .game-layout .main-column { order: 1; }
  .final-hero { padding: 23px 10px 30px; }
  .final-layout .side-column { order: 0; }
  .final-layout .main-column { order: 1; }
}

@media (max-width: 390px) {
  .page-shell { width: calc(100% - 24px); }
  .topbar-note { font-size: 9px; }
  .panel { padding: 12px; }
  .edit-cell { min-height: 112px; }
  .editor-toolbar .button { padding: 0 7px; font-size: 9px; }
  .live-cell { min-height: 69px; }
  .room-welcome h1, .game-welcome h1 { font-size: 35px; }
}

@media (prefers-reduced-motion: reduce) {
  :not(.confetti-emoji, .confetti-piece), *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .party-emoji, .party-toast { animation: none !important; opacity: 1; transform: none; }
}
