@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=IBM+Plex+Sans+Condensed:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap");

:root {
  --night: #061419;
  --night-2: #0a2027;
  --panel: rgba(12, 34, 41, 0.92);
  --panel-solid: #0c2229;
  --panel-light: #12303a;
  --gold: #d6b66a;
  --gold-bright: #f0d58d;
  --cyan: #43c8be;
  --text: #f3efe4;
  --muted: #9cb0b1;
  --line: rgba(214, 182, 106, 0.34);
  --line-soft: rgba(210, 228, 226, 0.12);
  --correct: #08643a;
  --partial: #765718;
  --wrong: #8e3542;
  --display: "Cinzel", Georgia, serif;
  --body: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --ko: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  color-scheme: dark;
  background: var(--night);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(5, 19, 24, 0.82), rgba(5, 19, 24, 0.96)),
    repeating-linear-gradient(135deg, transparent 0 47px, rgba(214, 182, 106, 0.025) 48px 49px),
    #07171c;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -3;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% -10%, rgba(67, 200, 190, 0.13), transparent 34%),
    linear-gradient(90deg, transparent 49.9%, rgba(214, 182, 106, 0.05) 50%, transparent 50.1%);
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(214, 182, 106, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  inset: 12%;
  border: inherit;
  border-radius: inherit;
  content: "";
}

.ambient::after {
  inset: 28%;
}

.ambient--one {
  top: 180px;
  left: -360px;
}

.ambient--two {
  right: -390px;
  bottom: 60px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.score-rail:focus-visible,
.table-scroll:focus-visible,
.chat-log:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  width: min(1320px, calc(100% - 40px));
  min-height: 94px;
  margin: 0 auto;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.brand-crest,
.mini-crest {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-content: center;
  border: 1px solid var(--gold);
  background: linear-gradient(145deg, rgba(214, 182, 106, 0.13), rgba(67, 200, 190, 0.06));
  box-shadow: inset 0 0 0 4px rgba(4, 17, 21, 0.84);
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 17px;
  transform: rotate(45deg);
}

.brand-crest::after,
.mini-crest::after {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(214, 182, 106, 0.2);
  content: "";
}

.brand-crest i {
  position: absolute;
  font-style: normal;
  transform: rotate(-45deg);
}

.brand-crest i:first-child {
  top: 8px;
  left: 11px;
}

.brand-crest i:last-child {
  right: 10px;
  bottom: 7px;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mode-nav {
  display: flex;
  justify-content: center;
}

.mode-tab {
  display: flex;
  min-width: 102px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: #718889;
  text-align: left;
}

.mode-tab:last-child {
  border-right: 0;
}

.mode-tab.is-active {
  color: var(--text);
}

.mode-tab.is-active .mode-glyph {
  border-color: var(--gold);
  background: rgba(214, 182, 106, 0.14);
  color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(214, 182, 106, 0.12);
}

.mode-glyph {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(156, 176, 177, 0.18);
  border-radius: 50%;
  font-size: 15px;
}

.mode-tab span:last-child {
  display: grid;
}

.mode-tab b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mode-tab small {
  margin-top: 2px;
  color: currentColor;
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 1;
  text-transform: uppercase;
}

.header-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.language-switch,
.sound-toggle,
.connection-chip {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(5, 20, 25, 0.78);
}

.language-switch button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.language-switch button + button {
  border-left: 1px solid var(--line);
}

.language-switch button.is-active {
  background: var(--gold);
  color: var(--night);
  font-weight: 700;
}

.sound-toggle {
  min-height: 44px;
  gap: 7px;
  padding: 0 10px;
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.sound-toggle:hover {
  border-color: rgba(240, 213, 141, 0.62);
  background: linear-gradient(145deg, rgba(214, 182, 106, 0.12), rgba(67, 200, 190, 0.05));
}

.sound-toggle svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: currentColor;
  overflow: visible;
}

.sound-toggle .sound-wave,
.sound-toggle .sound-muted-mark {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.sound-toggle .sound-muted-mark {
  display: none;
}

.sound-toggle[data-enabled="false"] {
  color: var(--muted);
}

.sound-toggle[data-enabled="false"] .sound-wave {
  display: none;
}

.sound-toggle[data-enabled="false"] .sound-muted-mark {
  display: block;
}

.connection-chip {
  gap: 7px;
  min-height: 44px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d17b3d;
  box-shadow: 0 0 0 3px rgba(209, 123, 61, 0.12);
}

.connection-chip[data-state="online"] .signal-dot {
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(67, 200, 190, 0.12), 0 0 12px rgba(67, 200, 190, 0.38);
}

.connection-chip[data-state="connecting"] .signal-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

.screen {
  display: none;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 195px);
  margin: 0 auto;
  padding: 68px 0 90px;
}

.game-screen {
  width: min(1320px, calc(100% - 40px));
}

.screen.is-active {
  display: block;
  animation: enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.landing-intro {
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: center;
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.section-kicker span {
  width: 42px;
  height: 1px;
  background: var(--gold);
}

.landing-intro h1,
.screen-title h1,
.guess-card h1 {
  margin: 0;
  font-family: var(--display);
}

.landing-intro h1 {
  display: grid;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.landing-intro h1 span {
  color: var(--text);
}

.landing-intro h1 em {
  margin-top: 8px;
  color: var(--gold-bright);
  font-style: normal;
  text-shadow: 0 0 38px rgba(214, 182, 106, 0.16);
}

.landing-intro > p:not(.section-kicker) {
  max-width: 590px;
  margin: 23px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}

.feature-row span {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #c5d2cf;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature-row i {
  color: var(--cyan);
  font-size: 8px;
}

.entry-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
  max-width: 930px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: rgba(5, 19, 24, 0.74);
  box-shadow: var(--shadow);
}

.entry-frame::before,
.entry-frame::after,
.glass-panel::before,
.guess-card::before {
  position: absolute;
  width: 20px;
  height: 20px;
  content: "";
  pointer-events: none;
}

.entry-frame::before,
.glass-panel::before,
.guess-card::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.entry-frame::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}

.entry-panel {
  padding: 29px;
}

.panel-heading {
  display: flex;
  gap: 17px;
  align-items: center;
  margin-bottom: 27px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-crest {
  width: 39px;
  height: 39px;
  font-size: 11px;
}

.mini-crest {
  transform: rotate(45deg);
}

.panel-heading p {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-label,
.card-label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.text-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(214, 182, 106, 0.28);
  border-radius: 2px;
  background: rgba(3, 15, 19, 0.72);
  color: var(--text);
  font-size: 17px;
}

.text-input::placeholder {
  color: #829899;
}

.entry-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(100deg, rgba(18, 48, 58, 0.76), rgba(12, 34, 41, 0.34));
}

.entry-action h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
}

.entry-action p {
  max-width: 390px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 18px;
  border: 1px solid #f3d891;
  background: linear-gradient(#d9bd75, #b88f42);
  box-shadow: inset 0 0 0 1px rgba(4, 18, 22, 0.34), 0 5px 16px rgba(0, 0, 0, 0.2);
  color: #07171c;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.text-button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.45;
}

.secondary-button {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--gold);
  background: rgba(214, 182, 106, 0.06);
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ornament-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #718486;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ornament-divider::before,
.ornament-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--line-soft);
}

.join-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.code-input {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.mode-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 26px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(67, 200, 190, 0.12), transparent 42%),
    linear-gradient(160deg, rgba(16, 50, 58, 0.76), rgba(5, 19, 24, 0.88));
  text-align: center;
}

