/* =========================================================
   HyperSeeker — Tactical Field Ops UI
   Mobile-first dark theme
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Space+Mono:wght@400;700&family=Bebas+Neue&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:         #050508;
  --surface:    #0c0c18;
  --card:       #111126;
  --card-hover: #161630;
  --border:     rgba(255,255,255,0.06);
  --border-glow:rgba(255,255,255,0.12);

  --seeker:     #00b4ff;
  --seeker-dim: rgba(0,180,255,0.15);
  --hider:      #00ff88;
  --hider-dim:  rgba(0,255,136,0.12);
  --admin:      #ffa040;
  --admin-dim:  rgba(255,160,64,0.12);
  --danger:     #ff3a3a;
  --danger-dim: rgba(255,58,58,0.15);
  --warn:       #ffcc00;
  --success:    #00ff88;

  --text:       #ddeeff;
  --text-dim:   #5a6a80;
  --text-muted: #2a3a50;

  --radius:     8px;
  --radius-lg:  14px;

  --phase-color: var(--seeker);
  --team-color:  var(--text);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  overflow: hidden;
  position: relative;
}

/* Scanline background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,200,255,0.012) 2px,
      rgba(0,200,255,0.012) 4px
    );
  pointer-events: none;
  z-index: 0;
}

/* Grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,180,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ── */
h1 { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.05em; }
h2 { font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: 0.04em; }
.mono { font-family: 'Space Mono', monospace; }

