:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #6d7771;
  --paper: #f7f3ea;
  --panel: #fffdfa;
  --line: #d9d1c3;
  --accent: #c9472c;
  --accent-2: #18746b;
  --gold: #d99f2b;
  --shadow: 0 22px 70px rgba(42, 31, 20, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(24,33,31,.07) 1px, transparent 1px),
    linear-gradient(rgba(24,33,31,.06) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.topbar-spacer {
  flex: 1 1 auto;
  min-height: 48px;
  align-self: stretch;
  cursor: default;
  user-select: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  transition: color .15s ease, transform .15s ease;
}

.brand-mark {
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 5px 5px 0 var(--ink);
  object-fit: cover;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }

.brand-room-tagline {
  display: none !important;
}

.brand-room-tagline > strong {
  display: inline;
  color: var(--accent);
  font-size: 1.05em;
}

.brand-room-mobile {
  display: none;
}

body[data-app-view="room"] .brand,
body[data-app-view="access"] .brand {
  position: relative;
  padding: 7px 10px 7px 7px;
  border: 1px solid transparent;
  margin-left: -7px;
}

body[data-app-view="room"] .brand-home-tagline,
body[data-app-view="access"] .brand-home-tagline {
  display: none;
}

body[data-app-view="room"] .brand-room-tagline,
body[data-app-view="access"] .brand-room-tagline {
  display: block !important;
  color: var(--ink);
  font-weight: 800;
}

body[data-app-view="room"] .brand:hover,
body[data-app-view="access"] .brand:hover {
  border-color: var(--ink);
  background: #fffdfa;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--accent);
  transform: translate(-2px, -2px);
}

body[data-app-view="room"] .brand:focus-visible,
body[data-app-view="access"] .brand:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.brand-room-arrow {
  display: inline-block;
  transition: transform .15s ease;
}

body[data-app-view="room"] .brand:hover .brand-room-arrow,
body[data-app-view="access"] .brand:hover .brand-room-arrow,
body[data-app-view="room"] .brand:focus-visible .brand-room-arrow,
body[data-app-view="access"] .brand:focus-visible .brand-room-arrow {
  transform: translateX(4px);
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.identity-editor {
  display: grid;
  gap: 0;
  justify-items: end;
  line-height: 1.2;
  cursor: text;
}

.identity-name {
  width: min(220px, 42vw);
  height: auto;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 0;
  margin: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  outline: none;
}

.identity-name:hover {
  border-color: var(--line);
}

.identity-name:focus {
  border-color: var(--ink);
  background: #fff;
}

.name-hint {
  margin-top: 2px;
  padding-right: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: italic;
  line-height: 1.2;
}

.name-hint.hidden {
  display: none;
}

.identity-status {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.identity-status .status-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.identity-status .status-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.identity-status .status-check {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.identity-status.is-pending {
  color: #9aa5a0;
}

.identity-status.is-pending .status-ring {
  fill: currentColor;
  stroke: none;
  opacity: 0.85;
}

.identity-status.is-connected {
  color: #1f6feb;
}

.identity-status.is-connected .status-check {
  opacity: 1;
}

.identity-status.is-failed {
  color: var(--accent);
}

.identity-status.is-failed .status-ring {
  fill: currentColor;
  stroke: none;
}

.identity-status.is-failed .status-check {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 22px;
  padding-top: 22px;
}

body.is-game-deeplink-entry #lobbyView {
  visibility: hidden;
}

.workspace.dashboard-only,
.workspace.setup-only {
  grid-template-columns: 1fr;
}

.home-guide-index {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 250, .75);
}

.home-guide-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.home-guide-head span {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .13em;
}

.home-guide-head h2 {
  margin: 2px 0 0;
  font-family: "Book Antiqua", "Palatino Linotype", "Noto Serif KR", serif;
  font-size: 1.05rem;
  line-height: 1.2;
}

.home-guide-head > a {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: .8rem;
  font-weight: 900;
  text-underline-offset: 4px;
}

.home-guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.home-guide-links a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  font-size: .8rem;
  font-weight: 750;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.home-guide-links a:hover,
.home-guide-links a:focus-visible {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdfa;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding: 24px 0 18px;
  border-top: 2px solid var(--ink);
}

.site-footer-owner strong,
.site-footer-owner span { display: block; }
.site-footer-owner span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.site-footer-owner .site-footer-build { margin-top: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .7rem; letter-spacing: .02em; opacity: .8; }
.site-footer-owner .site-footer-build:empty { display: none; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 17px; }
.site-footer a { font-size: .82rem; font-weight: 800; text-underline-offset: 4px; }

@media (max-width: 720px) {
  .site-footer { display: grid; }
  .site-footer nav { justify-content: flex-start; }
}

.panel, .answer-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.creator-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(217, 159, 43, 0.18) 0%, transparent 46%),
    linear-gradient(180deg, #efe6d4 0%, #e4dac6 100%);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 rgba(24, 33, 31, 0.18);
}

.visibility-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px;
  background: transparent;
}

.visibility-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  cursor: pointer;
  font-weight: 800;
}

.visibility-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.visibility-option span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #efeae0;
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}

.visibility-option input:checked + span {
  border-color: var(--ink);
  background: var(--gold);
  color: var(--ink);
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0 var(--ink);
}

