/* Jimbound: menus, lobby and room.
   Menus float over a generated battlefield (see backdrop.ts). Panels are charcoal
   with light-blue trim; buttons press down like physical keys. Red and blue come from the tanks. */

:root {
  /* Jimmydome palette: charcoal, off-white and light blue, matching the jimmydome.com banner. */
  --night: #232020;
  --panel: rgba(42, 38, 38, 0.92);
  --panel-solid: #2a2626;
  --raised: #353030;
  --raised-hi: #403a3a;
  --line: #4a4242;
  --line-soft: rgba(236, 236, 236, 0.12);
  --text: #ececec;
  --muted: #a39b9b;
  --faint: #6f6767;
  --accent: #3aa9f0;
  --accent-hi: #8fd0f7;
  --accent-deep: #0f6aa6;
  --accent-ink: #04233a;
  --accent-btn: #1994de;
  --red: #e8553a;
  --red-deep: #9d2e18;
  --blue: #3a8fe8;
  --blue-deep: #1c4f91;
  --mint: #63d48e;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --r-panel: 16px;
  --r-ctrl: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--text);
  font: 500 15px/1.45 var(--body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-hi); outline-offset: 2px; }

#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; transition: filter 0.5s ease; }
body[data-dim='deep'] #backdrop { filter: brightness(0.42) saturate(0.85) blur(3px); }
#app { position: relative; z-index: 1; height: 100%; }

.screen { height: 100%; }