.mode-preview-icon,
.mode-orb {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(214, 182, 106, 0.07);
  box-shadow: 0 0 0 7px rgba(214, 182, 106, 0.035), 0 0 34px rgba(67, 200, 190, 0.08);
  color: var(--gold-bright);
  font-size: 24px;
}

.mode-preview > p:first-of-type {
  margin: 18px 0 7px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mode-preview h2,
.selected-mode-card h2 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 24px;
}

.mode-preview > p:last-of-type,
.selected-mode-card > p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.color-key {
  display: flex;
  gap: 5px;
  margin-top: 22px;
}

.color-key i {
  width: 33px;
  height: 4px;
}

.color-key i:nth-child(1) { background: var(--correct); }
.color-key i:nth-child(2) { background: var(--partial); }
.color-key i:nth-child(3) { background: var(--wrong); }

.screen-title {
  position: relative;
  margin-bottom: 38px;
  text-align: center;
}

.screen-title > p {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.screen-title h1 {
  color: var(--text);
  font-size: clamp(38px, 6vw, 66px);
}

.screen-title h1 em {
  color: var(--gold-bright);
  font-style: normal;
  letter-spacing: 0.12em;
}

.text-button {
  margin-top: 15px;
  min-height: 44px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.leave-room-button {
  border-color: rgba(178, 83, 94, 0.55);
  color: #e5a5ad;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.6fr);
  gap: 22px;
  max-width: 1000px;
  margin: 0 auto;
}

.glass-panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.players-panel {
  min-height: 420px;
  padding: 24px;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-bar h2 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 18px;
}

.panel-bar span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.player-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  background: rgba(4, 18, 22, 0.5);
}

.player-card.is-you {
  border-color: var(--gold);
  background: rgba(214, 182, 106, 0.08);
}

.player-card.is-offline {
  opacity: 0.48;
}

.player-avatar {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--panel-light);
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 15px;
}