/* ── Screens ── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.screen.active { display: flex; flex-direction: column; }

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,8,0.92);
  backdrop-filter: blur(6px);
}
.overlay.hidden { display: none; }

/* ── Loading ── */
#loading-overlay { z-index: 200; }
.loading-ring {
  width: 56px; height: 56px;
  border: 3px solid var(--border-glow);
  border-top-color: var(--phase-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-msg {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.08em;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--border-glow);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 40px);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 24px;
  border-radius: var(--radius);
  border: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  text-transform: uppercase;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, #1a3a6a, #0a5afa);
  color: #fff;
  box-shadow: 0 0 20px rgba(0,100,255,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 0 30px rgba(0,100,255,0.5), inset 0 1px 0 rgba(255,255,255,0.1); }

.btn-success {
  background: linear-gradient(135deg, #0a4a2e, #00cc66);
  color: #fff;
  box-shadow: 0 0 20px rgba(0,200,100,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-success:not(:disabled):hover { box-shadow: 0 0 30px rgba(0,200,100,0.45); }

.btn-danger {
  background: linear-gradient(135deg, #5a0a0a, #cc2200);
  color: #fff;
  box-shadow: 0 0 20px rgba(200,40,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-danger:not(:disabled):hover { box-shadow: 0 0 30px rgba(200,40,0,0.5); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-glow);
  color: var(--text-dim);
}
.btn-ghost:not(:disabled):hover { border-color: var(--phase-color); color: var(--phase-color); }

.btn-tag {
  background: linear-gradient(135deg, #4a0a1a, #cc003a);
  color: #fff;
  box-shadow: 0 0 25px rgba(200,0,60,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  font-size: 20px;
  min-height: 64px;
  animation: tagPulse 2s ease-in-out infinite;
}
@keyframes tagPulse {
  0%, 100% { box-shadow: 0 0 25px rgba(200,0,60,0.4), inset 0 1px 0 rgba(255,255,255,0.1); }
  50%       { box-shadow: 0 0 45px rgba(200,0,60,0.7), inset 0 1px 0 rgba(255,255,255,0.1); }
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-glow {
  border-color: var(--phase-color);
  box-shadow: 0 0 20px rgba(0,180,255,0.1);
}

/* ── Inputs ── */
.input-field {
  width: 100%;
  min-height: 56px;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 600;
  padding: 0 18px;
  outline: none;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.input-field:focus {
  border-color: var(--seeker);
  box-shadow: 0 0 0 3px rgba(0,180,255,0.12);
}
.input-field::placeholder { color: var(--text-muted); font-weight: 500; }

.input-code {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 24px;
  font-family: 'Space Mono', monospace;
}

/* ── Labels ── */
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
  font-family: 'Space Mono', monospace;
}

/* ── Radio Role Picker ── */
.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.role-option input { display: none; }
.role-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 84px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: center;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.role-option.seeker input:checked ~ label {
  border-color: var(--seeker);
  background: var(--seeker-dim);
  color: var(--seeker);
  box-shadow: 0 0 16px rgba(0,180,255,0.2);
}
.role-option.hider input:checked ~ label {
  border-color: var(--hider);
  background: var(--hider-dim);
  color: var(--hider);
  box-shadow: 0 0 16px rgba(0,255,136,0.2);
}
.role-option .role-icon { font-size: 26px; }
.role-option .role-name { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }

/* ── Status dots ── */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.connected {
  background: var(--hider);
  box-shadow: 0 0 8px var(--hider);
  animation: dotBlink 2s ease-in-out infinite;
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════
   ── TUTORIAL
   ═══════════════════════════════════════ */
#tutorial-overlay {
  background: rgba(5,5,10,0.97);
  flex-direction: column;
  z-index: 500;
}
.tutorial-card {
  background: linear-gradient(160deg, #0f0f22, #0a0a18);
  border: 1px solid rgba(0,180,255,0.25);
  border-radius: 20px;
  padding: 36px 28px 28px;
  max-width: 360px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 0 60px rgba(0,100,255,0.15);
  position: relative;
}
.tutorial-icon { font-size: 56px; margin-bottom: 16px; display: block; }
.tutorial-card h2 { font-size: 28px; color: #fff; margin-bottom: 12px; }
.tutorial-card p  { color: var(--text-dim); font-size: 16px; line-height: 1.6; margin-bottom: 28px; }
.tutorial-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 24px; }
.tutorial-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.tutorial-dot.active {
  background: var(--seeker);
  box-shadow: 0 0 8px var(--seeker);
}
.tutorial-step {
  position: absolute; top: 16px; right: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.1em;
}
.tutorial-actions { display: flex; flex-direction: column; gap: 10px; }

/* ═══════════════════════════════════════
   ── HOME SCREEN
   ═══════════════════════════════════════ */
#screen-home {
  padding: 0;
  justify-content: space-between;
  align-items: center;
}
.home-hero {
  width: 100%;
  padding: 60px 24px 0;
  text-align: center;
  flex-shrink: 0;
}
.home-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(135deg, var(--seeker) 0%, #8080ff 50%, var(--hider) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  display: block;
}
.home-tagline {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 40px;
}
.home-form {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 28px 20px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
#home-main-btns { display: flex; flex-direction: column; gap: 12px; }
#home-join-section { display: flex; flex-direction: column; gap: 12px; }

/* ═══════════════════════════════════════
   ── LOBBY SCREEN
   ═══════════════════════════════════════ */
#screen-lobby {
  padding: 0;
}
.lobby-header {
  padding: 50px 20px 20px;
  background: linear-gradient(180deg, rgba(0,100,255,0.08) 0%, transparent 100%);
  text-align: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lobby-header h2 { font-size: 16px; letter-spacing: 0.2em; color: var(--text-dim); margin-bottom: 10px; }
.room-code-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  letter-spacing: 0.25em;
  color: var(--seeker);
  text-shadow: 0 0 20px rgba(0,180,255,0.5);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.room-code-hint {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.lobby-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.player-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.player-role-icon { font-size: 24px; flex-shrink: 0; }
.player-info { flex: 1; }
.player-role { font-size: 12px; letter-spacing: 0.1em; color: var(--text-dim); }
.player-name { font-size: 18px; font-weight: 700; }
.player-name.empty { color: var(--text-muted); font-style: italic; font-weight: 400; }

.seeker-row .player-name { color: var(--seeker); }
.hider-row .player-name  { color: var(--hider); }

.settings-panel { }
.settings-panel h3 {
  font-size: 12px; letter-spacing: 0.15em;
  color: var(--text-dim); text-transform: uppercase;
  font-family: 'Space Mono', monospace;
  margin-bottom: 14px;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setting-item label {
  font-size: 11px; color: var(--text-dim); display: block;
  font-family: 'Space Mono', monospace; letter-spacing: 0.08em; margin-bottom: 4px;
}
.setting-item input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: 'Space Mono', monospace;
  font-size: 15px; padding: 8px 10px; outline: none;
  -webkit-appearance: none;
}
.setting-item input:focus { border-color: var(--seeker); }

.my-role-badge {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-dim);
}
.my-role-badge .badge-icon { font-size: 20px; }
.my-role-badge strong { color: var(--team-color); font-size: 16px; }

.share-btn-row { display: flex; gap: 10px; }
.share-btn-row .btn { font-size: 14px; min-height: 44px; }

.lobby-footer { padding: 16px 20px; flex-shrink: 0; border-top: 1px solid var(--border); }
.waiting-msg {
  text-align: center; color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: 0.1em; padding: 8px;
  animation: waitBlink 2s ease-in-out infinite;
}
@keyframes waitBlink { 0%,100%{ opacity:1 } 50%{ opacity:0.4 } }

/* ═══════════════════════════════════════
   ── GAME SCREEN
   ═══════════════════════════════════════ */
#screen-game {
  flex-direction: column;
}

/* ── Game Header ── */
.game-header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}
.game-header-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.phase-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.15em;
  color: var(--phase-color);
  text-transform: uppercase;
}
.round-badge {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.timer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.phase-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}
.phase-timer {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 0.05em;
  color: var(--phase-color);
  text-shadow: 0 0 20px var(--phase-color);
  line-height: 1;
  min-width: 90px;
  text-align: right;
}
.phase-timer.urgent {
  color: var(--danger);
  text-shadow: 0 0 20px var(--danger);
  animation: timerUrgent 0.5s ease-in-out infinite alternate;
}
@keyframes timerUrgent { from{ opacity:1 } to{ opacity:0.6 } }

.team-strip {
  flex-shrink: 0;
  padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.team-strip-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.15em;
  color: var(--text-dim);
}
.team-strip-name {
  font-size: 14px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--team-color);
}

/* ── Phase Panels ── */
.game-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.phase-panel { display: none; padding: 20px; min-height: 100%; flex-direction: column; gap: 20px; }
.phase-panel.active { display: flex; }

/* ── Big Message ── */
.big-msg {
  text-align: center;
  padding: 40px 20px;
}
.big-msg .msg-icon { font-size: 64px; margin-bottom: 16px; display: block; }
.big-msg h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 10px;
}
.big-msg p {
  color: var(--text-dim); font-size: 16px; line-height: 1.6;
  max-width: 280px; margin: 0 auto;
}

/* ── Seeker Wait ── */
#panel-seeker-wait .big-msg h2 { color: var(--seeker); }

/* ── Photo Upload (Hider) ── */
.camera-area {
  background: var(--surface);
  border: 2px dashed var(--border-glow);
  border-radius: var(--radius-lg);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
  overflow: hidden;
  position: relative;
}
.camera-area:has(img:not(.hidden)) { border-style: solid; }
#photo-preview {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
  border-radius: calc(var(--radius-lg) - 2px);
}
#photo-preview.hidden { display: none; }
.camera-placeholder { text-align: center; padding: 20px; z-index: 1; position: relative; }
.camera-placeholder span { font-size: 48px; display: block; margin-bottom: 12px; }
.camera-placeholder p { color: var(--text-dim); font-size: 14px; }
#photo-input { display: none; }
.quality-msg {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  min-height: 20px;
  color: var(--text-dim);
}
.quality-msg.ok    { color: var(--hider); }
.quality-msg.error { color: var(--danger); }

/* ── Hiding Phase (Seeker - photo display) ── */
.hider-photo-frame {
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hider-photo-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--text-dim);
  padding: 10px 14px 6px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.hider-photo-label::before {
  content: '';
  display: inline-block; width: 6px; height: 6px;
  background: var(--danger); border-radius: 50%;
  box-shadow: 0 0 6px var(--danger);
  animation: dotBlink 1s ease-in-out infinite;
}
#hider-photo {
  width: 100%; display: block;
  max-height: 300px; object-fit: contain;
  background: #000;
}
#hider-photo.hidden { display: none; }

/* ── Penalty Map ── */
#penalty-map-container {
  background: var(--card);
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255,58,58,0.2);
}
#penalty-map-container.hidden { display: none; }
.penalty-alert-header {
  background: linear-gradient(90deg, rgba(255,58,58,0.2), transparent);
  padding: 10px 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 0.12em;
  color: var(--danger); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
#penalty-map {
  height: 220px;
  width: 100%;
}

/* ── Hiding Phase (Hider - stay still) ── */
#panel-hiding-hider .big-msg h2 { color: var(--warn); }
.location-monitor {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
}
.location-monitor .loc-icon { font-size: 24px; flex-shrink: 0; }
#location-status {
  font-family: 'Space Mono', monospace;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-dim);
}
#location-status.warning { color: var(--warn); }
#location-status.penalty { color: var(--danger); }