.visibility-option input:focus-visible + span {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.creator-heading {
  display: grid;
  gap: 3px;
  margin: 24px 0 14px;
}

.creator-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.creator-heading h2 {
  margin: 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: 1.28rem;
  line-height: 1.25;
}

/* ── Lobby: game library (left) + game detail (right) ───────────── */
.lobby-workspace {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  align-items: start;
}

.library-panel {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
}

.library-panel .creator-heading {
  margin: 2px 2px 12px;
}

.game-picker {
  display: grid;
  gap: 6px;
}

.library-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 10px 7px 7px;
  overflow: hidden;
  border: 1px solid transparent;
  background: rgba(255, 253, 250, .45);
  color: var(--ink);
  text-align: left;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.library-row:hover {
  border-color: rgba(24, 33, 31, .35);
  background: rgba(255, 253, 250, .9);
}

.library-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.library-row.is-selected {
  border-color: var(--ink);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.library-row.is-flash {
  animation: library-flash 1.2s ease-in-out 2;
}

.library-row-icon {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
}

.library-row-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.library-row-text strong {
  overflow: hidden;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row.is-selected .library-row-text strong::after {
  content: " \25B8";
  color: var(--gold);
}

.library-row-text span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-row-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
}

.library-rank {
  padding: 2px 6px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.library-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.library-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b2a5;
}

.library-live.is-active { color: #1f7a45; }
.library-live.is-active i {
  background: #2fae62;
  box-shadow: 0 0 0 3px rgba(47, 174, 98, .18);
  animation: live-pulse 1.8s ease-in-out infinite;
}
.library-live.is-pending i {
  background: var(--gold);
  animation: live-pulse 1.8s ease-in-out infinite;
}
.library-live.is-offline i { background: var(--accent); }

.library-row-tick {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background: var(--gold);
}

.library-panel.is-spotlight .library-row.is-selected .library-row-tick {
  animation: library-tick var(--spotlight-ms, 7s) linear forwards;
}

.library-panel.is-spotlight-paused .library-row.is-selected .library-row-tick {
  animation-play-state: paused;
}

@keyframes library-tick { to { width: 100%; } }
@keyframes library-flash { 50% { box-shadow: 4px 4px 0 var(--ink), 0 0 0 4px rgba(217, 159, 43, .45); } }

.lobby-stage {
  display: grid;
  gap: 14px;
  align-content: start;
}

.lobby-stage .home-guide-index { margin-top: 8px; }

.game-detail {
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 rgba(24, 33, 31, .12);
}

.game-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.game-detail-media {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  overflow: hidden;
  border-right: 1px solid var(--ink);
  background: #e9dfcb;
}

.game-detail-media img,
.game-detail-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-detail-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  background: var(--panel);
  font-size: 11px;
  font-weight: 800;
}

.game-detail-badge.is-demo {
  left: auto;
  right: 12px;
  background: var(--ink);
  color: #fffdfa;
}

.game-detail-info {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: 20px 22px;
}

.game-detail-eyebrow {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.game-detail-info h2 {
  margin: -4px 0 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  text-wrap: balance;
}

.game-detail-pitch {
  max-width: 46ch;
  margin: 0;
  color: #394440;
  font-size: 14px;
  line-height: 1.6;
}

.game-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-detail-chips li {
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 11.5px;
  font-weight: 750;
}

.game-detail-chips li.is-strong {
  border-color: var(--ink);
  background: var(--panel);
}

.game-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.game-detail-stats div { min-width: 0; padding-right: 8px; }
.game-detail-stats div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.game-detail-stats strong { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.game-detail-stats span { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }

.game-detail-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
  counter-reset: how-to;
}

.game-detail-steps li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.45;
  counter-increment: how-to;
}

.game-detail-steps li + li { border-left: 1px solid var(--line); }

.game-detail-steps li::before {
  content: counter(how-to);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -3px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #efe6d4;
  font-size: 12px;
  font-weight: 900;
}

.game-detail-create {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--ink);
  background: linear-gradient(180deg, #f8f2e5, #f2eadb);
}

.game-detail-create .visibility-switch {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 8px;
  padding: 0;
}

.game-detail-create .visibility-option,
.game-detail-create .visibility-option span {
  min-height: 40px;
}

.game-detail-create .visibility-option span {
  padding: 0 14px;
  font-size: 13px;
}

.game-detail-create #roomPasswordField {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
}

.game-detail-create #roomPasswordField.hidden { display: none !important; }
.game-detail-create #roomPasswordField > span { font-size: 13px; }
.game-detail-create #roomPasswordInput { width: 170px; min-height: 40px; border-color: var(--ink); }
.game-detail-create .field-message { flex-basis: 100%; }

.game-detail-guide {
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 800;
  text-underline-offset: 3px;
}

.game-detail-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.game-detail-share,
.game-detail-create-btn {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  font-size: 13.5px;
  font-weight: 850;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.game-detail-share { background: var(--panel); color: var(--ink); }
.game-detail-share:not(:disabled):hover { background: #efe6d4; }

.game-detail-create-btn {
  background: var(--ink);
  color: #fffdfa;
  box-shadow: 3px 3px 0 var(--gold);
}

.game-detail-create-btn:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--gold); }
.game-detail-create-btn:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--gold); }

.game-detail-share:focus-visible,
.game-detail-create-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.game-detail-create .share-result {
  flex-basis: 100%;
  min-height: 0;
  margin: 0;
  font-size: 13px;
}

.game-detail-create .share-result:empty { display: none; }

.game-detail.is-swapping .game-detail-media > *,
.game-detail.is-swapping .game-detail-info,
.game-detail.is-swapping .game-detail-steps {
  animation: game-detail-swap .28s ease both;
}

@keyframes game-detail-swap {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.game-library-hint {
  margin: -6px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.game-library-hint:empty { display: none; }

/* ── My rooms (topbar chip + panel) ─────────────────────────────── */
.my-rooms-wrap { position: relative; }
body:not([data-app-view="lobby"]) .my-rooms-wrap { display: none; }

.my-rooms-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  box-shadow: 3px 3px 0 rgba(24, 33, 31, .18);
}

.my-rooms-btn[aria-expanded="true"] { background: #efe6d4; }

.my-rooms-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b2a5;
}

.my-rooms-btn.has-live .my-rooms-dot {
  background: #2fae62;
  box-shadow: 0 0 0 3px rgba(47, 174, 98, .18);
}

.my-rooms-count {
  min-width: 20px;
  padding: 1px 6px;
  background: var(--accent-2);
  color: #fff;
  font-size: 11px;
  text-align: center;
}

.my-rooms-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: 6px 6px 0 rgba(24, 33, 31, .18);
}

