:root {
  --bg: #070a13;
  --panel: rgba(17, 23, 40, .78);
  --panel-strong: #11182a;
  --line: rgba(255,255,255,.09);
  --text: #f7f9ff;
  --muted: #8e98b3;
  --blue: #6d7cff;
  --cyan: #35d8ff;
  --pink: #ff4fa3;
  --green: #35e6a5;
  --red: #ff667c;
  --shadow: 0 30px 90px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, #17204a 0, transparent 42%),
    linear-gradient(145deg, #080b14 0%, #070a13 65%, #0a0d18 100%);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(120px); opacity: .17; pointer-events: none; }
.ambient-one { background: var(--blue); top: -140px; left: -120px; }
.ambient-two { background: var(--pink); right: -160px; bottom: -200px; }

.app-shell { width: min(1180px, calc(100% - 36px)); margin: auto; min-height: 100vh; position: relative; z-index: 2; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 18px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: Manrope; font-weight: 800; background: linear-gradient(135deg, var(--cyan), var(--blue) 55%, var(--pink)); box-shadow: 0 8px 30px rgba(109,124,255,.32); }
.online-pill { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.025); }
.online-pill span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: var(--green); box-shadow: 0 0 12px var(--green); }
.topbar-actions, .auth-actions, .profile-button { display: flex; align-items: center; gap: 9px; }
.header-link, .header-primary { min-height: 37px; padding: 0 14px; border-radius: 10px; font-size: 12px; font-weight: 750; }
.header-link { color: #c7cee0; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.header-primary { color: white; border: 0; background: linear-gradient(110deg, #5e6fff, #a75fff); box-shadow: 0 8px 25px rgba(109,124,255,.2); }
.profile-button { min-height: 46px; padding: 5px 11px 5px 6px; color: white; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); text-align: left; }
.profile-button > span:not(.profile-avatar) { display: flex; flex-direction: column; gap: 1px; }
.profile-button b { max-width: 115px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.profile-button small { color: var(--muted); font-size: 9px; }
.profile-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), var(--blue), var(--pink)); font-size: 10px; font-weight: 900; }

