/* ==========================================================================
   Apple of Fortune Live Predictor — CSS
   ========================================================================== */

:root {
  --bg-main: #060b14;
  --bg-card: #111a2e;
  --border-color: #1e293b;
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --accent-green: #10b981;
  --accent-green-bright: #059669;
  --accent-red: #f43f5e;
  --accent-yellow: #facc15;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.4;
  padding: 16px 12px;
}

.predict-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
  background: #1e293b;
}

.nav-link.active {
  color: #ffffff;
  background: #0284c7;
  border-color: #0369a1;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sound,
.btn-refresh {
  background: #1e293b;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sound:hover,
.btn-refresh:hover {
  background: #334155;
  border-color: #475569;
}

.btn-refresh {
  background: #0284c7;
  border-color: #0369a1;
}

.btn-refresh:hover {
  background: #0369a1;
}

/* Header */
.predict-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  font-size: 2.2rem;
}

.predict-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.header-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-status {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-waiting {
  background: #334155;
  color: var(--text-muted);
}

.badge-active {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.bet-display {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   HUGE RECOMMENDATION BANNER (Visible at a glance across room)
   ========================================================================== */
.recommend-banner {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%);
  color: #ffffff;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5), 0 0 20px rgba(16, 185, 129, 0.3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid #34d399;
}

.banner-tier {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d1fae5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-action {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.banner-options {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ecfdf5;
  background: rgba(0, 0, 0, 0.2);
  display: inline-block;
  margin: 0 auto;
  padding: 4px 16px;
  border-radius: 9999px;
}

/* Empty State */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #334155;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-muted);
  max-width: 460px;
  font-size: 0.95rem;
}

/* Matrix Card */
.grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  overflow-x: auto;
}

.grid-header-cols {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.col-spacer {
  width: 110px;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
  padding-right: 6px;
}

.col-label {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.matrix-rows-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-grid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.matrix-grid-row.current-row {
  background: rgba(250, 204, 21, 0.08);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% {
    box-shadow: 0 0 0 2px #facc15, 0 0 12px rgba(250, 204, 21, 0.4);
    border-color: #facc15;
  }
  50% {
    box-shadow: 0 0 0 3px #eab308, 0 0 24px rgba(234, 179, 8, 0.7);
    border-color: #eab308;
  }
  100% {
    box-shadow: 0 0 0 2px #facc15, 0 0 12px rgba(250, 204, 21, 0.4);
    border-color: #facc15;
  }
}

.matrix-grid-row.completed-row {
  opacity: 0.55;
}

.tier-label {
  width: 110px;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
  padding-right: 6px;
}

.tier-label strong {
  color: var(--text-primary);
}

.cell-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  user-select: none;
  transition: transform 0.15s ease;
  position: relative;
}

.cell-good {
  background: rgba(16, 185, 129, 0.25);
  border: 2px solid #10b981;
  color: #34d399;
}

.cell-bad {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.matrix-grid-row.current-row .cell-good {
  background: rgba(16, 185, 129, 0.45);
  border: 3px solid #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
  transform: scale(1.02);
}

.cell-picked::after {
  content: '★';
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 1rem;
  color: #fbbf24;
  text-shadow: 0 0 4px #000;
}

/* Footer */
.game-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.game-meta-footer strong {
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .banner-action {
    font-size: 2.2rem;
  }
  .cell-container {
    height: 42px;
    font-size: 1.2rem;
  }
  .col-spacer, .tier-label {
    width: 70px;
    font-size: 0.7rem;
  }
}