/* ---------- Logo: the one loud element ---------- */
.logo { display: inline-flex; align-items: flex-end; gap: 0.18em; margin: 0; line-height: 0.9; font-weight: 400; }
.logo-main {
  font-family: var(--display);
  font-size: clamp(56px, 10vw, 118px);
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffffff 0%, var(--accent-hi) 30%, var(--accent) 58%, #1994de 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #0b3f63;
  filter: drop-shadow(0 3px 0 #0f5a8c) drop-shadow(0 6px 0 #083656) drop-shadow(0 14px 18px rgba(25, 23, 23, 0.55));
}
.logo-sub {
  font-family: var(--display);
  font-size: clamp(18px, 2.4vw, 28px);
  color: #fff;
  background: var(--red);
  padding: 0.12em 0.5em 0.18em;
  border-radius: 6px;
  transform: rotate(-5deg) translateY(-0.5em);
  box-shadow: 0 3px 0 var(--red-deep), 0 8px 16px rgba(25, 23, 23, 0.4);
}
.logo-small .logo-main { font-size: 30px; -webkit-text-stroke-width: 1px; filter: drop-shadow(0 2px 0 #0f5a8c) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)); }
.logo-small .logo-sub { font-size: 13px; transform: rotate(-5deg) translateY(-0.35em); box-shadow: 0 2px 0 var(--red-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--r-ctrl);
  font-weight: 800; font-size: 15px;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform 0.06s ease, box-shadow 0.06s ease, background-color 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-btn));
  color: #fff;
  box-shadow: 0 3px 0 var(--accent-deep), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #5bbaf4, var(--accent)); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--accent-deep), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.btn-quiet {
  background: var(--raised);
  color: var(--text);
  box-shadow: 0 3px 0 #272323, inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.btn-quiet:hover:not(:disabled) { background: var(--raised-hi); }
.btn-quiet:active:not(:disabled) { box-shadow: 0 1px 0 #272323; }
.btn-shop {
  background: linear-gradient(180deg, #ff7a5c, var(--red));
  color: #fff;
  box-shadow: 0 3px 0 var(--red-deep), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-shop:hover { background: linear-gradient(180deg, #ff917a, #f0654a); }
.btn-shop:active { box-shadow: 0 1px 0 var(--red-deep); }
.btn-big { min-height: 50px; font-size: 17px; padding: 0 26px; }
.btn-huge { min-height: 62px; width: 100%; font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: 0.02em; }
.btn-huge.is-armed { background: linear-gradient(180deg, #8ff0b1, var(--mint)); color: #0d3a1f; box-shadow: 0 3px 0 #2f8a52; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--raised); color: var(--text); }
.link-btn { border: 0; background: none; color: var(--accent-hi); font-weight: 700; cursor: pointer; padding: 4px 2px; }
.link-btn:hover { text-decoration: underline; }
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }

/* ---------- Fields ---------- */
.field {
  width: 100%; min-height: 44px; padding: 0 14px;
  background: #232020; color: var(--text);
  border: 2px solid var(--line); border-radius: var(--r-ctrl);
  font-weight: 700;
}
.field::placeholder { color: var(--faint); font-weight: 600; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(58, 169, 240, 0.2); }
.field-label { display: block; margin: 14px 0 6px; color: var(--muted); font-weight: 700; font-size: 14px; }
.field-label:first-child { margin-top: 0; }
.field-error { min-height: 1.3em; margin: 6px 0 0; color: #ff9c86; font-weight: 700; font-size: 13px; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; background: #232020; border-radius: 10px; border: 1px solid var(--line-soft); }
.seg { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg:hover:not(:disabled) { color: var(--text); }
.seg.is-on { background: var(--raised-hi); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.seg:disabled { cursor: default; }
.segmented-lg { display: flex; }
.segmented-lg .seg { flex: 1; padding: 10px 0; font-size: 15px; }
.segmented-lg .seg.is-on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: 0 18px 40px rgba(20, 18, 18, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
}
.panel-head h2 { margin: 0; font: 400 21px/1 var(--display); letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; }
.count { font: 800 12px/1 var(--body); color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 4px 8px; }
.spacer { flex: 1; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.status-dot.on { background: var(--mint); box-shadow: 0 0 0 3px rgba(99, 212, 142, 0.22); }
.status-dot.off { background: #ff6b5a; }
.status-dot.wait { background: var(--accent); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--av), var(--av-deep));
  color: #fff; font-family: var(--display); line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 2px 0 rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* ---------- Server select ---------- */
.screen-server {
  display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  gap: 28px; padding: 24px 16px; overflow-y: auto;
}
.title-block { text-align: center; }
.tagline { margin: 14px 0 0; font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(25, 23, 23, 0.7); }
.server-card { width: min(560px, 100%); padding: 22px; flex: none; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; }
.list-head h2 { margin: 0; font: 400 20px var(--display); }
/* Servers sit in a 2x2 grid: Items servers on the top row, No Items below. */
.server-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.server-row {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "dot name ping" "pop pop pop"; grid-template-rows: 1fr auto;
  align-items: start; column-gap: 10px; row-gap: 12px;
  padding: 14px 14px 12px;
  background: var(--raised); border: 2px solid transparent; border-radius: 12px;
  cursor: pointer;
}
.server-row:hover { background: var(--raised-hi); }
.server-row.is-selected { border-color: var(--accent); background: linear-gradient(90deg, rgba(58, 169, 240, 0.14), var(--raised) 60%); }
.server-row.is-offline { opacity: 0.75; }
/* "Checking…" / "Servers offline" take the full width. */
.server-row.is-wide { grid-column: 1 / -1; grid-template-areas: "dot name"; grid-template-columns: auto 1fr; grid-template-rows: auto; align-items: center; }
.server-row > .status-dot { grid-area: dot; margin-top: 6px; }
.server-row.is-wide > .status-dot { margin-top: 0; }
.server-name { grid-area: name; min-width: 0; font-weight: 800; font-size: 17px; display: flex; flex-direction: column; line-height: 1.2; }
.server-name small { color: var(--muted); font-weight: 600; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.server-pop { grid-area: pop; display: flex; flex-direction: column; gap: 5px; }
.pop-bar { height: 6px; border-radius: 3px; background: #232020; overflow: hidden; }
.pop-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--accent)); border-radius: 3px; min-width: 2px; }
.pop-text { font-size: 12px; color: var(--muted); font-weight: 700; }
.server-ping { grid-area: ping; font-size: 12px; color: var(--muted); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; margin-top: 3px; white-space: nowrap; }
.server-note { min-height: 1.4em; margin: 10px 0; color: var(--muted); font-weight: 700; font-size: 14px; }
.server-note.is-warn { color: #ffb3a3; }
.server-card .btn-big { width: 100%; }
.foot { display: flex; align-items: center; gap: 8px; margin: 0; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 6px rgba(25, 23, 23, 0.8); }

/* ---------- Shared top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px 0; }
.server-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.you-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding-right: 6px; }

/* ---------- Lobby ---------- */
.screen-lobby, .screen-room {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1440px; margin: 0 auto; padding: 14px 18px 18px;
}
.lobby-grid {
  flex: 1; min-height: 0;
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-rows: minmax(0, 1.45fr) minmax(210px, 1fr);
}
.rooms-panel { grid-column: 1; grid-row: 1; }
.players-panel { grid-column: 2; grid-row: 1 / span 2; }
.lobby-grid .chat-panel { grid-column: 1; grid-row: 2; }

.room-grid {
  flex: 1; overflow-y: auto; padding: 14px;
  display: grid; gap: 10px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.room-card {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px;
  text-align: left;
  background: var(--raised);
  border: 0; border-left: 5px solid var(--mint); border-radius: 12px;
  box-shadow: 0 3px 0 #272323;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.06s ease;
}
.room-card:hover { background: var(--raised-hi); }
.room-card:active { transform: translateY(2px); box-shadow: 0 1px 0 #272323; }
.room-card.is-playing { border-left-color: var(--red); }
.room-card.is-full { border-left-color: var(--faint); }
.room-card[aria-disabled='true'] { cursor: default; }
.room-card[aria-disabled='true']:active { transform: none; box-shadow: 0 3px 0 #272323; }
.room-no {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 10px;
  background: #232020;
  font: 400 30px/1 var(--display); color: var(--accent);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
}
.room-no-sm { width: 40px; height: 40px; font-size: 22px; }
.room-main { display: flex; flex-direction: column; min-width: 0; }
.room-title { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-title .icon { color: var(--accent); }
.room-host { font-size: 13px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pips { display: flex; gap: 4px; }
.pip { width: 9px; height: 9px; border-radius: 50%; background: #232020; box-shadow: inset 0 0 0 1.5px var(--line); }
.pip.is-filled { background: var(--accent); box-shadow: none; }
.room-state { font-size: 12px; font-weight: 800; color: var(--mint); }
.is-playing .room-state { color: #ff8a73; }
.is-full .room-state { color: var(--muted); }

.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 40px 16px; color: var(--muted); }
.empty p { margin: 0; }
.empty .btn { margin-top: 14px; }
.empty-title { font: 400 22px var(--display); color: var(--text); }

.player-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.player-row:hover { background: rgba(255, 255, 255, 0.04); }
.player-row.is-you { background: rgba(58, 169, 240, 0.1); }
.player-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.player-name { display: flex; align-items: center; gap: 6px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-where { font-size: 12px; color: var(--muted); font-weight: 600; }
/* Leaderboard (bottom half of the Online panel) */
.players-panel .player-list { flex: 1 1 0; min-height: 0; }
.board-head { border-top: 1px solid var(--line-soft); border-radius: 0; }
.board-list { list-style: none; margin: 0; padding: 6px 8px 8px; overflow-y: auto; flex: 1 1 0; min-height: 0; }
.board-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-weight: 800; font-size: 14px; }
.board-row:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.board-row.is-you { background: rgba(58, 169, 240, 0.1); }
.board-pos { flex: none; min-width: 24px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-row.is-top1 .board-pos { color: #ffd45e; }
.board-row.is-top2 .board-pos { color: #dad7d7; }
.board-row.is-top3 .board-pos { color: #e3a26b; }
.board-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-stat { margin-left: auto; padding-left: 8px; flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.board-stat small { font-size: 11px; opacity: 0.8; }
.board-row.is-top1 .board-stat { color: #ffd45e; }
.board-empty { padding: 10px 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.you-tag { font-size: 11px; font-weight: 800; color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 0 5px; }

/* ---------- Chat ---------- */
.chat-log { list-style: none; margin: 0; padding: 10px 14px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-line { display: flex; gap: 8px; align-items: baseline; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.chat-time { flex: none; color: var(--faint); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 32px; }
.chat-from { flex: none; font-weight: 800; }
.chat-from::after { content: ':'; color: var(--faint); }
.chat-text { color: #e4e2e2; }
.chat-line.is-system { padding-left: 40px; }
.chat-line.is-system .chat-text { color: var(--muted); font-style: italic; font-size: 13px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line-soft); }
.chat-form .btn { min-height: 44px; width: 48px; padding: 0; }

/* ---------- Room ---------- */
.room-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 0 6px; font: 400 26px/1.1 var(--display); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.room-heading .icon { color: var(--accent); }
.room-layout {
  flex: 1; min-height: 0;
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr) auto;
}
.slots-panel { grid-column: 1; grid-row: 1; padding: 16px; overflow-y: auto; }
/* The side panel scrolls when its content is taller than the window; the Start button stays pinned below it. */
.room-side { grid-column: 2; grid-row: 1 / span 2; padding: 18px; justify-content: flex-start; gap: 18px; overflow-y: auto; scrollbar-gutter: stable; }
.room-side > * { flex: none; }
.room-layout .chat-panel { grid-column: 1; grid-row: 2 / span 2; min-height: 200px; }

.teams-legend { display: flex; gap: 8px; margin-bottom: 12px; }
.team-tag { font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.team-tag.team-red { background: rgba(232, 85, 58, 0.18); color: #ff9a85; }
.team-tag.team-blue { background: rgba(58, 143, 232, 0.18); color: #8fc3ff; }

.slot-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.slot {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 10px 16px;
  background: var(--raised);
  border-radius: 14px;
  box-shadow: 0 3px 0 #272323;
  overflow: hidden;
}
.slot::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; }
.slot.team-red::before { background: var(--red); }
.slot.team-blue::before { background: var(--blue); }
.slot.is-you { box-shadow: 0 3px 0 #272323, inset 0 0 0 2px var(--accent); }
.slot.is-empty { background: rgba(35, 32, 32, 0.55); box-shadow: inset 0 0 0 2px var(--line-soft); justify-content: center; min-height: 140px; }
.slot.is-empty::before { opacity: 0.35; }
.slot-open { color: var(--faint); font: 400 18px var(--display); }
.slot-name { font-weight: 800; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.slot-badge.is-host { background: var(--accent); color: var(--accent-ink); }
.slot-badge.is-ready { background: var(--mint); color: #0d3a1f; }
.slot-badge.is-waiting { background: #232020; color: var(--muted); }

/* Settings strip in the top bar, next to the room name. */
.room-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; min-width: 0; font-size: 13px; }
.room-info-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.room-info dt { color: var(--muted); font-weight: 700; }
.room-info dd { margin: 0; font-weight: 800; }
.room-action { grid-column: 2; grid-row: 3; padding: 14px 16px 12px; gap: 8px; }
.action-note { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; text-align: center; min-height: 2.6em; line-height: 1.3; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(22, 20, 20, 0.6); overscroll-behavior: contain; }
/* While a dialog is open the page behind it stays put (phones would otherwise scroll the room under your finger). */
html.modal-open, html.modal-open body { overflow: hidden !important; }
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); width: min(440px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); animation: pop 0.16s ease-out; }
.modal-wide { width: min(640px, 100%); }
/* The type chart has 18 types: give it more room, and let it scroll sideways on narrow screens. */
.modal-wide:has(.type-chart) { width: min(800px, 100%); }
.type-chart-wrap { overflow-x: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font: 400 24px var(--display); }
.modal-head { flex: none; }
/* The dialog's content scrolls on its own, and the scroll never spills over to the page. */
.modal-body { padding: 18px 20px 20px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.modal-body > p { margin: 0 0 12px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.modal-actions .btn-big { width: 100%; }
@keyframes pop { from { transform: scale(0.96) translateY(6px); opacity: 0; } }

.shop-body .segmented { display: flex; }
.shop-body .seg { flex: 1; padding: 9px 0; }
.shop-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px 26px; color: var(--muted); }
.shop-empty .icon { color: var(--red); margin-bottom: 6px; }
.shop-empty p { margin: 0; max-width: 40ch; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 10px; font-weight: 800; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: pop 0.16s ease-out; transition: opacity 0.4s ease, transform 0.4s ease; }
.toast-error { border-color: #ff6b5a; color: #ffc2b6; }
.toast-out { opacity: 0; transform: translateY(-8px); }

/* ---------- Game screen: fills the window; sidebars only past the map's edges ---------- */
.screen-game { position: fixed; inset: 0; z-index: 1; overflow: hidden; background: #171515; }
/* Sized at the 1280 x 720 scale; game.ts sets the frame's real width/height to the window's shape and scales it. */
.frame { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; display: flex; flex-direction: column; }
.battlefield { position: relative; height: 570px; flex: none; }
#game { display: block; width: 1280px; height: 570px; outline: none; }
.game-sidebar {
  position: absolute; top: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(90, 82, 82, 0.35), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #2c2929, #1f1c1c);
}
.game-sidebar-left { box-shadow: inset -3px 0 0 rgba(58, 169, 240, 0.55), inset -10px 0 24px rgba(0, 0, 0, 0.5); }
.game-sidebar-right { box-shadow: inset 3px 0 0 rgba(58, 169, 240, 0.55), inset 10px 0 24px rgba(0, 0, 0, 0.5); }

.console {
  display: grid; grid-template-columns: 200px 222px minmax(0, 1fr) 236px; gap: 14px; align-items: stretch;
  height: 150px; flex: none; padding: 9px max(14px, calc((100% - 1252px) / 2)) 10px;
  /* On wide screens the console's controls keep their classic 1280 layout, centered. */
  background: linear-gradient(180deg, #443f3f 0%, #322d2d 45%, #2a2626 100%);
  border-top: 3px solid var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.console > div { min-width: 0; }
.c-caption { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.c-caption kbd, .meter-head kbd {
  display: inline-block; min-width: 18px; padding: 0 4px; margin-right: 2px;
  font: 800 11px/17px var(--body); text-align: center; color: #fff;
  background: #1a1818; border-radius: 4px; box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.08);
}

/* Angle gauge */
.c-angle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
#angle-gauge { width: 200px; height: 104px; }
.c-angle { gap: 4px; }
.angle-row { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.angle-dial { position: relative; }
/* The key hints sit in the empty top corner beside the half dial. */
.angle-keys { position: absolute; top: 0; right: -6px; line-height: 1.9; text-align: right; }
.angle-last { font: 400 14px/1 var(--display); color: var(--muted); white-space: nowrap; }
.angle-last b { font-weight: 400; color: #3aa9f0; margin-left: 3px; }

/* Keycap buttons: shots, pass, leave */
.key-btn {
  position: relative; display: grid; place-items: center;
  border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #524b4b, #413c3c);
  color: #fff; box-shadow: 0 4px 0 #232020, inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
}
.key-btn:hover:not(:disabled) { filter: brightness(1.15); }
.key-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #232020; }
.key-btn:disabled { cursor: not-allowed; opacity: 0.4; }
.key-label {
  position: absolute; top: 5px; left: 6px;
  font: 800 10px/1 var(--body); letter-spacing: 0.02em;
  padding: 3px 4px; border-radius: 4px;
  background: #1a1818; color: var(--accent-hi);
}
.c-shots { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 40px; gap: 8px; }
.shot-name { font: 400 30px/1 var(--display); padding-top: 6px; }
.shot-btn.is-on { background: linear-gradient(180deg, var(--accent), var(--accent-btn)); color: #fff; box-shadow: 0 4px 0 var(--accent-deep), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.shot-btn.is-on .key-label { background: rgba(58, 39, 6, 0.85); }
.shot-ss .shot-name { color: #ffb3a3; }
.pass-btn { grid-column: 1 / -1; }
.pass-btn .shot-name { font-size: 20px; padding-top: 0; }
.pass-btn .key-label { top: 50%; transform: translateY(-50%); }

/* Power and move meters */
.c-meters { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.meter-name { font: 400 18px/1 var(--display); color: #fff; letter-spacing: 0.02em; }
.meter-name b { font-weight: 400; color: var(--accent-hi); margin-left: 4px; }
.power-meter { position: relative; height: 30px; margin-top: 12px; border-radius: 8px; background: #1a1818; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 0 2px #494343; }
.power-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #ffe27a, #ff9f43 70%, #ff4d4d); }
.power-ticks {
  position: absolute; inset: 0; border-radius: 8px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255, 255, 255, 0.28) calc(10% - 1px) 10%) bottom / 100% 40% no-repeat,
    repeating-linear-gradient(90deg, transparent 0 calc(50% - 1px), rgba(255, 255, 255, 0.45) calc(50% - 1px) 50%);
}
.power-last { position: absolute; top: -12px; bottom: -4px; width: 0; transform: translateX(-1px); border-left: 3px solid var(--accent); }
.power-last::before { content: ''; position: absolute; top: -2px; left: -8px; border: 7px solid transparent; border-top-color: var(--accent); }
.power-last span { position: absolute; top: -15px; left: 8px; font: 800 11px/1 var(--body); color: var(--accent-hi); white-space: nowrap; }
.move-meter { height: 10px; border-radius: 5px; background: #1a1818; box-shadow: 0 0 0 2px #494343; overflow: hidden; }
.move-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #3fb36b, var(--mint)); transition: width 0.1s linear; }

/* Items and footer */
.c-side { display: flex; flex-direction: column; gap: 6px; }
.items { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 6px; flex: 1; }
.item-slot { position: relative; border: 0; border-radius: 8px; background: #232020; box-shadow: inset 0 0 0 2px #494343, inset 0 3px 6px rgba(0, 0, 0, 0.5); cursor: not-allowed; }
.item-slot .key-label { top: 4px; left: 4px; }
.c-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-title { font-size: 12px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leave-btn { height: 36px; padding: 0 14px; font-weight: 800; font-size: 14px; }
.leave-btn.is-primary { background: linear-gradient(180deg, var(--accent), var(--accent-btn)); color: #fff; box-shadow: 0 4px 0 var(--accent-deep); }

/* Not your turn: the controls step back. */
.console:not(.is-my-turn) .c-shots, .console:not(.is-my-turn) .c-meters, .console:not(.is-my-turn) .c-angle { opacity: 0.5; }

/* Chat over the battlefield */
.chat-overlay { position: absolute; left: 12px; bottom: 12px; width: min(420px, 45%); pointer-events: none; }
.co { display: flex; flex-direction: column; gap: 6px; }
.co-log { list-style: none; margin: 0; padding: 0; max-height: 160px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.co-line { font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.6); transition: opacity 1s ease; overflow-wrap: anywhere; }
.co-line.is-system { color: #dcd9d9; font-style: italic; font-weight: 600; }
.co-line.is-old { opacity: 0; }
.co.is-open { pointer-events: auto; }
.co.is-open .co-log { overflow-y: auto; background: rgba(26, 24, 24, 0.72); border-radius: 8px; padding: 6px 8px; }
.co.is-open .co-line.is-old { opacity: 0.85; }
.co-input { width: 100%; height: 34px; padding: 0 10px; border: 2px solid var(--accent); border-radius: 8px; background: rgba(26, 24, 24, 0.9); color: #fff; font-weight: 700; outline: none; }


/* ---------- Smaller screens ---------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100%; }
  .screen-lobby, .screen-room { height: auto; }
  .lobby-grid, .room-layout { grid-template-columns: 1fr; grid-template-rows: none; }
  .rooms-panel, .players-panel, .lobby-grid .chat-panel,
  .slots-panel, .room-side, .room-action, .room-layout .chat-panel { grid-column: 1; grid-row: auto; }
  .room-side { overflow: visible; }
  .rooms-panel { min-height: 320px; }
  /* Stacked on a phone: Online and Leaderboard each show about five names, then scroll. */
  .players-panel { max-height: none; }
  .players-panel .player-list { flex: none; height: 290px; min-height: 290px; }
  .players-panel .board-list { flex: none; height: 172px; min-height: 172px; }
  .chat-panel { height: 340px; }
  .room-layout .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Narrow phones: one server per row. */
@media (max-width: 480px) {
  .server-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-card { grid-template-columns: 48px minmax(0, 1fr); }
  .room-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .room-no { width: 48px; height: 48px; font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Room teams: blue left, red right ---------- */
/* Start countdown above the teams: everyone ready, the host has 10 seconds to start. Turns red for the last 5. */
.ready-timer { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 10px 16px; border-radius: var(--r-ctrl); background: var(--raised); border: 2px solid var(--mint); }
.ready-timer-num { flex: none; min-width: 1.6em; font-family: var(--display); font-size: 40px; line-height: 1; text-align: center; color: var(--mint); font-variant-numeric: tabular-nums; }
.ready-timer-text { font-weight: 800; font-size: 15px; }
.ready-timer.is-urgent { border-color: var(--red); }
.ready-timer.is-urgent .ready-timer-num { color: var(--red); animation: timer-beat 1s ease-out infinite; }
.ready-timer.is-host.is-urgent { background: rgba(232, 85, 58, 0.16); }
@keyframes timer-beat { 0% { transform: scale(1.25); } 40%, 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ready-timer.is-urgent .ready-timer-num { animation: none; } }
.teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: start; }
.team-col { border-radius: 14px; background: rgba(35, 32, 32, 0.55); overflow: hidden; }
.team-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.team-head h2 { margin: 0; font: 400 22px/1 var(--display); letter-spacing: 0.02em; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.team-count { font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); color: #fff; }
.team-blue .team-head { background: linear-gradient(180deg, #4a9cf0, var(--blue)); box-shadow: inset 0 -3px 0 var(--blue-deep); }
.team-red .team-head { background: linear-gradient(180deg, #f2694f, var(--red)); box-shadow: inset 0 -3px 0 var(--red-deep); }
.team-blue { box-shadow: inset 0 0 0 2px rgba(58, 143, 232, 0.35); }
.team-red { box-shadow: inset 0 0 0 2px rgba(232, 85, 58, 0.35); }
.seat-list { list-style: none; margin: 0; padding: 10px; display: grid; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 62px; background: var(--raised); border-radius: 10px; box-shadow: 0 3px 0 #272323; }
.seat.is-you { box-shadow: 0 3px 0 #272323, inset 0 0 0 2px var(--accent); }
.seat-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.is-empty { background: transparent; box-shadow: inset 0 0 0 2px var(--line-soft); justify-content: center; }
.seat-open { color: var(--faint); font: 400 17px var(--display); }
.team-note { margin: 0; padding: 0 14px 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.versus-col { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 36px; }
.versus { font: 400 34px/1 var(--display); color: var(--accent); text-shadow: 0 3px 0 #0f5a8c, 0 6px 14px rgba(0, 0, 0, 0.4); }
.switch-btn { flex-direction: column; gap: 4px; min-height: 64px; width: 96px; padding: 8px 6px; font-size: 13px; white-space: normal; line-height: 1.15; }
@media (max-width: 700px) {
  .teams { grid-template-columns: 1fr; }
  .versus-col { padding: 0; flex-direction: row; justify-content: center; }
  .switch-btn { flex-direction: row; width: auto; min-height: 40px; }
}

.modal-actions-split { justify-content: space-between; gap: 10px; }
.modal-actions-split .btn { flex: 1; }
.meter-name { white-space: nowrap; }
.meter-head .c-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Login ---------- */
.account-box { display: flex; flex-direction: column; }
.account-box .segmented-lg { margin-bottom: 4px; }
.field-hint { margin: 5px 0 0; color: var(--faint); font-size: 12px; font-weight: 600; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.continue-box { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--raised); }
.continue-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.continue-text strong { font: 400 24px/1.1 var(--display); }
.continue-hello { color: var(--muted); font-size: 13px; font-weight: 700; }
.server-card .list-head { margin-top: 14px; }

/* ---------- Wallet ---------- */
.wallet { display: inline-flex; gap: 6px; }
.coin { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 7px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.coin-gold .icon { color: #f6c445; }
.coin-cash .icon { color: #5fd3ef; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-group { margin-top: 14px; }
/* Item stats on/off tag (server list and lobby) */
.items-tag { display: inline-block; margin-left: 2px; padding: 1px 8px; border-radius: 999px; font: 800 11px/1.6 var(--body); letter-spacing: 0.01em; }
.items-tag.is-items { background: rgba(58, 169, 240, 0.18); color: var(--accent-hi); }
.items-tag.is-noitems { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.server-pill .items-tag { margin-left: 4px; }
.continue-box .btn { min-height: 36px; padding: 0 12px; font-size: 14px; }

/* ---------- Ranks ---------- */
.rank-icon { flex: none; vertical-align: middle; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
button.you-chip { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 4px 10px 4px 6px; border-radius: 999px; }
button.you-chip:hover { background: rgba(255, 255, 255, 0.07); }
.ranks-body { max-height: min(78vh, 760px); display: flex; flex-direction: column; gap: 12px; }
.ranks-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px; border-radius: 14px; background: var(--raised); }
.ranks-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ranks-name { font: 400 26px/1.1 var(--display); }
.ranks-gp { color: var(--accent-hi); font-weight: 800; font-variant-numeric: tabular-nums; }
.ranks-progress { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.ranks-bar { height: 8px; border-radius: 4px; background: #232020; overflow: hidden; }
.ranks-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.ranks-next { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.ranks-record { display: flex; gap: 14px; margin: 0; }
.ranks-record div { display: flex; flex-direction: column; align-items: center; }
.ranks-record dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.ranks-record dd { margin: 0; font: 400 22px/1.1 var(--display); }
.ranks-how { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.45; }
.ranks-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; flex: 1; min-height: 0; border-radius: 12px; background: rgba(35, 32, 32, 0.6); }
.ranks-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 5px 10px; border-radius: 8px; opacity: 0.55; }
.ranks-row.is-reached { opacity: 1; }
.ranks-row.is-top { opacity: 1; }
.ranks-row.is-you { background: rgba(58, 169, 240, 0.16); box-shadow: inset 0 0 0 2px var(--accent); }
.ranks-row-name { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.ranks-row-need { color: var(--accent-hi); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.ranks-row.is-top .ranks-row-need { color: #ffb3a3; }
.seat-name .rank-icon, .player-name .rank-icon { margin-right: 2px; }

/* Rank progress in the lobby top bar */
.xp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: inherit; cursor: pointer; }
.xp-chip:hover { background: var(--raised); }
.xp-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; gap: 3px; }
.xp-gp { font-weight: 800; font-size: 12px; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.xp-next { font-weight: 700; font-size: 10px; color: var(--muted); }
.xp-bar { display: block; width: 110px; height: 7px; border-radius: 4px; background: #232020; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.xp-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
@media (max-width: 900px) { .xp-text { display: none; } .xp-bar { width: 70px; } }

/* ---------- Shop (full screen) ---------- */
.screen-shop { display: flex; flex-direction: column; gap: 14px; max-width: 1440px; margin: 0 auto; padding: 14px 18px 18px; }
.shop-title { display: flex; align-items: center; gap: 10px; margin: 0 0 0 6px; font: 400 30px/1 var(--display); letter-spacing: 0.02em; color: var(--accent-hi); text-shadow: 0 2px 0 #0b3f63; }
.shop-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 400px) 1fr; gap: 14px; }
.shop-left { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-height: 0; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-cash { background: linear-gradient(180deg, #8fe6ff, #42bfe6); color: #08303d; box-shadow: 0 3px 0 #1d7f9c, inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.btn-cash:hover:not(:disabled) { background: linear-gradient(180deg, #b5f0ff, #5fd3ef); }
.btn-quiet.is-armed { background: #3a2f6e; box-shadow: 0 3px 0 #272323, inset 0 0 0 2px #b46bff; }

.shop-avatar .avatar-row { display: flex; gap: 12px; padding: 12px; }
.stage-wrap { position: relative; flex: none; }
.shop-stage {
  width: 190px; height: 190px; border-radius: 14px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #5c5454 0%, #353030 70%) center / cover no-repeat;
  box-shadow: inset 0 0 0 2px var(--accent-deep), inset 0 0 0 4px #232020, 0 6px 16px rgba(20, 18, 18, 0.4);
}
.shop-stage.has-bg { background-color: #353030; background-size: cover; }
.shop-stage .char-img { width: 182px; height: 182px; filter: drop-shadow(0 4px 4px rgba(25, 23, 23, 0.35)); }
.stage-note { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; background: #b46bff; color: #fff; font: 800 11px/1.6 var(--body); box-shadow: 0 2px 0 #5a2a9a; }
.avatar-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.stat-list { margin: 0; display: grid; gap: 7px; }
.stat-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; }
.stat-row dt { font: 400 15px/1 var(--display); color: var(--accent-hi); letter-spacing: 0.03em; }
.stat-row dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.stat-bar { flex: 1; height: 8px; border-radius: 4px; background: #232020; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-soft); }
.stat-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #b5e1fa); border-radius: 4px; transition: width 0.25s ease; }
.stat-val { width: 40px; text-align: right; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.stat-diff { font-weight: 900; font-size: 12px; padding: 0 5px; border-radius: 6px; }
.stat-diff.is-up { color: #0d3a1f; background: var(--mint); }
.stat-diff.is-down { color: #fff; background: #c2412a; }
.stat-note { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.3; }
.avatar-side .btn { align-self: flex-start; margin-top: auto; }

.shop-inv .count { margin-left: 2px; }
.inv-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; align-content: start; }
.inv-empty { grid-column: 1 / -1; margin: 6px 2px; color: var(--muted); font-weight: 700; font-size: 14px; }
.inv-tile { position: relative; border-radius: 10px; background: var(--raised); box-shadow: 0 3px 0 #272323; }
.inv-tile.is-on { box-shadow: 0 3px 0 #272323, inset 0 0 0 2px var(--accent); background: #464040; }
.inv-pick { width: 100%; border: 0; background: none; padding: 6px 4px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.inv-pick .thumb { width: 58px; height: 58px; display: grid; place-items: center; }
.inv-pick .thumb.is-ex { border-radius: 8px; background-size: cover; background-position: center; }
.inv-name { font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; color: var(--text); }
.inv-on { font-size: 10px; font-weight: 900; color: var(--accent-ink); background: var(--accent); padding: 0 6px; border-radius: 999px; }
.inv-sell { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 6px; padding: 1px 5px; font-size: 10px; font-weight: 800; background: rgba(35, 32, 32, 0.85); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.inv-tile:hover .inv-sell, .inv-sell:focus-visible { opacity: 1; }
.inv-sell:hover { color: #fff; background: #c2412a; }

.shop-catalog .panel-head h2 { min-width: 110px; }
.page-text { color: var(--muted); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.seg-tier-1.is-on { background: #3e7a5a; }
.seg-tier-2.is-on { background: #2f5fb0; }
.seg-tier-3.is-on { background: linear-gradient(90deg, #b46bff, #ff6ac1); color: #fff; }
.seg-tier-4.is-on { background: linear-gradient(90deg, #ff8a1a, #e8344e); color: #fff; }
.seg-tier-5.is-on { background: linear-gradient(90deg, #1994de, #3aa9f0); color: #fff; }
.shop-catalog .panel-head .segmented .seg { padding-left: 10px; padding-right: 10px; }
.shop-grid { flex: 1; min-height: 0; padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, minmax(max-content, 1fr)); gap: 10px; overflow-y: auto; }
.item-card {
  position: relative; min-height: min-content; display: grid; grid-template-columns: 108px 1fr; grid-template-rows: auto auto 1fr auto auto; column-gap: 12px;
  padding: 8px 10px 9px; border-radius: 12px; background: linear-gradient(180deg, #443f3f, #373232); box-shadow: 0 3px 0 #232020, inset 0 0 0 1px var(--line-soft);
}
.item-card.is-blank { background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 2px var(--line-soft); }
.item-card.tier-2 { background: linear-gradient(180deg, #274077, #1b2a5a); box-shadow: 0 3px 0 #10142e, inset 0 0 0 1px rgba(110, 160, 255, 0.35); }
.item-card.tier-3 { background: linear-gradient(160deg, #3c2a7a, #23194f 60%, #3a1a5a); box-shadow: 0 3px 0 #10142e, inset 0 0 0 1.5px rgba(214, 140, 255, 0.6), 0 0 18px rgba(180, 107, 255, 0.18); }
/* Event: seasonal orange; Jims: OnlyJims charcoal and blue */
.item-card.tier-4 { background: linear-gradient(160deg, #6a2a3a, #3a1a3a 60%, #4a2030); box-shadow: 0 3px 0 #10142e, inset 0 0 0 1.5px rgba(255, 150, 70, 0.6), 0 0 16px rgba(255, 120, 40, 0.16); }
.item-card.tier-5 { background: radial-gradient(circle at 70% 0%, #34302f, #232020 60%, #1a1717); box-shadow: 0 3px 0 #0c0a0a, inset 0 0 0 1.5px rgba(25, 148, 222, 0.75), 0 0 18px rgba(25, 148, 222, 0.22); }
.item-card.is-tried { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px #b46bff; }
.item-card.is-locked .card-preview, .item-card.is-locked .pbanner { filter: saturate(0.7) brightness(0.85); }
.item-card.is-owned .card-preview { opacity: 0.92; }
.card-tags { grid-column: 1 / -1; display: flex; gap: 5px; align-items: center; margin-bottom: 4px; }
.tier-tag, .set-tag { font: 800 10px/1.7 var(--body); padding: 0 7px; border-radius: 999px; letter-spacing: 0.02em; text-transform: uppercase; }
.tier-1 .tier-tag { background: rgba(99, 212, 142, 0.18); color: #8ff0b1; }
.tier-2 .tier-tag { background: rgba(90, 150, 255, 0.22); color: #a9c8ff; }
.tier-3 .tier-tag { background: linear-gradient(90deg, #b46bff, #ff6ac1); color: #fff; }
.tier-4 .tier-tag { background: linear-gradient(90deg, #ff8a1a, #e8344e); color: #fff; }
.tier-5 .tier-tag { background: #1994de; color: #fff; }
.lock-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font: 800 10px/1.7 var(--body); padding: 0 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; background: rgba(30, 27, 27, 0.6); color: #ffd0a0; box-shadow: inset 0 0 0 1px rgba(255, 208, 160, 0.35); }
.tier-5 .lock-tag { color: #9fd8ff; box-shadow: inset 0 0 0 1px rgba(25, 148, 222, 0.5); }
.btn-locked:disabled { opacity: 1; cursor: not-allowed; background: repeating-linear-gradient(135deg, #3d3838 0 6px, #353030 6px 12px); color: #b9b3b3; box-shadow: inset 0 0 0 1px var(--line-soft); }
.shop-empty { grid-column: 1 / -1; align-self: center; text-align: center; color: var(--muted); font-weight: 700; margin: 0; padding: 30px 10px; }
.set-tag { background: rgba(58, 169, 240, 0.16); color: var(--accent-hi); text-transform: none; }
.card-preview { grid-row: 2 / span 4; align-self: center; width: 108px; height: 108px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #5f5656, #322d2d 75%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.card-preview.is-ex { background-size: cover; background-position: center; }
.tier-3 .card-preview { background: radial-gradient(circle at 50% 40%, #6a46b8, #251a52 75%); }
.tier-4 .card-preview { background: radial-gradient(circle at 50% 40%, #a3503a, #3a1a2e 75%); }
.tier-5 .card-preview { background: radial-gradient(circle at 50% 40%, #3a3434, #1a1717 75%); box-shadow: inset 0 0 0 1px rgba(25, 148, 222, 0.4); }
.card-name { margin: 0; min-height: 1.15em; font: 400 17px/1.1 var(--display); letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-3 .card-name { background: linear-gradient(90deg, #ffe39b, #ff9fe0, #9fd8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tier-4 .card-name { color: #ffd0a0; }
.tier-5 .card-name { color: #6fc3ff; }
.card-stats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-content: flex-start; }
.stat-chip { font: 800 11px/1.6 var(--body); padding: 0 6px; border-radius: 6px; background: #232020; color: #cfe0ff; }
.stat-chip.is-none { color: var(--muted); }
.card-prices { display: flex; align-items: center; gap: 5px; margin: 5px 0 6px; flex-wrap: wrap; }
.card-prices .coin { padding: 2px 8px 2px 5px; font-size: 13px; }
.card-prices .or { color: var(--faint); font-size: 11px; font-weight: 800; }
.owned-tag { font: 800 12px/1.8 var(--body); padding: 0 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.card-actions { display: flex; gap: 6px; }
.card-actions .btn { flex: 1; }

.shop-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); }
.page-arrow {
  display: grid; place-items: center; width: 50px; height: 44px; border: 0; border-radius: 12px; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, #3aa9f0, #1994de); box-shadow: 0 3px 0 #0f6aa6, inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.page-arrow svg { filter: drop-shadow(0 1px 0 #0f6aa6); }
.page-arrow:hover:not(:disabled) { background: linear-gradient(180deg, #ffc77e, #ff8a2a); }
.page-arrow:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0f6aa6; }
.page-arrow:disabled { opacity: 0.45; cursor: default; }
.shop-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: #232020; box-shadow: inset 0 0 0 1px var(--line-soft); }
.shop-tab { border: 0; cursor: pointer; padding: 9px 16px; border-radius: 10px; background: transparent; color: var(--muted); font: 400 17px/1 var(--display); letter-spacing: 0.02em; }
.shop-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.shop-tab.is-on { background: linear-gradient(180deg, var(--accent), var(--accent-btn)); color: #fff; box-shadow: 0 2px 0 var(--accent-deep); }
/* The tabs and page arrows in the shop's top bar */
.shop-nav { display: flex; align-items: center; gap: 8px; }
.shop-nav .page-arrow { width: 42px; height: 38px; }
.shop-nav .shop-tab { padding: 8px 14px; font-size: 16px; }

.buy-top { display: flex; gap: 16px; align-items: center; }
.buy-preview { flex: none; width: 150px; height: 150px; border-radius: 12px; background: radial-gradient(circle at 50% 38%, #5c5454, #353030 75%) center / cover no-repeat; box-shadow: inset 0 0 0 2px var(--accent-deep); }
.buy-name { margin: 0; font: 400 26px/1.1 var(--display); }
.buy-meta { margin: 4px 0 0; font-weight: 800; font-size: 13px; color: var(--muted); }
.tier-text-3 { color: #e0a9ff; }
.tier-text-4 { color: #ffb070; }
.tier-text-5 { color: #6fc3ff; }
.buy-stats { margin: 8px 0 10px; font-weight: 700; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.buy-actions { gap: 10px; flex-wrap: wrap; }
.buy-actions .btn { flex: 1; min-width: 180px; }
.pay-short { font-size: 12px; font-weight: 800; opacity: 0.85; margin-left: 2px; }

.gender-intro { margin-top: 0; }
.gender-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.gender-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #5c5454, #353030 75%); box-shadow: 0 4px 0 #232020, inset 0 0 0 2px var(--line);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.gender-card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #232020, inset 0 0 0 2px var(--accent); }
.gender-name { font: 400 24px/1 var(--display); color: var(--accent-hi); }

/* Character pictures in lists and seats */
.char-img { display: block; flex: none; }
.face-chip { flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--av, #6f6666), var(--av-deep, #3a3535)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); }

@media (max-width: 1100px) {
  .screen-shop { height: auto; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .item-card { min-height: 150px; }
}
.seat { min-height: 84px; padding: 6px 12px 6px 6px; }
.seat-art { flex: none; width: 76px; height: 72px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #5c5454, #353030 75%) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.seat-art .char-img { width: 76px; height: 76px; margin-top: 4px; }
.team-blue .seat-art { box-shadow: inset 0 0 0 2px rgba(58, 143, 232, 0.6); }
.team-red .seat-art { box-shadow: inset 0 0 0 2px rgba(232, 85, 58, 0.6); }

/* ---------- Player banner (room seats, EX items) ---------- */
.pbanner {
  --pb-h: 92px; --pb-frame: #2a4f9a; --pb-frame-hi: #6fa8ff;
  position: relative; width: 100%; height: var(--pb-h); border-radius: 10px; overflow: hidden; isolation: isolate;
  background: #302c2c;
  box-shadow: 0 3px 0 #0c1130, inset 0 0 0 2px var(--pb-frame-hi), inset 0 0 0 4px var(--pb-frame);
}
.pbanner.is-red { --pb-frame: #8a2a18; --pb-frame-hi: #ff8a6a; }
.pbanner.is-you { box-shadow: 0 3px 0 #0c1130, 0 0 0 2px var(--accent), inset 0 0 0 2px var(--pb-frame-hi), inset 0 0 0 4px var(--pb-frame); }
.pb-bg { position: absolute; inset: 0; z-index: -1; background-size: cover; background-position: center; }
.pbanner.is-plain .pb-bg { background: linear-gradient(180deg, #4f8de8 0%, #2c5fc0 55%, #1d3f8f 100%); }
.pbanner.is-plain.is-red .pb-bg { background: linear-gradient(180deg, #ef7a5c 0%, #c4442a 55%, #8a2a18 100%); }
.pbanner.is-plain .pb-bg::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.06) 0 14px, transparent 14px 34px); }
.pb-head {
  position: absolute; left: 4px; right: 4px; top: 4px; height: calc(var(--pb-h) * 0.27); min-height: 20px;
  display: flex; align-items: center; gap: 6px; padding: 0 8px 0 calc(var(--pb-h) * 0.86 + 8px);
  background: linear-gradient(180deg, rgba(30, 27, 27, 0.82), rgba(30, 27, 27, 0.55)); border-radius: 6px 6px 0 0;
}
.pb-name { font-weight: 900; font-size: max(12px, calc(var(--pb-h) * 0.16)); color: #fff; text-shadow: 0 1px 2px #000a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-head .slot-badge { padding: 1px 9px; font-size: 11px; }
.pb-char { position: absolute; z-index: 1; left: 2px; bottom: calc(var(--pb-h) * -0.08); width: calc(var(--pb-h) * 0.95); filter: drop-shadow(0 3px 3px rgba(8, 10, 30, 0.45)); }
.pb-char .char-img { width: 100%; height: auto; }
.pb-chev { position: absolute; right: 8px; bottom: 10%; height: 62%; width: auto; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }

.pbanner.has-side { --pb-side: min(calc(var(--pb-h) * 1.05), 28%); }
.pb-side { position: absolute; z-index: 2; top: 4px; right: 4px; bottom: 4px; width: var(--pb-side); display: flex; container-type: inline-size; }
.pbanner.has-side .pb-head { right: calc(var(--pb-side) + 6px); border-radius: 6px 0 0 0; overflow: hidden; }
.pbanner.has-side .pb-name { flex-shrink: 0; max-width: 100%; }
.seat-status {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 0 6px 6px 0;
  font: 400 min(calc(var(--pb-h) * 0.22), 21cqw)/1 var(--display, 'Lilita One', sans-serif); text-transform: uppercase; letter-spacing: 0.02em; text-align: center;
}
.seat-status.is-ready { background: linear-gradient(180deg, #7ff0a6, #34c46a); color: #0b3a1d; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
.seat-status-check { font-size: 1.3em; }
.seat-status.is-waiting { background: rgba(10, 14, 40, 0.62); color: #aab3d6; font-size: min(calc(var(--pb-h) * 0.15), 15cqw); }
.seat-status.is-match { background: rgba(10, 14, 40, 0.72); color: var(--accent); font-size: min(calc(var(--pb-h) * 0.15), 15cqw); }
.seat.seat-banner { padding: 0; min-height: 0; background: none; box-shadow: none; display: block; }
.seat-list { gap: 10px; }

.my-card { padding: 0 12px 12px; display: grid; gap: 5px; }
.my-card-label { color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.item-card.is-ex-card { display: flex; flex-direction: column; gap: 6px; }
.is-ex-card .card-tags { margin: 0; }
.is-ex-card .card-name { margin-left: 2px; font-size: 16px; }
.ex-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.ex-foot .card-prices { margin: 0; flex: 1; }
.ex-foot .card-actions { flex: none; }
.ex-foot .card-actions .btn { flex: none; }
.buy-banner { margin-bottom: 14px; }

/* Shot buttons show the mobile's shot names; the console names your mobile */
.shot-btn { grid-template-rows: 1fr auto; padding-bottom: 5px; }
.shot-btn .shot-name { font-size: 26px; padding-top: 8px; }
.shot-sub { font: 800 10px/1 var(--body); letter-spacing: 0.01em; opacity: 0.85; white-space: nowrap; }
.c-side-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mobile-tag { flex: none; font: 400 14px/1 var(--display); letter-spacing: 0.03em; color: #bfe9ff; padding: 3px 8px; border-radius: 6px; background: linear-gradient(180deg, #2a6fc0, #1c4f91); box-shadow: inset 0 0 0 1px rgba(160, 220, 255, 0.4); }
.shot-btn.is-locked:disabled { opacity: 0.6; background: repeating-linear-gradient(135deg, #413c3c 0 8px, #363131 8px 16px); }
.shot-btn.is-locked .shot-sub { color: #ffb3a3; }
/* SS ready: the button glows (a pulsing warm ring) so you notice it's available again. */
.shot-ss.is-ready:not(:disabled)::after {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 179, 163, 0.9), 0 0 14px 3px rgba(255, 140, 90, 0.75);
  animation: ss-ready 1.3s ease-in-out infinite;
}
.shot-ss.is-ready:not(:disabled) .shot-name { text-shadow: 0 0 10px rgba(255, 150, 110, 0.9); }
@keyframes ss-ready { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .shot-ss.is-ready:not(:disabled)::after { animation: none; opacity: 0.85; } }

/* Mobile picker (room) and mobile chips on seats */
.mobile-box { padding: 14px 16px 4px; }
.mobile-box-title { margin: 0 0 8px; font: 400 18px/1 var(--display); letter-spacing: 0.02em; color: var(--accent-hi); }
.mobile-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mobile-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border: 0; border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #5c5454, #353030 80%); color: var(--text); box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--line);
}
.mobile-opt:hover:not(:disabled) { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--accent-deep); }
.mobile-opt.is-on { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--accent), 0 0 14px rgba(58, 169, 240, 0.25); }
.mobile-opt:disabled { cursor: default; opacity: 0.7; }
.mobile-name { font: 400 16px/1 var(--display); letter-spacing: 0.02em; }
.mobile-opt.is-on .mobile-name { color: var(--accent-hi); }
.seat-tags { display: inline-flex; align-items: center; gap: 5px; }
.mobile-chip { font: 800 11px/1.7 var(--body); padding: 0 8px; border-radius: 999px; color: #fff; background: #2f6fc0; }
.mobile-chip.is-zard { background: #d8641a; }
.mobile-tag.is-zard { color: #ffe2c4; background: linear-gradient(180deg, #e8742a, #a8440e); box-shadow: inset 0 0 0 1px rgba(255, 200, 150, 0.45); }
.mobile-pick { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mobile-opt .mobile-name { font-size: 14px; }
.mobile-chip.is-swamptoad { background: #3f9a43; }
.mobile-tag.is-swamptoad { color: #e6ffd9; background: linear-gradient(180deg, #4caf50, #2e7d32); box-shadow: inset 0 0 0 1px rgba(190, 255, 170, 0.45); }
.mobile-pick { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mobile-opt .mobile-name { font-size: 12px; }
.mobile-chip.is-zap { background: #c99a00; color: #1b1400; }
.mobile-tag.is-zap { color: #2a2000; background: linear-gradient(180deg, #ffe06a, #e0aa00); box-shadow: inset 0 0 0 1px rgba(255, 245, 190, 0.6); }
.mobile-pick { grid-template-columns: repeat(3, 1fr); }
.mobile-chip.is-yew2 { background: #8e4ad6; }
.mobile-tag.is-yew2 { color: #fff; background: linear-gradient(180deg, #a865f0, #6a2fb0); box-shadow: inset 0 0 0 1px rgba(240, 210, 255, 0.5); }
.mobile-chip.is-jimcena { background: #3fae49; }
.mobile-tag.is-jimcena { color: #10230f; background: linear-gradient(180deg, #f6d7bd, #d9a57f); box-shadow: inset 0 0 0 1px rgba(63, 174, 73, 0.8); }
.mobile-chip.is-3shits { background: #7a4f2a; }
.mobile-tag.is-3shits { color: #fff1e0; background: linear-gradient(180deg, #8f6037, #5a3a1c); box-shadow: inset 0 0 0 1px rgba(255, 143, 177, 0.6); }
#angle-gauge { transition: transform 0.2s ease; }
.mobile-chip.is-lisa { background: #6fa8d8; }
.mobile-tag.is-lisa { color: #12304a; background: linear-gradient(180deg, #e6f4ff, #a9d4f5); box-shadow: inset 0 0 0 1px rgba(200, 210, 225, 0.9); }
.mobile-chip.is-donny { background: #2b3f7a; }
.mobile-tag.is-donny { color: #fff; background: linear-gradient(180deg, #3a54a0, #1f2f5c); box-shadow: inset 0 0 0 1px rgba(208, 38, 43, 0.85); }

/* ---- Touch screens ------------------------------------------------------------------------- */
/* Taps act at once (no double-tap zoom delay) on every button. */
button, .seg, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* The battle screen never scrolls or zooms under a finger. */
html.is-touch .screen-game, html.is-touch .screen-game canvas { touch-action: none; }
.chat-open-btn { background: none; border: 0; padding: 4px 2px; font: inherit; cursor: pointer; }
.chat-open-btn:hover { color: var(--text, #fff); }

.touch-controls { position: fixed; z-index: 5; pointer-events: none; --tc: 56px; }
.touch-controls[hidden] { display: none; }
.touch-controls > * { pointer-events: auto; }
.tc-pad {
  position: absolute; left: calc(14px + env(safe-area-inset-left)); bottom: 14px;
  display: grid; grid-template-columns: repeat(3, var(--tc)); grid-template-rows: repeat(3, var(--tc)); gap: 3px;
}
.tc-btn, .tc-power {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 2px solid rgba(255, 255, 255, 0.45); color: #fff; background: rgba(26, 24, 24, 0.38);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
  opacity: 0.55; transition: opacity 0.15s, background 0.1s, transform 0.08s;
  font: 800 10px Nunito, system-ui; letter-spacing: 0.04em; text-transform: uppercase;
}
.tc-btn { border-radius: 12px; padding: 0; }
.tc-btn svg { width: 46%; height: 46%; }
.tc-btn span { font-size: 8px; opacity: 0.85; }
.tc-up { grid-column: 2; grid-row: 1; }
.tc-left { grid-column: 1; grid-row: 2; }
.tc-right { grid-column: 3; grid-row: 2; }
.tc-down { grid-column: 2; grid-row: 3; }
.tc-power {
  position: absolute; right: calc(18px + env(safe-area-inset-right)); bottom: 18px;
  width: calc(var(--tc) * 1.9); height: calc(var(--tc) * 1.9); border-radius: 50%;
  border-color: rgba(255, 213, 74, 0.7); background: rgba(80, 50, 0, 0.32);
}
.tc-power b { font: 400 calc(var(--tc) * 0.34) "Lilita One", system-ui; letter-spacing: 0.03em; color: #8fd0f7; }
.tc-power span { font-size: 8px; opacity: 0.8; text-transform: none; line-height: 1.1; text-align: center; padding: 0 6px; }
.touch-controls.is-small .tc-btn span, .touch-controls.is-small .tc-power span { display: none; }
.touch-controls.is-small .tc-btn svg { width: 52%; height: 52%; }
.touch-controls.is-myturn .tc-btn, .touch-controls.is-myturn .tc-power { opacity: 0.8; }
.tc-btn.is-down { background: rgba(255, 255, 255, 0.3); transform: scale(0.94); opacity: 1; }
.tc-power.is-charging { background: rgba(255, 170, 30, 0.5); transform: scale(0.95); opacity: 1; }

.rotate-hint { display: none; }
@media (orientation: portrait) {
  html.is-touch .screen-game .rotate-hint {
    display: block; position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6;
    padding: 8px 14px; border-radius: 999px; background: rgba(26, 24, 24, 0.8); color: #fff;
    font: 700 13px Nunito, system-ui; white-space: nowrap; pointer-events: none;
  }
}
.mobile-chip.is-wraith { background: #6b4fa0; }
.mobile-tag.is-wraith { color: #f0e8ff; background: linear-gradient(180deg, #6b4fa0, #3b2a5e); box-shadow: inset 0 0 0 1px rgba(190, 255, 205, 0.5); }
.mobile-chip.is-mimic { background: #3fae94; }
.mobile-tag.is-mimic { color: #3a0f33; background: linear-gradient(180deg, #f0b6e6, #c75bb4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.mobile-chip.is-gdude { background: #8a2332; }
.mobile-tag.is-gdude { color: #eaf6ff; background: linear-gradient(180deg, #a83242, #5e1622); box-shadow: inset 0 0 0 1px rgba(110, 200, 255, 0.6); }
.mobile-chip.is-jimitsu { background: #ee8a2a; }
.mobile-tag.is-jimitsu { color: #fffdf6; background: linear-gradient(180deg, #f39a3c, #b85a14); box-shadow: inset 0 0 0 1px rgba(255, 226, 70, 0.75); }

/* ---- Sound button ------------------------------------------------------------------------- */
.settings-btn {
  position: fixed; right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: #ececec; background: rgba(26, 24, 24, 0.72); border: 1px solid rgba(58, 169, 240, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.settings-btn svg { width: 20px; height: 20px; }
.settings-btn:hover { border-color: #3aa9f0; }
.settings-btn .icon { display: grid; place-items: center; }
.c-side-head .settings-btn .icon svg { width: 15px; height: 15px; }

/* ---- Settings window ------------------------------------------------------------------------ */
.settings-section { margin: 0 0 4px; font: 400 18px var(--display); letter-spacing: 0.02em; color: var(--accent-hi); }
.vol-row { margin-top: 12px; }
.vol-label { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 800; font-size: 14px; }
.vol-line { display: flex; align-items: center; gap: 10px; }
.vol-mute { flex: none; color: var(--text); }
.vol-row.is-muted .vol-mute { color: #726969; }
.vol-value { flex: none; width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.vol-slider { flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; --fill: 80%; }
.vol-slider::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--fill), #232020 var(--fill)); box-shadow: inset 0 0 0 1px var(--line); }
.vol-slider::-moz-range-track { height: 8px; border-radius: 999px; background: #232020; box-shadow: inset 0 0 0 1px var(--line); }
.vol-slider::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent); }
.vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; border: 2px solid var(--accent-deep); background: linear-gradient(180deg, var(--accent-hi), var(--accent)); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
.vol-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-deep); background: linear-gradient(180deg, var(--accent-hi), var(--accent)); }
.vol-slider:focus-visible { outline: none; }
.vol-slider:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent-hi); outline-offset: 2px; }
.c-foot .settings-btn { position: static; width: 30px; height: 30px; box-shadow: none; }
.c-foot .settings-btn svg { width: 17px; height: 17px; }

/* ---- Types ---------------------------------------------------------------------------------- */
.type-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; vertical-align: middle;
  font: 800 10px Nunito, system-ui; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.5;
  color: #1c1a1a; background: var(--type, #b8b49a); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.mobile-opt .type-badge { margin: 2px 0 0; font-size: 9px; }
.type-chart-btn { margin-left: auto; font-size: 12px; padding: 4px 10px; }
.mobile-box-head { display: flex; align-items: center; gap: 8px; }
.type-chart { border-collapse: separate; border-spacing: 2px; font: 700 11px Nunito, system-ui; margin: 0 auto; }
.type-chart th { padding: 2px 3px; color: var(--muted, #aab); font-weight: 800; }
.type-chart th .type-badge { margin: 0; font-size: 9px; padding: 1px 4px; }
.type-chart th.vert .type-badge { writing-mode: vertical-rl; transform: rotate(180deg); padding: 4px 1px; }
.type-chart td { width: 30px; height: 24px; text-align: center; border-radius: 4px; background: rgba(255, 255, 255, 0.04); color: #10131f; }
.type-chart td.is-strong { background: #f0a43a; }
.type-chart td.is-weak { background: #7f8aa8; }
.type-chart td.is-barely { background: #4b5068; color: #dfe3f0; }
.type-chart-note { margin: 10px 0 0; color: var(--muted, #aab); font-size: 12px; text-align: center; }
/* 11 mobiles: four smaller cards per row so the room info still fits. */
.mobile-pick { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mobile-opt { padding: 4px 2px 6px; }
.mobile-opt .mobile-name { font-size: 11px; }
.topbar .settings-btn { position: static; width: 38px; height: 38px; flex: none; }
.c-side-head .settings-btn { position: static; width: 26px; height: 26px; margin-left: auto; flex: none; box-shadow: none; }
.c-side-head .settings-btn svg { width: 15px; height: 15px; }

/* ---- Select Tank ------------------------------------------------------------------------- */
.my-tank { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 6px 0 8px; border-radius: 12px;
  background: radial-gradient(circle at 25% 50%, #5c5454, #353030 80%); box-shadow: inset 0 0 0 2px var(--line); }
.my-tank-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.my-tank-text strong { font: 400 20px "Lilita One", system-ui; letter-spacing: 0.02em; }
.my-tank-text .type-badge { margin: 0; }
.select-tank-btn { width: 100%; }
.tank-secret-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.tank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tank-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #5c5454, #353030 80%); color: var(--text); box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--line);
}
.tank-card:hover { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--accent-deep); }
.tank-card.is-on { box-shadow: 0 3px 0 #232020, inset 0 0 0 3px var(--accent, #3aa9f0); }
.tank-card-name { font: 400 16px "Lilita One", system-ui; letter-spacing: 0.02em; }
.tank-card .type-badge { margin: 0; }
.tank-card.is-disabled { opacity: 0.45; filter: grayscale(1); cursor: not-allowed; }
.tank-card.is-disabled:hover { box-shadow: 0 3px 0 #232020; }
/* Custom tanks (Tank Workshop): a gold edge and who made it. */
.tank-card.is-custom { background: radial-gradient(circle at 50% 40%, #5f5644, #383126 80%); }
.tank-card-by { margin-top: -3px; font-size: 11px; font-weight: 700; color: #f5c542; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tank-off-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
/* Random: its own wide button above the grid, apart from the tanks. */
.tank-random {
  display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; margin: 0 0 14px; padding: 10px 16px;
  border: 0; border-radius: 14px; cursor: pointer; color: var(--text); text-align: left;
  background: linear-gradient(135deg, #3a2f78, #443f3f 55%, #353030);
  box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--line);
}
.tank-random:hover { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--accent-deep); }
.tank-random:hover .random-icon svg { transform: rotate(-8deg) scale(1.06); }
.tank-random.is-on { box-shadow: 0 3px 0 #232020, inset 0 0 0 3px var(--accent, #3aa9f0); }
.tank-random-text { display: flex; flex-direction: column; gap: 3px; }
.tank-random-sub { font-size: 12px; font-weight: 700; color: var(--muted); }
.random-icon { display: inline-flex; flex: none; }
.random-icon svg { width: 100%; height: 100%; transition: transform 0.15s; }
.mobile-chip.is-secret { background: #3a4160; color: #cfd6ee; min-width: 22px; text-align: center; }

/* ---- Login Bonus and Daily Missions -------------------------------------------------------- */
.daily-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.daily-btn {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 12px; cursor: pointer; text-align: left;
  color: var(--text); background: linear-gradient(180deg, #5c5454, #443e3e); box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--line);
}
.daily-btn:hover { box-shadow: 0 3px 0 #232020, inset 0 0 0 2px var(--accent-deep, #0f6aa6); }
.daily-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #232020, inset 0 0 0 2px var(--line); }
.daily-btn svg { flex: none; color: #8fd0f7; }
.daily-missions svg { color: #9fd3ff; }
.daily-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.daily-text b { font: 400 15px "Lilita One", system-ui; letter-spacing: 0.02em; }
.daily-text span { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.daily-btn.has-dot::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: #ff5a4a; box-shadow: 0 0 0 2px #353030, 0 0 8px rgba(255, 90, 74, 0.8); animation: dot-pulse 1.4s ease-in-out infinite;
}
.daily-btn.has-dot .daily-text span { color: #8fd0f7; }
@keyframes dot-pulse { 50% { transform: scale(1.25); } }
.missions { display: flex; flex-direction: column; gap: 10px; min-width: min(560px, 80vw); }
.mission { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.mission.is-done { box-shadow: inset 0 0 0 2px var(--accent, #3aa9f0); }
.mission.is-claimed { opacity: 0.6; }
.mission-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mission-text { font-size: 15px; }
.mission-bar { height: 10px; border-radius: 999px; background: #221f1f; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.mission-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3aa9f0, #8fd0f7); }
.mission-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.mission-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.mission-rewards { display: flex; gap: 6px; }
.rw { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font: 800 12px Nunito, system-ui; background: rgba(0, 0, 0, 0.3); }
.rw-gp { color: #b6f0a0; } .rw-gold { color: #ffd54a; } .rw-cash { color: #9fd3ff; }
.mission-claim { min-width: 110px; }
.mission-claimed { font-weight: 800; color: #9be59b; font-size: 13px; padding: 6px 0; }
.mission-note { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 640px) { .mission { flex-direction: column; align-items: stretch; } .mission-side { align-items: stretch; } }
/* The lobby top bar is the busiest: tighter spacing so the sound button fits on the same line. */
.screen-lobby .topbar { gap: 8px; }
.screen-lobby .topbar .settings-btn { width: 34px; height: 34px; }
.screen-lobby .topbar .server-pill .items-tag { display: none; }
@media (min-width: 1360px) { .screen-lobby .topbar .server-pill .items-tag { display: inline; } }

/* ---- Battle items --------------------------------------------------------------------------- */
.items-box { margin-top: 10px; }
.room-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.room-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 7px; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--text); background: #353030; box-shadow: 0 2px 0 #232020, inset 0 0 0 2px var(--line);
}
.room-item:hover:not(:disabled) { box-shadow: 0 2px 0 #232020, inset 0 0 0 2px var(--accent-deep, #0f6aa6); }
.room-item.is-empty { opacity: 0.6; }
.room-item-name { font-size: 11px; font-weight: 800; }
.item-icon { display: inline-grid; place-items: center; flex: none; }
.item-icon:empty { border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15); }
.item-pick { display: flex; flex-direction: column; gap: 8px; min-width: min(460px, 80vw); }
.item-pick-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 12px; cursor: pointer; text-align: left;
  color: var(--text); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line);
}
.item-pick-row:hover { box-shadow: inset 0 0 0 2px var(--accent-deep, #0f6aa6); }
.item-pick-row.is-on { box-shadow: inset 0 0 0 2px var(--accent, #3aa9f0); }
.item-pick-text { display: flex; flex-direction: column; gap: 2px; }
.item-pick-text strong { font: 400 17px "Lilita One", system-ui; letter-spacing: 0.02em; }
.item-pick-text span { font-size: 12px; color: var(--muted); }
/* In the battle console. */
.item-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--text); }
.item-slot:not(:disabled) { cursor: pointer; box-shadow: inset 0 0 0 2px #6f6666, inset 0 3px 6px rgba(0, 0, 0, 0.5); }
.item-slot:not(:disabled):hover { box-shadow: inset 0 0 0 2px #3aa9f0, inset 0 3px 6px rgba(0, 0, 0, 0.5); }
.item-slot.is-armed { background: #173a52; box-shadow: inset 0 0 0 2px #8fd0f7, 0 0 10px rgba(143, 208, 247, 0.6); }
.item-slot .item-name { font-size: 9px; font-weight: 800; line-height: 1; }
.item-slot.is-empty .item-name { opacity: 0.4; }
.item-slot:disabled .item-icon { opacity: 0.55; }
.items { grid-template-rows: 1fr; }
.my-tank { padding: 4px 10px; margin: 4px 0 6px; }
.tank-secret-note { margin: 4px 0 0; }
.items-box { margin-top: 6px; }
.room-item { padding: 4px 2px 5px; }

/* ---- Map choice in Room Settings ----------------------------------------------------------- */
.map-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.map-opt {
  padding: 16px 4px 6px; border: 0; border-radius: 10px; cursor: pointer; font: 800 12px Nunito, system-ui; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); box-shadow: inset 0 0 0 2px var(--line); background-size: cover;
}
.map-opt.is-on { box-shadow: inset 0 0 0 3px var(--accent, #f0b84a), 0 0 8px rgba(240, 184, 74, 0.5); }
.map-opt.is-random { background: linear-gradient(135deg, #3a4790, #1b2150); }
.map-opt.is-space { background: radial-gradient(circle at 50% 38%, #000 0 14%, #ffd27a 16%, #ff7a2a 22%, rgba(120, 40, 160, 0.5) 34%, transparent 48%), linear-gradient(180deg, #05030d 0%, #170a2e 56%, #78dcff 57%, #3a3460 100%); }
.map-opt.is-jungle { background: linear-gradient(180deg, #03100f 0%, #0b2a24 55%, #2e5c34 56%, #3e2e24 100%); }
.map-opt.is-beach { background: linear-gradient(180deg, #2fb6e8 0%, #ffc9a8 45%, #29b8c8 46%, #1e8fae 55%, #f6e2b2 56%, #d6aa70 100%); }
.map-opt.is-snow { background: linear-gradient(180deg, #7ea7d4 0%, #e3eefa 55%, #f4f9ff 56%, #80a0c0 100%); }
.map-opt.is-graveyard { background: linear-gradient(180deg, #060818 0%, #3a2c50 55%, #465c42 56%, #423640 100%); }
.maptype-pick { grid-template-columns: repeat(4, 1fr); }
.maptype-opt { padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: linear-gradient(180deg, #484242, #353030); }
.maptype-opt svg { width: 100%; max-width: 64px; height: 26px; display: block; }

/* ---- Room Settings: two columns, toggles for weather and items ------------------------------- */
.modal-settings { width: min(900px, 100%); }
.modal-settings .room-settings { max-height: calc(100vh - 90px); overflow-y: auto; }
.rs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.rs-col { min-width: 0; }
@media (max-width: 760px) { .rs-cols { grid-template-columns: 1fr; } }
.toggle-row { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-soft); background: #232020; color: var(--faint); font: 800 13px Nunito, system-ui;
}
.toggle-chip .item-icon { opacity: 0.45; }
.toggle-chip.is-on { color: #fff; border-color: var(--accent, #3aa9f0); background: #3d3838; }
.toggle-chip.is-on .item-icon { opacity: 1; }
.toggle-chip:not(.is-on) { text-decoration: line-through; }
.toggle-dot { width: 10px; height: 10px; border-radius: 50%; background: #554e4e; }
.toggle-chip.wx-force.is-on .toggle-dot { background: #ffd54a; box-shadow: 0 0 6px #ffd54a; }
.toggle-chip.wx-lightning.is-on .toggle-dot { background: #9fc4ff; box-shadow: 0 0 6px #9fc4ff; }
.toggle-chip.wx-tornado.is-on .toggle-dot { background: #d8d4d4; box-shadow: 0 0 6px #d8d4d4; }
.toggle-chip.wx-mirror.is-on .toggle-dot { background: #8fe3ff; box-shadow: 0 0 6px #8fe3ff; }
.room-item.is-banned { opacity: 0.45; }
.room-item.is-banned .room-item-name { text-decoration: line-through; }
.item-pick-row.is-banned { opacity: 0.6; }
.banned-tag { color: #ff9a85; font-style: normal; font-weight: 700; font-size: 12px; }

/* ---- Item picker in the room side panel ------------------------------------------------------ */
.item-palette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 6px 0 10px; }
.palette-item {
  display: flex; align-items: center; gap: 5px; padding: 5px 6px; border: 0; border-radius: 9px; cursor: pointer; min-width: 0;
  color: var(--text); background: #2e2a2a; box-shadow: inset 0 0 0 1.5px var(--line-soft); font: 800 11px Nunito, system-ui; text-align: left;
}
.palette-item:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--accent-deep, #0f6aa6); background: #3a3535; }
.palette-item:active:not(:disabled) { transform: translateY(1px); }
.palette-item:disabled { opacity: 0.5; cursor: default; }
.palette-item.is-banned { opacity: 0.45; }
.palette-item.is-banned .palette-item-name { text-decoration: line-through; }
.palette-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items-equipped-title { margin-top: 2px; }
.room-item.is-target { box-shadow: 0 2px 0 #232020, inset 0 0 0 2.5px var(--accent, #3aa9f0); }
.item-hint { margin: 6px 0 0; color: var(--faint); font-size: 11px; font-weight: 600; line-height: 1.3; }
/* Short windows: tighten the room side panel so the Start button always fits. */
@media (max-height: 820px) {
  .room-side { gap: 10px; padding: 14px 16px; }
  .room-side .tank-secret-note, .room-side .item-hint { display: none; }
  .item-palette { margin: 4px 0 6px; }
  .palette-item { padding: 4px 5px; }
  .room-item { padding: 3px 2px 4px; }
}
/* Very short windows: slightly smaller item icons so everything still fits. */
@media (max-height: 760px) {
  .room-side { gap: 8px; }
  .palette-item .item-icon, .palette-item .item-icon svg { width: 26px !important; height: 26px !important; }
  .room-item .item-icon, .room-item .item-icon svg { width: 31px !important; height: 31px !important; }
}

/* ---- Bot seats (host clicks open seats to add bots) -------------------------------------------- */
.seat.is-clickable { padding: 0; }
.seat-btn {
  flex: 1; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer; font: inherit; padding: 6px 12px;
}
.seat.is-empty.is-clickable:hover { box-shadow: inset 0 0 0 2px var(--accent-deep, #0f6aa6); background: rgba(58, 169, 240, 0.06); }
.seat-hint { color: var(--accent, #3aa9f0); font-size: 12px; font-weight: 800; opacity: 0; transition: opacity 0.12s; }
.seat.is-clickable:hover .seat-hint, .seat.is-clickable:focus-within .seat-hint { opacity: 1; }
html.is-touch .seat-hint { opacity: 0.8; }
.seat-banner-btn { padding: 0; display: block; width: 100%; text-align: left; }
.seat.seat-bot.is-clickable:hover .pbanner { box-shadow: 0 3px 0 #0c1130, 0 0 0 2px #ff9a85, inset 0 0 0 2px var(--pb-frame-hi), inset 0 0 0 4px var(--pb-frame); }
.seat-plus {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  font: 400 26px/1 var(--display); color: var(--faint); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 2px var(--line-soft);
}
.seat.is-empty.is-clickable .seat-plus { color: #04233a; background: linear-gradient(180deg, #8fd0f7, #3aa9f0); box-shadow: 0 2px 0 #0f6aa6; }
.seat.is-empty.is-clickable:hover .seat-plus { transform: scale(1.08); }
.seat-bot .seat-hint { color: #ff9a85; }
.seat-bot-name { font: 400 18px var(--display); color: #cfe0ff; }
.bot-face { display: grid; place-items: center; }

/* ---- Room Settings: mode select and the Bots / Wind pair -------------------------------------- */
.mode-select { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 12px; background: #232020; box-shadow: inset 0 0 0 1px var(--line-soft); }
.mode-arrow {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 9px; cursor: pointer; color: #fff; font-size: 15px;
  background: linear-gradient(180deg, #3aa9f0, #1994de); box-shadow: 0 2px 0 #0f6aa6;
}
.mode-arrow:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 #0f6aa6; }
.mode-arrow:disabled { opacity: 0.35; cursor: default; }
.mode-name { flex: 1; text-align: center; font: 400 20px var(--display); color: var(--accent-hi, #8fd0f7); }
.rs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Free-For-All room: one list of seats ------------------------------------------------------ */
.teams.is-ffa { grid-template-columns: minmax(0, 1fr) auto; }
.team-ffa .team-head { background: linear-gradient(180deg, #8a6ad8, #6a4fb8); }
.seat-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .seat-grid { grid-template-columns: 1fr; } }

/* ---- Hover popup (ui/tooltip.ts) ------------------------------------------------------------- */
.tooltip {
  position: fixed; z-index: 1000; left: 0; top: 0; width: max-content; max-width: 240px; padding: 9px 11px 10px;
  border-radius: 10px; background: #221f1f; color: var(--text); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 1.5px var(--accent-deep, #0f6aa6);
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s; visibility: hidden;
}
.tooltip.is-shown { opacity: 1; transform: none; visibility: visible; }
.tooltip::after {
  content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg);
  background: #221f1f; box-shadow: 1.5px 1.5px 0 var(--accent-deep, #0f6aa6);
}
.tooltip.is-below::after { bottom: auto; top: -6px; box-shadow: -1.5px -1.5px 0 var(--accent-deep, #0f6aa6); }
.tip-head { display: flex; align-items: center; gap: 9px; }
.tip-name { font: 400 17px/1.1 var(--display); color: var(--accent-hi, #8fd0f7); }
.tip-meta { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.tip-body { margin: 7px 0 0; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.tip-warn { margin: 5px 0 0; font-size: 12px; font-weight: 800; color: #ff9a85; }

/* Shot detail card: the wide version of the hover popup on the F1 / F2 / F3 shot buttons (ui/shotCard.ts). */
.tooltip.tooltip--card { max-width: min(340px, calc(100vw - 16px)); padding: 12px 14px 11px; }
.shot-card-head { display: flex; align-items: center; gap: 10px; }
.shot-card-head > .type-badge { margin: 0 0 0 auto; align-self: flex-start; }
.shot-card-key {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  font: 400 13px/1 var(--display); color: var(--accent-ink); background: var(--accent-hi);
}
.shot-card-title { min-width: 0; }
.shot-card-title .tip-name { font-size: 19px; }
.shot-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 10px; }
.shot-card-stat { display: flex; flex-direction: column; padding: 5px 7px 6px; border-radius: 7px; background: rgba(255, 255, 255, 0.05); }
.shot-card-label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.shot-card-value { font: 400 16px/1.15 var(--display); color: var(--text); }
.shot-card-sub { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.shot-card-traits { margin: 9px 0 0; padding: 0 0 0 15px; font-size: 12px; font-weight: 600; line-height: 1.35; }
.shot-card-traits li { margin: 3px 0 0; }
.shot-card-traits li::marker { color: var(--type, var(--accent)); }
.shot-card-mus { display: grid; gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.shot-card-mu { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.shot-card-mu .type-badge { margin: 0; font-size: 9px; padding: 0 5px; }
.shot-card-mu-label { width: 62px; flex: none; font-size: 10.5px; font-weight: 800; }
.shot-card-mu-label.is-good { color: #8fe08a; }
.shot-card-mu-label.is-bad { color: #ff9a85; }
.shot-card-note { margin: 8px 0 0; font-size: 11.5px; font-weight: 700; color: var(--accent-hi); }
.shot-card-foot { margin: 7px 0 0; font-size: 10.5px; font-weight: 600; line-height: 1.3; color: var(--muted); }

/* ---------- Statistics link (lobby, room, server select) ---------- */
a.btn { text-decoration: none; }
.stats-btn-wide { display: flex; width: 100%; margin-bottom: 12px; }

/* Account tags: a small square with the tag's first letter (gold J = Jims, purple S = Supporter).
   The badge's own look is set in tag.ts; these rules only place it. */
.tag-chip { margin-left: 6px; }
.chat-line .tag-chip { margin-left: 0; align-self: center; }
.co-line .tag-chip { margin-left: 0; }
.pb-head .tag-chip { margin-left: 0; }
.you-name { display: inline-flex; align-items: center; }

/* ---------- Icons (shop section): round badges by your name ---------- */
.face-chip.has-icon { background: #1b1818; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16); }
.face-chip.has-icon .icon-img { width: 100%; height: 100%; display: block; }
.icon-img { border-radius: 50%; }
.pb-icon { flex: none; display: inline-grid; place-items: center; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 1px 3px #000a; }
.pb-icon .icon-img { display: block; }
.card-preview.is-icon .icon-img { width: 84px; height: 84px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.14); }
.inv-pick .thumb.is-icon .icon-img { width: 46px; height: 46px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14); }
.buy-preview.is-icon { display: grid; place-items: center; }
.buy-preview.is-icon .icon-img { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(255, 255, 255, 0.16); }

/* ---- Your tank's shots (under Select Tank in the room) ------------------------------------------ */
.tank-shots { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tank-shot { padding: 6px 9px 7px; border-radius: 9px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-soft); cursor: default; }
.tank-shot.is-ss { box-shadow: inset 0 0 0 1px rgba(255, 196, 70, 0.45); background: rgba(255, 196, 70, 0.06); }
.tank-shot.is-random { color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.tank-shot-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tank-shot-key { flex: none; padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 900; letter-spacing: 0.03em; color: #04233a; background: #8fd0f7; }
.tank-shot.is-ss .tank-shot-key { background: #ffc446; color: #3a2400; }
.tank-shot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 15px "Lilita One", system-ui; letter-spacing: 0.02em; }
.tank-shot-dmg { flex: none; color: var(--muted); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tank-shot-about { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
/* (The side panel scrolls now, so the short shot descriptions always show.) */

/* ---- Phones held sideways: the room scrolls as one page and the chat stays small ------------------ */
@media (orientation: landscape) and (max-height: 540px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100%; }
  .screen-room { height: auto; padding: 10px calc(14px + env(safe-area-inset-right)) 14px calc(14px + env(safe-area-inset-left)); gap: 10px; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: auto auto auto; align-items: start; gap: 10px; }
  .slots-panel { grid-column: 1; grid-row: 1; overflow: visible; padding: 12px; }
  .room-side { grid-column: 2; grid-row: 1 / span 2; overflow: visible; height: auto; padding: 14px; gap: 10px; }
  .room-action { grid-column: 2; grid-row: 3; }
  .room-layout .chat-panel { grid-column: 1; grid-row: 2 / span 2; height: 190px; min-height: 0; }
  .room-layout .chat-panel .panel-head { padding-top: 8px; padding-bottom: 8px; }
  .room-layout .chat-panel .panel-head h2 { font-size: 17px; }
  .room-layout .chat-panel .chat-form { padding: 6px 10px 8px; }
  .room-layout .chat-panel .chat-form .btn, .room-layout .chat-panel .chat-input { min-height: 38px; height: 38px; }
  .room-side .tank-secret-note, .room-side .item-hint { display: block; }
}
