:root {
  color-scheme: light;
  --bg: #eaeded;
  --panel: #ffffff;
  --panel-strong: #232f3e;
  --text: #0f1111;
  --muted: #565959;
  --line: #d5d9d9;
  --primary: #ffd814;
  --primary-dark: #f7ca00;
  --accent: #007185;
  --nav: #131921;
  --nav-2: #232f3e;
  --danger: #b12704;
  --warn: #c45500;
  --shadow: 0 2px 8px rgba(15, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid #fcd200;
  border-radius: 20px;
  background: var(--primary);
  color: #0f1111;
  cursor: pointer;
  min-height: 38px;
  padding: 0 16px;
  touch-action: manipulation;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid #888c8c;
}

button.secondary:hover {
  background: #f7fafa;
}

button.danger {
  background: #fff;
  border-color: #b12704;
  color: #b12704;
}

button.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: var(--nav);
  color: #fff;
  border-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 34px;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -1px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.brand p,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar .brand p,
.topbar .muted {
  color: #d5d9d9;
}

.searchbar {
  display: grid;
  grid-template-columns: 86px minmax(180px, 1fr) 96px;
  flex: 1 1 460px;
  max-width: 760px;
  min-width: 260px;
}

.searchbar select,
.searchbar input,
.searchbar button {
  border-radius: 0;
  min-height: 40px;
}

.searchbar select {
  border-radius: 5px 0 0 5px;
  background: #f3f3f3;
  color: #111;
  border-color: #cdcdcd;
}

.searchbar input {
  border-left: 0;
  border-right: 0;
  font-size: 15px;
}

.searchbar .search-button {
  border-radius: 0 5px 5px 0;
  background: #febd69;
  border-color: #febd69;
  color: #111;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar .top-actions {
  flex: 0 0 auto;
}

.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.online-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #31c46c;
  box-shadow: 0 0 0 3px rgba(49, 196, 108, 0.18);
}

.topbar .top-actions button {
  min-height: 36px;
  border-radius: 3px;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 700;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.topbar .theme-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 3px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.82);
}

.topbar .theme-toggle button.active {
  background: #fff;
  color: #111827;
}

.content {
  width: min(1180px, calc(100vw - 32px));
  margin: 14px auto 28px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: none;
  padding: 26px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.error {
  color: var(--danger);
  min-height: 20px;
}

.tabs {
  display: flex;
  gap: 0;
  margin: -18px calc((100vw - min(1180px, calc(100vw - 32px))) / -2) 18px;
  padding: 0 clamp(16px, 4vw, 48px);
  flex-wrap: wrap;
  background: var(--nav-2);
}

.tabs button {
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 0;
  min-height: 40px;
}

.tabs button.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.game-card {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.product-media {
  display: grid;
  place-items: center;
  min-height: 128px;
  background: #f7f7f7;
  padding: 10px;
}

.game-card img,
.product-media img {
  width: 100%;
  max-width: 260px;
  height: 108px;
  object-fit: contain;
  display: block;
}

.product-body {
  display: grid;
  gap: 4px;
  padding: 10px 12px 4px;
}

.sponsored,
.sku {
  color: #565959;
  font-size: 11px;
}

.game-card h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500;
}

.product-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 0;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffa41c;
  font-size: 14px;
}

.rating a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.rating a:hover {
  color: #c45500;
  text-decoration: underline;
}

.price {
  color: #b12704;
  font-size: 20px;
  line-height: 1.1;
}

.delivery {
  margin: 0;
  color: #0f1111;
  font-size: 12px;
}

.coupon {
  justify-self: start;
  background: #7fda69;
  color: #0f1111;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 2px;
}

.win-records {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f2;
  font-size: 12px;
}

.win-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.win-list span {
  border: 1px solid #d5d9d9;
  border-radius: 3px;
  padding: 3px 6px;
  background: #f7fafa;
  color: #0f1111;
}

.game-actions {
  position: static;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 7px;
  background: #fff;
  opacity: 1;
  padding: 8px 12px 10px;
}

.lives-picker {
  display: grid;
  grid-template-columns: auto 74px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: #565959;
  font-size: 13px;
  white-space: nowrap;
}

.lives-picker select {
  min-height: 38px;
  padding: 0 8px;
}

.game-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 9px;
}

.quiz-create-options {
  flex: 2 1 520px;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  min-width: 0;
  max-height: 290px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  background: #f8f9f9;
}

.quiz-setting {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.quiz-setting input,
.quiz-setting select {
  width: 100%;
  min-height: 38px;
}

.quiz-category-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 6px 10px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
}

.quiz-category-picker legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.quiz-category {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
}

.quiz-category input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
}

