/* ==========================================
   Game Runner — The Master Planner's Workshop
   ========================================== */

.game-container {
  max-width: 900px;
  margin: 0 auto;
}

/* ---- Mode Selection ---- */
.game-mode-grid {
  display: grid;
  gap: var(--space-lg);
  max-width: 700px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .game-mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.game-mode-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.game-mode-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 134, 11, 0.08);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
  transition: border-color var(--transition-normal);
}

.game-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(184, 134, 11, 0.12);
}

.game-mode-card:hover::before {
  border-color: rgba(184, 134, 11, 0.2);
}

.game-mode-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  color: var(--accent-gold);
  transition: transform var(--transition-normal);
}

.game-mode-card:hover .game-mode-icon {
  transform: scale(1.1);
}

.game-mode-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
  color: var(--text-heading, var(--text-primary));
}

.game-mode-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game-mode-players {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: 3px var(--space-sm);
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold-dark);
  letter-spacing: 0.03em;
}

/* ---- Game Header (In Progress) ---- */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-dark);
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  position: relative;
  border-bottom: 2px solid var(--accent-gold-dark);
  box-shadow: var(--shadow-md);
}

.game-round-label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.game-phase-label {
  font-size: 0.8rem;
  opacity: 0.8;
}

.game-pass-direction {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--accent-gold-light);
  font-weight: 600;
}

/* ---- Solo / Automa Card ---- */
.automa-card {
  background: var(--bg-card);
  border: 3px solid var(--border-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto var(--space-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}

.automa-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 134, 11, 0.08);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}

.automa-card-header {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--accent-gold-dark);
}

.automa-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 200px;
}

.automa-column {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

.automa-column:first-child {
  border-right: 1px solid var(--divider);
}

.automa-column-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
}

.automa-action {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
}

.automa-action-icon {
  width: 24px;
  height: 24px;
}

.automa-priority-row {
  display: flex;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  justify-content: center;
  border-top: 1px solid var(--divider);
}

.automa-priority-icon {
  width: 20px;
  height: 20px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.automa-priority-icon svg {
  width: 14px;
  height: 14px;
}

/* ---- Difficulty Selector ---- */
.difficulty-selector {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.difficulty-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  color: var(--text-heading, var(--text-primary));
}

.difficulty-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.difficulty-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.difficulty-btn:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.difficulty-btn.active {
  background: linear-gradient(175deg, var(--accent-gold-light), var(--accent-gold-dark));
  border-color: var(--accent-gold-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.difficulty-btn .diff-adjust {
  font-size: 0.6rem;
  opacity: 0.7;
}

/* ---- Tile Hand Display ---- */
.tile-hand {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-inset);
}

.tile-hand-tile {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
}

.tile-hand-tile:hover:not(.disabled) {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.tile-hand-tile.selected {
  outline: 3px solid var(--accent-gold);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(184, 134, 11, 0.25);
}

.tile-hand-tile.used {
  opacity: 0.3;
  cursor: not-allowed;
}

.tile-hand-tile.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.tile-hand-tile .tile-icon svg {
  width: 28px;
  height: 28px;
}

.tile-hand-tile .tile-img-wrap {
  width: 28px;
  height: 28px;
}

.tile-hand-tile .tile-badge {
  width: 12px;
  height: 12px;
}

/* ---- Duplex Tile Hand ---- */
.duplex-hand {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-inset);
}

.duplex-hand-tile {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.duplex-hand-tile.portrait {
  flex-direction: column;
}

.duplex-hand-tile:hover:not(.disabled) {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.duplex-hand-tile.selected {
  outline: 3px solid var(--accent-gold);
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(184, 134, 11, 0.25);
}

.duplex-hand-tile.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.duplex-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  min-width: 55px;
  min-height: 55px;
}

.duplex-connector {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1;
}

.duplex-orientation-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  background: var(--bg-dark, #333);
  color: var(--text-inverse, #fff);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.duplex-preview {
  display: inline-flex;
  gap: 2px;
}

.duplex-preview.portrait {
  flex-direction: column;
}

/* ---- Round Tracker ---- */
.round-tracker {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.round-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.round-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.round-dot.active {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-dark));
  border-color: var(--accent-gold);
  color: white;
  box-shadow: 0 2px 10px rgba(184, 134, 11, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.round-dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.round-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

/* ---- City Pair Display ---- */
.city-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: start;
  margin-bottom: var(--space-lg);
}

.city-pair-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding-top: var(--space-xl);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
}

.city-pair-label {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: var(--space-sm);
  color: var(--text-heading, var(--text-secondary));
  letter-spacing: 0.03em;
}

@media (max-width: 767px) {
  .city-pair {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .city-pair-divider {
    flex-direction: row;
    padding-top: 0;
    justify-content: center;
  }
}

/* ============================================
   Two-Player & Online Variant Styles
   ============================================ */

/* Sub-round tracker */
.subround-tracker {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.subround-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.subround-dot.active {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-dark));
  border-color: var(--accent-gold);
  color: white;
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

.subround-dot.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Turn indicator */
.turn-indicator {
  text-align: center;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.turn-indicator-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent-gold-dark);
  text-shadow: 0 1px 2px rgba(184, 134, 11, 0.1);
}

/* Privacy / handoff screen */
.privacy-screen {
  text-align: center;
  padding: var(--space-3xl, 3rem) var(--space-lg);
  background: var(--bg-dark);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  border: 2px solid rgba(184, 134, 11, 0.2);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.privacy-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(184, 134, 11, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.privacy-screen-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent-gold-light);
  margin-bottom: var(--space-md);
  position: relative;
  letter-spacing: 0.03em;
}

/* Mini-scanner badges */
.mini-scanner-badge {
  padding: 2px var(--space-sm);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.mini-scanner-badge.current {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-dark));
  color: white;
  border-color: var(--accent-gold-dark);
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.25);
}

.mini-scanner-badge.done {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* ---- Scoring Method Selector ---- */
.scoring-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.scoring-method-card {
  text-align: center;
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.scoring-method-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 134, 11, 0.06);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
  transition: border-color var(--transition-fast);
}

.scoring-method-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.scoring-method-card:hover::before {
  border-color: rgba(184, 134, 11, 0.15);
}

/* ---- Variant Tabs ---- */
.variant-tabs {
  display: flex;
  margin-bottom: var(--space-lg);
}

.variant-tab {
  flex: 1;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  background: var(--bg-card);
}

.variant-tab:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.variant-tab:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.variant-tab:hover:not(.active) {
  background: var(--bg-secondary);
  border-color: var(--accent-gold);
}

.variant-tab.active {
  background: linear-gradient(175deg, var(--accent-gold-light), var(--accent-gold-dark));
  border-color: var(--accent-gold-dark);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.25);
}