.my-rooms-head {
  display: grid;
  gap: 2px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.my-rooms-head strong { font-size: 14px; }
.my-rooms-head small { color: var(--muted); font-size: 11.5px; }

.my-rooms-list {
  gap: 0;
  max-height: min(60vh, 440px);
  margin: 0;
  overflow-y: auto;
}

.my-rooms-list .game-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.my-rooms-list .game-row:last-child { border-bottom: 0; }
.my-rooms-list .game-row:hover { transform: none; box-shadow: none; background: #f6efe1; }
.my-rooms-list .game-row img { width: 40px; height: 40px; }
.my-rooms-list .game-row h3 { margin: 0 0 3px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.my-rooms-list .game-row p { font-size: 11.5px; }
.my-rooms-list .game-row p + p { display: none; }
.my-rooms-list .row-aside { min-width: 0; gap: 4px; }
.my-rooms-list .row-status { padding: 4px 7px; font-size: 11px; }
.my-rooms-list .row-delete-btn { min-height: 28px; padding: 3px 8px; font-size: 11.5px; }

.library-quick { display: none; }
.game-detail.is-collapsed { display: none; }

@media (max-width: 980px) {
  .library-panel { max-height: none; overflow: visible; }
  .library-item { position: relative; }
  .library-item .library-row { padding-right: 86px; border-color: rgba(24, 33, 31, .18); background: rgba(255, 253, 250, .8); }
  .library-quick {
    position: absolute;
    top: 14px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 2px 2px 0 var(--gold);
    transition: transform .12s ease, box-shadow .12s ease;
  }
  .library-quick:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--gold); }
  .library-quick:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
  .library-quick:disabled { border-color: var(--line); background: #e7e0d2; color: var(--muted); box-shadow: none; }
  .library-item .game-detail { margin: 6px 0 12px; box-shadow: 4px 4px 0 rgba(24, 33, 31, .12); }
  .library-row.is-selected { transform: none; box-shadow: 3px 3px 0 var(--ink); }
  .library-item .library-row { scroll-margin-top: 12px; }
  .game-detail-top { grid-template-columns: 1fr; }
  .game-detail-media { width: 100%; max-height: 210px; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 1px solid var(--ink); }
  .game-detail-steps { grid-template-columns: 1fr; }
  .game-detail-steps li + li { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .game-detail-info { padding: 16px; }
  .game-detail-actions { width: 100%; margin-left: 0; }
  .game-detail-actions button { flex: 1; }
  .my-rooms-label { display: none; }
  .my-rooms-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
  .my-rooms-list .game-row { grid-template-columns: 40px minmax(0, 1fr); }
}

@keyframes live-pulse {
  50% { opacity: .45; transform: scale(.82); }
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title span, .eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

#roomPasswordField {
  margin-top: 12px;
  margin-bottom: 0;
}

.field-message {
  min-height: 1.2em;
  color: #b42318;
  font-size: 0.85rem;
  line-height: 1.35;
}

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

#roomPasswordInput[aria-invalid="true"] {
  border-color: #b42318;
}

.field span {
  font-weight: 800;
}

input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.place-map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 6px;
  align-items: stretch;
  width: 100%;
  height: 200px;
}

.place-map-wrap.hidden {
  display: none;
}

.place-map-inline {
  min-width: 0;
  height: 100%;
  border: 1px solid var(--ink);
  background: #efeae0;
  overflow: hidden;
}

.place-map-inline iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-zoom-stack {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 2px;
  height: 100%;
  min-height: 0;
}

.map-zoom-mark {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

.map-zoom-range {
  width: 24px;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  writing-mode: vertical-lr;
  direction: rtl;
  accent-color: var(--accent-2);
  cursor: pointer;
  appearance: slider-vertical;
  -webkit-appearance: slider-vertical;
}

.place-input-field {
  display: block;
}

.place-picker small {
  color: var(--muted);
  line-height: 1.45;
}

.primary-btn, .secondary-btn, .ghost-btn, .tab {
  min-height: 42px;
  border: 1px solid var(--ink);
  padding: 9px 14px;
  font-weight: 850;
  background: #fff;
  color: var(--ink);
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  background: var(--accent);
  color: #fffdfa;
  box-shadow: 4px 4px 0 var(--ink);
}

.secondary-btn {
  width: 100%;
  margin-top: 12px;
  background: #f4e5bd;
}

.ghost-btn {
  background: transparent;
}

.cropper {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.crop-controls {
  display: grid;
  gap: 8px;
  margin-top: 0;
  max-width: 400px;
}

.crop-controls label {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 400px;
}

.field-label-row > span {
  font-weight: 800;
}

.crop-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: right;
}

.crop-hint.hidden {
  display: none;
}

.share-result {
  min-height: 22px;
  color: var(--accent-2);
  word-break: break-all;
  line-height: 1.45;
}

.setup-panel {
  padding: 22px;
  box-shadow: none;
}

.setup-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.setup-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* 네이티브 호스트에서만 보이는 "혼자하기" 진입점. 설정 화면 최상단. */
.solo-random-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft, rgba(127, 127, 127, 0.06));
}

.solo-random-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 240px;
}

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

.solo-random-copy span {
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.45;
}

/* .primary-btn 은 기본이 width:100% + margin-top — 이 줄에서는 옆으로 붙어야 한다. */
.solo-random-bar .primary-btn {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.setup-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.2;
}

.setup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
}

.room-name-btn {
  margin: 0;
  padding: 2px 4px;
  border: 1px dashed transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  max-width: min(200px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.room-name-btn.is-editable {
  border-color: rgba(24, 33, 31, 0.28);
  cursor: pointer;
}

.room-name-btn.is-editable:hover,
.room-name-btn.is-editable:focus-visible {
  border-color: var(--ink);
  outline: none;
  background: rgba(255, 253, 250, 0.85);
}

.room-name-input {
  width: min(200px, 42vw);
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.setup-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 22px;
}

.setup-actions .setup-publish-btn,
.setup-details .setup-actions .setup-publish-btn,
.setup-details .setup-actions .primary-btn {
  flex: 1 1 auto;
  width: auto;
  margin-top: 0;
}

.setup-actions .setup-close-btn {
  flex: 0 0 auto;
  min-width: 72px;
  margin-top: 0;
}

.setup-warning {
  margin: 14px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--gold);
  background: #fff4cf;
  color: #684c0c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  max-width: 52ch;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(280px, 1fr);
  gap: 28px;
  margin-top: 20px;
  align-items: start;
}

.setup-media .secondary-btn {
  margin-top: 12px;
}

.setup-media .field {
  margin-top: 0;
}

.image-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  border: 1px dashed var(--ink);
  background: #efeae0;
  cursor: pointer;
  outline: none;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.image-dropzone:hover,
.image-dropzone:focus-visible {
  border-style: solid;
  box-shadow: 4px 4px 0 rgba(24, 33, 31, 0.16);
}

.image-dropzone.is-dragover {
  border-style: solid;
  border-color: var(--accent-2);
  background: #e9f5f1;
  box-shadow: 4px 4px 0 rgba(24, 116, 107, 0.2);
}

.image-dropzone:not(.is-empty) {
  border-style: solid;
  background: #fff;
  cursor: grab;
}

.image-dropzone:not(.is-empty).is-panning {
  cursor: grabbing;
}

#cropCanvas {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 1;
  background: transparent;
}

.image-drop-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  color: var(--muted);
}

.image-drop-hint strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.image-drop-hint span {
  font-size: 0.92rem;
  line-height: 1.4;
}

.image-dropzone:not(.is-empty) .image-drop-hint {
  display: none;
}

.image-dropzone + .crop-controls {
  margin-top: -2px;
}

.crop-controls.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.setup-details {
  display: grid;
  gap: 4px;
  align-content: start;
  max-width: 420px;
}

.setup-details .primary-btn {
  margin-top: 22px;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--ink);
  background: var(--gold);
  box-shadow: 6px 6px 0 var(--ink);
}

.dashboard-actions > div:first-child,
.dashboard-status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}

.dashboard-status .eyebrow {
  margin: 0;
  flex: 0 0 auto;
}

.dashboard-actions > div > strong,
.dashboard-status strong {
  font-size: 18px;
  line-height: 1.2;
}

