/* ── Samurai Duel Game Styles ───────────────────────────────────────────── */

/* Header → see .game-header in global.css */

/* Mode tabs */
.mode-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.2rem;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.mode-tab:hover:not(.active) {
  background: var(--surface-3);
  color: var(--text);
}

/* Stats bar */
.sam-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sam-stat {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-right: 1px solid var(--border);
}
.sam-stat:last-child { border-right: none; }

.sam-stat span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sam-stat label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.1rem;
}

.sam-stat.p1-stat span { color: #6366f1; }
.sam-stat.p2-stat span { color: #ef4444; }
.sam-stat.round-stat span { color: var(--accent); }

/* Canvas wrap */
.sam-canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0;
  max-width: 100%;
  overflow: hidden;
}

#samurai-canvas {
  display: block;
  border-radius: 10px;
  border: 2px solid #2d1a5e;
  max-width: 100%;
  height: auto;
  touch-action: none;
  cursor: pointer;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

/* Overlay */
.sam-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 3, 20, 0.85);
  border-radius: 10px;
  z-index: 20;
}

.sam-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 220px;
  max-width: 300px;
  width: 88%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.sam-ov-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.sam-ov-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sam-ov-sub {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.sam-ov-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sam-btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s, transform 0.1s;
}
.sam-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.sam-btn-primary:active { transform: translateY(0); }

.sam-btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.sam-btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Score card in overlay */
.sam-ov-scorecard {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sam-sc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.sam-sc-row span { color: var(--text-muted); }
.sam-sc-row strong { color: var(--text); font-weight: 700; }

/* Action row — P1 / P2 tap buttons for mobile */
.sam-action-row {
  display: none;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  justify-content: center;
}

.sam-btn-p1,
.sam-btn-p2 {
  flex: 1;
  max-width: 180px;
  padding: 1rem 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.03em;
}

.sam-btn-p1 {
  background: #4f46e5;
  color: #fff;
}

.sam-btn-p2 {
  background: #dc2626;
  color: #fff;
}

.sam-btn-p1:active,
.sam-btn-p2:active {
  transform: scale(0.95);
  opacity: 0.85;
}

/* Show action buttons on mobile */
@media (max-width: 600px) {
  .sam-action-row {
    display: flex;
  }
  /* In AI mode, hide P2 button */
  .sam-action-row.ai-mode .sam-btn-p2 {
    display: none;
  }
  .sam-action-row.ai-mode .sam-btn-p1 {
    max-width: 260px;
  }

  .sam-stat span { font-size: 0.88rem; }
  .sam-stat label { font-size: 0.58rem; }
  .mode-tab { font-size: 0.72rem; padding: 0.25rem 0.5rem; }
}

/* Responsive canvas */
@media (max-width: 520px) {
  .sam-canvas-wrap { padding: 0.25rem 0; }
}