.quiz-category span {
  overflow-wrap: anywhere;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8f9f9;
  color: var(--text);
  font-size: 13px;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.all-categories {
  font-weight: 700;
}

.meta-pill {
  display: inline-flex;
  justify-content: center;
  border: 1px solid #d5d9d9;
  background: #f7fafa;
  padding: 0 12px;
}

[data-theme="game"] {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-strong: #1f3a5f;
  --text: #172033;
  --muted: #64748b;
  --line: #d8e1ec;
  --primary: #2f80ed;
  --primary-dark: #1d6fd7;
  --accent: #16a085;
  --nav: #18324f;
  --nav-2: #ffffff;
  --danger: #d64545;
  --warn: #d97706;
  --shadow: 0 10px 28px rgba(24, 50, 79, 0.12);
}

[data-theme="game"] body,
body[data-theme="game"] {
  background:
    linear-gradient(180deg, rgba(47, 128, 237, 0.08), rgba(238, 243, 248, 0) 260px),
    var(--bg);
}

[data-theme="game"] button {
  border-color: var(--primary);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

[data-theme="game"] button:hover {
  background: var(--primary-dark);
}

[data-theme="game"] button.secondary {
  background: #fff;
  color: var(--primary);
  border-color: rgba(47, 128, 237, 0.45);
}

[data-theme="game"] button.secondary:hover {
  background: #f0f6ff;
}

[data-theme="game"] .topbar {
  background: linear-gradient(135deg, #18324f, #245c8f);
  box-shadow: 0 8px 22px rgba(24, 50, 79, 0.2);
}

[data-theme="game"] .brand-mark {
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #245c8f;
  font-size: 18px;
  letter-spacing: 0;
}

[data-theme="game"] .searchbar select,
[data-theme="game"] .searchbar input,
[data-theme="game"] .searchbar button {
  border-radius: 8px;
}

[data-theme="game"] .searchbar {
  gap: 8px;
}

[data-theme="game"] .searchbar input {
  border: 1px solid transparent;
}

[data-theme="game"] .searchbar .search-button {
  background: #16a085;
  border-color: #16a085;
  color: #fff;
}

[data-theme="game"] .topbar .top-actions button {
  border-radius: 8px;
}

[data-theme="game"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: 8px;
}

[data-theme="game"] .tabs {
  gap: 10px;
  margin-top: 0;
  margin-bottom: 18px;
  padding-top: 12px;
  padding-bottom: 12px;
  background: transparent;
}

[data-theme="game"] .tabs button {
  color: #245c8f;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(24, 50, 79, 0.07);
}

[data-theme="game"] .tabs button.active {
  background: #245c8f;
  border-color: #245c8f;
  color: #fff;
}

[data-theme="game"] .game-card {
  border-radius: 8px;
  border: 1px solid rgba(216, 225, 236, 0.95);
  box-shadow: var(--shadow);
}

[data-theme="game"] .game-lobby-card {
  overflow: hidden;
  background: #fff;
}

[data-theme="game"] .game-cover {
  position: relative;
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 10px;
  background: linear-gradient(135deg, #f8fbff, #e8f2ff);
}

[data-theme="game"] .game-cover img {
  width: 100%;
  max-width: 280px;
  height: 110px;
  object-fit: contain;
}

[data-theme="game"] .game-art {
  width: min(100%, 280px);
  height: 110px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

[data-theme="game"] .idiom-art {
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 12px;
  background: linear-gradient(135deg, #fff7ed, #eef6ff);
}

[data-theme="game"] .idiom-art span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #f2d6ae;
  color: #9a3412;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.12);
}

[data-theme="game"] .ddz-art {
  grid-template-columns: repeat(4, 42px);
  justify-content: center;
  gap: 7px;
  padding: 12px;
  background: radial-gradient(circle at center, #e8fff7, #dcecff);
}

[data-theme="game"] .ddz-art span {
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fbff;
  border: 1px solid #b8c6d8;
  color: #245c8f;
  font-weight: 800;
  box-shadow: 0 10px 16px rgba(36, 92, 143, 0.14);
}

[data-theme="game"] .poker-art {
  background: radial-gradient(circle at center, #1f9d7a 0 42%, #176f5b 43% 68%, #0f3b35 69%);
}

[data-theme="game"] .poker-art .table-line {
  position: absolute;
  width: 70%;
  height: 54%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

[data-theme="game"] .poker-art .chip {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: 4px dashed rgba(255, 255, 255, 0.72);
  z-index: 1;
}

[data-theme="game"] .poker-art .chip-a {
  left: 58px;
  top: 46px;
  background: #d64545;
}

[data-theme="game"] .poker-art .chip-b {
  right: 72px;
  top: 34px;
  background: #2f80ed;
}

[data-theme="game"] .poker-art .chip-c {
  right: 106px;
  bottom: 26px;
  background: #f59e0b;
}

[data-theme="game"] .monopoly-art {
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  padding: 12px;
  background: linear-gradient(135deg, #eef6ff, #f4f0ff);
}

[data-theme="game"] .monopoly-art span {
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #cfdceb;
  box-shadow: inset 0 -4px 0 rgba(36, 92, 143, 0.12);
}

[data-theme="game"] .monopoly-art span.special {
  background: linear-gradient(135deg, #16a085, #2f80ed);
  border-color: transparent;
}

[data-theme="game"] .quiz-art {
  grid-template-columns: 72px 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 7px 10px;
  padding: 12px;
  background: linear-gradient(135deg, #e8fff7, #eaf2ff);
}

[data-theme="game"] .quiz-mark {
  grid-row: 1 / 4;
  display: grid;
  place-items: center;
  width: 68px;
  height: 82px;
  border-radius: 8px;
  background: #16a085;
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(22, 160, 133, 0.22);
}

[data-theme="game"] .quiz-line {
  height: 13px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #cfdceb;
}

[data-theme="game"] .quiz-line.line-two {
  width: 82%;
}

[data-theme="game"] .quiz-line.line-three {
  width: 64%;
}

[data-theme="game"] .gomoku-art {
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;
  padding: 12px;
  background:
    linear-gradient(#c89f68 1px, transparent 1px),
    linear-gradient(90deg, #c89f68 1px, transparent 1px),
    #f8deb4;
  background-size: 22px 22px;
}

[data-theme="game"] .gomoku-art span {
  position: relative;
  border-radius: 4px;
}

[data-theme="game"] .gomoku-art-stone::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.18);
}

[data-theme="game"] .gomoku-art-stone.black::after {
  background: #172033;
}

[data-theme="game"] .gomoku-art-stone.white::after {
  background: #fff;
  border: 1px solid #a7b2c0;
}

[data-theme="game"] .fruit-bell-art {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: #f8fafc;
}

[data-theme="game"] .fruit-art-card,
[data-theme="game"] .fruit-art-bell {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
}

[data-theme="game"] .fruit-art-card.apple { border-color: #d05a4b; background: #fff1f0; }
[data-theme="game"] .fruit-art-card.banana { border-color: #c79313; background: #fff9dd; }
[data-theme="game"] .fruit-art-card.pear { border-color: #579663; background: #effbf1; }

[data-theme="game"] .fruit-art-bell {
  aspect-ratio: 1;
  border-color: #a94414;
  border-radius: 50%;
  background: #ffd814;
  box-shadow: inset 0 -6px 0 rgba(166, 68, 20, 0.24);
}

[data-theme="game"] .quiz-create-options {
  border-radius: 8px;
  background: #f8fbff;
}

.room-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-card-actions button {
  flex: 1 1 130px;
}

.spectator-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.spectator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gomoku-table {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
}

.gomoku-board-panel {
  min-width: 0;
}

.gomoku-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gomoku-board-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.gomoku-board {
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  border: 2px solid #aab7c2;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.gomoku-board td {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(100, 116, 139, 0.42);
}

.gomoku-cell {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #0f1111;
  cursor: pointer;
}

.gomoku-cell:not(:disabled):hover {
  background: rgba(20, 110, 180, 0.16);
}

.gomoku-cell:disabled {
  cursor: default;
  opacity: 1;
}

.gomoku-cell.last {
  box-shadow: inset 0 0 0 2px rgba(215, 80, 50, 0.85);
}

.gomoku-stone {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  line-height: 1;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
}

.gomoku-stone.black {
  color: #0f172a;
}

.gomoku-stone.white {
  color: #f8fafc;
  text-shadow:
    -1px -1px 0 #334155,
    1px -1px 0 #334155,
    -1px 1px 0 #334155,
    1px 1px 0 #334155;
}

.gomoku-side {
  min-width: 0;
}

.gomoku-color-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.gomoku-color-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f8f9f9;
}

.fruit-bell-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 14px;
}

.fruit-bell-board,
.fruit-bell-side {
  min-width: 0;
}

.fruit-bell-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.fruit-bell-play-area {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #d5dce7;
  border-radius: 6px;
  background: #f8fafc;
}

.fruit-bell-bell {
  display: grid;
  place-items: center;
  gap: 2px;
  width: 116px;
  height: 116px;
  padding: 10px;
  border: 4px solid #a94414;
  border-radius: 50%;
  background: #ffd814;
  color: #3b1d0a;
  box-shadow: inset 0 -8px 0 rgba(166, 68, 20, 0.24), 0 5px 0 #a94414;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.fruit-bell-bell:not(:disabled):hover,
.fruit-bell-bell.active {
  background: #ffcb38;
  transform: translateY(-1px);
}

.fruit-bell-bell:disabled {
  border-color: #9ca3af;
  background: #e5e7eb;
  box-shadow: inset 0 -6px 0 rgba(71, 85, 105, 0.14), 0 4px 0 #9ca3af;
  color: #475569;
  opacity: 1;
}

.fruit-bell-bell-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 22px 22px 8px 8px;
  font-size: 22px;
  line-height: 1;
}

.fruit-bell-bell-note {
  margin: 0;
  text-align: center;
}

.fruit-bell-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  width: 100%;
  gap: 9px;
}

.fruit-bell-player {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.fruit-bell-player.me {
  border-color: #f08804;
  background: #fff8e8;
}

.fruit-bell-player.current {
  box-shadow: inset 0 0 0 2px #007185;
}

.fruit-bell-player.finished {
  opacity: 0.72;
}

.fruit-bell-player-head,
.fruit-bell-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.fruit-bell-hand-count {
  color: #b12704;
  font-size: 15px;
  font-weight: 800;
}

.fruit-bell-revealed {
  display: flex;
  flex-wrap: wrap;
  min-height: 50px;
  gap: 6px;
  align-items: center;
}

.fruit-bell-card {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.fruit-bell-card.apple { border-color: #d05a4b; background: #fff1f0; }
.fruit-bell-card.banana { border-color: #c79313; background: #fff9dd; }
.fruit-bell-card.pear { border-color: #579663; background: #effbf1; }
.fruit-bell-card.strawberry { border-color: #b54162; background: #fff0f5; }
.fruit-bell-card.wild { border-color: #6b5bb8; background: #f4f1ff; }
.fruit-bell-card.bell { border-color: #b7791f; background: #fff7dd; }
.fruit-bell-card.reverse { border-color: #007185; background: #e6f7f8; }

.fruit-bell-empty {
  color: var(--muted);
  font-size: 12px;
}

.fruit-bell-flip {
  width: 100%;
}

.fruit-bell-result {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: center;
}

.fruit-bell-result.correct { border-color: #86efac; background: #f0fdf4; color: #166534; }
.fruit-bell-result.wrong { border-color: #fbbf24; background: #fffbeb; color: #92400e; }

.fruit-bell-status-list {
  display: grid;
  gap: 7px;
}

.fruit-bell-status-row {
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.fruit-bell-status-row.me {
  background: #fff8e8;
}

.fruit-bell-log-panel {
  grid-column: 1 / -1;
}

.twenty-four-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 14px;
}

.twenty-four-board,
.twenty-four-score-panel {
  min-width: 0;
}

.twenty-four-head {
  align-items: start;
  gap: 12px;
}

.twenty-four-workspace {
  position: relative;
  min-height: 250px;
  margin: 12px 0;
  padding: 18px;
  overflow: visible;
  border: 1px solid #d5dce7;
  border-radius: 6px;
  background: #f8fafc;
}

.twenty-four-workspace-note {
  margin: 0 0 12px;
  text-align: center;
}

.twenty-four-tree-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 16px 4px 28px;
}

.twenty-four-tree-link {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
}

.twenty-four-tree-item {
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
}

.twenty-four-tree-item:active {
  cursor: grabbing;
}

.twenty-four-number-card {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid #2563eb;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 26px;
  font-weight: 800;
}

.twenty-four-group-card {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 8px;
  border: 2px solid #0f766e;
  border-radius: 6px;
  background: #f0fdfa;
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
}

.twenty-four-group-result {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid #99d5cd;
  color: #0f766e;
  font-size: 16px;
}

.twenty-four-tree-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.twenty-four-tree-leaf,
.twenty-four-group-bracket {
  display: inline-grid;
  min-width: 18px;
  place-items: center;
}

.twenty-four-group-operator {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
}

.twenty-four-operation-slot {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
}

.twenty-four-operator-input {
  width: 100%;
  height: 44px;
  padding: 7px;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.twenty-four-operator-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: #2563eb;
}

.twenty-four-operation-picker {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 50%;
  display: grid;
  gap: 8px;
  width: 230px;
  padding: 10px;
  transform: translateX(-50%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.twenty-four-operation-options,
.twenty-four-picker-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.twenty-four-operation-options button.active {
  border-color: #2563eb;
  background: #dbeafe;
}

.twenty-four-picker-actions {
  grid-template-columns: 1fr 1fr;
}

.twenty-four-priority-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.twenty-four-workspace > .twenty-four-operation-picker {
  position: relative;
  top: auto;
  left: auto;
  margin: 0 auto;
  transform: none;
}

.twenty-four-split-confirm {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  margin: 14px auto 0;
  padding: 12px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fffbeb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.twenty-four-split-confirm p {
  margin: 0;
}

.twenty-four-player-list {
  display: grid;
  gap: 8px;
}

.twenty-four-player-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.twenty-four-player-card.me {
  border-color: #f08804;
  background: #fff8e8;
}

.twenty-four-player-card .badge {
  justify-self: end;
}

.twenty-four-player-score {
  grid-column: 1 / -1;
  color: #b12704;
  font-size: 18px;
}

.twenty-four-log-panel {
  grid-column: 1 / -1;
}

.twenty-four-actions,
.twenty-four-votes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.twenty-four-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.twenty-four-votes {
  justify-content: flex-start;
  margin-top: 12px;
}

.twenty-four-reveal {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #f0fdf4;
}

.twenty-four-success-backdrop {
  z-index: 75;
  pointer-events: none;
}

.twenty-four-success-modal {
  width: min(360px, calc(100vw - 28px));
  text-align: center;
}

.twenty-four-solution {
  display: block;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  font-size: 18px;
}

.result-backdrop {
  z-index: 80;
}

.result-modal {
  width: min(460px, calc(100vw - 24px));
}

.quiz-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.quiz-question-panel,
.quiz-score-panel {
  min-width: 0;
}

.quiz-progress-head {
  margin-bottom: 14px;
}

.quiz-question {
  display: grid;
  gap: 14px;
}

.quiz-question-meta,
.quiz-setting-summary,
.quiz-response-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quiz-question h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quiz-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 12px;
  text-align: left;
  overflow-wrap: anywhere;
}

.quiz-option-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.quiz-option.selected {
  box-shadow: inset 0 0 0 3px rgba(255, 153, 0, 0.38);
}

.quiz-option.correct,
.quiz-option.correct:disabled {
  border-color: #168342;
  background: #e8f7ee;
  color: #126b37;
  opacity: 1;
}

.quiz-option.wrong,
.quiz-option.wrong:disabled {
  border-color: #c62828;
  background: #fdecec;
  color: #a51f1f;
  opacity: 1;
}

.quiz-answer-note,
.quiz-reveal {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--warn);
  background: #fff8e5;
}

.quiz-reveal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-left-color: #168342;
  background: #edf8f1;
}

.quiz-score-list {
  display: grid;
  gap: 8px;
}

.quiz-score-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.quiz-score-row.me {
  border-color: #e6a400;
  background: #fffaf0;
}

.quiz-score-row small {
  display: block;
  color: var(--muted);
}

.quiz-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eef1f1;
  font-weight: 700;
}

.quiz-score {
  font-size: 17px;
  font-weight: 800;
}

.quiz-mode-note {
  margin: 12px 0 0;
  line-height: 1.55;
}

.quiz-room-rules {
  display: grid;
  gap: 12px;
}

[data-theme="game"] .game-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 999px;
  background: rgba(22, 160, 133, 0.12);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

[data-theme="game"] .game-lobby-body {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

[data-theme="game"] .game-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

[data-theme="game"] .game-title-row h2 {
  color: #172033;
  font-size: 18px;
  font-weight: 800;
}

[data-theme="game"] .player-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef6ff;
  color: #245c8f;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}

[data-theme="game"] .game-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  min-height: 0;
}

[data-theme="game"] .game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

[data-theme="game"] .game-tags span,
[data-theme="game"] .win-list span {
  border: 1px solid #d8e1ec;
  border-radius: 999px;
  background: #f8fbff;
  color: #245c8f;
  font-size: 12px;
  padding: 4px 8px;
}

[data-theme="game"] .win-records {
  border-top-color: #e6eef7;
}

[data-theme="game"] .game-actions {
  border-top: 1px solid #e6eef7;
  background: #fbfdff;
}

[data-theme="game"] .lives-picker,
[data-theme="game"] .meta-pill {
  color: #475569;
}

[data-theme="game"] .meta-pill {
  border-radius: 8px;
  background: #eef6ff;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.lobby-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.lobby-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.lobby-summary h2 {
  margin: 0 0 2px;
  font-size: 17px;
}

.lobby-online {
  flex: 0 0 auto;
  border-color: #a8d5b7;
  background: #edf8f1;
  color: #126b37;
}

.panel,
.room-card,
.user-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
}

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

.panel h2,
.panel h3 {
  margin: 0 0 9px;
  font-weight: 600;
}

.room-list {
  display: grid;
  gap: 10px;
}

.room-card {
  padding: 11px;
  display: grid;
  gap: 7px;
  background: #fff;
}

.room-head,
.player-row,
.user-row,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 3px;
  padding: 0 10px;
  font-size: 12px;
  background: #f0f2f2;
  color: var(--muted);
}

.badge.ready {
  background: #e7f4f5;
  color: #007185;
}

.badge.warn {
  background: #fff4e6;
  color: var(--warn);
}

.badge.danger {
  background: #fde7e7;
  color: var(--danger);
}

.room-screen {
  display: grid;
  gap: 10px;
}

.suspend-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #f0c14b;
  background: #fff8e6;
  color: #0f1111;
}

.suspend-banner strong {
  color: #b12704;
}

.game-table {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 10px;
}

.content:has(.monopoly-table) {
  width: min(1760px, calc(100vw - 24px));
}

.current-box {
  display: grid;
  gap: 10px;
  align-content: start;
}

.idiom {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
  color: #b12704;
}

.side-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.chat-panel {
  display: grid;
  gap: 12px;
}

.chat-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.chat-row {
  display: grid;
  grid-template-columns: minmax(70px, auto) 1fr auto;
  gap: 8px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.log-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.chat-row strong {
  color: #007185;
}

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

.room-top-panel {
  padding-bottom: 14px;
}

.room-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.room-top-layout .chat-panel {
  padding: 0;
  border: 0;
}

.room-top-layout .chat-list {
  max-height: 150px;
}

.server-chat-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.server-chat-float .chat-panel,
.server-chat-float .chat-shell {
  width: min(360px, calc(100vw - 36px));
  max-height: min(520px, calc(100vh - 110px));
  box-shadow: 0 8px 28px rgba(15, 17, 17, 0.24);
}

.chat-shell {
  display: grid;
  gap: 0;
}

.chat-shell .chat-panel {
  border-top: 0;
  box-shadow: none;
}

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.chat-tabs button {
  border: 0;
  border-radius: 0;
  background: #fff;
  min-height: 36px;
}

.chat-tabs button.active {
  background: #e7f4f5;
  color: #007185;
  font-weight: 700;
}

.server-chat-button {
  position: relative;
  min-width: 74px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chat-button-icon {
  font-size: 16px;
  line-height: 1;
}

.monopoly-help-float {
  position: fixed;
  right: 106px;
  bottom: 18px;
  z-index: 29;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.monopoly-help-button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 50%;
  padding: 0;
  font-size: 20px;
  font-weight: 800;
}

.monopoly-help-panel {
  width: min(390px, calc(100vw - 36px));
  max-height: min(560px, calc(100vh - 112px));
  overflow: auto;
  box-shadow: 0 8px 28px rgba(15, 17, 17, 0.24);
}

.legend-grid,
.region-legend {
  display: grid;
  gap: 8px;
}

.legend-row,
.region-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-icon {
  position: relative;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

.chat-unread-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border-radius: 10px;
  background: #b12704;
  border: 2px solid var(--panel);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.ddz-table .current-box {
  gap: 16px;
}

.current-box.my-turn {
  border-color: #007185;
  box-shadow: inset 4px 0 0 #007185;
  background: #f7fafa;
}

.ddz-status,
.last-batch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ddz-count-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-clock {
  font-size: 14px;
  min-width: 44px;
  justify-content: center;
}

.player-row.active-desk {
  border-color: #007185;
  background: #f7fafa;
}

.player-row.my-desk strong::after {
  content: " · You";
  color: #007185;
  font-weight: 600;
}

.last-batch {
  display: grid;
  border: 1px solid #d5d9d9;
  background: #f7fafa;
  padding: 10px;
}

.last-batch p {
  margin: 0;
  font-family: Consolas, "Segoe UI Mono", monospace;
  color: #565959;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}

.token-chip {
  border-radius: 3px;
  border-color: #888c8c;
  background: #fff;
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 13px;
  min-height: 34px;
  padding: 0 8px;
}

.token-chip.selected {
  background: #e7f4f5;
  border-color: #007185;
  color: #007185;
  font-weight: 700;
}

.poker-table .current-box {
  gap: 16px;
}

.poker-status,
.poker-actions,
.signal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.signal-row {
  align-items: flex-start;
}

.signal-row > strong {
  min-width: 128px;
  font-size: 13px;
}

.poker-signals {
  flex: 1;
  min-width: 220px;
}

.signal-token {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
}

.wager-input {
  width: 92px;
}

.rules-modal {
  max-width: 620px;
}

.rules-copy {
  line-height: 1.8;
  color: #111;
  white-space: pre-wrap;
}

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

.players {
  display: grid;
  gap: 8px;
}

.player-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.monopoly-player-card {
  display: grid;
  gap: 9px;
  box-shadow: inset 3px 0 0 var(--player-color, #007185);
}

.player-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.status-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-toggle {
  width: fit-content;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.asset-groups {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.asset-region {
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.asset-region h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 13px;
}

.asset-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f2f2;
}

.asset-line strong {
  font-size: 12px;
}

.asset-line small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.asset-empty {
  padding-top: 4px;
}

.hp {
  color: #b12704;
  font-weight: 700;
}

.history {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.history-row {
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.user-grid {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(100px, 1.2fr) minmax(100px, 1fr) minmax(150px, 1.5fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.user-management-head,
.user-record-actions,
.password-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-management-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.password-cell input {
  min-width: 0;
}

.user-readonly-value {
  display: flex;
  align-items: center;
  min-height: 38px;
  overflow: hidden;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.password-cell .user-readonly-value {
  flex: 1;
  min-width: 0;
}

.password-eye {
  min-width: 36px;
  padding-inline: 8px;
}

.user-form-wrap {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.user-field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.idiom-form {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.idiom-list {
  display: grid;
  gap: 10px;
}

.idiom-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 2px;
}

.countdown {
  font-size: 34px;
  font-weight: 800;
  color: #b12704;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 17, 17, 0.45);
}

.modal {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(15, 17, 17, 0.28);
  padding: 18px;
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.modal p {
  margin: 0 0 12px;
}

.room-setup-modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 16px;
}

.room-setup-modal.quiz-room-setup {
  width: min(820px, 100%);
}

.room-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.room-setup-head h3,
.room-setup-head p,
.room-setup-copy {
  margin: 0;
}

.room-setup-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.room-setup-controls {
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.room-setup-controls > * {
  width: 100%;
}

.room-setup-controls .lives-picker {
  grid-template-columns: minmax(0, 1fr) minmax(90px, 180px);
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8f9f9;
}

.room-setup-controls .option-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-setup-controls .meta-pill {
  min-height: 44px;
}

.room-setup-controls .quiz-create-options {
  max-height: none;
  overflow: visible;
}

.room-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.room-setup-actions button {
  min-width: 112px;
}

@media (hover: none), (pointer: coarse) {
  .game-card {
    min-height: 0;
  }

  .game-actions {
    position: static;
    opacity: 1;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 12px 14px 14px;
  }

  .game-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 860px) {
  .split,
  .lobby-layout,
  .game-table,
  .room-top-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .lobby-layout {
    gap: 10px;
  }

  .searchbar {
    width: 100%;
    max-width: none;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .room-head,
  .player-row,
  .history-row,
  .suspend-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-head > *,
  .player-row > *,
  .history-row > *,
  .suspend-banner > * {
    width: 100%;
  }

  .user-form,
  .answer-form {
    grid-template-columns: 1fr;
  }

  .user-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .chat-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  button {
    min-height: 44px;
    padding: 0 14px;
  }

  input,
  select {
    min-height: 44px;
  }

  .topbar {
    gap: 8px;
    padding: 8px 10px 10px;
  }

  .brand {
    width: 100%;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p,
  .muted {
    font-size: 12px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .searchbar {
    grid-template-columns: 72px minmax(0, 1fr) 74px;
  }

  .searchbar input {
    font-size: 13px;
  }

  .top-actions button,
  .top-actions .badge {
    width: 100%;
    justify-content: center;
  }

  .top-actions .theme-toggle {
    grid-column: 1 / -1;
    width: 100%;
  }

  .top-actions .theme-toggle button {
    flex: 1 1 0;
    width: auto;
  }

  .content {
    width: min(100vw - 20px, 1180px);
    margin: 10px auto 20px;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: -12px -10px 14px;
    padding-left: 10px;
    padding-right: 10px;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    min-width: 82px;
  }

  .panel {
    padding: 11px;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .game-card img {
    height: 120px;
  }

  .product-media {
    min-height: 132px;
    padding: 8px;
  }

  .game-card h2 {
    font-size: 16px;
  }

  .game-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .game-actions button {
    min-height: 42px;
    padding: 6px;
    font-size: 12px;
    line-height: 1.25;
  }

  .lives-picker {
    grid-template-columns: 1fr 84px;
  }

  .split,
  .lobby-layout,
  .room-screen,
  .game-table {
    gap: 12px;
  }

  .room-card {
    padding: 12px;
  }

  .idiom {
    font-size: 16px;
    line-height: 1.1;
    word-break: keep-all;
  }

  .token-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .server-chat-float {
    right: 10px;
    bottom: 10px;
  }

  .monopoly-help-float {
    right: 96px;
    bottom: 10px;
  }

  .monopoly-help-float.open {
    right: 10px;
    bottom: 62px;
  }

  .countdown {
    font-size: 28px;
  }

  .answer-form {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 10px 0 0;
    background: var(--panel);
  }

  .players {
    gap: 6px;
  }

  .player-row {
    padding: 9px;
  }

  .history {
    max-height: 240px;
  }

  .user-form {
    gap: 8px;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-record-actions {
    justify-content: flex-end;
  }

  .user-row {
    gap: 8px;
  }

  .idiom-grid {
    max-height: 320px;
  }

  .login-wrap {
    align-items: start;
    padding: 16px 12px;
  }

  .login-card {
    padding: 20px;
  }

  .lobby-summary {
    padding: 9px 10px;
  }

  .room-setup-backdrop {
    align-items: end;
    padding: 8px;
  }

  .room-setup-modal,
  .room-setup-modal.quiz-room-setup {
    width: 100%;
    max-height: calc(100vh - 16px);
    padding: 12px;
    border-radius: 8px 8px 0 0;
  }

  .room-setup-controls .option-stack,
  .room-setup-controls .quiz-create-options {
    grid-template-columns: 1fr;
  }

  .room-setup-controls .quiz-category-picker {
    grid-template-columns: 1fr;
  }

  .gomoku-table {
    grid-template-columns: 1fr;
  }

  .twenty-four-table {
    grid-template-columns: 1fr;
  }

  .twenty-four-workspace {
    min-height: 138px;
    padding: 10px;
  }

  .twenty-four-tree-row {
    justify-content: flex-start;
    gap: 6px;
  }

  .twenty-four-number-card {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .twenty-four-group-card {
    min-height: 54px;
    padding: 6px;
    font-size: 18px;
  }

  .twenty-four-operation-slot {
    flex-basis: 48px;
    width: 48px;
  }

  .twenty-four-operator-input {
    height: 38px;
    padding-inline: 5px;
    font-size: 16px;
  }

  .gomoku-board-wrap {
    width: 100%;
  }

  .gomoku-board td,
  .gomoku-cell {
    width: 30px;
    height: 30px;
  }

  .gomoku-stone {
    width: 24px;
    height: 24px;
    font-size: 25px;
  }

  .gomoku-head {
    align-items: stretch;
    flex-direction: column;
  }

  .room-setup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-setup-actions button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

  .idiom {
    font-size: 16px;
  }
}

.option-stack {
  display: grid;
  gap: 8px;
}

.hero-grid,
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.hero-choice,
.tool-card {
  display: grid;
  gap: 6px;
  text-align: left;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px;
  color: var(--text);
  min-height: 0;
}

.hero-choice.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 113, 133, 0.18);
}

.hero-choice:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.hero-choice small,
.tool-card p {
  color: var(--muted);
  line-height: 1.35;
}

.monopoly-table {
  --mono-tile-w: 96px;
  --mono-tile-h: 94px;
  grid-template-columns: 220px max-content 260px;
  align-items: start;
  justify-content: center;
}

.monopoly-table .board-panel {
  grid-column: auto;
  order: 2;
}

.monopoly-table > .current-box {
  order: 1;
  position: sticky;
  top: 12px;
}

.monopoly-table > .current-box .poker-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.monopoly-table > .current-box .poker-actions button,
.monopoly-table > .current-box .poker-actions .badge {
  width: 100%;
}

.monopoly-table > .panel:last-child {
  order: 3;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.board-panel {
  overflow: visible;
}

.monopoly-board {
  display: grid;
  grid-template-columns: repeat(10, var(--mono-tile-w));
  grid-auto-rows: var(--mono-tile-h);
  gap: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.board-tile {
  width: var(--mono-tile-w);
  height: var(--mono-tile-h);
  min-height: var(--mono-tile-h);
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 6px 26px 34px 6px;
  display: grid;
  gap: 3px;
  align-content: start;
  margin: -1px 0 0 -1px;
  position: relative;
}

.board-tile.owned {
  border-color: var(--owner-color, #007185);
  background: color-mix(in srgb, var(--owner-color, #007185) 12%, white);
  box-shadow: inset 0 3px 0 var(--owner-color, #007185);
}

.board-tile > * {
  position: relative;
  z-index: 1;
}

.board-tile.path-turn::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  bottom: -11px;
  width: 18px;
  height: 18px;
  border-right: 3px solid #007185;
  border-bottom: 3px solid #007185;
  opacity: 0.78;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.board-tile.path-turn-right::after {
  right: 10px;
  transform: rotate(45deg);
}

.board-tile.path-turn-left::after {
  left: 10px;
  transform: rotate(45deg) scaleX(-1);
}

.board-tile.shop,
.board-tile.celestial,
.board-tile.blackrose {
  background: #fff8e6;
}

.tile-index {
  width: fit-content;
  border-radius: 999px;
  background: #232f3e;
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
}

.tile-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #febd69;
  border: 1px solid #c45500;
  overflow: hidden;
}

.tile-icon::before,
.tile-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.tile-icon-start::before {
  left: 7px;
  top: 4px;
  width: 2px;
  height: 14px;
  background: #111;
}

.tile-icon-start::after {
  left: 9px;
  top: 5px;
  width: 8px;
  height: 6px;
  background: #007185;
  clip-path: polygon(0 0, 100% 18%, 78% 50%, 100% 82%, 0 100%);
}

.tile-icon-property::before {
  left: 5px;
  bottom: 4px;
  width: 12px;
  height: 13px;
  border: 2px solid #111;
  border-bottom-width: 3px;
  background: linear-gradient(90deg, transparent 34%, #111 34% 44%, transparent 44% 66%, #111 66% 76%, transparent 76%);
}

.tile-icon-property::after {
  left: 8px;
  top: 3px;
  width: 7px;
  height: 5px;
  background: #111;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tile-icon-event::before {
  inset: 5px;
  background: #111;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.tile-icon-event::after {
  left: 10px;
  top: 8px;
  width: 2px;
  height: 7px;
  background: #fff;
  box-shadow: 0 5px 0 #fff;
}

.tile-icon-jail::before {
  inset: 5px;
  border: 2px solid #111;
  background: repeating-linear-gradient(90deg, transparent 0 3px, #111 3px 5px);
}

.tile-icon-shop::before {
  left: 5px;
  bottom: 4px;
  width: 12px;
  height: 10px;
  border: 2px solid #111;
  border-radius: 2px 2px 3px 3px;
}

.tile-icon-shop::after {
  left: 8px;
  top: 4px;
  width: 6px;
  height: 6px;
  border: 2px solid #111;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.tile-icon-portal::before {
  inset: 4px;
  border: 3px solid #007185;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #fff;
}

.tile-icon-portal::after {
  left: 9px;
  top: 4px;
  width: 4px;
  height: 14px;
  border-radius: 50%;
  border-left: 2px solid #111;
  transform: rotate(30deg);
}

.tile-icon-wormhole {
  background: conic-gradient(from 40deg, #111, #007185, #fff, #6f42c1, #111);
}

.tile-icon-wormhole::before {
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}

.tile-icon-wormhole::after {
  inset: 8px;
  border-radius: 50%;
  background: #111;
}

.tile-icon-celestial::before {
  inset: 4px;
  background: #111;
  clip-path: polygon(50% 0, 61% 34%, 98% 34%, 68% 55%, 79% 92%, 50% 70%, 21% 92%, 32% 55%, 2% 34%, 39% 34%);
}

.tile-icon-spirit::before {
  left: 4px;
  top: 7px;
  width: 14px;
  height: 8px;
  border: 2px solid #111;
  border-radius: 50%;
}

.tile-icon-spirit::after {
  left: 9px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #111;
}

.tile-icon-blackrose::before {
  inset: 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 20%, #111 0 20%, transparent 22%),
    radial-gradient(circle at 77% 48%, #111 0 20%, transparent 22%),
    radial-gradient(circle at 63% 78%, #111 0 20%, transparent 22%),
    radial-gradient(circle at 35% 78%, #111 0 20%, transparent 22%),
    radial-gradient(circle at 23% 48%, #111 0 20%, transparent 22%);
}

.tile-icon-blackrose::after {
  inset: 8px;
  border-radius: 50%;
  background: #b12704;
}

.board-tile.event .tile-icon,
.board-tile.blackrose .tile-icon {
  background: #f5c2c7;
  border-color: #b12704;
}

.board-tile.shop .tile-icon {
  background: #ffd814;
  border-color: #fcd200;
}

.board-tile.jail .tile-icon {
  background: #d5d9d9;
  border-color: #879596;
}

.board-tile.wormhole .tile-icon,
.board-tile.portal .tile-icon {
  background: #c7f0ff;
  border-color: #007185;
}

.board-tile.celestial .tile-icon,
.board-tile.spirit .tile-icon {
  background: #d9f7be;
  border-color: #067d62;
}

.mono-mini-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.region-mark {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 17px;
  height: 17px;
  background: #232f3e;
  -webkit-mask: var(--region-mask) center / contain no-repeat;
  mask: var(--region-mask) center / contain no-repeat;
}

.inline-region {
  position: static;
  right: auto;
  bottom: auto;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.region-demacia {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2l8 3v6c0 5-3.3 9-8 11-4.7-2-8-6-8-11V5l8-3z'/%3E%3C/svg%3E");
}

.region-freljord {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='black' stroke-width='3' stroke-linecap='round' d='M12 3v18M4.2 7.5l15.6 9M19.8 7.5l-15.6 9'/%3E%3C/svg%3E");
}

.region-piltover {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M10 2h4l1 3 3-1 2 4-2 2 2 2-2 4-3-1-1 3h-4l-1-3-3 1-2-4 2-2-2-2 2-4 3 1 1-3zm2 7a3 3 0 100 6 3 3 0 000-6z'/%3E%3C/svg%3E");
}

.region-zaun {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M9 2h6v3l-1 1v4l5 8c1 2-.2 4-2.5 4h-9C5.2 22 4 20 5 18l5-8V6L9 5V2zM8 18h8l-3-5h-2l-3 5z'/%3E%3C/svg%3E");
}

.region-bilgewater {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M11 2h2v5h4v2h-4v8c2-.3 3.7-1.7 4.5-4l-2.5.8V11l6 2-3 5-1.5-1.5A7 7 0 0112 22a7 7 0 01-4.5-5.5L6 18l-3-5 6-2v2.8L6.5 13C7.3 15.3 9 16.7 11 17V9H7V7h4V2z'/%3E%3C/svg%3E");
}

.region-shadow {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2c5 0 9 4 9 9 0 3-1.5 5.5-4 7v3h-3v-3h-4v3H7v-3c-2.5-1.5-4-4-4-7 0-5 4-9 9-9zm-4 9a2 2 0 104 0 2 2 0 00-4 0zm6 0a2 2 0 104 0 2 2 0 00-4 0z'/%3E%3C/svg%3E");
}

.region-shurima {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2l2.2 5.2L20 5l-2.2 5.8L23 13l-5.2 2.2L20 21l-5.8-2.2L12 24l-2.2-5.2L4 21l2.2-5.8L1 13l5.2-2.2L4 5l5.8 2.2L12 2z'/%3E%3C/svg%3E");
}

.region-void {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2l10 18H2L12 2zm0 6l-4 8h8l-4-8z'/%3E%3C/svg%3E");
}

.region-targon {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M2 21L10 3l4 9 3-5 5 14H2zm10-4h5l-2-5-1 2-2-4-4 7h4z'/%3E%3C/svg%3E");
}

.region-ionia {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M20 3C11 3 5 7 5 14c0 2 1 4 3 5-2 0-3 .5-5 2 3-7 8-11 14-13-4 3-7 6-9 10 2 1 5 1 7-1 4-3 5-8 5-14z'/%3E%3C/svg%3E");
}

.region-noxus {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2l3 6 6 1-4.5 4.5L18 21l-6-3-6 3 1.5-7.5L3 9l6-1 3-6z'/%3E%3C/svg%3E");
}

.region-bandle {
  --region-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3c5 0 9 4 9 9H3c0-5 4-9 9-9zm-4 11h8v7H8v-7zM7 8a2 2 0 100 4 2 2 0 000-4zm10 0a2 2 0 100 4 2 2 0 000-4z'/%3E%3C/svg%3E");
}

.board-tile strong {
  font-size: 11px;
  line-height: 1.2;
}

.board-tile small {
  color: var(--muted);
  font-size: 10px;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  min-height: 30px;
  align-items: flex-end;
  z-index: 3;
  pointer-events: none;
}

.desk-token {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 1px 5px rgba(15, 17, 17, 0.34);
  transition: transform 260ms ease, opacity 260ms ease;
  flex: 0 0 28px;
}

.supply-box {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.tool-card button {
  width: fit-content;
}

.trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1500px) and (min-width: 901px) {
  .monopoly-table {
    --mono-tile-w: 84px;
    --mono-tile-h: 90px;
    grid-template-columns: 200px max-content 240px;
  }
}

@media (max-width: 900px) {
  .monopoly-table {
    --mono-tile-w: 96px;
    --mono-tile-h: 76px;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .monopoly-table > .current-box,
  .monopoly-table > .panel:last-child {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .monopoly-board {
    grid-template-columns: repeat(5, var(--mono-tile-w));
    grid-auto-rows: var(--mono-tile-h);
    max-height: none;
    overflow: visible;
  }

  .board-tile {
    padding: 5px 22px 31px 5px;
  }

  .tile-icon {
    width: 18px;
    height: 18px;
    top: 5px;
    right: 5px;
  }

  .region-mark {
    width: 14px;
    height: 14px;
  }

  .desk-token {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 12px;
  }

  .quiz-create-options {
    flex-basis: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-height: 360px;
  }

  .quiz-category-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-table {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .fruit-bell-table {
    grid-template-columns: 1fr;
  }

  .fruit-bell-play-area {
    padding: 12px;
  }

  .fruit-bell-bell {
    width: 96px;
    height: 96px;
  }

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

  .quiz-options,
  .quiz-category-picker {
    grid-template-columns: 1fr;
  }

  .quiz-question h2 {
    font-size: 16px;
  }

  .quiz-reveal {
    flex-direction: column;
  }
}

[data-theme="lol"] {
  --bg: #eef1f3;
  --panel: #fff;
  --text: #172126;
  --muted: #647076;
  --line: #d4dade;
  --primary: #c8952e;
  --primary-dark: #dbab4d;
  --accent: #087f8c;
  --nav: #172126;
  --nav-2: #243036;
  --danger: #b43a34;
  --shadow: 0 4px 18px rgba(23, 33, 38, 0.1);
}

[data-theme="lol"] body,
body[data-theme="lol"] {
  background: #eef1f3;
  color: #172126;
}

[data-theme="lol"] .topbar {
  background: #172126;
  border-bottom: 3px solid #c8952e;
}

[data-theme="lol"] .brand-mark {
  width: 48px;
  background: #c8952e;
  color: #172126;
  font-size: 14px;
  font-weight: 900;
}

[data-theme="lol"] button {
  border-radius: 4px;
  border-color: #b98520;
  background: #c8952e;
  color: #111719;
}

[data-theme="lol"] button:hover {
  background: #dbab4d;
}

[data-theme="lol"] button.secondary {
  background: #fff;
  border-color: #8b969b;
  color: #172126;
}

[data-theme="lol"] button.danger {
  color: #a62925;
  border-color: #b43a34;
  background: #fff;
}

[data-theme="lol"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="lol"] .theme-toggle button {
  border: 0;
  background: transparent;
  color: #f4f6f7;
}

[data-theme="lol"] .theme-toggle button.active {
  background: #e5bc68;
  color: #172126;
}

[data-theme="lol"] .content {
  width: min(1540px, calc(100% - 24px));
  max-width: none;
  padding: 18px 0 28px;
}

.lol-topbar-status,
.lol-meta-stats,
.lol-tabs,
.lol-playstyle-toolbar,
.lol-playstyle-tabs,
.lol-admin-actions,
.lol-section-heading,
.lol-catalog-controls,
.lol-admin-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lol-topbar-status {
  gap: 14px;
  color: #d8e0e3;
  font-size: 12px;
}

.lol-room-reminder {
  box-shadow: 0 0 0 2px #e0b65e;
}

.lol-advisor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
}

.lol-advisor-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 126px;
  padding: 22px 26px;
  border-left: 5px solid #c8952e;
  background: #172126;
  color: #fff;
}

.lol-advisor-banner h2,
.lol-champion-header h2,
.lol-section-heading h3 {
  margin: 3px 0;
  letter-spacing: 0;
}

.lol-advisor-banner h2 {
  font-size: 26px;
}

.lol-advisor-banner p {
  max-width: 760px;
  margin: 7px 0 0;
  color: #cbd4d8;
  font-size: 13px;
  line-height: 1.6;
}

.lol-kicker,
.lol-section-label {
  display: block;
  color: #996719;
  font-size: 11px;
  font-weight: 800;
}

.lol-advisor-banner .lol-kicker {
  color: #e4bd6c;
}

.lol-meta-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
}

.lol-meta-stats strong {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f3d18c;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
}

.lol-tabs {
  gap: 2px;
  border-bottom: 1px solid #c7ced1;
  background: #fff;
}

.lol-tabs button {
  min-width: 120px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #344047;
}

.lol-tabs button.active {
  border-bottom-color: #c8952e;
  background: #fff8e9;
  color: #7d5313;
}

.lol-champion-layout {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.lol-champion-browser,
.lol-champion-detail,
.lol-catalog,
.lol-loading,
.lol-error {
  border: 1px solid #d0d6d9;
  background: #fff;
  box-shadow: var(--shadow);
}

.lol-champion-browser {
  position: sticky;
  top: 12px;
  padding: 12px;
}

.lol-champion-count,
.lol-catalog-count {
  padding: 9px 2px;
  color: #687379;
  font-size: 12px;
}

.lol-champion-list {
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.lol-champion-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 5px 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #172126;
  text-align: left;
}

.lol-champion-option:hover,
.lol-champion-option.active {
  border-color: #c8952e;
  background: #fff7e7;
}

.lol-champion-option img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.lol-champion-option strong,
.lol-champion-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lol-champion-option small {
  margin-top: 3px;
  color: #667178;
  font-size: 10px;
}

.lol-champion-detail {
  min-width: 0;
  padding: 18px;
}

.lol-champion-header {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #d8dee1;
}

.lol-champion-header > img {
  width: 82px;
  height: 82px;
  border: 2px solid #c8952e;
  object-fit: cover;
}

.lol-champion-header p,
.lol-build-card p {
  margin: 4px 0 0;
  color: #667178;
  font-size: 11px;
}

.lol-rate-block {
  display: grid;
  justify-items: end;
}

.lol-rate-block strong {
  color: #087f8c;
  font-size: 23px;
}

.lol-rate-block span,
.lol-sample-warning {
  color: #667178;
  font-size: 11px;
}

.lol-playstyle-toolbar,
.lol-section-heading {
  justify-content: space-between;
}

.lol-playstyle-toolbar {
  margin: 14px 0 10px;
}

.lol-playstyle-tabs {
  flex: 1;
  overflow-x: auto;
}

.lol-playstyle-tabs button {
  flex: 0 0 auto;
  background: #f4f6f7;
  border-color: #bdc6ca;
}

.lol-playstyle-tabs button.active {
  background: #f0ce89;
  border-color: #b98520;
}

.lol-playstyle-summary {
  padding: 12px 14px;
  border-left: 4px solid #087f8c;
  background: #f3f8f8;
}

.lol-playstyle-summary p {
  margin: 5px 0;
  line-height: 1.6;
}

.lol-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lol-tag-row span,
.lol-source-chip {
  padding: 3px 7px;
  border: 1px solid #bdc7cb;
  background: #fff;
  color: #536067;
  font-size: 10px;
}

.lol-section {
  margin-top: 18px;
}

.lol-section-heading {
  margin-bottom: 9px;
}

.lol-section-heading input {
  width: min(420px, 50%);
}

.lol-build-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 7px;
}

.lol-build-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 174px;
  padding: 14px 8px 10px;
  border: 1px solid #ccd3d6;
  background: #fafbfb;
  text-align: center;
}

.lol-build-number {
  position: absolute;
  top: 5px;
  left: 6px;
  width: 22px;
  height: 22px;
  padding-top: 2px;
  background: #172126;
  color: #fff;
  font-weight: 800;
}

.lol-build-card img {
  width: 58px;
  height: 58px;
  border: 1px solid #b98520;
  object-fit: cover;
}

.lol-build-card strong,
.lol-build-card p {
  overflow-wrap: anywhere;
}

.lol-rating-groups {
  display: grid;
  gap: 12px;
}

.lol-rating-group {
  border: 1px solid #d4dade;
}

.lol-rating-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f3f5f6;
}

.lol-rating-group-title small {
  margin-left: auto;
}

.lol-tier-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 25px;
  padding: 0 6px;
  background: #78848a;
  color: #fff;
  font-weight: 900;
}

.lol-tier-badge.tier-s,
.tier-s > .lol-rating-group-title .lol-tier-badge {
  background: #b43a34;
}

.lol-tier-badge.tier-a,
.tier-a > .lol-rating-group-title .lol-tier-badge {
  background: #b98520;
}

.lol-tier-badge.tier-b,
.tier-b > .lol-rating-group-title .lol-tier-badge {
  background: #087f8c;
}

.lol-augment-grid,
.lol-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #d9dfe2;
}

.lol-augment-card,
.lol-catalog-card {
  min-width: 0;
  padding: 11px;
  background: #fff;
}

.lol-augment-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lol-augment-title img,
.lol-catalog-card > img {
  width: 42px;
  height: 42px;
  border: 1px solid #c9d0d3;
  background: #172126;
  object-fit: cover;
}

.lol-augment-title strong,
.lol-augment-title span,
.lol-catalog-card strong,
.lol-catalog-card small {
  display: block;
}

.lol-augment-title span,
.lol-catalog-card small {
  color: #6a757a;
  font-size: 10px;
}

.lol-augment-effect,
.lol-rating-reason,
.lol-catalog-card p {
  margin: 8px 0;
  color: #4f5a60;
  font-size: 12px;
  line-height: 1.55;
}

.lol-rating-reason {
  padding-top: 7px;
  border-top: 1px solid #e5e9eb;
  color: #7b5317;
}

.lol-rating-editor {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.lol-catalog,
.lol-admin-editor {
  padding: 14px;
}

.lol-catalog-controls {
  justify-content: flex-start;
}

.lol-catalog-controls input {
  max-width: 540px;
}

.lol-catalog-controls select {
  width: 180px;
}

.lol-catalog-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 8px;
}

.lol-item-catalog {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lol-admin-editor {
  margin: 14px 0;
  border: 1px solid #9aa7ad;
  background: #f7f9fa;
}

.lol-admin-fields,
.lol-admin-build {
  display: grid;
  gap: 9px;
}

.lol-admin-fields {
  grid-template-columns: minmax(180px, 0.35fr) minmax(280px, 1fr);
  margin: 10px 0;
}

.lol-admin-build {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.lol-admin-fields label,
.lol-admin-build-slot label {
  display: grid;
  gap: 4px;
  color: #536067;
  font-size: 11px;
}

.lol-admin-fields textarea {
  min-height: 82px;
}

.lol-admin-build-slot {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #d3dade;
  background: #fff;
}

.lol-admin-footer {
  flex-wrap: wrap;
  margin-top: 12px;
}

.lol-loading,
.lol-error,
.lol-empty {
  padding: 36px;
  text-align: center;
}

@media (max-width: 1120px) {
  .lol-build-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .lol-augment-grid,
  .lol-catalog-grid,
  .lol-item-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  [data-theme="lol"] .content {
    width: 100%;
    padding: 0 0 18px;
  }

  [data-theme="lol"] .topbar,
  [data-theme="lol"] .brand,
  [data-theme="lol"] .lol-topbar-status,
  [data-theme="lol"] .top-actions {
    width: 100%;
    min-width: 0;
  }

  [data-theme="lol"] .top-actions {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  [data-theme="lol"] .top-actions > * {
    flex: 0 0 auto;
    width: auto;
  }

  [data-theme="lol"] .top-actions .theme-toggle {
    width: max-content;
  }

  [data-theme="lol"] .top-actions .theme-toggle button {
    flex: 0 0 auto;
    width: auto;
  }

  .lol-topbar-status {
    width: 100%;
    justify-content: space-between;
  }

  .lol-advisor {
    gap: 8px;
  }

  .lol-advisor-banner {
    display: grid;
    min-height: 0;
    padding: 15px;
    overflow: hidden;
  }

  .lol-advisor-banner > * {
    min-width: 0;
  }

  .lol-advisor-banner h2 {
    font-size: 21px;
  }

  .lol-meta-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lol-meta-stats strong {
    padding: 8px 3px;
    font-size: 10px;
    white-space: normal;
  }

  .lol-tabs {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .lol-tabs button {
    flex: 1;
    min-width: 0;
    padding: 0 7px;
  }

  .lol-champion-layout {
    display: block;
  }

  .lol-champion-browser {
    position: static;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .lol-champion-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .lol-champion-option {
    flex: 0 0 142px;
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .lol-champion-option img {
    width: 36px;
    height: 36px;
  }

  .lol-champion-detail {
    padding: 12px;
    border: 0;
    border-top: 1px solid #d0d6d9;
    box-shadow: none;
  }

  .lol-champion-header {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .lol-champion-header > img {
    width: 64px;
    height: 64px;
  }

  .lol-rate-block,
  .lol-sample-warning {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .lol-playstyle-toolbar,
  .lol-section-heading,
  .lol-catalog-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .lol-section-heading input,
  .lol-catalog-controls input,
  .lol-catalog-controls select {
    width: 100%;
    max-width: none;
  }

  .lol-admin-actions {
    width: 100%;
  }

  .lol-admin-actions button {
    flex: 1;
  }

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

  .lol-augment-grid,
  .lol-catalog-grid,
  .lol-item-catalog,
  .lol-admin-fields,
  .lol-admin-build {
    grid-template-columns: 1fr;
  }

  .lol-admin-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