.dashboard-action-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: stretch;
  justify-content: end;
}

.dashboard-action-buttons .primary-btn,
.dashboard-action-buttons .secondary-btn {
  width: auto;
  min-width: 0;
  margin-top: 0;
  flex: 0 0 auto;
}

.dashboard-actions .secondary-btn.is-copied,
.room-qr-dialog .secondary-btn.is-copied {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--ink);
}

.play-surface {
  min-width: 0;
}

.hero-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  padding: 14px 18px;
  background: var(--ink);
  color: #fffdfa;
  border: 1px solid var(--ink);
}

.hero-strip .eyebrow {
  margin: 0;
  font-size: 11px;
}

.hero-strip h1, .hero-strip h2, .runner-head h1 {
  margin: 0;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.35;
  letter-spacing: 0;
  font-weight: 750;
}

.hero-strip .hero-lead {
  margin: 6px 0 0;
  font-size: clamp(13px, 1.2vw, 14px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

#roomDashboard .hero-strip {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 18px 22px;
}

#roomDashboard .hero-strip h1,
#roomDashboard .hero-strip h2 {
  margin: 0;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 850;
}

.status-card {
  display: grid;
  align-content: center;
  gap: 6px;
  border-left: 1px solid rgba(255,255,255,.25);
  padding-left: 18px;
}

.dashboard-hero-tools {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.dashboard-hero-tools .status-card {
  width: 190px;
}

.game-guide-trigger {
  display: grid;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(24, 33, 31, .32);
  font-family: Georgia, "Batang", serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.game-guide-trigger:hover {
  background: var(--accent);
  color: #fffdfa;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(24, 33, 31, .32);
}

.game-guide-trigger:focus-visible {
  outline: 3px solid #fffdfa;
  outline-offset: 3px;
}

.status-card span, .timer span {
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.status-card strong, .timer strong {
  font-size: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.tab.active {
  background: var(--accent-2);
  color: #fff;
}

.list-view {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, .7fr);
  gap: 14px;
  margin: 18px 0;
}

.room-grid .results-panel {
  grid-column: 1 / -1;
  margin-top: 0;
}

.room-panel {
  padding: 16px;
  box-shadow: none;
}

.asset-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  margin-top: 14px;
  color: var(--muted);
}

.asset-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--ink);
  filter: blur(10px) saturate(0.7);
  transform: scale(1.12);
  user-select: none;
  pointer-events: none;
}

.asset-preview-thumb {
  flex: none;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #111;
}

.asset-preview.is-placeholder .asset-preview-thumb {
  background: #f0ebe0;
  display: grid;
  place-items: center;
}

.asset-preview.is-placeholder img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 0;
  filter: none;
  transform: none;
  opacity: .72;
}

.user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.user-pill {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 7px 9px;
  font-weight: 800;
  font-size: 13px;
}

.game-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: rgba(255,253,250,.82);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}

.game-row:hover {
  border-color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.game-row:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.game-row img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.game-row h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.game-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.row-status {
  border: 1px solid var(--line);
  background: #efeae0;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  text-align: center;
}

.row-aside {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  align-content: center;
  min-width: 88px;
}

.row-delete-btn {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.row-delete-btn:hover,
.row-delete-btn:focus-visible {
  background: #ffe8df;
  outline: none;
}

.row-status.status-published {
  border-color: var(--accent-2);
  background: rgba(24, 116, 107, 0.12);
  color: var(--accent-2);
}

.row-status.status-archived {
  border-color: var(--line);
  background: #e7e2d8;
  color: var(--muted);
}

.game-row.is-archived {
  opacity: 0.78;
}

.row-status.status-draft {
  border-color: var(--gold);
  background: rgba(217, 159, 43, 0.16);
  color: #8a6410;
}

.row-status.status-unknown {
  border-color: var(--accent);
  background: rgba(201, 71, 44, .08);
  color: var(--accent);
}

.runner {
  padding-top: 24px;
}

.runner-head {
  display: grid;
  grid-template-columns: 160px 1fr 140px;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: var(--ink);
  color: #fffdfa;
}

.back-link {
  color: #fffdfa;
  text-decoration: none;
  font-weight: 850;
}

.timer {
  text-align: right;
}

.game-board-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
  width: 100%;
}

.puzzle-board {
  display: grid;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  background: #111;
  box-shadow: var(--shadow);
  justify-self: stretch;
}

.piece {
  border: 1px solid rgba(255,255,255,.35);
  background-repeat: no-repeat;
  touch-action: manipulation;
}

.piece.selected {
  outline: 4px solid var(--gold);
  outline-offset: -4px;
}

.puzzle-board.puzzle-solved {
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 32px rgba(217, 159, 43, .45),
    var(--shadow);
  animation: puzzle-glow 1.4s ease-in-out infinite alternate;
}

.puzzle-board.puzzle-solved .piece {
  pointer-events: none;
  border-color: transparent;
}

@keyframes puzzle-glow {
  from { filter: saturate(1); }
  to { filter: saturate(1.15) brightness(1.04); }
}

.answer-ready {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 3px rgba(24, 116, 107, .22);
  animation: answer-pulse 1.1s ease-in-out infinite alternate;
}

.answer-wrong {
  border-color: var(--accent) !important;
  animation: answer-shake .45s ease;
}

@keyframes answer-pulse {
  from { box-shadow: 0 0 0 2px rgba(24, 116, 107, .15); }
  to { box-shadow: 0 0 0 4px rgba(24, 116, 107, .28); }
}

@keyframes answer-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Fullscreen Three.js celebration overlay (above native dialogs) */
.celebration-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(24, 33, 31, .55), rgba(24, 33, 31, .78) 70%);
  animation: celebration-fade-in .28s ease-out;
}

.celebration-root--puzzle {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(24, 116, 107, .28), rgba(24, 33, 31, .72) 68%);
}

.celebration-root--clear {
  background:
    radial-gradient(ellipse at 50% 25%, rgba(201, 71, 44, .35), rgba(24, 33, 31, .82) 72%);
}

.celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.celebration-card {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 40px));
  padding: 28px 28px 24px;
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--ink), 0 30px 80px rgba(0, 0, 0, .35);
  text-align: center;
  animation: celebration-card-pop .55s cubic-bezier(.2, 1.2, .35, 1);
}

.celebration-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
}

.celebration-card h2 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  text-shadow: 3px 3px 0 rgba(217, 159, 43, .35);
}

