﻿
.pregame-lobby {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: flex;
  flex-direction: column;
  background: #060608;
  color: #c8c8c8;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.pregame-lobby[hidden] {
  display: none !important;
}

.pregame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #1e1e24;
}

.pregame-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pregame-mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: auto;
}

.pregame-logo {
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: #eee;
}

.pregame-badge {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: #888;
  border: 1px solid #333;
  padding: 4px 8px;
}

.pregame-leave {
  background: none;
  border: none;
  color: #888;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  cursor: pointer;
}

.pregame-leave:hover {
  color: #fff;
}

.pregame-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(300px, 36%);
  gap: 0;
}

.pregame-players-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #1e1e24;
}

.pregame-players-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1e1e24;
  color: #888;
  font-size: 0.65rem;
}

.pregame-player-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}

.pregame-player-row {
  display: grid;
  grid-template-columns: 28px 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #141418;
}

.pregame-player-self {
  border: 1px solid #6a5a28;
  background: rgba(50, 42, 18, 0.25);
}

.pregame-player-self .pregame-player-name {
  color: #e8d090;
}

.pregame-player-empty {
  opacity: 0.35;
}

.pregame-slot {
  color: #555;
  font-size: 0.65rem;
}

.pregame-swatch {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pregame-player-name {
  color: #ccc;
}

.pregame-host-tag {
  font-size: 0.58rem;
  color: #c9a84a;
  border: 1px solid #6a5a28;
  padding: 2px 6px;
  margin-right: 6px;
}

.pregame-status {
  width: auto;
  min-width: 72px;
  padding: 5px 10px;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  background: none;
  cursor: pointer;
}

.pregame-status.is-ready {
  border: 1px solid #3d6b45;
  color: #6ecf6e;
}

.pregame-status.is-waiting {
  border: 1px solid #333;
  color: #666;
}

.pregame-status:disabled {
  cursor: default;
}

/* --- right sidebar --- */

.pregame-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, #08080c 0%, #060608 100%);
}

.pregame-side-role {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #1e1e26;
  background: #0a0a0e;
}

.pregame-side-role-badge {
  align-self: flex-start;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  padding: 4px 8px;
  border: 1px solid #333;
  color: #888;
}

.pregame-side-role-badge.is-host {
  border-color: #6a5a28;
  color: #d4b85a;
  background: rgba(50, 42, 18, 0.2);
}

.pregame-side-role-text {
  font-size: 0.64rem;
  line-height: 1.45;
  color: #8a8a94;
  letter-spacing: 0.04em;
}

.pregame-side-panel--host .pregame-side-role {
  border-color: #2a2618;
  background: rgba(30, 26, 14, 0.35);
}

.pregame-side-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #1c1c22;
  background: #0a0a0f;
}

.pregame-side-card-head {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5a64;
}

.pregame-room-code-guest {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pregame-room-code-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid #25252e;
  background: #060608;
}

.pregame-code {
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  color: #f0f0f4;
  text-align: center;
}

.pregame-side-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pregame-side-field-label {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
}

.pregame-side-field-hint {
  font-size: 0.58rem;
  line-height: 1.4;
  color: #555;
  letter-spacing: 0.03em;
}

.pregame-rule-readout {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pregame-rule-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pregame-rule-value {
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #eee;
}

.pregame-rule-unit {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #666;
}

.pregame-percent-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pregame-percent-suffix {
  color: #666;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.pregame-copy {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #333;
  background: #0e0e12;
  color: #999;
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.pregame-copy:hover {
  border-color: #666;
  color: #eee;
}

.pregame-save-btn {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #444;
  background: #111116;
  color: #ddd;
  font-family: 'Orbitron', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.pregame-save-btn:hover {
  border-color: #888;
  background: #16161c;
}

.pregame-side-card-cycle {
  gap: 8px;
}

.pregame-cycle-canvas {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 268 / 42;
}

.pregame-countdown {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  line-height: 1;
  text-align: center;
  color: #e8e8f0;
  letter-spacing: 0.08em;
  padding: 14px 12px;
  border: 1px solid #1c1c22;
  background: #0a0a0f;
}

.pregame-countdown[hidden] {
  display: none;
}

.pregame-side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #1a1a20;
}

.pregame-footer {
  font-size: 0.62rem;
  color: #707078;
  text-align: center;
  line-height: 1.5;
  padding: 0 4px;
  min-height: 1.5em;
}

.pregame-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pregame-start {
  width: 100%;
  padding: 13px 12px;
  border: 1px solid #555;
  background: linear-gradient(180deg, #16161c 0%, #101014 100%);
  color: #eee;
  font-family: 'Orbitron', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.pregame-start:hover {
  border-color: #bbb;
  color: #fff;
}

.pregame-cancel {
  border-color: #4a3030;
  background: #120c0c;
  color: #c88;
}

.pregame-cancel:hover {
  border-color: #a55;
  color: #faa;
}

.pregame-ready-toggle {
  width: 100%;
  padding: 12px;
  border: 1px solid #333;
  background: #0c0c10;
  color: #aaa;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pregame-ready-toggle:hover {
  border-color: #555;
  color: #ddd;
}

.pregame-ready-toggle.is-ready {
  border-color: #3d6b45;
  background: rgba(30, 60, 36, 0.25);
  color: #6ecf6e;
}

.pregame-ready-toggle.is-ready:hover {
  border-color: #5a9a62;
  color: #8ef08e;
}

@media (max-width: 800px) {
  .pregame-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .pregame-players-panel {
    border-right: none;
    border-bottom: 1px solid #1e1e24;
    max-height: 45vh;
  }

  .pregame-side-panel {
    padding-bottom: 24px;
  }
}
