:root {
  --navy: #101c3a;
  --navy-2: #17264a;
  --red: #ed3b4d;
  --red-dark: #c8263b;
  --blue: #2857d9;
  --blue-dark: #173aa1;
  --yellow: #ffc83d;
  --cream: #fffaf1;
  --paper: #ffffff;
  --ink: #14203a;
  --muted: #68728a;
  --line: #e7e9ef;
  --green: #16a66a;
  --shadow: 0 18px 50px rgba(17, 30, 62, .12);
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --display: "Rubik", var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--font); background: #f7f8fb; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.hidden { display: none !important; }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.icon { width: 22px; height: 22px; fill: currentColor; flex: 0 0 auto; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); text-decoration: none; }
.brand-mark { width: 45px; height: 52px; position: relative; display: grid; place-items: center; color: white; background: var(--red); border: 3px solid var(--navy); border-radius: 9px 9px 12px 12px; box-shadow: 3px 3px 0 var(--yellow); transform: rotate(-3deg); }
.brand-mark::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.6); border-radius: 5px 5px 8px 8px; }
.brand-mark span { font: 800 28px/1 var(--display); transform: rotate(3deg); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font: 800 25px/1 var(--display); letter-spacing: .6px; }
.brand small { margin-top: 3px; color: var(--red); font-size: 8px; font-weight: 800; letter-spacing: 4px; }
.brand.compact .brand-mark { width: 37px; height: 42px; }
.brand.compact .brand-mark span { font-size: 22px; }
.brand.compact strong { font-size: 20px; }
.brand.compact small { font-size: 7px; letter-spacing: 3px; }