.celebration-root--clear .celebration-card h2 {
  background: linear-gradient(120deg, #c9472c, #d99f2b 55%, #18746b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.celebration-message {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}

.celebration-time {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 2px dashed var(--ink);
  background: #fff6df;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.celebration-time:empty {
  display: none;
}

.celebration-continue {
  width: 100%;
  margin-top: 20px;
  min-height: 48px;
  font-weight: 800;
}

@keyframes celebration-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes celebration-card-pop {
  0% { transform: scale(.72) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.answer-panel {
  padding: 16px;
}

.answer-panel img,
.hint-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.hint-preview {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px dashed var(--ink);
  background: #efeae0;
  overflow: hidden;
}

.hint-preview.is-revealed {
  border-style: solid;
  background: #fff;
}

.hint-preview-lock {
  padding: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.hint-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.piece-hint-wrong {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px rgba(201, 71, 44, 0.35);
}

.score-grid {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.score-grid span {
  color: var(--muted);
}

.offline {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  background: #ffe8df;
  color: #7b210e;
  font-weight: 800;
}

.results-panel {
  margin-top: 20px;
  padding: 16px;
  box-shadow: none;
}

.results-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.result-row span,
.result-row time { color: var(--muted); }

.game-dialog {
  width: 100vw;
  max-width: none;
  /* iOS Safari에서 100vh는 하단 툴바가 숨은 상태 기준이라 버튼이 가려진다 — dvh로 보정 */
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}

.game-dialog::backdrop { background: var(--ink); }

.game-dialog-frame {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(90deg, rgba(24,33,31,.07) 1px, transparent 1px),
    linear-gradient(rgba(24,33,31,.06) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
}

.game-dialog-column {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.game-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
  padding: 18px 22px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fffdfa;
}

.game-dialog-head h2 { margin: 4px 0 0; font-size: clamp(22px, 3vw, 38px); }
.game-dialog-head .eyebrow { margin: 0; }
.game-clock { display: grid; text-align: right; }
.game-clock span { color: rgba(255,255,255,.7); font-size: 12px; }
.game-clock strong { color: var(--gold); font-size: 30px; }
.quit-game-btn { width: 100%; margin-top: 12px; }

.game-dialog-actions {
  margin: 16px 0 0;
}

.game-dialog.is-compact-play .game-dialog-actions {
  display: none;
}

@media (max-width: 960px) {
  .game-dialog.is-compact-play .game-dialog-head {
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .game-dialog.is-compact-play .game-dialog-head h2 {
    display: none;
  }

  .game-dialog.is-compact-play .game-clock {
    display: none;
  }

  .game-dialog.is-compact-play .game-dialog-head .eyebrow {
    font-size: 13px;
  }

  .game-dialog.is-compact-play .game-clock strong {
    font-size: 22px;
  }

  .game-dialog.is-compact-play .game-board-wrap {
    margin-top: 0;
    gap: 10px;
  }
}

.setup-details .setup-publish-btn {
  margin-top: 22px;
}

#gameSetupSlot {
  margin-top: 4px;
}

#gameStageSlot {
  width: 100%;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255,253,250,.65);
}

.hidden { display: none !important; }

.notice-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.notice-dialog::backdrop {
  background: rgba(12, 18, 17, .78);
  backdrop-filter: blur(5px);
}

.notice-dialog[open] .notice-dialog-frame {
  animation: dialog-in .18s ease-out;
}

.notice-dialog-frame {
  display: grid;
  gap: 12px;
  padding: 28px 26px 24px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--gold);
  text-align: center;
}

.notice-dialog-frame .eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.notice-dialog-frame h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
}

.notice-dialog-frame .dialog-message {
  margin: 0;
  color: var(--muted);
}

.notice-dialog-frame .dialog-encourage {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--ink);
  background: rgba(255, 253, 250, .7);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.notice-dialog-frame .dialog-actions {
  margin-top: 8px;
  display: grid;
}

.ready-dialog {
  width: min(400px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.ready-dialog::backdrop {
  background: rgba(12, 18, 17, .78);
  backdrop-filter: blur(5px);
}

.ready-dialog[open] .ready-dialog-frame {
  animation: dialog-in .18s ease-out;
}

.ready-dialog-frame {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 28px 26px 24px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--gold);
  text-align: center;
}

.ready-dialog-frame .eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.ready-dialog-frame h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 26px);
}

.ready-thumb {
  width: 96px;
  height: 96px;
  border: 2px solid var(--ink);
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.ready-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ready-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(12, 18, 17, .15);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: ready-spin .9s linear infinite;
}

@keyframes ready-spin {
  to { transform: rotate(360deg); }
}

.ready-status {
  margin: 0;
  color: var(--muted);
  min-height: 1.5em;
}

.ready-dialog[data-stage="ready"] .ready-status {
  color: var(--ink);
  font-weight: 600;
}

.ready-dialog[data-stage="failed"] .ready-status {
  color: var(--danger, #a62929);
  font-weight: 600;
}

.ready-name-field {
  width: 100%;
  text-align: left;
}

.ready-actions {
  width: 100%;
  display: grid;
  gap: 8px;
}

.ready-actions .primary-btn,
.ready-actions .ghost-btn {
  width: 100%;
  margin-top: 0;
}

.room-qr-dialog {
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.room-qr-dialog::backdrop {
  background: rgba(12, 18, 17, .78);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.room-qr-dialog[open] .room-qr-dialog-frame {
  animation: dialog-in .18s ease-out;
}

.room-qr-dialog-frame {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 24px 22px 20px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--gold);
  text-align: center;
}

.room-qr-dialog-frame .eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.room-qr-dialog-frame h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 24px);
}

.room-qr-dialog-desc {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.room-qr-dialog canvas {
  display: block;
  width: min(240px, calc(100vw - 76px));
  height: min(240px, calc(100vw - 76px));
  pointer-events: none;
}

.room-qr-dialog-actions {
  width: 100%;
  display: grid;
  gap: 8px;
}

.room-qr-dialog-actions .secondary-btn,
.room-qr-dialog-actions .ghost-btn {
  width: 100%;
  margin-top: 0;
}

.confirm-dialog {
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.confirm-dialog::backdrop {
  background: rgba(12, 18, 17, .78);
  backdrop-filter: blur(5px);
}

.confirm-dialog[open] .confirm-dialog-frame {
  animation: dialog-in .18s ease-out;
}

.confirm-dialog-frame {
  display: grid;
  gap: 14px;
  padding: 24px 22px 20px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--gold);
}

.confirm-dialog-frame h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 24px);
}

.confirm-dialog-message {
  margin: 0;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.5;
  white-space: pre-line;
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.confirm-dialog-actions .ghost-btn,
.confirm-dialog-actions .primary-btn {
  width: 100%;
  margin-top: 0;
}

.place-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.place-dialog::backdrop {
  background: rgba(12, 18, 17, .78);
  backdrop-filter: blur(5px);
}

.place-dialog[open] .place-dialog-frame {
  animation: dialog-in .18s ease-out;
}

.place-dialog-frame {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 12px 12px 0 var(--gold);
  overflow: hidden;
}

.place-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--ink);
  background: #fffdfa;
}