.screen { display: none; animation: appear .35s ease both; }
.screen.active { display: grid; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hero-grid { grid-template-columns: 1.08fr .92fr; gap: 72px; min-height: calc(100vh - 84px); align-items: center; padding: 54px 0 80px; }
.eyebrow { color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.hero-copy h1 { font: 800 clamp(46px, 6vw, 78px)/.98 Manrope, sans-serif; letter-spacing: -.05em; margin: 20px 0 24px; }
.hero-copy h1 span { background: linear-gradient(90deg, #81ecff, #8c92ff 50%, #ff72bb); -webkit-background-clip: text; color: transparent; }
.hero-copy > p { color: var(--muted); font-size: 18px; line-height: 1.7; max-width: 600px; }
.feature-row { display: flex; gap: 42px; margin-top: 42px; }
.feature-row div { display: flex; flex-direction: column; gap: 4px; }
.feature-row b { font: 800 25px Manrope; }
.feature-row span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

.live-stats { grid-column: 1 / -1; display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); align-items: stretch; overflow: hidden; margin-top: -24px; }
.live-stats-heading { display: flex; align-items: center; gap: 13px; padding: 20px 24px; }
.live-stats-heading > div { display: flex; flex-direction: column; gap: 5px; }
.live-stats-heading strong { font: 800 15px Manrope, sans-serif; }
.live-stats-heading small { color: var(--muted); font-size: 11px; }
.live-indicator { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px rgba(53,230,165,.85); animation: livePulse 1.8s ease-in-out infinite; }
.live-stat { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 78px; padding: 16px 24px; border-left: 1px solid var(--line); }
.live-stat strong { font: 800 25px Manrope, sans-serif; color: #fff; }
.live-stat span { color: var(--muted); font-size: 11px; }
@keyframes livePulse { 50% { opacity: .45; transform: scale(.82); } }

.glass-card { background: linear-gradient(145deg, rgba(22,29,51,.94), rgba(12,17,31,.88)); border: 1px solid rgba(255,255,255,.11); border-radius: 25px; box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.access-card { padding: 28px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0,0,0,.25); padding: 5px; border-radius: 13px; margin-bottom: 25px; }
.tab { color: var(--muted); border: 0; background: transparent; padding: 12px; border-radius: 9px; font-weight: 700; }
.tab.active { color: white; background: #202942; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }
.field label, .field-label { color: #c7cee1; font-size: 13px; font-weight: 600; }
input { width: 100%; border: 1px solid var(--line); outline: none; color: white; background: #0b1020; padding: 15px 16px; border-radius: 12px; transition: .2s; }
input:focus { border-color: rgba(109,124,255,.8); box-shadow: 0 0 0 4px rgba(109,124,255,.11); }
input::placeholder { color: #515c77; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.level-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 10px 0 23px; }
.level { border: 1px solid var(--line); color: white; background: rgba(255,255,255,.025); border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; gap: 3px; transition: .2s; }
.level:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.18); }
.level.active { border-color: var(--blue); background: rgba(109,124,255,.13); box-shadow: 0 0 0 3px rgba(109,124,255,.08); }
.level b { font-size: 16px; }
.level span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.primary-btn { width: 100%; border: 0; color: white; background: linear-gradient(100deg, #596bff, #8b65ff 55%, #d154ff); padding: 15px 20px; border-radius: 13px; font-weight: 800; box-shadow: 0 14px 35px rgba(105,96,255,.28); transition: .2s; }
.primary-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.primary-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.primary-btn span { float: right; }
.code-input { text-transform: uppercase; text-align: center; font-size: 25px; letter-spacing: .3em; font-weight: 800; }

.lobby-screen { min-height: calc(100vh - 84px); align-content: center; padding: 45px 0 75px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.section-heading h2 { font: 800 42px Manrope; margin: 8px 0 0; }
.room-code-box { border: 1px solid var(--line); border-radius: 15px; padding: 11px 12px 11px 18px; display: grid; grid-template-columns: auto auto; column-gap: 15px; background: rgba(255,255,255,.03); }
.room-code-box small { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.room-code-box strong { grid-row: 2; font: 800 24px Manrope; letter-spacing: .16em; }
.room-code-box button { grid-row: 1 / 3; grid-column: 2; align-self: center; border: 0; color: #cdd4ff; background: rgba(109,124,255,.15); padding: 9px 11px; border-radius: 9px; font-size: 11px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; }
.player-slot { min-height: 310px; border: 1px solid var(--line); border-radius: 23px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: linear-gradient(145deg, rgba(22,29,51,.82), rgba(11,16,29,.7)); position: relative; }
.player-slot.waiting { border-style: dashed; background: rgba(255,255,255,.018); }
.slot-label { position: absolute; top: 20px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.avatar { width: 96px; height: 96px; border-radius: 30px; display: grid; place-items: center; font: 800 25px Manrope; margin-bottom: 22px; }
.avatar-blue { background: linear-gradient(145deg, #1d93ff, #6855ff); box-shadow: 0 18px 45px rgba(65,104,255,.28); }
.avatar-pink { background: linear-gradient(145deg, #ff4ba1, #8e55ff); box-shadow: 0 18px 45px rgba(255,75,161,.23); }
.player-slot h3 { font: 800 22px Manrope; margin: 0 0 10px; }
.ready-status { color: var(--green); font-size: 12px; }
.waiting-status { display: flex; gap: 6px; height: 12px; }
.waiting-status i { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; animation: bounce 1s infinite alternate; }
.waiting-status i:nth-child(2) { animation-delay: .18s; }.waiting-status i:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { to { transform: translateY(-6px); opacity: .35; } }
.versus-column { text-align: center; }
.versus-column span { display: block; font: 800 30px Manrope; color: #68718b; }
.versus-column small { display: inline-block; margin-top: 10px; background: rgba(53,216,255,.1); color: var(--cyan); border: 1px solid rgba(53,216,255,.22); padding: 7px 11px; border-radius: 8px; font-weight: 800; }
.lobby-bottom { display: flex; align-items: center; gap: 30px; margin-top: 30px; }
.lobby-tip { color: var(--muted); flex: 1; font-size: 13px; }
.start-btn { max-width: 270px; }

.countdown-screen { min-height: calc(100vh - 84px); place-content: center; text-align: center; }
.countdown-number { font: 800 min(30vw, 230px)/1 Manrope; background: linear-gradient(180deg, white, #7886ff); -webkit-background-clip: text; color: transparent; filter: drop-shadow(0 0 50px rgba(109,124,255,.35)); }
.countdown-screen p { color: var(--muted); }

.game-screen { min-height: calc(100vh - 84px); align-content: start; padding: 30px 0 70px; }
.match-hud { display: grid; grid-template-columns: 1fr 240px 1fr; align-items: center; border: 1px solid var(--line); background: rgba(14,19,34,.75); padding: 15px 20px; border-radius: 18px; }
.hud-player { display: flex; align-items: center; gap: 12px; }
.hud-player.opponent { justify-content: flex-end; text-align: right; }
.hud-player > div:not(.mini-avatar) { display: flex; flex-direction: column; }
.hud-player span { color: #b7bfd5; font-size: 12px; }
.hud-player strong { font: 800 25px Manrope; }
.mini-avatar { width: 45px; height: 45px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.timer-wrap { text-align: center; }
.timer { font: 800 30px Manrope; letter-spacing: .04em; }
.timer-track { height: 4px; margin: 6px 0 7px; background: #242a3d; border-radius: 999px; overflow: hidden; }
.timer-track span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width .2s linear; }
.timer-wrap small { color: var(--cyan); font-weight: 800; font-size: 9px; letter-spacing: .12em; }
.battle-stage { width: min(760px, 100%); margin: 75px auto 0; text-align: center; }
.word-meta { display: flex; justify-content: center; gap: 12px; }
.word-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.part-of-speech { margin-top: 22px; color: #7f8aa8; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
#streakBadge.hot { color: #ffd262; border-color: rgba(255,210,98,.3); background: rgba(255,210,98,.06); }
.battle-stage h2 { font: 800 clamp(58px, 9vw, 105px)/1 Manrope; margin: 12px 0 16px; letter-spacing: -.04em; }
.battle-stage > p { color: var(--muted); margin-bottom: 28px; }
#answerForm { display: grid; grid-template-columns: 1fr auto; gap: 10px; border: 1px solid rgba(255,255,255,.12); background: #0b1020; padding: 7px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
#answerForm input { border: 0; background: transparent; font-size: 18px; box-shadow: none; }
#answerForm button { border: 0; border-radius: 11px; color: white; background: linear-gradient(100deg, #596bff, #a95eff); padding: 0 25px; font-weight: 800; }
.answer-actions { display: flex; justify-content: space-between; margin-top: 13px; }
.answer-actions button { border: 0; background: transparent; color: #7e88a2; padding: 5px 0; }
.answer-actions span { color: #58627b; font-size: 11px; }
.feedback { height: 42px; margin-top: 16px; font-weight: 700; }
.feedback.correct { color: var(--green); }.feedback.wrong { color: var(--red); }

.result-screen { min-height: calc(100vh - 84px); place-content: center; justify-items: center; text-align: center; padding: 50px 0 80px; }
.result-icon { font-size: 60px; margin-bottom: 15px; filter: drop-shadow(0 0 25px rgba(255,210,98,.3)); }
.result-screen h2 { font: 800 48px Manrope; margin: 10px 0; }
.result-screen > p { color: var(--muted); margin: 0 0 35px; }
.result-players { width: min(700px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.result-player { border: 1px solid var(--line); border-radius: 18px; background: rgba(20,26,45,.76); padding: 22px; text-align: left; }
.result-player.winner { border-color: rgba(53,230,165,.38); box-shadow: 0 0 40px rgba(53,230,165,.08); }
.result-player header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.result-player h3 { margin: 0; font-size: 17px; }
.result-score { font: 800 34px Manrope; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 16px; }
.result-stats div { display: flex; flex-direction: column; gap: 4px; }
.result-stats b { font-size: 14px; }.result-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.rematch-btn { max-width: 280px; margin-top: 25px; }
.toast { position: fixed; top: 22px; left: 50%; z-index: 10; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: #151b2d; color: white; box-shadow: var(--shadow); transition: .25s; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 35px; padding-top: 45px; }
  .hero-copy h1 { font-size: 52px; }
  .section-heading { align-items: flex-start; gap: 25px; }
  .lobby-grid { grid-template-columns: 1fr; gap: 15px; }
  .versus-column { display: flex; justify-content: center; align-items: center; gap: 12px; }
  .versus-column small { margin: 0; }
  .match-hud { grid-template-columns: 1fr 110px 1fr; padding: 12px; }
  .hud-player span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .live-stats { grid-template-columns: 1fr repeat(3, minmax(0, .72fr)); margin-top: 0; }
  .live-stats-heading { padding: 18px; }
  .live-stat { padding: 14px 16px; }
}
@media (max-width: 560px) {
  .app-shell { width: min(100% - 22px, 1180px); }
  .topbar { height: 68px; }.online-pill { display: none; }
  .hero-grid { min-height: auto; padding: 45px 0; }
  .hero-copy h1 { font-size: 41px; }
  .hero-copy > p { font-size: 15px; }
  .feature-row { gap: 23px; }
  .access-card { padding: 18px; }
  .level-picker { grid-template-columns: repeat(2, 1fr); }
  .section-heading { flex-direction: column; }
  .room-code-box { width: 100%; }
  .player-slot { min-height: 235px; }
  .lobby-bottom { flex-direction: column; }.start-btn { max-width: none; }
  .match-hud { grid-template-columns: 1fr 82px 1fr; }
  .mini-avatar { display: none; }.timer { font-size: 22px; }
  .battle-stage { margin-top: 55px; }
  .battle-stage h2 { font-size: 56px; }
  #answerForm { grid-template-columns: 1fr; }
  #answerForm button { padding: 13px; }
  .result-players { grid-template-columns: 1fr; }
  .result-screen h2 { font-size: 38px; }
  .live-stats { grid-template-columns: repeat(3, 1fr); }
  .live-stats-heading { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .live-stat { min-height: 72px; padding: 13px 10px; text-align: center; }
  .live-stat:first-of-type { border-left: 0; }
  .live-stat strong { font-size: 22px; }
  .live-stat span { font-size: 9px; }
}

/* Lobby controls and detailed match statistics */
.lobby-controls { margin-top: 26px; padding: 20px 24px; }
.level-picker.compact { grid-template-columns: repeat(6, 1fr); margin: 10px 0 8px; }
.lobby-level { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); border-radius: 12px; padding: 12px; font-weight: 800; cursor: pointer; }
.lobby-level.active { color: #fff; border-color: rgba(96,116,255,.75); background: rgba(96,116,255,.18); box-shadow: 0 0 22px rgba(96,116,255,.12); }
.lobby-level:disabled { cursor: not-allowed; opacity: .65; }
.secondary-btn { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #fff; border-radius: 14px; padding: 15px 21px; font-weight: 700; cursor: pointer; }
.secondary-btn:hover { background: rgba(255,255,255,.08); }
.feedback.partial { color: #ffd166; }
.result-actions { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 22px; }
.result-actions .rematch-btn { margin: 0; }
.word-history { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.word-history summary { cursor: pointer; font-weight: 700; color: #dce2ff; }
.history-list { max-height: 260px; overflow-y: auto; margin-top: 12px; display: grid; gap: 7px; padding-right: 5px; }
.history-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 11px; border-radius: 10px; background: rgba(255,255,255,.035); border-left: 3px solid #ff667c; }
.history-row.correct { border-left-color: #35e6a5; }
.history-row.partial { border-left-color: #ffd166; }
.history-row.skipped { border-left-color: #8e96ad; }
.history-row > div { display: flex; flex-direction: column; gap: 3px; }
.history-row > div:last-child { text-align: right; }
.history-row span, .history-row small { color: var(--muted); font-size: 12px; }
.history-row strong { font-size: 13px; }
.empty-history { color: var(--muted); text-align: center; }
@media (max-width: 700px) {
  .level-picker.compact { grid-template-columns: repeat(3, 1fr); }
  .result-actions { flex-direction: column; width: 100%; }
  .result-actions button { width: 100%; }
}

.direction-picker { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.direction, .lobby-direction {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
}
.direction.active, .lobby-direction.active {
  color: #fff;
  border-color: rgba(96,116,255,.75);
  background: rgba(96,116,255,.18);
  box-shadow: 0 0 22px rgba(96,116,255,.12);
}
.lobby-direction:disabled { cursor: not-allowed; opacity: .65; }
.lobby-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) {
  .lobby-controls { grid-template-columns: 1fr; }
  .direction-picker { grid-template-columns: 1fr !important; }
}

/* v0.3 — solo mode, ladder mode and match settings */
.hidden { display: none !important; }
.option-picker { display: grid; gap: 9px; margin: 10px 0 20px; }
.option-picker.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-picker.compact-gap { margin-bottom: 18px; }
.option-picker button,
.duration-picker button {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 13px;
  font-weight: 800;
  transition: transform .18s, border-color .18s, background .18s, color .18s;
}
.option-picker button:hover:not(:disabled),
.duration-picker button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(255,255,255,.2); }
.option-picker button.active,
.duration-picker button.active {
  color: #fff;
  border-color: rgba(96,116,255,.78);
  background: rgba(96,116,255,.18);
  box-shadow: 0 0 22px rgba(96,116,255,.12);
}
.option-picker button b { display: block; font-size: 13px; }
.option-picker button span { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; font-weight: 600; }
.option-picker button:disabled,
.duration-picker button:disabled { cursor: not-allowed; opacity: .55; }
.duration-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 23px; }
.duration-picker button { padding: 11px 7px; }
.disabled-block { opacity: .48; filter: saturate(.55); }
.disabled-block::after { content: 'В лестнице сложность меняется автоматически'; display: block; color: var(--cyan); font-size: 11px; margin: -13px 0 20px; }
.level:disabled { cursor: not-allowed; transform: none; }

.lobby-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.control-group { min-width: 0; }
.control-group > small { display: block; min-height: 30px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.disabled-picker { opacity: .48; filter: saturate(.55); }
.lobby-duration-picker { margin-bottom: 8px; }
.solo-slot { border-color: rgba(53,216,255,.18); background: linear-gradient(145deg, rgba(19,38,55,.82), rgba(11,16,29,.7)); }
.solo-slot .avatar { background: linear-gradient(145deg, #2dcbe8, #596bff); }

.game-screen.solo-game #opponentHud { visibility: hidden; }
.game-screen.solo-game .match-hud { background: linear-gradient(90deg, rgba(14,19,34,.82), rgba(20,27,50,.78), rgba(14,19,34,.82)); }
#matchLevel { white-space: nowrap; }

.result-players { width: min(820px, 100%); }
.result-players.solo-results { grid-template-columns: minmax(0, 560px); justify-content: center; }
.result-stats { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 12px; }
.history-row em {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(53,216,255,.1);
  color: var(--cyan);
  font-size: 9px;
  font-style: normal;
  vertical-align: 2px;
}

@media (max-width: 760px) {
  .option-picker.two-column { grid-template-columns: 1fr; }
  .duration-picker { grid-template-columns: repeat(3, 1fr); }
  .lobby-controls { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .feature-row b { font-size: 20px; }
  .feature-row span { font-size: 9px; }
  .duration-picker { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .duration-picker button { font-size: 11px; padding: 10px 2px; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
}


/* v0.3.2 — compact ladder notification that never covers the word/input */
.tier-transition {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 9999;
  pointer-events: none;
  transform: translateX(-50%);
  animation: tierOverlayIn .18s ease-out both;
}
.tier-transition.leaving { animation: tierOverlayOut .28s ease-in both; }
.tier-transition-card {
  min-width: 290px;
  padding: 11px 20px 12px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 15px;
  text-align: center;
  background: rgba(14,20,38,.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 44px rgba(0,0,0,.42), 0 0 32px rgba(75,100,255,.14);
  animation: tierCardIn .32s cubic-bezier(.2,.9,.2,1.12) both;
}
.tier-transition.promotion .tier-transition-card { border-color: rgba(55,231,178,.42); }
.tier-transition.demotion .tier-transition-card { border-color: rgba(255,91,119,.42); }
.tier-transition-card small { display:inline; letter-spacing:.14em; color:var(--cyan); font-weight:900; font-size:9px; }
.tier-transition.demotion .tier-transition-card small { color:var(--red); }
.tier-transition-card strong { display:inline; margin-left:12px; font-size:24px; line-height:1; color:#fff; }
.tier-transition-card strong span { color:var(--muted); font-size:.7em; }
.tier-transition-card p { display:inline; margin-left:12px; color:var(--muted); font-weight:700; font-size:11px; }
.tier-pulse { animation: tierBadgePulse .8s ease-out; }
@keyframes tierOverlayIn { from { opacity:0; transform:translate(-50%,-14px) } to { opacity:1; transform:translate(-50%,0) } }
@keyframes tierOverlayOut { to { opacity:0; transform:translate(-50%,-12px) } }
@keyframes tierCardIn { from { opacity:0; transform:scale(.92) } to { opacity:1; transform:scale(1) } }
@keyframes tierBadgePulse { 0%,100% { transform:scale(1) } 45% { transform:scale(1.12); filter:brightness(1.4) } }
@media (max-width: 700px) {
  .tier-transition { top: 64px; width: calc(100vw - 24px); }
  .tier-transition-card { min-width: 0; padding: 10px 12px; }
  .tier-transition-card p { display:block; margin:5px 0 0; }
}



.history-row.synonym { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .08); }
.history-note { display: block; margin-top: 4px; color: #fbbf24; font-size: .72rem; line-height: 1.25; }

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px 22px;
  flex-wrap: wrap;
  width: min(1180px, calc(100% - 36px));
  margin: -54px auto 0;
  padding: 22px 0 28px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
  text-align: center;
}
.site-footer strong { color: rgba(255,255,255,.82); letter-spacing: .09em; }

.account-dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; color: var(--text); background: #101626; box-shadow: 0 45px 120px rgba(0,0,0,.65); }
.account-dialog::backdrop { background: rgba(3,5,11,.78); backdrop-filter: blur(8px); }
.account-dialog-card { position: relative; padding: 29px; }
.account-dialog h2 { margin: 8px 0 7px; font: 800 28px Manrope; letter-spacing: -.03em; }
.account-dialog-card > p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.dialog-close { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: #aab3ca; background: rgba(255,255,255,.035); font-size: 20px; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 19px; border: 1px solid var(--line); border-radius: 12px; background: #0a0f1b; }
.account-tab { min-height: 37px; border: 0; border-radius: 8px; color: #727d96; background: transparent; font-weight: 750; font-size: 12px; }
.account-tab.active { color: white; background: rgba(109,124,255,.16); }
.account-form { display: none; gap: 13px; }
.account-form.active { display: grid; }
.account-form label { display: grid; gap: 7px; }
.account-form label span { color: #abb4ca; font-size: 10px; font-weight: 700; }
.account-form input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: white; background: #0a0f1b; outline: 0; }
.account-form input:focus { border-color: rgba(109,124,255,.72); box-shadow: 0 0 0 3px rgba(109,124,255,.09); }
.account-submit { min-height: 46px; margin-top: 5px; border: 0; border-radius: 11px; color: white; background: linear-gradient(110deg, #5c6eff, #a45fff); font-weight: 800; }
.account-submit:disabled { opacity: .55; cursor: wait; }
.account-error { min-height: 18px; margin-top: 11px; color: #ff8294; font-size: 11px; text-align: center; }
.profile-dialog { width: min(570px, calc(100vw - 28px)); }
.profile-heading { display: flex; align-items: center; gap: 15px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-heading h2 { margin-bottom: 2px; }
.profile-heading p { margin: 0; color: #727d96; font-size: 11px; }
.profile-large-avatar { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 19px; display: grid; place-items: center; background: linear-gradient(135deg, var(--cyan), var(--blue), var(--pink)); box-shadow: 0 14px 35px rgba(109,124,255,.24); font: 800 17px Manrope; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 20px 0 13px; }
.profile-stats div { min-height: 82px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.profile-stats span, .profile-records span { color: #7e89a2; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.profile-stats strong { font: 800 24px Manrope; }
.profile-stats .wins strong { color: var(--green); }
.profile-records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--line); }
.profile-records div { min-height: 61px; padding: 11px; display: flex; flex-direction: column; justify-content: center; gap: 4px; background: #101626; }
.profile-records b { font-size: 14px; }
.logout-button { width: 100%; min-height: 42px; margin-top: 18px; border: 1px solid rgba(255,102,124,.24); border-radius: 11px; color: #ff899b; background: rgba(255,102,124,.07); font-weight: 750; }
.admin-editor-button { width: 100%; min-height: 44px; margin-top: 18px; border: 1px solid rgba(53,216,255,.25); border-radius: 11px; color: #a9efff; background: rgba(53,216,255,.07); display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 800; font-size: 12px; }
.admin-editor-button + .logout-button { margin-top: 9px; }

@media (max-width: 700px) {
  .site-footer { margin-top: 0; padding-bottom: 22px; }
  .auth-actions { gap: 5px; }
  .header-link, .header-primary { padding: 0 9px; font-size: 10px; }
  .profile-button small, .online-pill { display: none; }
  .profile-button b { max-width: 80px; }
  .account-dialog-card { padding: 24px 18px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-records { grid-template-columns: 1fr; }
}
