/* ── Flip 7 responsive layout — overrides styles.css for larger screens ── */

/* ── Round indicator row ─────────────────────────────────── */
.round-indicator {
  text-align: center;
  padding: 5px;
  font-weight: bold;
  font-size: 0.8rem;
  background: var(--surface);
  flex-shrink: 0;
}

/* ── .game-body: flex column on mobile (base) ────────────── */
/* Wraps .table-container + .controls so we can go two-column */
.game-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   SETUP SCREEN — ≥ 640px
══════════════════════════════════════════════ */
@media (min-width: 640px) {
  #setup-screen {
    align-items: center;
    padding: 48px 32px;
  }

  #setup-screen h1 {
    font-size: 7rem;
  }

  .mode-grid {
    gap: 12px;
  }

  .mode-btn {
    padding: 18px 10px;
    font-size: 0.82rem;
    border-radius: 14px;
  }

  .player-row input {
    padding: 16px;
    border-radius: 12px;
  }

  .primary-btn {
    font-size: 2.4rem;
    padding: 22px;
    border-radius: 18px;
  }

  .add-player-link {
    font-size: 1rem;
  }
}

/* ══════════════════════════════════════════════
   GAME SCREEN — two-column ≥ 768px
══════════════════════════════════════════════ */
@media (min-width: 768px) {

  /* Let content fill the viewport width */
  body { align-items: stretch; }
  .content-width { max-width: 100%; }

  /* Constrain setup content to a centred column */
  #setup-screen {
    align-items: center;
    width: 100%;
  }
  #setup-screen > * {
    width: 100%;
    max-width: 540px;
  }

  /* Flip pill bar: slightly taller on desktop */
  .flip-pill-bar {
    padding: 10px 20px;
  }

  #mode-title {
    font-size: 1.5rem;
  }

  /* Round indicator row */
  .round-indicator {
    padding: 7px 20px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
  }

  /* game-body becomes a row */
  .game-body {
    flex-direction: row;
  }

  /* Score table: left column, fills remaining space */
  .table-container {
    padding: 14px 20px;
  }

  table {
    font-size: 0.88rem;
  }

  th {
    font-size: 0.65rem;
    padding: 10px 8px;
  }

  td {
    padding: 12px 6px;
    font-size: 0.88rem;
  }

  /* Controls: right panel — flat sidebar, no bottom-sheet style */
  .controls {
    width: 380px;
    flex-shrink: 0;
    border-top: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    overflow-y: auto;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  #live-save-btn {
    margin-bottom: 10px;
    font-size: 1.4rem;
    padding: 16px;
    border-radius: 14px;
  }

  .current-info {
    margin-bottom: 6px;
  }

  .active-name  { font-size: 1.6rem; }
  .active-score { font-size: 1.9rem; }

  .grid {
    gap: 5px;
    margin-bottom: 10px;
  }

  .btn-num { font-size: 1.1rem; }

  .btn-mod {
    padding: 9px 14px;
    font-size: 0.8rem;
  }

  .actions { gap: 10px; }

  .btn-action {
    font-size: 1.15rem;
    padding: 12px;
    border-radius: 12px;
  }
}

/* ══════════════════════════════════════════════
   LARGE DESKTOP — ≥ 1100px
══════════════════════════════════════════════ */
@media (min-width: 1100px) {
  .controls {
    width: 440px;
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  }

  #live-save-btn {
    font-size: 1.6rem;
    padding: 18px;
  }

  .active-name  { font-size: 1.9rem; }
  .active-score { font-size: 2.1rem; }

  .btn-num { font-size: 1.2rem; }

  .btn-action {
    font-size: 1.3rem;
    padding: 14px;
  }

  .grid { gap: 6px; }

  .btn-mod {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .flip-pill {
    font-size: 0.72rem;
    padding: 7px 18px;
  }
}

/* ══════════════════════════════════════════════
   FLIP 7 OVERLAY
══════════════════════════════════════════════ */
#f7-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#f7-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.f7-ov-card {
  font-family: 'Bebas Neue', cursive;
  font-size: 4.5rem;
  color: #fff;
  background: #2563eb;
  border-radius: 16px;
  width: 88px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.9);
  margin-bottom: 20px;
  animation: f7CardFlip 0.75s ease-in-out infinite;
}

.f7-ov-text {
  font-family: 'Bebas Neue', cursive;
  font-size: 4.4rem;
  letter-spacing: 0.06em;
  line-height: 1;
  animation: f7Pulse 0.5s ease-in-out infinite alternate;
}

.f7-ov-sub {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.55);
}

@keyframes f7CardFlip {
  0%   { transform: rotateY(0deg) scale(1); }
  40%  { transform: rotateY(180deg) scale(1.18); }
  100% { transform: rotateY(360deg) scale(1); }
}

@keyframes f7Pulse {
  from { color: #93c5fd; text-shadow: 0 0 20px rgba(37, 99, 235, 0.5); }
  to   { color: #ffffff; text-shadow: 0 0 60px rgba(37, 99, 235, 1), 0 0 120px rgba(37, 99, 235, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .f7-ov-card { animation: none; }
  .f7-ov-text { animation: none; color: #93c5fd; }
}
