/* 消消宇宙 — Cosmic Animal Match-3 Stylesheet */
:root {
  --bg-deep: #0e1026;
  --bg-mid: #1a1d42;
  --glass: rgba(25, 29, 64, 0.78);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text-main: #f7f8ff;
  --text-dim: #b4bce2;
  --primary: #ff7aa8;
  --primary-2: #ffb36b;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --gold: #ffd166;
  --danger: #ff5c7c;
  --success: #52e5a0;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  font-family: 'Segoe UI', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at 20% 15%, #23275e 0%, var(--bg-deep) 60%, #090a1a 100%);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

/* Cosmic Background */
.cosmos-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 24%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 34% 72%, rgba(255, 230, 160, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 58% 18%, rgba(160, 220, 255, 0.8), transparent),
    radial-gradient(2px 2px at 78% 44%, rgba(255, 190, 220, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 88% 82%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 22% 88%, rgba(150, 255, 220, 0.6), transparent);
  background-size: 420px 420px;
  opacity: 0.75;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
}

.nebula-1 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #ff7aa8, transparent 70%);
  top: -120px;
  left: -80px;
}

.nebula-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #5eead4, transparent 70%);
  bottom: -160px;
  right: -100px;
}

/* Top Bar */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.brand-icon {
  font-size: 1.4rem;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conn-badge {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.conn-badge:hover {
  background: rgba(255, 255, 255, 0.14);
}

.icon-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-select {
  border: 1px solid var(--glass-border);
  background: rgba(20, 24, 54, 0.9);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Containers & Glass Cards */
.view-container {
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2px 16px 14px;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

/* Buttons */
.btn {
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  padding: 10px 18px;
  font-size: 0.95rem;
  color: #fff;
  transition: transform 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.86rem;
}

.btn-xs {
  padding: 6px 11px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #1c1026;
  box-shadow: 0 8px 22px rgba(255, 122, 168, 0.35);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1829;
  box-shadow: 0 8px 22px rgba(94, 234, 212, 0.28);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
}

/* Main Menu */
.hero-card {
  padding: 28px;
}

.hero-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff5d6, #ff9bc0 50%, #7ef5e3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 2px;
}

.hero-subtitle {
  text-align: center;
  color: var(--text-dim);
  margin: 8px auto 22px;
  max-width: 640px;
  line-height: 1.5;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
}

.profile-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.avatar-picker {
  display: flex;
  gap: 6px;
}

.avatar-opt {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.avatar-opt:hover {
  transform: scale(1.08);
}

.avatar-opt.active {
  border-color: var(--gold);
  background: rgba(255, 209, 102, 0.22);
  transform: scale(1.1);
}

.name-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.name-input-wrap label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.name-input-wrap input {
  background: rgba(12, 15, 36, 0.85);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: 155px;
  font-size: 0.92rem;
}

.profile-stats {
  display: flex;
  gap: 12px;
}

.stat-pill {
  background: rgba(12, 15, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 94px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.stat-pill strong {
  font-size: 1.05rem;
  color: var(--gold);
}

/* Mode Grid */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.mode-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.mode-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-emoji {
  font-size: 2.2rem;
}

.mode-head h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.mode-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge-solo {
  background: rgba(255, 122, 168, 0.22);
  color: #ffb3cd;
  border: 1px solid rgba(255, 122, 168, 0.4);
}

.badge-multi {
  background: rgba(94, 234, 212, 0.2);
  color: #8bf7e7;
  border: 1px solid rgba(94, 234, 212, 0.4);
}

.mode-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
}

.multi-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-row {
  display: flex;
  gap: 8px;
}

.join-row input {
  flex: 1;
  min-width: 0;
  background: rgba(12, 15, 36, 0.85);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

/* Lobby View */
.lobby-card {
  padding: 24px;
}

.lobby-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.room-code-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  background: rgba(94, 234, 212, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.35);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.room-code-box strong {
  font-size: 1.35rem;
  letter-spacing: 3px;
  color: var(--accent);
}

.lobby-settings {
  display: flex;
  align-items: center;
  gap: 10px;
}

.duration-select {
  background: rgba(12, 15, 36, 0.9);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.lobby-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}

.lobby-body h3 {
  font-size: 0.96rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.player-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.player-avatar {
  font-size: 1.35rem;
}

.tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.tag-host {
  background: rgba(255, 209, 102, 0.22);
  color: var(--gold);
}

.tag-you {
  background: rgba(94, 234, 212, 0.22);
  color: var(--accent);
}

.chat-log {
  height: 220px;
  overflow-y: auto;
  background: rgba(10, 12, 30, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
}

.chat-msg {
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg.sys {
  color: var(--gold);
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chat-form input {
  flex: 1;
  background: rgba(12, 15, 36, 0.85);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.lobby-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wait-hint {
  color: var(--gold);
  font-weight: 600;
}

/* Gameplay View */
.game-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
}

.board-column {
  flex: 0 1 620px;
  width: 100%;
  padding: 10px 14px 12px;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.hud-mode-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

.hud-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.metric-box {
  background: rgba(10, 13, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.metric-box span {
  font-size: 0.66rem;
  color: var(--text-dim);
}

.metric-box strong {
  font-size: 0.96rem;
  color: #fff;
}

.time-box strong {
  color: var(--accent);
}

.time-box.urgent strong {
  color: var(--danger);
  animation: pulseFast 0.7s infinite;
}

.hud-actions {
  display: flex;
  gap: 6px;
}

/* Hourglass Energy Bar */
.hourglass-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 13, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  margin-bottom: 10px;
}

.hourglass-icon {
  font-size: 1.55rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.hourglass-icon.refill {
  transform: scale(1.25) rotate(-12deg);
}

.hourglass-icon.drain {
  transform: scale(0.92) rotate(12deg);
}

.hourglass-icon.low {
  animation: shakeLow 0.45s infinite;
}

.hourglass-bar-area {
  flex: 1;
}

.hourglass-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 6px;
  color: var(--text-dim);
}

.hourglass-label-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drain-speed-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.16);
  color: var(--accent);
}

.drain-speed-badge.fast {
  background: rgba(255, 190, 92, 0.22);
  color: var(--gold);
}

.drain-speed-badge.hyper {
  background: rgba(255, 92, 124, 0.25);
  color: #ff8aa0;
}

.hourglass-values {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hourglass-values strong {
  color: var(--gold);
  font-size: 0.96rem;
}

.energy-delta {
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.25s;
}

.energy-delta.show {
  opacity: 1;
}

.energy-delta.plus {
  color: var(--success);
}

.energy-delta.minus {
  color: var(--danger);
}

.hourglass-track {
  height: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
}

.hourglass-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #52e5a0, #ffd166);
  transition: width 0.22s ease, background 0.25s ease;
}

.hourglass-fill.warn {
  background: linear-gradient(90deg, #ff9f43, #ffd166);
}

.hourglass-fill.danger {
  background: linear-gradient(90deg, #ff476f, #ff8566);
}

/* Board Canvas */
.board-stage {
  position: relative;
  width: min(100%, 540px, calc(100vh - 220px));
  width: min(100%, 540px, calc(100dvh - 220px));
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(11, 14, 34, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.55);
  touch-action: none;
  overscroll-behavior: contain;
}

#boardCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.board-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(18, 22, 56, 0.94);
  border: 2px solid var(--gold);
  color: var(--gold);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 6;
}

.waiting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 30, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
}

.waiting-card {
  text-align: center;
  padding: 24px;
}

.waiting-emoji {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.waiting-card p {
  margin-top: 8px;
  color: var(--gold);
  font-weight: 700;
  font-size: 1.15rem;
}

/* Multiplayer Sidebar */
.multi-sidebar {
  flex: 0 0 320px;
  width: 320px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sidebar-section h3 {
  font-size: 0.98rem;
  color: var(--text-dim);
}

.mini-code {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.14);
  padding: 3px 8px;
  border-radius: 8px;
}

.live-score-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
}

.live-score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}

.live-score-item.is-me {
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.12);
}

.live-rank {
  font-weight: 900;
  width: 24px;
  text-align: center;
  color: var(--gold);
}

.live-player-info {
  flex: 1;
  min-width: 0;
}

.live-player-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-player-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.live-player-score {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--gold);
}

.compact-chat {
  height: 170px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 8, 22, 0.76);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  padding: 26px;
  text-align: center;
}

.new-record-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ffd166, #ff7aa8);
  color: #1c1026;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 22px;
}

.res-stat {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.res-stat span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.res-stat strong {
  font-size: 1.35rem;
  color: var(--gold);
}

.standings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 22px;
  text-align: left;
  max-height: 280px;
  overflow-y: auto;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(20, 24, 58, 0.95);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

@keyframes shakeLow {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.08); }
  75% { transform: rotate(10deg) scale(1.08); }
}

@keyframes pulseFast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (max-width: 920px) {
  .game-layout {
    flex-direction: column;
    align-items: center;
  }
  .multi-sidebar {
    flex: 1 1 auto;
    width: 100%;
    max-width: 620px;
  }
  .lobby-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top-bar {
    padding: 6px 10px;
    gap: 6px;
  }
  .brand-wrap {
    font-size: 0.95rem;
    gap: 5px;
  }
  .brand-icon {
    font-size: 1.15rem;
  }
  .top-controls {
    gap: 6px;
  }
  .conn-badge {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
  .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 0.88rem;
  }
  .lang-select {
    padding: 4px 6px;
    font-size: 0.76rem;
    max-width: 108px;
  }
  .view-container {
    padding: 2px 6px 10px;
  }
  .hero-card,
  .lobby-card {
    padding: 14px;
    border-radius: 16px;
  }
  .profile-strip {
    padding: 10px 12px;
    gap: 10px;
  }
  .avatar-picker {
    flex-wrap: wrap;
    gap: 5px;
  }
  .avatar-opt {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
  }
  .name-input-wrap {
    width: 100%;
  }
  .name-input-wrap input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .profile-stats {
    width: 100%;
  }
  .stat-pill {
    flex: 1;
  }
  .board-column {
    padding: 8px 8px 10px;
    border-radius: 16px;
  }
  .game-hud {
    gap: 6px;
    margin-bottom: 6px;
  }
  .hud-left {
    order: 1;
  }
  .hud-actions {
    order: 2;
    gap: 4px;
  }
  .hud-actions .btn-xs {
    padding: 5px 8px;
    font-size: 0.74rem;
  }
  .hud-metrics {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }
  .metric-box {
    min-width: 0;
    padding: 4px 4px;
  }
  .metric-box span {
    font-size: 0.62rem;
    white-space: nowrap;
  }
  .metric-box strong {
    font-size: 0.88rem;
  }
  .hourglass-panel {
    padding: 5px 10px;
    margin-bottom: 8px;
    gap: 8px;
  }
  .hourglass-icon {
    font-size: 1.35rem;
  }
  .hourglass-labels {
    font-size: 0.74rem;
    margin-bottom: 4px;
  }
  .hourglass-track {
    height: 12px;
  }
  .board-stage {
    border-radius: 12px;
  }
  .multi-sidebar {
    padding: 12px;
    border-radius: 16px;
  }
  .live-score-list {
    max-height: 200px;
  }
  .compact-chat {
    height: 130px;
  }
  .modal-card {
    padding: 18px;
  }
}