/* ============================================
   Automacity Display (Solo Mode)
   ============================================ */

.automacity-display {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin: var(--space-lg) auto;
  max-width: 500px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.automacity-display::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(184, 134, 11, 0.06);
  border-radius: calc(var(--radius-lg) - 4px);
  pointer-events: none;
}

.automacity-header {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--divider);
  color: var(--text-heading, var(--text-primary));
  letter-spacing: 0.03em;
}

.automacity-type-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  min-height: 36px;
}

.automacity-type-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 100px;
  flex-shrink: 0;
}

.automacity-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.automacity-type-icon svg {
  width: 16px;
  height: 16px;
}

.automacity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.automacity-tile-chip {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-color, var(--bg-secondary));
  color: white;
  font-size: 0.8rem;
  transition: transform var(--transition-fast);
}

.automacity-tile-chip:hover {
  transform: scale(1.1);
}

.automacity-tile-chip svg {
  width: 18px;
  height: 18px;
}

/* PNG tile images inside automacity chips */
.automacity-tile-chip .tile-img-wrap {
  width: 100%;
  height: 100%;
}

.automacity-tile-chip .tile-img {
  border-radius: 2px;
}

.automacity-tile-chip .tile-badge {
  width: 14px;
  height: 14px;
  bottom: -1px;
  right: -1px;
}

.automacity-duplex-pair {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.automacity-score {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--divider);
  font-family: var(--font-heading);
}

/* Solo mode overrides for inline tile chips in assignment UI */
.automacity-tile-chip[style*="width:48px"] {
  font-size: 1.2rem;
}

.automacity-tile-chip[style*="width:48px"] svg {
  width: 28px;
  height: 28px;
}

.automacity-tile-chip[style*="width:48px"] .tile-badge {
  width: 18px;
  height: 18px;
}

/* ---- Campaign Progress Table ---- */
.campaign-progress-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.campaign-progress-table th,
.campaign-progress-table td {
  padding: 6px 10px;
  text-align: center;
}

.campaign-progress-table th {
  background: var(--bg-dark);
  color: var(--text-inverse);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--accent-gold-dark);
}

.campaign-progress-table tr {
  border-bottom: 1px solid var(--divider);
  transition: background var(--transition-fast);
}

.campaign-progress-table tr:hover {
  background: rgba(184, 134, 11, 0.04);
}

.campaign-progress-table td {
  color: var(--text-secondary);
}