.place-dialog-head h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1;
}

.place-dialog-head .eyebrow {
  margin: 0;
}

.dialog-close {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.place-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr);
  min-height: 500px;
}

.place-map-panel {
  position: relative;
  min-height: 500px;
  border-right: 1px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(24,33,31,.07) 1px, transparent 1px),
    linear-gradient(rgba(24,33,31,.07) 1px, transparent 1px),
    #e8e2d6;
  background-size: 32px 32px;
}

.place-map-panel iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: 0;
}

.place-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.place-map-empty strong {
  color: var(--ink);
  font-size: 22px;
}

.place-entry-panel {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: #fffdfa;
}

.place-entry-panel h3 {
  margin: 12px 0 8px;
  font-size: 22px;
  line-height: 1.15;
}

.place-entry-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--gold);
  font-weight: 900;
}

.dialog-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--accent) !important;
  font-weight: 800;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.dialog-actions .primary-btn {
  margin-top: 0;
}

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

@media (max-width: 980px) {
  .workspace, .game-board-wrap, .hero-strip, .runner-head, .room-grid, .setup-layout {
    grid-template-columns: 1fr;
  }

  .creator-panel {
    position: static;
  }

  .status-card {
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.25);
    padding-left: 0;
    padding-top: 14px;
  }

  .dashboard-hero-tools {
    justify-content: space-between;
  }

  .dashboard-hero-tools .status-card {
    width: auto;
    flex: 1;
  }

  .place-dialog {
    overflow: auto;
  }

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

  .place-map-panel,
  .place-map-panel iframe {
    min-height: 360px;
  }

  .place-map-panel {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .dashboard-actions {
    grid-template-columns: 1fr;
  }
  .dashboard-action-buttons {
    flex-wrap: nowrap;
    justify-content: stretch;
    gap: 8px;
  }
  .dashboard-action-buttons .primary-btn,
  .dashboard-action-buttons .secondary-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }
  .game-dialog { overflow: auto; }
}

@media (max-width: 620px) {
  .shell { padding: 10px; }
  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    min-height: 0;
  }
  .brand > span:not(.brand-mark) {
    display: none;
  }
  body[data-app-view="room"] .brand-copy,
  body[data-app-view="access"] .brand-copy {
    display: block !important;
    min-width: 0;
  }
  body[data-app-view="room"] .brand-copy > strong,
  body[data-app-view="access"] .brand-copy > strong {
    overflow: hidden;
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-app-view="room"] .brand-room-tagline,
  body[data-app-view="access"] .brand-room-tagline {
    overflow: hidden;
    max-width: 142px;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body[data-app-view="room"] .brand-room-desktop,
  body[data-app-view="access"] .brand-room-desktop {
    display: none;
  }
  body[data-app-view="room"] .brand-room-mobile,
  body[data-app-view="access"] .brand-room-mobile {
    display: inline;
  }
  .identity {
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
  }
  .tabs { align-items: stretch; flex-direction: column; }
  .identity-name { width: min(180px, 52vw); }
  .game-row { grid-template-columns: 64px 1fr; }
  .row-aside { grid-column: 1 / -1; justify-self: start; grid-auto-flow: column; grid-template-columns: auto auto; }
  .place-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .place-dialog-head, .place-entry-panel { padding: 18px; }
  .place-map-panel, .place-map-panel iframe { min-height: 280px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 1fr; gap: 4px; }
  .game-dialog-frame { padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .game-dialog-head { align-items: flex-start; padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .library-live.is-active i, .library-live.is-pending i { animation: none; }
  .library-row, .game-detail-create-btn, .game-detail-share { transition: none; }
  .game-detail.is-swapping .game-detail-media > *,
  .game-detail.is-swapping .game-detail-info,
  .game-detail.is-swapping .game-detail-steps { animation: none; }
}

body.realtime-open {
  overflow: hidden;
}

@media (max-width: 360px) {
  body[data-app-view="room"] .identity-name,
  body[data-app-view="access"] .identity-name {
    width: 80px;
  }
}

.game-guide-dialog {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.game-guide-dialog, .game-guide-frame { scrollbar-width: none; -ms-overflow-style: none; }
.game-guide-dialog::-webkit-scrollbar, .game-guide-frame::-webkit-scrollbar { display: none; }
.game-guide-dialog::backdrop { background: rgba(20, 47, 61, .72); backdrop-filter: blur(3px); }
.game-guide-frame { display: flex; flex-direction: column; gap: 16px; width: min(960px, 100%); height: 100%; margin: 0 auto; overflow: auto; padding: 18px; box-sizing: border-box; }
.game-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-guide-head h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.game-guide-head .eyebrow { margin: 0 0 4px; }
.game-guide-hero { flex: 0 0 auto; overflow: hidden; border: 2px solid var(--ink); background: var(--ink); aspect-ratio: 16 / 9; max-height: 34vh; width: 100%; box-shadow: 5px 5px 0 var(--gold); }
.game-guide-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-guide-intro { margin: 0; font-size: clamp(16px, 2.3vw, 20px); font-weight: 750; line-height: 1.5; }
.game-guide-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0; }
.game-guide-facts > div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); background: #fffdfa; }
.game-guide-facts dt { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.game-guide-facts dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.game-guide-facts > .is-wide { grid-column: 1 / -1; }
.game-guide-text { display: grid; gap: 12px; }
.game-guide-section { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); background: rgba(255, 253, 250, .8); }
.game-guide-section h3, .game-guide-section p { margin: 0; }
.game-guide-section h3 { font-size: 17px; }
.game-guide-section p { color: var(--muted); line-height: 1.55; }
.game-guide-section ol, .game-guide-section ul { display: grid; gap: 8px; margin: 0; padding-left: 1.5rem; }
.game-guide-section li { padding: 8px 10px; background: #eef5f1; line-height: 1.45; }
.game-guide-section li strong, .game-guide-section li span { display: block; }
.game-guide-section li span { color: var(--muted); margin-top: 2px; }

.realtime-stage {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: #071018;
  color: #f4e7c8;
  font-family: Impact, "Arial Black", "Malgun Gothic", sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.realtime-stage.is-open {
  display: block;
}

.realtime-play-slot {
  position: absolute;
  inset: 0;
}

.realtime-chrome {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.rt-lobby,
.rt-count,
.rt-gone,
.rt-rotate {
  pointer-events: auto;
}

.rt-lobby {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(7, 16, 24, .72);
}

.rt-lobby.hidden,
.rt-count.hidden,
.rt-gone.hidden,
.rt-rotate.hidden { display: none; }

/* Direct Play field guide */
.site-about-trigger {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Georgia, "Batang", serif;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.site-about-trigger:hover,
.site-about-trigger[aria-current="page"] {
  background: var(--accent);
  color: #fffdfa;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.site-about-trigger:focus-visible,
.about-page a:focus-visible,
.about-page button:focus-visible,
.about-page summary:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.site-about-view {
  padding-top: 22px;
}

/* Language switch dropdown */
.lang-switch-wrap {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 11px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.lang-switch-btn:hover {
  background: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.lang-switch-btn:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 108px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--ink);
}

.lang-menu.hidden {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  outline: none;
}

.lang-option:hover,
.lang-option:focus-visible {
  background: #ede6d8;
}

.lang-option.is-active {
  color: var(--accent);
  font-weight: 900;
}

.lang-option.is-active::after {
  content: "✓";
  margin-left: 8px;
  font-size: 0.82rem;
}

/* 공통 피드백 위젯: 기본 비표시 (상단 빈 공간 3초 내 5회 클릭 시 잠금 해제), 한글 모드에서만 표시 */
[data-common-feedback-widget] {
  display: none !important;
}

html[lang="ko"] body.is-feedback-unlocked [data-common-feedback-widget] {
  display: block !important;
}

html:not([lang="ko"]) [data-common-feedback-widget],
[lang="en"] [data-common-feedback-widget] {
  display: none !important;
}

.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(24, 33, 31, 0.94);
  color: #fffdfa;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2147483002;
  white-space: nowrap;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.about-page {
  overflow: hidden;
  border: 1px solid var(--ink);
  background: #f4eddf;
  box-shadow: 8px 8px 0 rgba(24, 33, 31, .18);
}

.about-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 22px;
  border-bottom: 1px solid var(--ink);
  background: #fffdfa;
}

.about-back-link,
.about-text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.about-back-link:hover,
.about-text-link:hover,
.about-nav-links a:hover {
  color: var(--accent);
}

.about-nav-links {
  display: flex;
  gap: 22px;
}

.about-nav-links a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-underline-offset: 4px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(460px, 1.15fr);
  min-height: 650px;
  border-bottom: 1px solid var(--ink);
}

.about-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 6vw, 86px);
  background: var(--gold);
}

.about-hero-copy::after {
  position: absolute;
  right: -34px;
  bottom: 54px;
  z-index: 3;
  width: 68px;
  height: 68px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 5px 5px 0 var(--ink);
  content: "PLAY";
  display: grid;
  place-items: center;
  color: #fffdfa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  transform: rotate(-10deg);
}

.about-issue {
  margin: 0 0 26px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.about-hero h1 {
  margin: 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: clamp(58px, 7.2vw, 112px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .88;
}

.about-hero h1 em {
  color: var(--accent);
  font-style: italic;
  white-space: nowrap;
}

.about-hero-lead {
  max-width: 540px;
  margin: 32px 0 0;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 750;
  line-height: 1.5;
}

.about-hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 34px;
}

.about-primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fffdfa;
  box-shadow: 5px 5px 0 #fffdfa;
  font-weight: 900;
  text-decoration: none;
}

.about-primary-link:hover {
  background: var(--accent-2);
}

.about-growing-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 34px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(24, 33, 31, .4);
  font-size: 13px;
  font-weight: 800;
}

.about-growing-note span {
  font-size: 24px;
  line-height: 1;
}

.about-hero-collage {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  grid-template-rows: 1.15fr .85fr;
  min-width: 0;
  background: var(--ink);
}

.about-hero-collage figure {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-left: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.about-hero-collage figure:first-child {
  grid-row: 1 / 3;
}

.about-hero-collage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.about-hero-collage figure:hover img {
  transform: scale(1.025);
}

.about-hero-collage figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  background: #fffdfa;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.about-manifesto,
.about-games,
.about-direct,
.about-notices {
  padding: clamp(44px, 7vw, 96px);
  border-bottom: 1px solid var(--ink);
}

.about-manifesto {
  background: #fffdfa;
}

.about-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
  font-size: 11px;
  letter-spacing: .14em;
}

.about-section-label span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  font-weight: 900;
  letter-spacing: 0;
}