.home-page { background: var(--cream); overflow-x: hidden; }
.home-header { height: 94px; display: flex; align-items: center; justify-content: space-between; }
.icon-button { min-height: 44px; padding: 0 15px; border: 1px solid #dedfe4; border-radius: 12px; color: var(--navy); background: rgba(255,255,255,.72); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; transition: .2s ease; }
.icon-button:hover { border-color: var(--navy); transform: translateY(-1px); }
.sound-off { display: none; }
.sound-toggle[aria-pressed="false"] .sound-on { display: none; }
.sound-toggle[aria-pressed="false"] .sound-off { display: block; }

.hero { min-height: 610px; padding: 64px 0 82px; display: grid; grid-template-columns: 1.04fr .78fr; gap: 88px; align-items: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; z-index: -1; width: 540px; height: 540px; left: -390px; top: -20px; border: 90px solid rgba(237,59,77,.045); border-radius: 50%; }
.hero::after { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; right: -170px; bottom: 20px; background-image: radial-gradient(rgba(40,87,217,.18) 2px, transparent 2px); background-size: 18px 18px; transform: rotate(9deg); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(237,59,77,.12); }
.hero h1 { margin: 20px 0; color: var(--navy); font: 800 clamp(46px, 5.3vw, 73px)/.99 var(--display); letter-spacing: -3px; }
.hero h1 em { color: var(--red); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; height: 8px; left: 4px; right: 2px; bottom: -9px; border-radius: 100%; background: var(--yellow); transform: rotate(-1deg); }
.hero-copy > p { max-width: 590px; margin: 30px 0 27px; color: #566079; font-size: 17px; line-height: 1.75; }
.hero-trust { display: flex; gap: 24px; color: #38445e; font-size: 13px; font-weight: 700; }
.hero-trust span { display: flex; align-items: center; gap: 6px; }
.hero-trust .icon { width: 18px; height: 18px; color: var(--green); }

.join-card { padding: 31px; border: 1px solid rgba(16,28,58,.1); border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: var(--shadow), 8px 8px 0 rgba(16,28,58,.06); backdrop-filter: blur(10px); }
.card-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.mini-card { width: 43px; height: 48px; border-radius: 8px; display: grid; place-items: center; color: white; background: var(--navy); font: 800 20px var(--display); box-shadow: 3px 3px 0 var(--yellow); transform: rotate(-3deg); }
.card-heading h2 { margin: 0 0 4px; font: 800 22px var(--display); }
.card-heading p { margin: 0; color: var(--muted); font-size: 13px; }
form label { display: block; margin: 0 0 8px; color: #424c63; font-size: 12px; font-weight: 800; }
.input-wrap { height: 50px; border: 1.5px solid #dfe2e9; border-radius: 11px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: white; transition: .2s ease; }
.input-wrap:focus-within { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(16,28,58,.07); }
.input-wrap .icon { width: 19px; color: #8a92a4; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; font-weight: 600; }
.input-wrap input::placeholder { color: #a4aab7; }
.field-error { min-height: 18px; margin: 5px 0 2px; color: var(--red-dark); font-size: 11px; font-weight: 700; }
.primary-button, .secondary-button, .start-button { border: 0; border-radius: 11px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, opacity .2s; }
.primary-button:active, .secondary-button:active, .start-button:active, .action-button:active { transform: scale(.975); }
.create-button { width: 100%; height: 52px; color: white; background: var(--red); display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 8px 18px rgba(237,59,77,.24); }
.create-button:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 11px 23px rgba(237,59,77,.3); }
.divider { display: flex; align-items: center; gap: 12px; margin: 21px 0; color: #9ca2b0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.code-row { display: grid; grid-template-columns: 1fr 104px; gap: 9px; }
.code-input input { text-transform: uppercase; letter-spacing: 3px; font-family: var(--display); }
.secondary-button { color: var(--navy); background: var(--yellow); box-shadow: 0 5px 0 #e2a914; }
.secondary-button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #e2a914; }
.resume-button { width: 100%; padding: 11px; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 800; text-decoration: underline; }

.how-to { padding: 90px 0 105px; border-top: 1px solid rgba(16,28,58,.08); }
.section-heading { text-align: center; }
.section-heading > span { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.section-heading h2 { margin: 9px 0 7px; font: 800 37px var(--display); }
.section-heading p { margin: 0; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 53px; }
.steps article { min-height: 260px; padding: 30px; position: relative; overflow: hidden; border: 1px solid #e5e5e7; border-radius: 17px; background: rgba(255,255,255,.58); text-align: center; }
.step-number { position: absolute; right: 17px; top: 8px; color: rgba(16,28,58,.045); font: 800 61px var(--display); }
.step-icon { width: 60px; height: 60px; margin: 3px auto 21px; border-radius: 17px; display: grid; place-items: center; transform: rotate(-4deg); }
.step-icon svg { width: 31px; height: 31px; fill: currentColor; transform: rotate(4deg); }
.step-icon.red { color: var(--red); background: rgba(237,59,77,.1); }
.step-icon.yellow { color: #bc8200; background: rgba(255,200,61,.2); }
.step-icon.blue { color: var(--blue); background: rgba(40,87,217,.1); }
.steps h3 { margin: 0 0 11px; font: 800 19px var(--display); }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.home-footer { padding: 27px 0; color: white; background: var(--navy); }
.home-footer .shell { display: flex; justify-content: space-between; align-items: center; }
.home-footer span { font: 800 14px var(--display); }
.home-footer p { margin: 0; color: #aeb8d0; font-size: 11px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(410px, calc(100% - 30px)); padding: 13px 18px; border-radius: 11px; color: white; background: var(--navy); box-shadow: 0 10px 28px rgba(0,0,0,.2); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red-dark); }

/* Game shell */
.game-page { background: #f6f7fa; }
.game-header { min-height: 70px; padding: 10px max(26px, calc((100% - 1400px)/2)); display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); background: white; box-shadow: 0 2px 10px rgba(16,28,58,.035); }
.room-chip { margin-left: auto; min-height: 42px; padding: 0 5px 0 13px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 9px; background: #fafbfc; }
.room-chip > span { color: #9aa1b0; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.room-chip strong { font: 800 15px var(--display); letter-spacing: 2px; }
.copy-button { width: 34px; height: 34px; border: 0; border-radius: 7px; display: grid; place-items: center; color: var(--navy); background: white; }
.copy-button:hover { background: #eef0f4; }
.copy-button .icon { width: 17px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.connection-pill { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: #f0a52b; box-shadow: 0 0 0 3px rgba(240,165,43,.12); }
.connection-pill.connected i { background: var(--green); box-shadow: 0 0 0 3px rgba(22,166,106,.12); }
.connection-pill.disconnected i { background: var(--red); }
.game-header .icon-button { width: 42px; min-height: 42px; padding: 0; justify-content: center; }
.game-header .sound-label { display: none; }
.leave-button { height: 42px; padding: 0 13px; border: 1px solid #f0d8db; border-radius: 10px; color: var(--red-dark); background: #fff8f8; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; }
.leave-button:hover { background: #ffecef; }
.leave-button .icon { width: 18px; }
.game-shell { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 35px 0 50px; }
.loading-view { min-height: calc(100vh - 155px); display: grid; place-items: center; }
.loader-card { display: grid; justify-items: center; gap: 20px; color: var(--muted); font-size: 13px; }
.loading-bar { width: 180px; height: 4px; border-radius: 4px; overflow: hidden; background: #e5e7ed; position: relative; }
.loading-bar::after { content: ""; position: absolute; inset: 0; width: 45%; border-radius: inherit; background: var(--red); animation: loading 1.2s ease infinite; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(250%); } }

.lobby-intro { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 31px; }
.lobby-intro h1 { margin: 10px 0 7px; font: 800 clamp(28px, 3vw, 42px) var(--display); letter-spacing: -1.2px; }
.lobby-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.players-count { padding: 14px 20px; border: 1px solid var(--line); border-radius: 13px; background: white; display: flex; align-items: center; gap: 8px; }
.players-count strong { font: 800 21px var(--display); }
.players-count span { color: var(--muted); font-size: 11px; font-weight: 700; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 25px; align-items: start; }
.teams-panel { display: grid; grid-template-columns: 1fr 42px 1fr; gap: 14px; align-items: center; }
.team-card { min-height: 340px; padding: 24px; border: 1px solid var(--line); border-top: 4px solid; border-radius: 16px; background: white; box-shadow: 0 10px 30px rgba(16,28,58,.05); }
.team-red { border-top-color: var(--red); }
.team-blue { border-top-color: var(--blue); }
.team-title, .team-title > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-symbol { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: white; font: 800 16px var(--display); }
.team-red .team-symbol { background: var(--red); }
.team-blue .team-symbol { background: var(--blue); }
.team-title small { color: #949cab; font-size: 8px; font-weight: 800; letter-spacing: 1.6px; }
.team-title h2 { margin: 2px 0 0; font: 800 20px var(--display); }
.team-capacity { padding: 4px 8px; border-radius: 20px; background: #f1f2f5; color: var(--muted); font-size: 9px; font-weight: 800; }
.team-slots { min-height: 176px; margin: 21px 0; display: grid; gap: 10px; align-content: start; }
.player-slot { height: 76px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 11px; background: #fbfbfc; }
.player-slot.empty { border-style: dashed; color: #adb3bf; justify-content: center; font-size: 11px; }
.player-avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; }
.team-red .player-avatar { background: linear-gradient(135deg, #fc6473, var(--red-dark)); }
.team-blue .player-avatar { background: linear-gradient(135deg, #5c83ed, var(--blue-dark)); }
.player-slot > div { min-width: 0; flex: 1; }
.player-slot strong { max-width: 150px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.player-slot small { color: var(--muted); font-size: 9px; }
.crown { color: #d99700; font-size: 15px; font-weight: 900; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-dot.offline { background: #aeb3be; }
.team-join-button { width: 100%; height: 43px; border: 1px solid; border-radius: 9px; font-size: 11px; font-weight: 800; background: white; transition: .2s; }
.team-red .team-join-button { border-color: #fac7cd; color: var(--red-dark); }
.team-blue .team-join-button { border-color: #cbd7f9; color: var(--blue-dark); }
.team-join-button:hover:not(:disabled) { color: white; transform: translateY(-1px); }
.team-red .team-join-button:hover:not(:disabled) { background: var(--red); }
.team-blue .team-join-button:hover:not(:disabled) { background: var(--blue); }
.team-join-button:disabled { opacity: .45; }
.versus { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; z-index: 2; background: #f7f8fb; font: 800 10px var(--display); box-shadow: 0 0 0 7px #f7f8fb; }
.waiting-card { grid-column: 1 / -1; min-height: 80px; padding: 15px 20px; border: 1px dashed #d6d9e0; border-radius: 13px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.5); }
.waiting-card > div:first-child { display: flex; align-items: center; gap: 12px; }
.waiting-card .icon { color: #9ca4b5; }
.waiting-card h3 { margin: 0 0 2px; font-size: 11px; }
.waiting-card p { margin: 0; color: var(--muted); font-size: 9px; }
.waiting-players { display: flex; gap: 7px; }
.waiting-player { padding: 7px 10px; border-radius: 8px; background: white; font-size: 10px; font-weight: 700; }

.settings-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 10px 30px rgba(16,28,58,.05); }
.settings-title { min-height: 78px; padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.settings-title > div { display: flex; gap: 10px; align-items: center; }
.settings-title .icon { width: 21px; color: var(--red); }
.settings-title h2 { margin: 0 0 2px; font: 800 15px var(--display); }
.settings-title p { margin: 0; color: var(--muted); font-size: 8px; }
.host-badge { padding: 5px 8px; border-radius: 6px; color: #925f00; background: #fff2c6; font-size: 7px; font-weight: 800; letter-spacing: .7px; }
.settings-form { padding: 19px 20px 10px; display: grid; gap: 13px; }
.settings-form label { margin: 0; }
.settings-form select { width: 100%; height: 40px; margin-top: 6px; padding: 0 11px; border: 1px solid #dfe2e8; border-radius: 8px; outline: 0; color: var(--ink); background: #fafbfc; font-size: 11px; font-weight: 700; }
.settings-form select:focus { border-color: var(--navy); }
.settings-form select:disabled { color: #7f8797; opacity: .75; }
.setting-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle-setting { min-height: 48px; display: flex !important; align-items: center; justify-content: space-between; }
.toggle-setting span { display: flex; flex-direction: column; gap: 2px; }
.toggle-setting strong { font-size: 11px; }
.toggle-setting small { color: var(--muted); font-size: 8px; }
.toggle-setting input { position: absolute; opacity: 0; }
.toggle-setting i { width: 39px; height: 22px; padding: 3px; border-radius: 20px; background: #c8ccd4; transition: .2s; }
.toggle-setting i::after { content: ""; width: 16px; height: 16px; display: block; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-setting input:checked + i { background: var(--green); }
.toggle-setting input:checked + i::after { transform: translateX(17px); }
.toggle-setting input:disabled + i { opacity: .5; }
.start-button { width: calc(100% - 40px); min-height: 49px; margin: 8px 20px 0; color: white; background: var(--red); display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: 0 7px 16px rgba(237,59,77,.2); }
.start-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 21px rgba(237,59,77,.3); }
.start-button:disabled { opacity: .42; box-shadow: none; }
.start-hint { min-height: 31px; margin: 9px 20px 15px; color: var(--muted); text-align: center; font-size: 8px; line-height: 1.5; }

/* Playing */
.play-view { max-width: 1260px; margin-inline: auto; }
.scoreboard { display: grid; grid-template-columns: 1fr 160px 1fr; align-items: stretch; margin-bottom: 16px; }
.score-team { min-height: 91px; padding: 18px 24px; border: 1px solid var(--line); background: white; display: flex; align-items: center; justify-content: space-between; transition: .25s; }
.score-team.red { border-radius: 14px 0 0 14px; border-left: 4px solid var(--red); }
.score-team.blue { border-radius: 0 14px 14px 0; border-right: 4px solid var(--blue); }
.score-team.active.red { background: #fff7f8; box-shadow: inset 0 0 0 1px rgba(237,59,77,.16); }
.score-team.active.blue { background: #f6f8ff; box-shadow: inset 0 0 0 1px rgba(40,87,217,.16); }
.score-team > div { display: flex; align-items: center; gap: 12px; }
.score-dot { width: 13px; height: 13px; border-radius: 50%; }
.score-team.red .score-dot { background: var(--red); box-shadow: 0 0 0 5px rgba(237,59,77,.1); }
.score-team.blue .score-dot { background: var(--blue); box-shadow: 0 0 0 5px rgba(40,87,217,.1); }
.score-team small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.score-team > strong { font: 800 40px var(--display); }
.score-team.red > strong { color: var(--red); }
.score-team.blue > strong { color: var(--blue); }
.score-player-names { margin-top: 3px; font-size: 10px; font-weight: 700; }
.timer-wrap { z-index: 2; padding: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; background: var(--navy); box-shadow: 0 5px 14px rgba(16,28,58,.24); }
.timer-wrap small { color: #aab6d0; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.timer { font: 800 40px/.95 var(--display); font-variant-numeric: tabular-nums; }
.timer-wrap > span { margin-top: 5px; color: var(--yellow); font-size: 8px; font-weight: 800; }
.timer.danger { color: #ff5263; animation: pulseTimer .75s infinite; }
@keyframes pulseTimer { 50% { opacity: .45; transform: scale(1.06); } }
.role-banner { min-height: 70px; margin-bottom: 16px; padding: 11px 17px; border: 1px solid #e2e5eb; border-radius: 12px; display: flex; align-items: center; gap: 13px; background: #fff; }
.role-icon { width: 43px; height: 43px; border-radius: 10px; display: grid; place-items: center; color: var(--red); background: #fff0f2; }
.role-banner > div:nth-child(2) { flex: 1; }
.role-banner small { display: block; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: 1.3px; }
.role-banner strong { font: 800 14px var(--display); }
.role-banner p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.role-people { display: flex; gap: 22px; }
.role-people span { color: var(--muted); font-size: 9px; }
.role-people strong { display: block; color: var(--ink); font: 800 10px var(--font); }
.play-grid { display: grid; grid-template-columns: 218px minmax(360px, 1fr) 218px; gap: 17px; align-items: stretch; }
.round-feed, .turn-info { height: 440px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.feed-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.feed-title h2, .turn-info h2 { margin: 0; font: 800 13px var(--display); }
.feed-title span { color: var(--green); font-size: 7px; font-weight: 800; letter-spacing: .8px; }
.feed-list { margin-top: 11px; display: grid; gap: 9px; max-height: 360px; overflow: auto; }
.feed-item { padding: 10px; border-radius: 8px; border-left: 3px solid #aeb3bd; background: #f7f8fa; animation: feedIn .25s ease; }
.feed-item.correct { border-color: var(--green); }
.feed-item.pass { border-color: var(--yellow); }
.feed-item.tabu { border-color: var(--red); }
.feed-item.win { border-color: var(--blue); }
.feed-item p { margin: 0; color: #505a70; font-size: 9px; line-height: 1.45; }
.feed-item time { margin-top: 4px; display: block; color: #a1a7b3; font-size: 7px; }
@keyframes feedIn { from { opacity: 0; transform: translateX(-7px); } }
.card-stage { min-height: 440px; display: grid; place-items: center; position: relative; border-radius: 17px; background: radial-gradient(circle at 50% 30%, #fff 0, #f1f3f7 75%); overflow: hidden; }
.card-stage::before, .card-stage::after { content: ""; position: absolute; width: 100px; height: 100px; background-image: radial-gradient(#d9dce4 1.5px, transparent 1.5px); background-size: 10px 10px; opacity: .55; }
.card-stage::before { left: 10px; top: 10px; }
.card-stage::after { right: 10px; bottom: 10px; }
.tabu-card { z-index: 1; width: min(330px, 84%); min-height: 405px; padding: 0 24px 15px; overflow: hidden; border: 5px solid white; outline: 2px solid #dfe1e5; border-radius: 18px; background: white; box-shadow: 0 18px 45px rgba(16,28,58,.18), 8px 9px 0 var(--navy); text-align: center; animation: cardIn .28s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) rotate(-1.5deg) scale(.97); } }
.card-ribbon { margin: 0 -24px 13px; padding: 8px; color: white; background: var(--red); font-size: 8px; font-weight: 800; letter-spacing: 1.4px; }
.tabu-card h1 { margin: 0; padding-bottom: 14px; border-bottom: 3px solid var(--navy); font: 800 clamp(25px, 3vw, 36px)/1.05 var(--display); letter-spacing: -.7px; overflow-wrap: anywhere; }
.forbidden-title { margin: 12px 0 7px; display: flex; align-items: center; gap: 7px; color: var(--red); font-size: 7px; font-weight: 800; letter-spacing: 1px; }
.forbidden-title span { flex: 1; height: 1px; background: #f0cbd0; }
.tabu-card ul { margin: 0; padding: 0; list-style: none; }
.tabu-card li { padding: 7px 5px; border-bottom: 1px solid #eceef1; font: 800 15px var(--display); letter-spacing: .3px; }
.card-footer { margin-top: 11px; color: #9da4b2; font-size: 7px; font-weight: 800; letter-spacing: 1.2px; }
.card-footer span { width: 16px; height: 18px; display: inline-grid; place-items: center; margin-right: 4px; border-radius: 3px; color: white; background: var(--navy); font-size: 11px; }
.hidden-card { z-index: 1; width: min(410px, 86%); min-height: 340px; padding: 44px 35px; border: 1px solid #dfe2e8; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.92); text-align: center; box-shadow: var(--shadow); }
.hidden-lock { width: 65px; height: 65px; border-radius: 18px; display: grid; place-items: center; color: var(--navy); background: #edf0f6; }
.hidden-lock svg { width: 31px; height: 31px; fill: currentColor; }
.hidden-card h2 { margin: 22px 0 8px; font: 800 23px var(--display); }
.hidden-card p { max-width: 310px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.sound-waves { height: 30px; margin-top: 30px; display: flex; align-items: center; gap: 5px; }
.sound-waves i { width: 4px; height: 10px; border-radius: 5px; background: var(--blue); animation: wave .8s ease-in-out infinite alternate; }
.sound-waves i:nth-child(2), .sound-waves i:nth-child(4) { animation-delay: -.3s; height: 22px; }
.sound-waves i:nth-child(3) { animation-delay: -.55s; height: 30px; }
@keyframes wave { to { transform: scaleY(.35); opacity: .5; } }
.waiting-card-state { z-index: 1; text-align: center; }
.waiting-card-state h2 { font: 800 17px var(--display); }
.spinner { width: 35px; height: 35px; margin: auto; border: 3px solid #dfe2e8; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.turn-info h2 { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.info-person { margin-top: 16px; display: flex; align-items: center; gap: 10px; }
.person-avatar { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 800; }
.speaker-avatar { background: var(--red); }
.guesser-avatar { background: var(--blue); }
.info-person small { display: block; color: #9ba2b0; font-size: 7px; font-weight: 800; letter-spacing: 1px; }
.info-person strong { max-width: 118px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.pass-info, .target-info { margin-top: 19px; padding: 13px; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; background: #f6f7f9; }
.pass-info span, .target-info span { color: var(--muted); font-size: 9px; }
.pass-info strong, .target-info strong { font: 800 13px var(--display); }
.target-info { margin-top: 8px; background: #fff7e4; }
.target-info strong { color: #9c6800; }
.action-bar { min-height: 82px; margin-top: 16px; display: flex; justify-content: center; align-items: stretch; gap: 12px; }
.action-button { min-width: 225px; padding: 0 23px; border: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 12px; color: white; text-align: left; transition: .15s ease; box-shadow: 0 7px 17px rgba(16,28,58,.13); }
.action-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.action-button:disabled { opacity: .45; }
.action-button svg, .tabu-mark { width: 31px; height: 31px; fill: currentColor; }
.action-button span:not(.tabu-mark) { display: flex; flex-direction: column; }
.action-button strong { font: 800 15px var(--display); }
.action-button small { margin-top: 2px; color: rgba(255,255,255,.75); font-size: 8px; }
.action-button.correct { background: var(--green); }
.action-button.pass { background: #d1940b; }
.action-button.tabu { min-width: 300px; background: var(--red); }
.tabu-mark { display: grid; place-items: center; border: 2px solid white; border-radius: 7px; font: 800 22px var(--display); }
.no-actions { min-width: 380px; padding: 21px; border: 1px dashed #d6dae3; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: white; font-size: 11px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(9,17,38,.76); backdrop-filter: blur(6px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.summary-modal, .winner-modal { width: min(470px, 100%); padding: 35px; border-radius: 20px; background: white; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: modalIn .3s ease; }
@keyframes modalIn { from { transform: translateY(18px) scale(.96); } }
.summary-kicker, .winner-kicker { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.summary-modal h2, .winner-modal h2 { margin: 8px 0 5px; font: 800 29px var(--display); }
.summary-modal > p, .winner-modal > p { margin: 0; color: var(--muted); font-size: 11px; }
.summary-stats { margin: 26px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.summary-stats div { padding: 13px 5px; border-radius: 10px; background: #f5f6f8; }
.summary-stats strong { display: block; font: 800 20px var(--display); }
.summary-stats span { color: var(--muted); font-size: 8px; }
.summary-progress { height: 5px; overflow: hidden; border-radius: 5px; background: #eceef2; }
.summary-progress i { display: block; height: 100%; width: 100%; background: var(--red); transform-origin: left; animation: shrink 5s linear forwards; }
@keyframes shrink { to { transform: scaleX(0); } }
.trophy { width: 78px; height: 78px; margin: -4px auto 15px; border-radius: 50%; display: grid; place-items: center; color: #b87900; background: #fff1c2; box-shadow: 0 0 0 8px #fff8e3; }
.trophy svg { width: 40px; height: 40px; fill: currentColor; }
.final-score { margin: 24px auto; display: flex; justify-content: center; align-items: center; gap: 21px; }
.final-score span { font: 800 42px var(--display); }
.final-score i { color: #a8adba; font-style: normal; }
.red-text { color: var(--red); }
.blue-text { color: var(--blue); }
.winner-modal .start-button { width: 100%; margin: 0; }
#replayHint { margin-top: 10px; min-height: 15px; font-size: 9px; }

@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr .85fr; gap: 45px; }
  .lobby-grid { grid-template-columns: 1fr 320px; }
  .teams-panel { grid-template-columns: 1fr; }
  .versus { margin: -17px auto; }
  .waiting-card { grid-column: 1; }
  .play-grid { grid-template-columns: 190px minmax(340px, 1fr); }
  .turn-info { grid-column: 1 / -1; height: auto; display: grid; grid-template-columns: auto 1fr 1fr 1fr 1fr; align-items: center; gap: 12px; }
  .turn-info h2 { border: 0; padding: 0; }
  .info-person, .pass-info, .target-info { margin: 0; }
  .round-feed, .card-stage { height: 430px; }
}

@media (max-width: 760px) {
  .shell, .game-shell { width: min(100% - 28px, 580px); }
  .home-header { height: 77px; }
  .sound-label { display: none; }
  .hero { padding: 40px 0 65px; grid-template-columns: 1fr; gap: 42px; }
  .hero h1 { font-size: clamp(43px, 13vw, 60px); }
  .hero-copy > p { font-size: 15px; }
  .join-card { padding: 24px 20px; }
  .how-to { padding: 65px 0; }
  .steps { grid-template-columns: 1fr; margin-top: 35px; }
  .steps article { min-height: 220px; }
  .home-footer .shell { flex-direction: column; gap: 7px; text-align: center; }
  .game-header { padding: 9px 14px; gap: 10px; flex-wrap: wrap; }
  .game-header .brand { margin-right: auto; }
  .room-chip { order: 3; width: 100%; margin: 0; justify-content: center; }
  .connection-pill span { display: none; }
  .leave-button span { display: none; }
  .leave-button { width: 42px; padding: 0; justify-content: center; }
  .game-shell { padding-top: 22px; }
  .lobby-intro { align-items: flex-start; gap: 18px; }
  .lobby-intro h1 { font-size: 30px; }
  .lobby-intro p { max-width: 330px; }
  .players-count { padding: 9px 11px; flex-direction: column; gap: 0; text-align: center; flex: 0 0 auto; }
  .players-count span { font-size: 8px; }
  .lobby-grid { grid-template-columns: 1fr; }
  .settings-panel { order: -1; }
  .teams-panel { grid-template-columns: 1fr; }
  .team-card { min-height: 320px; }
  .scoreboard { grid-template-columns: 1fr 90px 1fr; }
  .score-team { min-height: 78px; padding: 11px 12px; }
  .score-team > div { gap: 7px; }
  .score-team > strong { font-size: 30px; }
  .score-dot { display: none; }
  .score-team small { font-size: 6px; }
  .score-player-names { max-width: 90px; font-size: 7px; }
  .timer { font-size: 31px; }
  .timer-wrap > span { display: none; }
  .role-banner { align-items: flex-start; }
  .role-people { display: none; }
  .play-grid { display: flex; flex-direction: column; }
  .round-feed { order: 3; height: auto; min-height: 150px; }
  .feed-list { max-height: 190px; }
  .card-stage { order: 1; min-height: 445px; }
  .turn-info { order: 2; height: auto; display: grid; grid-template-columns: 1fr 1fr; }
  .turn-info h2 { grid-column: 1 / -1; }
  .action-bar { position: sticky; z-index: 10; bottom: 0; margin: 12px -14px -50px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(246,247,250,.96); backdrop-filter: blur(10px); }
  .action-button { min-width: 0; flex: 1; min-height: 69px; padding: 0 12px; }
  .action-button svg, .tabu-mark { width: 26px; height: 26px; }
  .action-button strong { font-size: 13px; }
  .action-button small { display: none; }
  .action-button.tabu { min-width: 0; max-width: 360px; }
  .no-actions { min-width: 0; width: 100%; }
}

@media (max-width: 420px) {
  .brand strong { font-size: 21px; }
  .brand small { font-size: 7px; letter-spacing: 3px; }
  .home-header .icon-button { width: 45px; padding: 0; justify-content: center; }
  .hero { padding-top: 26px; }
  .hero h1 { letter-spacing: -2px; }
  .hero-trust { gap: 13px; flex-wrap: wrap; }
  .code-row { grid-template-columns: 1fr 91px; }
  .lobby-intro { display: block; }
  .players-count { margin-top: 17px; flex-direction: row; justify-content: center; }
  .tabu-card { width: 90%; padding-inline: 18px; }
  .card-ribbon { margin-inline: -18px; }
  .tabu-card h1 { font-size: 26px; }
  .summary-modal, .winner-modal { padding: 28px 19px; }
}

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

.portal-return {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(16, 28, 58, .14);
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease;
}
.portal-return:hover { transform: translateY(-1px); background: #fff; }
.compact-return { min-height: 36px; padding-inline: 11px; }

@media (max-width: 720px) {
  .home-header .portal-return { margin-left: auto; }
  .game-header .compact-return { order: 4; width: 100%; justify-content: center; }
}