/* ── Moving Phase ── */
#panel-moving .big-msg h2 { color: var(--hider); }

/* ── Tag Button area ── */
.tag-area {
  flex-shrink: 0;
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  border-top: 1px solid var(--border);
  background: var(--bg);
}
#tag-request-btn { font-size: 18px; letter-spacing: 0.1em; }

/* Admin skip button (small, ghost) */
.admin-skip {
  padding: 8px 20px;
  display: flex; gap: 10px;
  flex-shrink: 0;
}
.admin-skip .btn { font-size: 13px; min-height: 40px; }

/* ── Tag Confirm Modal ── */
#tag-modal {
  z-index: 400;
}
.tag-modal-card {
  background: linear-gradient(160deg, #2a0810, #120008);
  border: 2px solid var(--danger);
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 340px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 0 60px rgba(255,0,60,0.3);
  animation: tagModalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes tagModalIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.tag-modal-icon { font-size: 52px; margin-bottom: 12px; display: block; }
.tag-modal-card h2 { font-size: 28px; color: var(--danger); margin-bottom: 8px; }
.tag-modal-card p  { color: var(--text-dim); font-size: 15px; margin-bottom: 20px; line-height: 1.5; }
.tag-countdown {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  color: var(--danger);
  text-shadow: 0 0 20px var(--danger);
  margin-bottom: 20px;
  line-height: 1;
}
.tag-modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ═══════════════════════════════════════
   ── END SCREEN
   ═══════════════════════════════════════ */
#screen-end {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}
.end-content {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  max-width: 340px; width: 100%;
}
.end-trophy { font-size: 80px; animation: trophyBounce 0.6s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
@keyframes trophyBounce {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.end-winner {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px; letter-spacing: 0.06em;
  line-height: 1;
}
.end-winner.seekers { color: var(--seeker); text-shadow: 0 0 30px rgba(0,180,255,0.5); }
.end-winner.hiders  { color: var(--hider);  text-shadow: 0 0 30px rgba(0,255,136,0.5); }
.end-stats {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  display: flex; flex-direction: column; gap: 12px;
}
.end-stat {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px;
}
.end-stat .stat-label { color: var(--text-dim); font-family: 'Space Mono', monospace; font-size: 12px; letter-spacing: 0.08em; }
.end-stat .stat-value { font-weight: 700; font-size: 18px; }
.end-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }

/* ── Utility ── */
.hidden { display: none !important; }
.separator {
  height: 1px; background: var(--border); margin: 4px 0;
}
.section-title {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 10px;
}

/* Phase color theming */
body[data-phase="seeker_wait"]  { --phase-color: var(--seeker); }
body[data-phase="photo_upload"] { --phase-color: var(--warn); }
body[data-phase="hiding"]       { --phase-color: var(--danger); }
body[data-phase="moving"]       { --phase-color: var(--hider); }
body[data-phase="ended"]        { --phase-color: var(--text-dim); }

/* Team color theming */
body[data-team="seeker"] { --team-color: var(--seeker); }
body[data-team="hider"]  { --team-color: var(--hider); }
body[data-team="admin"]  { --team-color: var(--admin); }

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 2px; }

/* ── Branding credits ─────────────────────────────────── */
.home-dev-credit {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}
.end-branding {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  margin-top: 20px;
  padding-bottom: 12px;
}

/* ── Photo warning banner ─────────────────────────────── */
.photo-warning-banner {
  background: rgba(255, 58, 58, 0.18);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--danger);
  text-align: center;
  animation: warningPulse 1.2s ease-in-out infinite;
}
@keyframes warningPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,58,58,0.4); }
  50%       { opacity: 0.85; box-shadow: 0 0 0 6px rgba(255,58,58,0); }
}

/* ── Past clues bar ───────────────────────────────────── */
.past-clues-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border-glow);
  flex-shrink: 0;
  gap: 12px;
}
.past-clues-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.past-clues-btn-inline {
  width: auto !important;
  min-height: 36px !important;
  font-size: 12px !important;
  padding: 0 14px !important;
}

/* ── Photo history bottom sheet ─────────────────────── */
.photo-history-sheet {
  width: 100%;
  max-height: 80vh;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid var(--border-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.photo-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.photo-history-title {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.photo-history-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.photo-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  border: 1px solid var(--border-glow);
  background: var(--card);
  transition: transform 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.photo-thumb:active { transform: scale(0.96); }
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(5,5,8,0.78);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-align: center;
  padding: 4px 0;
}
.photo-history-footer {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

/* ── Photo lightbox ───────────────────────────────────── */
.lightbox-img {
  max-width: 94vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}
.lightbox-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
}