.player-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.host-badge {
  padding: 3px 6px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-slot {
  display: grid;
  min-height: 65px;
  place-items: center;
  border: 1px dashed rgba(156, 176, 177, 0.16);
  color: #829899;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-mode-card {
  display: flex;
  min-height: 650px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 27px;
  text-align: center;
}

.selected-mode-card .card-label {
  margin-bottom: 20px;
}

.selected-mode-card .mode-orb {
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  font-size: 20px;
}

.primary-button--large {
  width: 100%;
  margin-top: 28px;
}

.selected-mode-card > small {
  min-height: 30px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.rule-card {
  width: 100%;
  margin-top: 22px;
  padding: 15px 16px;
  border: 1px solid rgba(67, 200, 190, 0.38);
  background:
    linear-gradient(100deg, rgba(67, 200, 190, 0.1), transparent 58%),
    rgba(5, 23, 29, 0.66);
  text-align: left;
}

.rule-card span {
  display: block;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.rule-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
}

.rule-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.rule-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.rule-setting {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rule-setting--entry {
  grid-column: 1 / -1;
}

.rule-setting--time,
.rule-setting--guess,
.rule-setting--match,
.rule-setting--wide {
  grid-column: 1 / -1;
}

.rule-options--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-options--entry {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-options--guess {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-options--match {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rule-options--guess label:last-child > span,
.rule-options--match label:last-child > span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rule-setting-description {
  display: block;
  min-height: 40px;
  margin-top: 7px;
  color: #b8c7c6;
  font-size: 13px;
  line-height: 1.45;
}

.rule-setting legend {
  margin-bottom: 7px;
  color: #c5d2d1;
  font-size: 13px;
  font-weight: 700;
}

.rule-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: rgba(1, 12, 17, 0.68);
}

.rule-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.rule-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.rule-options span {
  display: grid;
  min-height: 44px;
  padding: 6px 8px;
  place-items: center;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  white-space: nowrap;
}

.rule-options input:checked + span {
  border-color: var(--gold);
  background: rgba(214, 182, 106, 0.14);
  color: var(--gold-bright);
}

.rule-options input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.rule-options input:disabled:not(:checked) + span {
  opacity: 0.45;
}

.rule-options input:disabled + span {
  cursor: default;
}

.rule-options--guess span > b,
.rule-options--match span > b {
  margin-right: 5px;
  color: var(--gold-bright);
  font-size: 19px;
  line-height: 0;
}

.rule-options--guess span > i,
.rule-options--match span > i {
  font-style: normal;
}

.custom-guess-control,
.custom-match-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(67, 200, 190, 0.3);
  background: linear-gradient(100deg, rgba(67, 200, 190, 0.1), rgba(3, 17, 21, 0.7));
}

.custom-guess-control > label,
.custom-match-control > label {
  color: #d4dfdc;
  font-size: 14px;
  font-weight: 700;
}

.number-field {
  display: flex;
  align-items: center;
  min-width: 132px;
  border-bottom: 1px solid var(--gold);
}

.number-field input {
  width: 68px;
  min-height: 40px;
  padding: 4px 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.number-field input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.number-field input:disabled {
  opacity: 0.72;
}

.number-field span {
  padding-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #ff9b91;
  font-size: 13px;
  line-height: 1.35;
}

.field-error:empty {
  display: none;
}

.rule-card .rule-summary {
  margin-top: 13px;
  color: var(--gold-bright);
  font-size: 15px;
  font-weight: 700;
}

.rule-control-note {
  display: block;
  margin-top: 5px;
  color: #b8c7c6;
  font-size: 13px;
  line-height: 1.4;
}

.game-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.game-statusbar > div:first-child {
  display: grid;
}

.game-status-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.game-status-actions .text-button {
  min-height: 44px;
  margin: 0;
}

.game-statusbar span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-statusbar strong {
  margin-top: 3px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 17px;
}

.race-clock {
  display: grid;
  min-width: 135px;
  text-align: right;
}

.race-clock strong {
  color: var(--cyan);
  font-family: var(--body);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.race-clock strong.is-warning {
  color: var(--gold-bright);
}

.race-clock strong.is-critical {
  color: #ff7c72;
}

.race-rule-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -2px 0 16px;
  padding: 10px 15px;
  border: 1px solid rgba(67, 200, 190, 0.28);
  background: rgba(67, 200, 190, 0.055);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.race-rule-copy {
  display: grid;
  gap: 3px;
}

.race-rule-strip strong {
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.guess-budget {
  display: flex;
  gap: 13px;
  align-items: center;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: #c5d2d1;
}

.guess-budget > span {
  font-size: 13px;
  font-weight: 700;
}

.guess-budget strong {
  display: flex;
  gap: 4px;
  align-items: baseline;
  color: var(--gold-bright);
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.guess-budget strong small {
  color: var(--muted);
  font-family: var(--body);
  font-size: 14px;
}

.guess-budget.is-exhausted > span,
.guess-budget.is-exhausted strong {
  color: #ff9b91;
}

.guess-budget.is-solved > span,
.guess-budget.is-solved strong {
  color: var(--cyan);
}

.race-scoreboard {
  position: relative;
  margin-bottom: 34px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 12% 0%, rgba(67, 200, 190, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(214, 182, 106, 0.045), transparent 46%),
    rgba(5, 23, 29, 0.9);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

.race-scoreboard::before,
.race-scoreboard::after {
  position: absolute;
  width: 44px;
  height: 44px;
  content: "";
  pointer-events: none;
}

.race-scoreboard::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--cyan);
  border-left: 1px solid var(--cyan);
}

.race-scoreboard::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.race-scoreboard-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.race-scoreboard-heading > div {
  display: grid;
}

.race-scoreboard-heading span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.race-scoreboard-heading h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(23px, 2.6vw, 32px);
  line-height: 1.1;
}

.scoreboard-heading-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scoreboard-heading-meta > strong {
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-target-pill {
  display: grid;
  min-width: 116px;
  padding: 7px 11px;
  border: 1px solid rgba(214, 182, 106, 0.4);
  background: rgba(214, 182, 106, 0.08);
  text-align: right;
}

.match-target-pill i {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.match-target-pill b {
  margin-top: 4px;
  color: var(--gold-bright);
  font-size: 14px;
  line-height: 1.1;
}

.score-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 10px;
}

.score-rail[data-count="1"] {
  grid-template-columns: minmax(0, 430px);
}

.standings-scroll-hint {
  display: none;
}

.competitor-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 50px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 120px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid rgba(210, 228, 226, 0.15);
  background:
    linear-gradient(110deg, rgba(67, 200, 190, 0.055), transparent 46%),
    rgba(8, 29, 35, 0.9);
  box-shadow: 0 11px 30px rgba(0, 0, 0, 0.2);
}

.competitor-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(67, 200, 190, 0.7), transparent);
  opacity: 0.55;
}

.competitor-card.is-you {
  border-color: rgba(214, 182, 106, 0.72);
  background:
    linear-gradient(110deg, rgba(214, 182, 106, 0.12), transparent 52%),
    rgba(10, 31, 37, 0.96);
  box-shadow:
    0 0 0 1px rgba(214, 182, 106, 0.09) inset,
    0 13px 36px rgba(0, 0, 0, 0.26);
}

.competitor-card.is-you::before {
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity: 0.9;
}

.competitor-card.is-winner {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px rgba(67, 200, 190, 0.12) inset,
    0 0 32px rgba(67, 200, 190, 0.13);
}

.competitor-card.is-match-winner {
  border-color: var(--gold-bright);
  background:
    radial-gradient(circle at 15% 50%, rgba(240, 213, 141, 0.18), transparent 34%),
    linear-gradient(110deg, rgba(214, 182, 106, 0.13), transparent 58%),
    rgba(10, 31, 37, 0.98);
  box-shadow:
    0 0 0 1px rgba(240, 213, 141, 0.18) inset,
    0 0 42px rgba(214, 182, 106, 0.18);
}

.competitor-card.is-offline {
  border-style: dashed;
  background: rgba(8, 25, 30, 0.74);
}

.competitor-card.is-exhausted:not(.is-winner) {
  border-color: rgba(255, 124, 114, 0.36);
  background:
    linear-gradient(110deg, rgba(255, 124, 114, 0.06), transparent 48%),
    rgba(8, 25, 30, 0.78);
}

.competitor-card.is-exhausted .score-status {
  color: #ff9b91;
}

.competitor-card.is-solved:not(.is-winner) {
  border-color: rgba(67, 200, 190, 0.58);
  background:
    linear-gradient(110deg, rgba(67, 200, 190, 0.11), transparent 52%),
    rgba(8, 29, 35, 0.92);
}

.competitor-card.is-solved .score-status {
  color: var(--cyan);
}

.score-rank {
  display: grid;
  min-height: 70px;
  align-content: center;
  justify-items: center;
  border-right: 1px solid var(--line-soft);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-rank small {
  margin-bottom: 7px;
  color: currentColor;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.score-rank b {
  font-family: var(--display);
  font-size: 24px;
}

.competitor-card.rank-1 .score-rank {
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(240, 213, 141, 0.38);
}

.competitor-card.rank-2 .score-rank {
  color: #cfdbdd;
}

.competitor-card.rank-3 .score-rank {
  color: #d99567;
}

.competitor-card.rank-1::after,
.competitor-card.rank-2::after,
.competitor-card.rank-3::after {
  position: absolute;
  top: -25px;
  left: -25px;
  width: 90px;
  height: 90px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.1;
  pointer-events: none;
}

.competitor-card.rank-1::after { color: var(--gold-bright); }
.competitor-card.rank-2::after { color: #cfdbdd; }
.competitor-card.rank-3::after { color: #d99567; }

.score-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(67, 200, 190, 0.7);
  background: rgba(67, 200, 190, 0.08);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.is-you .score-avatar {
  border-color: var(--gold-bright);
  background: rgba(214, 182, 106, 0.11);
}

.score-identity {
  display: grid;
  min-width: 0;
}

.score-status {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.score-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.is-you .score-status {
  color: var(--gold-bright);
}

.is-offline .score-status {
  color: var(--muted);
}

.score-identity > strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--text);
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-identity > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.score-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  min-width: 120px;
  padding-left: 10px;
  border-left: 1px solid var(--line-soft);
}

.score-wins,
.score-attempts {
  display: grid;
  align-content: center;
  text-align: center;
}

.score-wins {
  padding-right: 8px;
  border-right: 1px solid var(--line-soft);
}

.score-attempts {
  padding-left: 8px;
}

.score-wins strong,
.score-attempts strong {
  color: var(--cyan);
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 0.95;
}

.score-wins strong {
  color: var(--gold-bright);
  font-size: clamp(32px, 3.3vw, 42px);
}

.score-attempts strong {
  font-size: clamp(24px, 2.5vw, 32px);
}

.score-wins strong small,
.score-attempts strong small {
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.42em;
}

.is-you .score-wins strong,
.is-winner .score-wins strong {
  color: var(--gold-bright);
}

.score-wins > small,
.score-attempts small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.guess-card {
  position: relative;
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 31px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(67, 200, 190, 0.1), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.guess-card::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  content: "";
}

.mode-rune {
  display: block;
  color: var(--gold);
  font-size: 24px;
}

.guess-card .card-label {
  margin: 11px 0 8px;
}

.guess-card h1 {
  color: var(--text);
  font-size: clamp(25px, 4vw, 38px);
}

.guess-card > p:not(.card-label) {
  margin: 10px auto 23px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.submit-hint {
  margin: 10px 0 0 !important;
  color: #b7c6c5 !important;
  font-size: 12px !important;
  letter-spacing: 0.03em;
}

.champion-combobox {
  position: relative;
}

.guess-input {
  height: 54px;
  font-size: 18px;
}

.guess-input:read-only {
  cursor: wait;
  opacity: 0.72;
}

.guess-button {
  min-width: 118px;
  min-height: 54px;
}

.suggestion-list {
  position: absolute;
  z-index: 15;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--gold);
  background: #0b2027;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.suggestion-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.suggestion-option:last-child {
  border-bottom: 0;
}

.suggestion-option:hover,
.suggestion-option.is-selected {
  background: rgba(214, 182, 106, 0.12);
}

.suggestion-option img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.suggestion-option strong {
  display: block;
  font-size: 15px;
}

.suggestion-option small {
  color: var(--muted);
  font-size: 12px;
}

.suggestion-option > small {
  text-align: right;
}

.clue-board-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.clue-board-heading h2 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 23px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.legend span {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.legend-swatch--correct { background: var(--correct); }
.legend-swatch--partial { background: var(--partial); }
.legend-swatch--wrong { background: var(--wrong); }

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  background: rgba(5, 18, 22, 0.68);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.clue-table,
.empty-board {
  min-width: 1200px;
}

.clue-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) repeat(7, minmax(135px, 1fr));
}

.clue-row > span {
  position: relative;
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 11px 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: center;
}

.clue-row > span:last-child {
  border-right: 0;
}

.clue-row > span:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  box-shadow: 8px 0 14px rgba(0, 0, 0, 0.18);
}

.clue-row--header > span:first-child {
  z-index: 3;
}

.clue-row--header > span {
  min-height: 50px;
  background: #102a32;
  color: #c7d3d1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.clue-row--guess:last-child > span {
  border-bottom: 0;
}

.champion-cell {
  grid-template-columns: 56px 1fr !important;
  gap: 11px;
  justify-content: start;
  background: #102830;
  text-align: left !important;
}

.champion-cell img {
  width: 56px;
  height: 56px;
  border: 1px solid var(--gold);
  object-fit: cover;
}

.champion-cell strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
}

.clue-cell {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

.clue-cell[data-comparison="correct"] {
  background: linear-gradient(135deg, var(--correct), #064d2d);
}

.clue-cell[data-comparison="partial"] {
  background:
    repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, 0.06) 8px 10px),
    linear-gradient(135deg, var(--partial), #5b410f);
}

.comparison-mark {
  position: absolute;
  top: 5px;
  left: 7px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-style: normal;
  line-height: 1;
}

.clue-cell[data-comparison="wrong"],
.clue-cell[data-comparison="higher"],
.clue-cell[data-comparison="lower"] {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(135deg, var(--wrong), #692631);
}

.direction-arrow {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #fff1bb;
  font-size: 23px;
}

.empty-board {
  display: grid;
  min-height: 145px;
  place-content: center;
  color: #829899;
  text-align: center;
}

.empty-board span {
  color: var(--gold);
  font-size: 27px;
}

.empty-board p {
  margin: 9px 0 0;
  font-size: 14px;
}

.scroll-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.result-banner {
  position: relative;
  display: none;
  grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.15fr) minmax(170px, auto);
  gap: 24px;
  align-items: center;
  margin: 0 0 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--gold);
  background:
    radial-gradient(circle at 55% 50%, rgba(214, 182, 106, 0.13), transparent 29%),
    linear-gradient(100deg, #12323a, #0a2128);
  box-shadow: var(--shadow);
}

.result-banner::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 52%, rgba(240, 213, 141, 0.06) 52.2% 52.5%, transparent 52.7%);
}

.result-banner.is-visible {
  display: grid;
  animation: enter 350ms ease both;
}

.result-medallion {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(214, 182, 106, 0.1);
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 25px;
}

.result-round-summary,
.result-champion-reveal,
.result-actions {
  position: relative;
}

.result-round-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}

.result-copy {
  min-width: 0;
}

.result-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-copy h2 {
  margin: 4px 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.result-champion-reveal {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0 24px;
  border-inline: 1px solid rgba(214, 182, 106, 0.22);
}

.result-champion-portrait {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid var(--gold-bright);
  background: #092229;
  box-shadow:
    0 0 0 5px rgba(214, 182, 106, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.42);
  color: rgba(214, 182, 106, 0.35);
  font-size: 28px;
  transform: rotate(3deg);
}

.result-champion-portrait img {
  position: absolute;
  inset: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  object-fit: cover;
  transform: rotate(-3deg) scale(1.035);
}

.result-champion-reveal figcaption {
  min-width: 0;
}

.result-champion-reveal figcaption > span,
.winner-champion-reveal figcaption > span {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-champion-reveal figcaption > strong {
  display: block;
  margin-top: 2px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(29px, 3.3vw, 43px);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.result-champion-reveal figcaption > small {
  display: block;
  margin-top: 5px;
  color: #c7d5d4;
  font-size: 14px;
  line-height: 1.25;
}

.result-actions {
  min-width: 190px;
  text-align: center;
}

.result-actions .primary-button {
  width: 100%;
}

.result-actions small {
  display: block;
  max-width: 220px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.countdown-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  place-content: center;
  background:
    radial-gradient(circle, rgba(20, 68, 74, 0.5), transparent 43%),
    rgba(3, 14, 18, 0.97);
  text-align: center;
}

.countdown-layer.is-visible {
  display: grid;
}

.countdown-layer p,
.countdown-layer span {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.countdown-layer strong {
  margin: -8px 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: min(43vw, 410px);
  line-height: 1;
  text-shadow: 0 0 55px rgba(214, 182, 106, 0.2);
  animation: count 720ms ease both;
}

.leave-dialog {
  position: fixed;
  width: min(460px, calc(100vw - 32px));
  margin: auto;
  padding: 30px;
  overflow: hidden;
  border: 1px solid rgba(214, 182, 106, 0.72);
  border-radius: 2px;
  background:
    linear-gradient(120deg, rgba(67, 200, 190, 0.08), transparent 46%),
    #081c22;
  box-shadow:
    0 0 0 1px rgba(214, 182, 106, 0.1) inset,
    0 30px 100px rgba(0, 0, 0, 0.72);
  color: var(--text);
}

.leave-dialog[open] {
  animation: dialog-enter 180ms ease both;
}

.leave-dialog::backdrop {
  background: rgba(2, 11, 14, 0.84);
  backdrop-filter: blur(5px);
}

.leave-dialog-mark {
  position: absolute;
  top: -24px;
  right: -18px;
  color: rgba(214, 182, 106, 0.08);
  font-family: var(--display);
  font-size: 150px;
  line-height: 1;
  transform: rotate(-10deg);
}

.leave-dialog-eyebrow {
  position: relative;
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.leave-dialog h2 {
  position: relative;
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.15;
}

.leave-dialog-description {
  position: relative;
  max-width: 360px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.leave-dialog-actions {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 26px;
}

.leave-dialog-actions button {
  width: 100%;
  min-height: 48px;
}

.leave-dialog[aria-busy="true"] .leave-dialog-actions {
  opacity: 0.72;
}

.winner-dialog {
  position: fixed;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 36px 48px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 0%, rgba(214, 182, 106, 0.2), transparent 47%),
    linear-gradient(135deg, rgba(67, 200, 190, 0.1), transparent 46%),
    #06191f;
  box-shadow:
    0 0 0 1px rgba(240, 213, 141, 0.12) inset,
    0 35px 120px rgba(0, 0, 0, 0.8),
    0 0 70px rgba(214, 182, 106, 0.12);
  color: var(--text);
  text-align: center;
}

.winner-dialog[open] {
  animation: winner-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.winner-dialog::backdrop {
  background:
    radial-gradient(circle, rgba(20, 68, 74, 0.28), transparent 46%),
    rgba(2, 10, 13, 0.9);
  backdrop-filter: blur(7px);
}

.winner-dialog-rays {
  position: absolute;
  inset: -70%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(214, 182, 106, 0.035) 0deg 4deg,
    transparent 4deg 13deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0 26%, transparent 60%);
  mask-image: radial-gradient(circle, #000 0 26%, transparent 60%);
  animation: winner-rays 22s linear infinite;
}

.winner-dialog-eyebrow,
.winner-dialog-player,
.winner-dialog-result,
.winner-champion-reveal,
.winner-dialog-actions,
.winner-dialog > small {
  position: relative;
}

.winner-dialog-eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.winner-dialog-player {
  max-width: 620px;
  margin: 0 auto;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow: 0 4px 34px rgba(214, 182, 106, 0.23);
}

.winner-dialog-result {
  width: fit-content;
  margin: 11px auto 0;
  padding: 4px 14px;
  border-block: 1px solid rgba(214, 182, 106, 0.28);
  color: #c7d5d4;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 600;
  letter-spacing: 0.045em;
}

.winner-champion-reveal {
  margin: 30px 0 0;
}

.winner-champion-portrait {
  position: relative;
  display: grid;
  width: 208px;
  height: 208px;
  margin: 0 auto;
  isolation: isolate;
  place-items: center;
  border: 1px solid var(--gold-bright);
  background:
    radial-gradient(circle, rgba(67, 200, 190, 0.2), transparent 66%),
    #092229;
  box-shadow:
    0 0 0 7px rgba(214, 182, 106, 0.07),
    0 23px 55px rgba(0, 0, 0, 0.56),
    0 0 52px rgba(214, 182, 106, 0.16);
  color: rgba(214, 182, 106, 0.4);
  font-size: 42px;
}

.winner-champion-portrait::before,
.winner-champion-portrait::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.winner-champion-portrait::before {
  inset: -12px;
  border: 1px solid rgba(214, 182, 106, 0.48);
  transform: rotate(45deg);
}

.winner-champion-portrait::after {
  inset: -23px;
  border: 1px solid rgba(67, 200, 190, 0.18);
  border-radius: 50%;
}

.winner-champion-portrait img {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border: 1px solid rgba(240, 213, 141, 0.42);
  background: var(--panel-solid);
  object-fit: cover;
}

.winner-champion-reveal figcaption {
  margin-top: 27px;
}

.winner-champion-reveal figcaption > strong {
  display: block;
  max-width: 620px;
  margin: 3px auto 0;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.04;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.winner-champion-reveal figcaption > small {
  display: block;
  margin-top: 6px;
  color: #c7d5d4;
  font-size: clamp(15px, 2.4vw, 19px);
  line-height: 1.3;
}

.winner-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 25px;
}

.winner-dialog-actions button {
  min-width: 180px;
  min-height: 50px;
}

.winner-dialog > small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.match-dialog {
  position: fixed;
  width: min(800px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 34px 42px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--gold-bright);
  border-radius: 2px;
  background:
    radial-gradient(circle at 50% 14%, rgba(240, 213, 141, 0.19), transparent 31%),
    linear-gradient(145deg, rgba(67, 200, 190, 0.1), transparent 48%),
    #06191f;
  box-shadow:
    0 0 0 1px rgba(240, 213, 141, 0.16) inset,
    0 38px 130px rgba(0, 0, 0, 0.86),
    0 0 90px rgba(214, 182, 106, 0.18);
  color: var(--text);
  text-align: center;
}

.match-dialog[open] {
  animation: winner-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.match-dialog::backdrop {
  background:
    radial-gradient(circle, rgba(214, 182, 106, 0.18), transparent 43%),
    rgba(2, 9, 12, 0.94);
  backdrop-filter: blur(9px);
}

.match-dialog-halo {
  position: absolute;
  inset: -52%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 22.5deg,
    rgba(240, 213, 141, 0.045) 0deg 3deg,
    transparent 3deg 15deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0 23%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0 23%, transparent 62%);
  animation: winner-rays 30s linear infinite;
}

.match-dialog-eyebrow,
.match-dialog-mark,
.match-dialog-label,
.match-dialog h2,
.match-dialog-summary,
.match-champion-reveal,
.match-final-standings,
.match-dialog-actions,
.match-dialog > small {
  position: relative;
}

.match-dialog-eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.match-dialog-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 16px auto 12px;
  place-items: center;
  border: 1px solid var(--gold-bright);
  background: rgba(214, 182, 106, 0.1);
  box-shadow: 0 0 0 6px rgba(214, 182, 106, 0.045), 0 0 28px rgba(214, 182, 106, 0.2);
  transform: rotate(45deg);
}

.match-dialog-mark span {
  color: var(--gold-bright);
  font-size: 18px;
  transform: rotate(-45deg);
}

.match-dialog-label {
  margin: 0 0 3px;
  color: #c7d5d4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.match-dialog h2 {
  max-width: 700px;
  margin: 0 auto;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(46px, 8vw, 76px);
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 4px 38px rgba(214, 182, 106, 0.28);
  text-wrap: balance;
}

.match-dialog-summary {
  width: fit-content;
  margin: 11px auto 0;
  padding: 4px 16px;
  border-block: 1px solid rgba(214, 182, 106, 0.36);
  color: var(--gold-bright);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.match-champion-reveal {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: 500px;
  margin: 27px auto 0;
  text-align: left;
}

.match-champion-portrait {
  position: relative;
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border: 1px solid var(--gold-bright);
  background: #092229;
  box-shadow: 0 0 0 7px rgba(214, 182, 106, 0.06), 0 18px 44px rgba(0, 0, 0, 0.5);
  color: rgba(214, 182, 106, 0.4);
  font-size: 32px;
  transform: rotate(3deg);
}

.match-champion-portrait::before {
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(67, 200, 190, 0.25);
  content: "";
  pointer-events: none;
  transform: rotate(42deg);
}

.match-champion-portrait img {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: cover;
  transform: rotate(-3deg) scale(1.03);
}

.match-champion-reveal figcaption > span {
  display: block;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.match-champion-reveal figcaption > strong {
  display: block;
  margin-top: 3px;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.match-champion-reveal figcaption > small {
  display: block;
  margin-top: 6px;
  color: #c7d5d4;
  font-size: 16px;
}

.match-final-standings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 190px;
  margin: 28px 0 0;
  padding: 10px;
  overflow-y: auto;
  border-block: 1px solid rgba(214, 182, 106, 0.22);
  list-style: none;
}

.match-final-standings li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(210, 228, 226, 0.12);
  background: rgba(3, 17, 21, 0.58);
  text-align: left;
}

.match-final-standings li > span {
  color: var(--muted);
  font-family: var(--display);
  font-size: 18px;
  text-align: center;
}

.match-final-standings li > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-final-standings li > b {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.match-final-standings li > b em {
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 21px;
  font-style: normal;
}

.match-final-standings li.rank-1 {
  border-color: rgba(240, 213, 141, 0.58);
  background: linear-gradient(100deg, rgba(214, 182, 106, 0.15), rgba(3, 17, 21, 0.7));
}

.match-final-standings li.rank-1 > span { color: var(--gold-bright); }
.match-final-standings li.rank-2 > span { color: #cfdbdd; }
.match-final-standings li.rank-3 > span { color: #d99567; }

.match-dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.match-dialog-actions button {
  min-width: 190px;
  min-height: 50px;
}

.match-dialog > small {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
}

.toast-stack {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(350px, calc(100% - 36px));
}

.toast {
  padding: 13px 14px;
  border: 1px solid var(--gold);
  background: #0b2027;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  animation: toast-in 220ms ease both;
}

.toast.is-leaving {
  animation: toast-out 180ms ease both;
}

.chat-launcher {
  position: fixed;
  z-index: 35;
  right: 20px;
  bottom: 20px;
  display: flex;
  min-width: 118px;
  min-height: 50px;
  padding: 8px 13px;
  border: 1px solid var(--gold);
  align-items: center;
  justify-content: center;
  gap: 9px;
  background:
    linear-gradient(125deg, rgba(67, 200, 190, 0.12), transparent 58%),
    #0b252c;
  box-shadow: 0 15px 44px rgba(0, 0, 0, 0.48);
  color: var(--gold-bright);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.room-actions > .chat-launcher,
.game-status-actions > .chat-launcher {
  position: relative;
  z-index: 0;
  right: auto;
  bottom: auto;
  min-height: 44px;
  margin: 0;
  box-shadow:
    0 0 0 1px rgba(214, 182, 106, 0.08) inset,
    0 7px 20px rgba(0, 0, 0, 0.24);
}

.room-actions > .chat-launcher {
  margin-top: 15px;
}

.chat-launcher:hover {
  border-color: var(--gold-bright);
  background-color: #10323a;
  transform: translateY(-2px);
}

.chat-launcher > span:first-child {
  color: var(--cyan);
  font-family: var(--display);
  font-size: 20px;
}

.chat-launcher strong {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-unread {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--wrong);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.room-chat {
  position: fixed;
  z-index: 36;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr) auto;
  width: min(380px, calc(100vw - 40px));
  height: min(590px, calc(100dvh - 120px));
  overflow: hidden;
  border: 1px solid rgba(214, 182, 106, 0.78);
  background:
    radial-gradient(circle at 100% 0%, rgba(67, 200, 190, 0.12), transparent 42%),
    rgba(6, 25, 31, 0.98);
  box-shadow:
    0 0 0 1px rgba(214, 182, 106, 0.08) inset,
    0 30px 90px rgba(0, 0, 0, 0.62);
  animation: chat-enter 180ms ease both;
}

.room-chat-header {
  display: flex;
  min-height: 66px;
  padding: 11px 12px 11px 16px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
}

.room-chat-header > div {
  display: flex;
  gap: 11px;
  align-items: center;
}

.room-chat-header > div > span:last-child {
  display: grid;
}

.room-chat-rune {
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: 27px;
  line-height: 1;
}

.room-chat-header small {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.room-chat[data-live="true"] .room-chat-header small {
  color: var(--gold-bright);
  text-shadow: 0 0 16px rgba(214, 182, 106, 0.28);
}

.room-chat-header strong {
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
}

.chat-close-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-soft);
  place-items: center;
  background: rgba(2, 13, 17, 0.5);
  color: var(--muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.chat-close-button:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.chat-log {
  min-height: 0;
  padding: 14px 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(214, 182, 106, 0.42) transparent;
}

.chat-message-list {
  display: grid;
  gap: 13px;
}

.chat-empty {
  margin: 34px auto;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.chat-message {
  max-width: 88%;
  justify-self: start;
}

.chat-message.is-you {
  justify-self: end;
}

.chat-message header {
  display: flex;
  gap: 9px;
  align-items: baseline;
  margin: 0 4px 4px;
}

.chat-message header strong {
  overflow: hidden;
  max-width: 180px;
  color: var(--cyan);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message.is-you header {
  justify-content: flex-end;
}

.chat-message.is-you header strong {
  color: var(--gold-bright);
}

.chat-message time {
  color: #72888a;
  font-size: 10px;
}

.chat-message p {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(67, 200, 190, 0.22);
  background: rgba(16, 49, 57, 0.68);
  color: #e5edeb;
  font-size: 14px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message.is-you p {
  border-color: rgba(214, 182, 106, 0.34);
  background: rgba(214, 182, 106, 0.1);
}

.chat-form {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(2, 14, 18, 0.72);
}

.chat-form textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 96px;
  padding: 10px 11px;
  resize: none;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  background: #071a20;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.chat-form textarea::placeholder {
  color: #73898b;
}

.chat-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.chat-compose-footer output {
  color: #718587;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chat-form[data-over-limit="true"] output {
  color: #ff9b91;
  font-weight: 700;
}

.chat-form[aria-busy="true"] textarea,
.chat-form[aria-busy="true"] .chat-compose-footer {
  opacity: 0.68;
}

.chat-compose-footer button {
  min-width: 74px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--gold);
  background: rgba(214, 182, 106, 0.12);
  color: var(--gold-bright);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-compose-footer button:hover {
  background: rgba(214, 182, 106, 0.2);
}

.chat-compose-footer button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  color: #718587;
  font-size: 12px;
  line-height: 1.45;
}

.site-footer p {
  max-width: 900px;
  margin: 0;
}

.site-footer p + p {
  margin-top: 5px;
  color: #8fa1a2;
}

.site-footer a {
  display: inline-block;
  margin-top: 7px;
  color: var(--gold-bright);
  text-underline-offset: 3px;
}

.site-footer > span {
  white-space: nowrap;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

html[lang="ko"] body,
html[lang="ko"] button,
html[lang="ko"] input,
html[lang="ko"] textarea {
  font-family: var(--ko);
  word-break: keep-all;
}

html[lang="ko"] .brand-copy strong,
html[lang="ko"] .brand-crest,
html[lang="ko"] .mini-crest,
html[lang="ko"] .race-clock strong,
html[lang="ko"] .code-input,
html[lang="ko"] .score-avatar,
html[lang="ko"] .score-attempts strong,
html[lang="ko"] .result-medallion {
  font-family: var(--display);
}

html[lang="ko"] .landing-intro h1,
html[lang="ko"] .screen-title h1,
html[lang="ko"] .guess-card h1,
html[lang="ko"] .mode-preview h2,
html[lang="ko"] .selected-mode-card h2,
html[lang="ko"] .panel-heading p,
html[lang="ko"] .race-scoreboard-heading h2,
html[lang="ko"] .score-identity > strong,
html[lang="ko"] .clue-board-heading h2,
html[lang="ko"] .rule-card strong,
html[lang="ko"] .race-rule-strip strong,
html[lang="ko"] .leave-dialog h2,
html[lang="ko"] .winner-dialog h2,
html[lang="ko"] .match-dialog h2,
html[lang="ko"] .result-banner h2,
html[lang="ko"] .winner-champion-reveal figcaption > strong,
html[lang="ko"] .match-champion-reveal figcaption > strong,
html[lang="ko"] .result-champion-reveal figcaption > strong {
  font-family: var(--ko);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

html[lang="ko"] [class*="kicker"],
html[lang="ko"] .field-label,
html[lang="ko"] .card-label,
html[lang="ko"] .mode-tab b,
html[lang="ko"] .mode-tab small,
html[lang="ko"] .race-scoreboard-heading span,
html[lang="ko"] .scoreboard-heading-meta > strong,
html[lang="ko"] .score-status,
html[lang="ko"] .score-wins > small,
html[lang="ko"] .score-attempts > small,
html[lang="ko"] .rule-card span,
html[lang="ko"] .race-rule-strip strong,
html[lang="ko"] .rule-options span,
html[lang="ko"] .leave-dialog-eyebrow,
html[lang="ko"] .winner-dialog-eyebrow,
html[lang="ko"] .match-dialog-eyebrow,
html[lang="ko"] .primary-button,
html[lang="ko"] .secondary-button {
  letter-spacing: 0.01em;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(13px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes count {
  from { opacity: 0; transform: scale(1.22); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(14px); }
}

@keyframes chat-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dialog-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes winner-enter {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes winner-rays {
  to { transform: rotate(360deg); }
}

@media (max-width: 1080px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .mode-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    order: 3;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 5px 0 2px;
  }

  .header-tools {
    justify-self: end;
  }

  .mode-tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 820px) {
  .entry-frame,
  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .mode-preview {
    min-height: 255px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .selected-mode-card {
    min-height: 520px;
  }

  .score-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-rail[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-banner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .result-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .result-champion-reveal {
    grid-column: 1 / -1;
    padding: 20px 0 0;
    border-block-start: 1px solid rgba(214, 182, 106, 0.22);
    border-inline: 0;
  }

  .scroll-hint {
    display: block;
  }
}

@media (max-width: 620px) {
  .site-header,
  .screen,
  .site-footer {
    width: min(100% - 24px, 1320px);
  }

  .site-header {
    gap: 14px;
  }

  .brand-crest {
    width: 43px;
    height: 43px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small,
  .sound-toggle span,
  .connection-chip span:last-child {
    display: none;
  }

  .connection-chip {
    padding: 0 9px;
  }

  .sound-toggle {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .language-switch button {
    padding: 0 8px;
  }

  .mode-tab {
    min-width: 87px;
    padding: 6px 8px;
  }

  .mode-glyph {
    width: 29px;
    height: 29px;
  }

  .screen {
    min-height: 0;
    padding: 48px 0 70px;
  }

  .landing-intro h1 {
    font-size: 39px;
  }

  .landing-intro > p:not(.section-kicker) {
    font-size: 15px;
  }

  .feature-row {
    gap: 9px 14px;
  }

  .entry-panel {
    padding: 19px;
  }

  .entry-action {
    grid-template-columns: 1fr;
  }

  .entry-action .primary-button {
    width: 100%;
  }

  .join-form,
  .guess-form {
    grid-template-columns: 1fr;
  }

  .secondary-button,
  .guess-button {
    width: 100%;
  }

  .player-grid {
    grid-template-columns: 1fr;
  }

  .rule-settings {
    grid-template-columns: 1fr;
  }

  .rule-setting--entry {
    grid-column: auto;
  }

  .rule-setting--wide {
    grid-column: auto;
  }

  .rule-setting--match {
    grid-column: auto;
  }

  .players-panel {
    padding: 18px;
  }

  .game-statusbar,
  .clue-board-heading {
    align-items: flex-start;
  }

  .game-statusbar {
    gap: 14px;
    flex-wrap: wrap;
  }

  .game-status-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  .race-clock {
    min-width: 112px;
    text-align: left;
  }

  .race-rule-strip {
    display: grid;
    gap: 10px;
    padding: 11px 12px;
  }

  .guess-budget {
    justify-content: space-between;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .race-scoreboard {
    margin-bottom: 26px;
    padding: 14px 10px 12px;
  }

  .race-scoreboard::before,
  .race-scoreboard::after {
    width: 30px;
    height: 30px;
  }

  .race-scoreboard-heading {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 3px 10px;
  }

  .race-scoreboard-heading span {
    font-size: 10px;
  }

  .race-scoreboard-heading h2 {
    font-size: 21px;
  }

  .scoreboard-heading-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
  }

  .scoreboard-heading-meta > strong {
    font-size: 12px;
  }

  .match-target-pill {
    min-width: 102px;
    padding: 6px 8px;
  }

  .score-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: 350px;
    padding-right: 3px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--gold) rgba(1, 12, 17, 0.55);
    scrollbar-gutter: stable;
  }

  .score-rail[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .standings-scroll-hint.is-visible {
    display: block;
    margin: 9px 3px 0;
    color: var(--gold-bright);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: right;
  }

  .competitor-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 104px;
    padding: 12px 10px;
  }

  .score-avatar {
    display: none;
  }

  .score-rank {
    min-height: 64px;
  }

  .score-rank small {
    margin-bottom: 5px;
    font-size: 7px;
  }

  .score-rank b {
    font-size: 20px;
  }

  .score-status {
    gap: 4px;
    overflow: hidden;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .score-status i {
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
  }

  .score-identity > strong {
    margin-top: 5px;
    font-size: 16px;
  }

  .score-identity > span {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.15;
  }

  .score-metrics {
    grid-template-columns: repeat(2, minmax(42px, 1fr));
    min-width: 94px;
    padding-left: 5px;
  }

  .score-wins {
    padding-right: 5px;
  }

  .score-attempts {
    padding-left: 5px;
  }

  .score-wins strong,
  .score-attempts strong {
    font-size: 26px;
  }

  .score-wins > small,
  .score-attempts > small {
    margin-top: 5px;
    font-size: 8px;
    letter-spacing: 0.02em;
  }

  .clue-board-heading {
    display: grid;
  }

  .guess-card {
    padding: 24px 17px;
  }

  .result-banner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 17px;
  }

  .result-medallion {
    width: 48px;
    height: 48px;
  }

  .result-champion-reveal {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
  }

  .result-champion-portrait {
    width: 92px;
    height: 92px;
  }

  .result-champion-reveal figcaption > strong {
    font-size: clamp(27px, 10vw, 38px);
  }

  .leave-dialog {
    padding: 25px 20px 20px;
  }

  .winner-dialog {
    padding: 35px 20px 25px;
  }

  .winner-dialog-player {
    font-size: clamp(36px, 12vw, 52px);
  }

  .winner-champion-portrait {
    width: 176px;
    height: 176px;
  }

  .winner-champion-reveal figcaption {
    margin-top: 24px;
  }

  .winner-champion-reveal figcaption > strong {
    font-size: clamp(34px, 12vw, 48px);
  }

  .winner-dialog-actions {
    display: grid;
  }

  .winner-dialog-actions button {
    width: 100%;
    min-width: 0;
  }

  .match-dialog {
    padding: 27px 18px 23px;
  }

  .match-dialog-mark {
    width: 44px;
    height: 44px;
    margin-block: 14px 11px;
  }

  .match-dialog h2 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .match-champion-reveal {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    margin-top: 23px;
  }

  .match-champion-portrait {
    width: 112px;
    height: 112px;
  }

  .match-champion-reveal figcaption > strong {
    font-size: clamp(30px, 9vw, 42px);
  }

  .match-final-standings {
    grid-template-columns: 1fr;
    max-height: 180px;
    margin-top: 22px;
  }

  .match-dialog-actions {
    display: grid;
  }

  .match-dialog-actions button {
    width: 100%;
    min-width: 0;
  }

  .leave-dialog-actions {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
  }

  .chat-launcher {
    min-width: 108px;
    padding: 8px 12px;
  }

  .game-status-actions > .chat-launcher {
    flex: 0 0 auto;
  }

  .room-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    grid-template-rows: auto minmax(72px, 1fr) auto;
    width: auto;
    height: min(540px, 78dvh);
    max-height: calc(100dvh - max(24px, env(safe-area-inset-bottom)));
  }

  .room-chat-header {
    min-height: 58px;
    padding-block: 8px;
  }
}

@media (max-height: 760px) {
  .winner-dialog {
    padding: 24px 40px 22px;
  }

  .winner-dialog-player {
    font-size: clamp(38px, 7vh, 56px);
  }

  .winner-dialog-result {
    margin-top: 7px;
    padding-block: 2px;
  }

  .winner-champion-reveal {
    margin-top: 20px;
  }

  .winner-champion-portrait {
    width: 160px;
    height: 160px;
  }

  .winner-champion-reveal figcaption {
    margin-top: 20px;
  }

  .winner-champion-reveal figcaption > strong {
    font-size: clamp(36px, 6vh, 46px);
  }

  .winner-dialog-actions {
    margin-top: 18px;
  }

  .winner-dialog-actions button {
    min-height: 46px;
  }

  .match-dialog {
    padding-block: 20px 18px;
  }

  .match-dialog-mark {
    display: none;
  }

  .match-dialog h2 {
    font-size: clamp(38px, 7vh, 54px);
  }

  .match-dialog-summary {
    margin-top: 7px;
  }

  .match-champion-reveal {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    margin-top: 16px;
  }

  .match-champion-portrait {
    width: 104px;
    height: 104px;
  }

  .match-champion-reveal figcaption > strong {
    font-size: clamp(30px, 5vh, 40px);
  }

  .match-final-standings {
    max-height: 170px;
    margin-top: 16px;
  }

  .match-dialog-actions {
    margin-top: 14px;
  }

  .match-dialog-actions button {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .winner-dialog-player,
  .match-dialog h2 {
    font-size: clamp(32px, 9.5vw, 44px);
  }

  .score-rail,
  .score-rail[data-count="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .competitor-card {
    min-height: 94px;
  }
}

@media (max-width: 380px) {
  .rule-options--match {
    grid-template-columns: 1fr;
  }

  .match-champion-reveal {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .match-champion-portrait {
    margin-inline: auto;
  }

  .match-final-standings {
    padding-inline: 6px;
  }

  .match-final-standings li {
    grid-template-columns: 36px minmax(0, 1fr) 30px;
    gap: 6px;
    padding-inline: 8px;
  }

  .match-final-standings li > span {
    font-size: 15px;
  }

  .match-final-standings li > strong {
    font-size: 14px;
  }

  .match-final-standings li > b {
    text-align: right;
  }

  .match-final-standings li > b span {
    display: none;
  }

  .match-final-standings li > b em {
    font-size: 19px;
  }
}

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