.about-section-label strong {
  font-weight: 900;
}

.about-manifesto-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) 1.2fr;
  gap: clamp(38px, 8vw, 130px);
  align-items: start;
}

.about-manifesto-lead {
  margin: 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.about-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
  list-style: none;
}

.about-steps li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.about-steps li > span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 24px;
  font-style: italic;
}

.about-steps strong {
  display: block;
  font-size: 19px;
}

.about-steps p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.about-games {
  background: #e8dfcf;
}

.about-section-heading {
  display: grid;
  grid-template-columns: .65fr 1.35fr;
  gap: clamp(32px, 7vw, 100px);
  margin-bottom: 44px;
}

.about-section-heading .about-section-label {
  margin-bottom: 0;
}

.about-section-heading h2,
.about-direct h2 {
  margin: 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: clamp(38px, 5vw, 70px);
  letter-spacing: -.055em;
  line-height: 1;
}

.about-section-heading > div > p {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.about-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.about-game-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border: 1px solid var(--ink);
  background: #fffdfa;
  box-shadow: 6px 6px 0 var(--ink);
}

.about-game-card:nth-child(3n + 2) {
  transform: translateY(18px);
}

.about-game-media {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

.about-game-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.about-game-card:hover .about-game-media img {
  transform: scale(1.02);
}

.about-game-number {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 900;
}

.about-game-body {
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3vw, 28px);
}

.about-game-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.about-game-heading .eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.about-game-heading h3 {
  margin: 0;
  font-family: "Book Antiqua", "Batang", serif;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.about-game-status {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--ink);
  background: var(--accent-2);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

.about-game-status.is-coming {
  background: var(--line);
  color: var(--ink);
}

.about-game-pitch {
  flex: 1;
  margin: 18px 0;
  color: var(--muted);
  line-height: 1.6;
}

.about-game-facts {
  display: flex;
  gap: 24px;
  margin: 0 0 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.about-game-facts li {
  display: grid;
  gap: 3px;
}

.about-game-facts span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.about-game-facts strong {
  font-size: 13px;
}

.about-game-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.about-game-actions .primary-btn,
.about-game-actions .ghost-btn {
  width: auto;
  min-width: 0;
  min-height: 44px;
  margin: 0;
}

.about-game-actions .primary-btn {
  box-shadow: 3px 3px 0 var(--ink);
}

.about-next-game {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 56px;
  padding: 26px;
  border: 1px dashed var(--ink);
  background: rgba(255, 253, 250, .42);
}

.about-next-game > span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 34px;
  font-style: italic;
  font-weight: 900;
}

.about-next-game strong {
  font-size: 20px;
}

.about-next-game p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.about-direct {
  background: var(--ink);
  color: #fffdfa;
}

.about-direct .about-section-label span {
  color: var(--ink);
}

.about-direct-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(40px, 8vw, 130px);
}

