/* ===== WML CARD GAMES THEME - Dark Winter Blues ===== */

:root {
  --frost-bg:        #080c18;
  --frost-surface:   #0d1421;
  --frost-panel:     #101828;
  --frost-panel-alt: #131e30;
  --frost-border:    #1a2840;
  --frost-border-hi: #253852;
  --frost-blue:      #1a4080;
  --frost-blue-mid:  #2056a0;
  --frost-ice:       #5499cc;
  --frost-glow:      #7bbef5;
  --frost-accent:    #38bdf8;
  --frost-gold:      #eebb38;
  --frost-text:      #cce0f5;
  --frost-muted:     #4e6e8e;
  --frost-danger:    #d84455;
  --frost-success:   #38b86a;
  --frost-radius:    10px;
  --frost-shadow:    0 4px 24px rgba(0,0,0,0.4);
  --frost-shadow-lg: 0 8px 48px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }

body {
  background: var(--frost-bg);
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(26,64,128,0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(56,189,248,0.07) 0%, transparent 50%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--frost-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

/* ── Typography ────────────────────────────── */
.frost-title {
  font-family: Georgia, 'Times New Roman', serif;
  background: linear-gradient(135deg, var(--frost-glow) 0%, var(--frost-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.04em;
}

/* Fallback for contexts where gradient text doesn't work well */
.frost-title-plain {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--frost-glow);
  letter-spacing: 0.04em;
}

/* ── Navbar ────────────────────────────────── */
.frost-nav {
  background: rgba(8,12,24,0.92) !important;
  border-bottom: 1px solid var(--frost-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.5rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.frost-brand {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--frost-glow) 0%, var(--frost-accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.08em;
  text-decoration: none !important;
}
.frost-username {
  font-weight: 600;
  color: var(--frost-ice);
  font-size: 0.95rem;
}
.frost-nav .nav-link {
  color: var(--frost-muted) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem !important;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.frost-nav .nav-link:hover {
  color: var(--frost-glow) !important;
  background: rgba(91,163,217,0.08);
}

/* ── Buttons ───────────────────────────────── */
.btn-frost {
  background: linear-gradient(135deg, var(--frost-blue) 0%, var(--frost-blue-mid) 100%);
  border: 1px solid rgba(84,153,204,0.4);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  border-radius: var(--frost-radius);
}
.btn-frost:hover {
  background: linear-gradient(135deg, var(--frost-blue-mid) 0%, #1a8ecc 100%);
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 20px rgba(56,189,248,0.28), 0 4px 12px rgba(0,0,0,0.3);
  color: #fff;
  transform: translateY(-1px);
}
.btn-frost:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn-xs {
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* ── Inputs ────────────────────────────────── */
.frost-input {
  background: rgba(8,12,24,0.8) !important;
  border: 1px solid var(--frost-border) !important;
  color: var(--frost-text) !important;
  border-radius: var(--frost-radius) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.frost-input:focus {
  border-color: rgba(84,153,204,0.6) !important;
  box-shadow: 0 0 0 3px rgba(56,189,248,0.1) !important;
  outline: none;
  background: rgba(8,12,24,0.95) !important;
}
.frost-input::placeholder { color: var(--frost-muted) !important; }

/* ── Panels ────────────────────────────────── */
.frost-panel {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--frost-shadow);
}
.frost-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(84,153,204,0.4), transparent);
}

/* ── Auth card ─────────────────────────────── */
.frost-auth-card {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 18px;
  padding: 2.25rem;
  box-shadow: var(--frost-shadow-lg), 0 0 80px rgba(26,64,128,0.12);
}
.frost-auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(84,153,204,0.35), transparent);
  border-radius: 18px 18px 0 0;
  pointer-events: none;
}
.frost-icon-lg {
  font-size: 2.4rem;
  color: var(--frost-ice);
}
.frost-link {
  color: var(--frost-ice);
  text-decoration: none;
  font-weight: 500;
}
.frost-link:hover { color: var(--frost-glow); text-decoration: underline; }
.frost-divider {
  border-color: var(--frost-border);
  opacity: 0.4;
}

/* ── Hero ──────────────────────────────────── */
.frost-hero {
  position: relative;
  background: linear-gradient(160deg, rgba(8,12,24,0.92) 0%, rgba(16,24,40,0.97) 100%);
  border: 1px solid var(--frost-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--frost-shadow-lg);
}
.frost-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2354a0cc' fill-opacity='0.025'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.frost-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.3), transparent);
}
.frost-subtitle { color: var(--frost-ice); font-size: 1.15rem; opacity: 0.85; }

/* ── Feature cards ─────────────────────────── */
.frost-card {
  background: var(--frost-surface);
  border: 1px solid var(--frost-border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.frost-card:hover {
  border-color: var(--frost-border-hi);
  box-shadow: 0 0 24px rgba(84,153,204,0.12), 0 4px 20px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}
.frost-icon-wrap {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: rgba(26,64,128,0.3);
  border: 1px solid rgba(84,153,204,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 1.35rem;
  color: var(--frost-glow);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Lobby cards ───────────────────────────── */
.frost-lobby-card {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.frost-lobby-card:hover {
  border-color: var(--frost-border-hi);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(84,153,204,0.1), 0 6px 24px rgba(0,0,0,0.4);
}
.frost-lobby-name {
  color: var(--frost-glow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}
.frost-player-pips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 28px; }
.frost-pip {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--frost-blue) 0%, var(--frost-blue-mid) 100%);
  border: 1px solid rgba(84,153,204,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  color: #fff; text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.frost-pip-empty { background: transparent; border-style: dashed; border-color: var(--frost-border); color: var(--frost-muted); }

/* ── Badges ────────────────────────────────── */
.frost-badge-lock    { background: rgba(107,76,26,0.5); color: var(--frost-gold); border: 1px solid rgba(240,192,64,0.2); }
.frost-badge-private { background: rgba(61,26,76,0.5); color: #cc88ff; border: 1px solid rgba(160,80,220,0.2); }
.frost-badge-waiting { background: rgba(26,64,128,0.4); color: var(--frost-ice); border: 1px solid rgba(84,153,204,0.2); }
.frost-badge-ingame  { background: rgba(56,184,106,0.15); color: var(--frost-success); border: 1px solid rgba(56,184,106,0.25); }

/* ── Empty state ───────────────────────────── */
.frost-empty-state { opacity: 0.55; }

/* ── Lobby room ────────────────────────────── */
.frost-player-list { display: flex; flex-direction: column; gap: 5px; }
.frost-player-row {
  background: rgba(8,12,24,0.4);
  border: 1px solid var(--frost-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s, background 0.2s;
}
.frost-player-row:hover { border-color: var(--frost-border-hi); background: rgba(8,12,24,0.6); }
.frost-seat-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--frost-blue) 0%, var(--frost-blue-mid) 100%);
  border: 1px solid rgba(84,153,204,0.3);
  font-size: 0.68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.frost-player-name { font-weight: 600; color: var(--frost-text); font-size: 0.9rem; }
.frost-you-badge {
  display: inline-block;
  background: rgba(56,189,248,0.15);
  border: 1px solid rgba(56,189,248,0.3);
  color: var(--frost-accent);
  font-size: 0.58rem; font-weight: 700;
  padding: 0 5px; border-radius: 4px;
  vertical-align: middle; margin-left: 4px; letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Connection badge ──────────────────────── */
.frost-conn-badge {
  font-size: 0.55rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.4s;
}
.frost-conn-badge.connected    { color: var(--frost-success); filter: drop-shadow(0 0 3px rgba(56,184,106,0.6)); }
.frost-conn-badge.disconnected { color: #2a3845; }

/* ── Admin panel ───────────────────────────── */
.frost-admin-panel {
  background: rgba(238,187,56,0.04);
  border: 1px solid rgba(238,187,56,0.15);
  border-radius: 10px;
  padding: 0.85rem;
}
.frost-admin-label {
  color: rgba(238,187,56,0.65);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  font-weight: 600;
}

/* ── Lobby code ────────────────────────────── */
.frost-joincode-wrap {
  background: linear-gradient(135deg, rgba(26,64,128,0.25) 0%, rgba(56,189,248,0.04) 100%);
  border: 1px solid var(--frost-border-hi);
  border-radius: 12px;
  padding: 1rem 1rem;
  text-align: center;
}
.frost-joincode-label {
  color: var(--frost-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.frost-joincode-value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--frost-glow);
  text-shadow: 0 0 16px rgba(123,190,245,0.35);
  margin-bottom: 0.65rem;
}
.frost-joincode-actions { display: flex; gap: 8px; justify-content: center; }
.frost-code-btn {
  background: rgba(26,64,128,0.2);
  border: 1px solid var(--frost-border-hi);
  color: var(--frost-ice);
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}
.frost-code-btn:hover {
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.35);
  color: var(--frost-glow);
}
.frost-code-btn-success {
  background: rgba(56,184,106,0.15) !important;
  border-color: rgba(56,184,106,0.4) !important;
  color: var(--frost-success) !important;
}

/* ── Chat ──────────────────────────────────── */
.frost-chat {
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--frost-border) transparent;
}
.frost-chat-msg { padding: 3px 0; line-height: 1.45; font-size: 0.88rem; }
.frost-chat-author { color: var(--frost-ice); font-weight: 600; margin-right: 6px; }
.frost-chat-text { color: var(--frost-text); }
.frost-chat-system { color: var(--frost-muted); font-style: italic; font-size: 0.8rem; }

/* ── Modal ─────────────────────────────────── */
.frost-modal {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border-hi);
  color: var(--frost-text);
  box-shadow: var(--frost-shadow-lg);
}
.frost-spinner {
  width: 44px; height: 44px;
  border: 2px solid var(--frost-border);
  border-top-color: var(--frost-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin ─────────────────────────────────── */
.frost-stat-card {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  box-shadow: var(--frost-shadow);
  position: relative;
  overflow: hidden;
}
.frost-stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(84,153,204,0.3), transparent);
}
.frost-stat-num {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--frost-glow) 0%, var(--frost-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.frost-admin-link {
  display: block;
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  color: var(--frost-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: var(--frost-shadow);
}
.frost-admin-link:hover {
  border-color: var(--frost-border-hi);
  background: rgba(84,153,204,0.06);
  color: var(--frost-glow);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.frost-table { border-color: var(--frost-border) !important; }
.frost-table thead th {
  color: var(--frost-ice);
  border-color: var(--frost-border) !important;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--frost-panel-alt);
}
.frost-table td, .frost-table th { border-color: var(--frost-border) !important; vertical-align: middle; }
.frost-table tbody tr:hover { background: rgba(84,153,204,0.04); }

/* ── Game ──────────────────────────────────── */
.frost-game-container { max-width: 1400px; margin: 0 auto; }
.frost-game-topbar {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 12px;
  padding: 0.7rem 1.25rem;
  box-shadow: var(--frost-shadow);
}
.frost-game-panel {
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--frost-shadow);
}

/* ── Playing Cards ─────────────────────────── */
.frost-card-face {
  width: 56px; height: 80px;
  background: #fff;
  border-radius: 8px;
  border: 2px solid #d0d0d0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  color: #2a2a2a;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.frost-card-face:hover { transform: translateY(-4px); box-shadow: 0 6px 14px rgba(0,0,0,0.4); }
.frost-card-face.selected {
  transform: translateY(-12px);
  box-shadow: 0 0 18px rgba(56,189,248,0.65), 0 8px 20px rgba(0,0,0,0.4);
  border-color: var(--frost-accent);
}
.frost-card-face.red { color: #c82020; }
.frost-card-face.wild-card { background: linear-gradient(145deg, #fffae0, #fff5cc); border-color: var(--frost-gold); }

.frost-card-back {
  width: 56px; height: 80px;
  background: linear-gradient(145deg, var(--frost-blue) 0%, #080f28 100%);
  border-radius: 8px;
  border: 2px solid var(--frost-border-hi);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--frost-glow);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.frost-deck-pile {
  position: relative; cursor: pointer;
  transition: transform 0.15s ease;
}
.frost-deck-pile:hover { transform: scale(1.06); }
.frost-deck-count {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; color: var(--frost-muted); white-space: nowrap;
}
.frost-card-display {
  min-width: 56px; min-height: 80px;
  background: rgba(8,12,24,0.5);
  border: 1px dashed var(--frost-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.frost-hand-area {
  display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start;
  min-height: 100px; padding: 10px;
  background: rgba(8,12,24,0.35);
  border-radius: 10px;
  border: 1px dashed var(--frost-border);
}

.frost-o-display {
  background: rgba(238,187,56,0.06);
  border: 1px solid rgba(238,187,56,0.15);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}
.frost-o-label { color: var(--frost-muted); font-size: 0.85rem; }
.frost-o-count {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.4rem;
  color: var(--frost-gold);
  margin-left: 6px;
}

.frost-log {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.77rem;
  color: var(--frost-muted);
  display: flex; flex-direction: column; gap: 1px;
}
.frost-log .log-entry { padding: 2px 0; border-bottom: 1px solid rgba(26,40,64,0.5); }
.frost-log .log-win  { color: var(--frost-success); }
.frost-log .log-warn { color: var(--frost-gold); }

.frost-range { accent-color: var(--frost-ice); }

/* ── Player field groups ───────────────────── */
.frost-field-group {
  display: flex; flex-wrap: wrap; gap: 4px;
  background: rgba(8,12,24,0.4);
  border: 1px solid var(--frost-border);
  border-radius: 8px;
  padding: 6px;
}

/* ── Group builder ─────────────────────────── */
.frost-group-slot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  background: rgba(56,189,248,0.06);
  border: 1px solid var(--frost-border-hi);
  border-radius: 6px;
  padding: 4px 8px;
}
.frost-mini-card {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--frost-surface);
  border: 1px solid var(--frost-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem; font-weight: bold;
}
.frost-mini-card.red  { color: #c82020; }
.frost-mini-card.wild { color: var(--frost-gold); border-color: rgba(238,187,56,0.4); }

/* ── Cards locked in a pending group ──────── */
.frost-card-face.in-group {
  opacity: 0.5;
  border-color: var(--frost-border-hi);
  box-shadow: 0 0 8px rgba(56,189,248,0.3);
}

/* ── Score cards ───────────────────────────── */
.frost-score-card {
  background: var(--frost-surface);
  border: 1px solid var(--frost-border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.frost-score-card.active-turn {
  border-color: var(--frost-accent);
  box-shadow: 0 0 16px rgba(56,189,248,0.3);
  background: rgba(56,189,248,0.04);
}
.frost-score-card.active-me { border-color: var(--frost-ice); }
.frost-score-name { font-size: 0.8rem; font-weight: 700; color: var(--frost-text); }
.frost-score-pts {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  color: var(--frost-glow);
  line-height: 1.2;
}
.frost-score-sub { font-size: 0.66rem; color: var(--frost-muted); margin-top: 2px; }

/* ── Section labels ────────────────────────── */
.frost-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--frost-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ── Ghost outline buttons (CSP-safe hover) ── */
.btn-ghost-muted {
  background: transparent;
  border: 1px solid var(--frost-border);
  color: var(--frost-muted);
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost-muted:hover {
  border-color: var(--frost-border-hi);
  color: var(--frost-text);
}
.btn-ghost-ice {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--frost-border);
  color: var(--frost-ice);
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn-ghost-ice:hover {
  border-color: var(--frost-border-hi);
  color: var(--frost-text);
}
.btn-home-login {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--frost-text);
  transition: background 0.2s;
}
.btn-home-login:hover {
  background: rgba(255,255,255,0.09);
  color: var(--frost-text);
}
.btn-danger-soft {
  background: rgba(216,68,85,0.12);
  border: 1px solid rgba(216,68,85,0.25);
  color: rgba(216,68,85,0.8);
  transition: background 0.2s, color 0.2s;
}
.btn-danger-soft:hover {
  background: rgba(216,68,85,0.2);
  color: #d84455;
}
.btn-password-toggle {
  background: rgba(8,12,24,0.8);
  border: 1px solid var(--frost-border);
  border-left: none;
  color: var(--frost-muted);
  border-radius: 0 var(--frost-radius) var(--frost-radius) 0;
  transition: color 0.2s;
}
.btn-password-toggle:hover { color: var(--frost-ice); }

/* ── Form field labels / hints ─────────────── */
.frost-field-label {
  display: block;
  font-size: 0.78rem;
  color: var(--frost-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.frost-field-hint {
  font-size: 0.76rem;
  color: var(--frost-muted);
  margin-top: 5px;
  line-height: 1.4;
}
.x-small { font-size: 0.72rem; }

/* ── Input + button rows (replaces ugly inline-styled append buttons) ── */
.frost-input-row { display: flex; align-items: stretch; }
.frost-input-row .frost-input,
.frost-input-row select.frost-input {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: none !important;
  flex: 1 1 auto;
  min-width: 0;
}
.frost-input-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--frost-border);
  border-left: none;
  color: var(--frost-ice);
  border-top-right-radius: var(--frost-radius);
  border-bottom-right-radius: var(--frost-radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}
.frost-input-btn:hover {
  background: rgba(56,189,248,0.12);
  color: var(--frost-glow);
  border-color: var(--frost-border-hi);
}
.frost-input-btn-primary {
  background: linear-gradient(135deg, var(--frost-blue) 0%, var(--frost-blue-mid) 100%);
  border-color: rgba(84,153,204,0.4);
  color: #fff;
}
.frost-input-btn-primary:hover {
  background: linear-gradient(135deg, var(--frost-blue-mid) 0%, #1a8ecc 100%);
  color: #fff;
}
.frost-icon-btn { min-width: 44px; flex-shrink: 0; }

/* ── Settings rows + toggle ────────────────── */
.frost-setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--frost-border);
  border-radius: 8px;
}
.frost-setting-toggle-title { font-size: 0.82rem; color: var(--frost-text); line-height: 1.3; }
.frost-setting-toggle-sub { font-size: 0.68rem; color: var(--frost-muted); line-height: 1.3; }
.frost-toggle-btn {
  background: none; border: none; padding: 0; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
.frost-toggle-btn i { font-size: 1.6rem; color: var(--frost-accent); transition: color 0.2s; }
.min-w-0 { min-width: 0; }

/* ── Toggle switch (tables/inline) ─────────── */
.frost-switch {
  position: relative;
  display: inline-block;
  width: 42px; height: 22px;
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}
.frost-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.frost-switch-slider {
  position: absolute; inset: 0;
  border-radius: 22px;
  background: var(--frost-border);
  border: 1px solid var(--frost-border-hi);
  transition: background 0.2s, border-color 0.2s;
}
.frost-switch-slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 2px; top: 2px;
  border-radius: 50%;
  background: #7d93ab;
  transition: transform 0.2s, background 0.2s;
}
.frost-switch input:checked + .frost-switch-slider {
  background: rgba(56,189,248,0.22);
  border-color: var(--frost-accent);
}
.frost-switch input:checked + .frost-switch-slider::before {
  transform: translateX(20px);
  background: var(--frost-accent);
}
.frost-switch input:focus-visible + .frost-switch-slider {
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
}

/* ── Editable rule table (div-based so each row is a form) ── */
.frost-edit-table { display: flex; flex-direction: column; gap: 8px; }
.frost-edit-head, .frost-edit-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.1fr 60px 56px;
  gap: 12px;
}
.frost-edit-head {
  padding: 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--frost-ice);
  font-weight: 600;
}
.frost-edit-row {
  align-items: center;
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  border-radius: 10px;
  padding: 12px;
  transition: border-color 0.2s;
}
.frost-edit-row:hover { border-color: var(--frost-border-hi); }
.frost-edit-row .col-active,
.frost-edit-row .col-save { display: flex; align-items: center; justify-content: center; }
.frost-mono { font-family: 'Courier New', Courier, monospace; font-size: 0.78rem; }
.frost-cat-chip {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--frost-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--frost-border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 3px;
}
@media (max-width: 768px) {
  .frost-edit-head { display: none; }
  .frost-edit-row { grid-template-columns: 1fr; gap: 8px; }
  .frost-edit-row .col-active,
  .frost-edit-row .col-save { justify-content: flex-start; }
}

/* ── Game selector tabs ────────────────────── */
.frost-game-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.frost-game-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--frost-panel);
  border: 1px solid var(--frost-border);
  color: var(--frost-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.frost-game-tab:hover { border-color: var(--frost-border-hi); color: var(--frost-text); }
.frost-game-tab.active {
  border-color: var(--frost-accent);
  color: var(--frost-glow);
  background: rgba(56,189,248,0.08);
}
.frost-tab-off {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--frost-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 0 5px;
}

/* ── Admin link sub-label ──────────────────── */
.frost-admin-link-sub {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--frost-muted);
  margin-top: 4px;
  letter-spacing: 0;
}

/* ── Modal danger zone ─────────────────────── */
.frost-danger-zone {
  border-top: 1px solid var(--frost-border);
  padding: 1rem 1rem 1.25rem;
  background: rgba(216,68,85,0.03);
}

/* ── Table legibility without .table-dark ──── */
.frost-table {
  color: var(--frost-text);
  --bs-table-bg: transparent;
  --bs-table-color: var(--frost-text);
}
.frost-table > :not(caption) > * > * { background-color: transparent; }

/* ── Footer ────────────────────────────────── */
.frost-footer {
  background: rgba(8,12,24,0.6);
  border-top: 1px solid var(--frost-border);
  margin-top: auto;
}

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--frost-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--frost-border-hi); }

/* ── Responsive ────────────────────────────── */
@media (max-width: 576px) {
  .frost-auth-card { padding: 1.5rem; }
  .frost-title.display-3 { font-size: 2rem; }
  .frost-card-face { width: 46px; height: 66px; font-size: 0.78rem; }
  .frost-card-back { width: 46px; height: 66px; }
}

/* ── Mobile: player fields scroll horizontally so they don't push hand off-screen ── */
@media (max-width: 991.98px) {
  #playerFields {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  #playerFields > [class*="col-"] {
    flex: 0 0 auto;
    width: 220px;
  }
}