.about-direct h2 {
  color: var(--gold);
}

.about-direct-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.about-direct-copy {
  align-self: end;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 253, 250, .25);
}

.about-direct-copy p {
  margin: 0;
  color: rgba(255, 253, 250, .8);
  font-size: 16px;
  line-height: 1.75;
}

.about-direct-copy p + p {
  margin-top: 18px;
  color: var(--gold);
  font-weight: 800;
}

.about-notices {
  background: #fffdfa;
}

.about-notice-list {
  border-top: 2px solid var(--ink);
}

.about-notice-list details {
  border-bottom: 1px solid var(--ink);
}

.about-notice-list summary {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 12px 4px;
  cursor: pointer;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 850;
  list-style: none;
}

.about-notice-list summary::-webkit-details-marker {
  display: none;
}

.about-notice-list summary::after {
  content: "+";
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.about-notice-list details[open] summary::after {
  content: "−";
}

.about-notice-list summary span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 16px;
  font-style: italic;
}

.about-notice-list details > div {
  max-width: 880px;
  padding: 0 4px 24px 62px;
}

.about-notice-list details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.about-notice-list details p + p {
  margin-top: 10px;
}

.about-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 30px;
  align-items: center;
  padding: 28px clamp(24px, 5vw, 68px);
  background: var(--gold);
}

.about-footer > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.about-footer .brand-mark {
  background: transparent;
  box-shadow: 4px 4px 0 var(--ink);
}

.about-footer p,
.about-footer small {
  margin: 0;
}

.about-footer p {
  font-weight: 750;
}

.about-footer small {
  max-width: 390px;
  color: rgba(24, 33, 31, .72);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

@media (max-width: 1040px) {
  .about-hero {
    grid-template-columns: 1fr;
  }

  .about-hero-copy {
    min-height: 560px;
  }

  .about-hero-copy::after {
    right: 38px;
    bottom: -34px;
  }

  .about-hero-collage {
    min-height: 520px;
    border-top: 1px solid var(--ink);
  }

  .about-game-grid {
    grid-template-columns: 1fr;
  }

  .about-game-card:nth-child(3n + 2) {
    transform: none;
  }

  .about-game-card {
    grid-template-columns: minmax(280px, .9fr) 1.1fr;
    grid-template-rows: 1fr;
  }

  .about-game-media {
    height: 100%;
    border-right: 1px solid var(--ink);
    border-bottom: 0;
    aspect-ratio: auto;
  }

  .about-footer {
    grid-template-columns: auto 1fr;
  }

  .about-footer small {
    grid-column: 1 / -1;
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .site-about-view {
    padding-top: 10px;
  }

  .about-page {
    box-shadow: 4px 4px 0 rgba(24, 33, 31, .18);
  }

  .about-page-nav {
    min-height: 48px;
    padding: 0 14px;
  }

  .about-nav-links {
    gap: 12px;
  }

  .about-hero-copy {
    min-height: 520px;
    padding: 38px 24px 52px;
  }

  .about-hero-copy::after {
    right: 22px;
  }

  .about-hero h1 {
    font-size: clamp(54px, 18vw, 82px);
  }

  .about-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .about-text-link {
    align-self: flex-start;
  }

  .about-hero-collage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    min-height: 430px;
  }

  .about-hero-collage figure:first-child {
    grid-row: auto;
    grid-column: 1 / 3;
  }

  .about-manifesto,
  .about-games,
  .about-direct,
  .about-notices {
    padding: 48px 22px;
  }

  .about-manifesto-grid,
  .about-section-heading,
  .about-direct-grid {
    grid-template-columns: 1fr;
  }

  .about-section-heading {
    gap: 28px;
  }

  .about-game-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .about-game-media {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    aspect-ratio: 16 / 9;
  }

  .about-direct-copy {
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 253, 250, .25);
    border-left: 0;
  }

  .about-next-game {
    grid-template-columns: 1fr;
  }

  .about-notice-list summary {
    grid-template-columns: 40px 1fr auto;
  }

  .about-notice-list details > div {
    padding-left: 44px;
  }

  .about-footer {
    grid-template-columns: 1fr;
  }

  .about-footer p,
  .about-footer small {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .identity {
    gap: 8px;
  }

  .identity-name {
    width: min(96px, 28vw);
  }

  .name-hint {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-about-trigger {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .lang-switch-btn {
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.78rem;
  }

  .about-nav-links a:first-child {
    display: none;
  }

  .about-game-actions {
    grid-template-columns: 1fr;
  }
}

.rt-kicker {
  margin: 0;
  letter-spacing: .22em;
  color: #ffc53d;
}

.rt-lobby h2,
.rt-gone h2 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
}

#realtimeRoster {
  margin: 0;
  padding: 12px 16px;
  width: min(420px, 100%);
  list-style: none;
  border: 3px solid #f4e7c8;
  background: #08111c;
  box-shadow: 7px 7px 0 #ff4d2e;
}

#realtimeRoster li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 22px;
}

#realtimeLobbyHint {
  margin: 0;
  opacity: .75;
}

.rt-lobby-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.rt-lobby-actions button,
.rt-gone button,
.rt-leave {
  min-height: 48px;
  padding: 0 18px;
  border: 3px solid #f4e7c8;
  background: #ff4d2e;
  color: #fff8ef;
  font: 800 18px Impact, "Arial Black", sans-serif;
  letter-spacing: .06em;
}

.rt-lobby-actions button.is-on {
  background: #c6ff3a;
  color: #142200;
}

#realtimeStartBtn {
  background: #ffc53d;
  color: #08111c;
}

#realtimeReconnectBtn {
  background: #62d7ff;
  color: #08111c;
}

.rt-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(72px, 18vw, 160px);
  color: #ffc53d;
  text-shadow: 6px 6px 0 #ff4d2e;
}

.rt-gone {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: rgba(7, 16, 24, .86);
}

.rt-leave {
  position: absolute;
  top: 12px;
  right: 12px;
  pointer-events: auto;
  min-height: 40px;
  background: transparent;
  z-index: 9;
}

/* Moderated games render their own header and status badge in this corner. */
.moderated-open .rt-leave {
  top: auto;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #ff4d2e;
}

.rt-rotate {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: #08111c;
  font-size: 28px;
  z-index: 12;
}

@media (orientation: portrait) and (max-width: 900px) {
  .realtime-stage.is-open .rt-rotate { display: grid; }
}
