/* DZ-Puissance4 — design system (Algerian green, dark mode, RTL-friendly) */

:root {
  --bg: #eef2f7; --card: #fff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --accent: #008744; --accent-soft: #e8f5e9;
  --board-bg: #1e3a8a; --cell-hole: #eef2f7;
  --red: #dc2626; --yellow: #facc15;
  --shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.25);
}

[data-theme="dark"] {
  --bg: #0e1420; --card: #1a2233; --text: #e8eef7; --muted: #8fa0b8; --border: #2a3650;
  --accent-soft: rgba(0, 135, 68, 0.18);
  --board-bg: #12224e; --cell-hole: #1a2233;
  --shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.6);
}

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

body { font-family: 'Segoe UI', 'Cairo', 'Tahoma', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.4rem; background: linear-gradient(135deg, var(--accent), #005a2e); color: #fff; box-shadow: var(--shadow); }
.brand-title { font-weight: 800; font-size: 1.15rem; }
.brand-subtitle { font-size: 0.75rem; opacity: 0.85; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.lang-switch { display: flex; background: rgba(255, 255, 255, 0.15); border-radius: 8px; padding: 2px; }
.lang-btn { border: none; background: transparent; color: rgba(255, 255, 255, 0.75); font-weight: 700; font-size: 0.78rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.lang-btn.active { background: #fff; color: var(--accent); }
.icon-btn { border: none; background: rgba(255, 255, 255, 0.15); color: #fff; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.icon-btn.muted { opacity: 0.5; }

.layout { display: grid; grid-template-columns: minmax(340px, 1fr) 280px; gap: 1.2rem; max-width: 1000px; margin: 0 auto; padding: 1.2rem; align-items: start; }

.status-bar { display: flex; align-items: center; gap: 0.6rem; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; font-weight: 700; }
.status-text.over { color: var(--accent); }
.turn-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.turn-dot.p1 { background: var(--red); }
.turn-dot.p2 { background: var(--yellow); }

.board { display: grid; grid-template-columns: repeat(7, 1fr); direction: ltr !important; width: min(88vw, 520px); aspect-ratio: 7 / 6; background: var(--board-bg); border-radius: 14px; padding: 10px; gap: 8px; box-shadow: var(--shadow); user-select: none; margin: 0 auto; }
.cell { position: relative; border-radius: 50%; background: var(--cell-hole); display: flex; align-items: center; justify-content: center; }
.cell.clickable { cursor: pointer; }
.cell.clickable:hover { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35); }

.disc { width: 86%; height: 86%; border-radius: 50%; box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.3); }
.disc.p1 { background: radial-gradient(circle at 35% 30%, #f87171, #dc2626 70%); }
.disc.p2 { background: radial-gradient(circle at 35% 30%, #fde047, #eab308 70%); }
.disc.winning { outline: 4px solid #fff; animation: pulse 1s infinite alternate; }

@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }

.controls-row { display: flex; gap: 0.75rem; justify-content: center; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.hint { text-align: center; margin-top: 0.5rem; font-size: 0.78rem; color: var(--muted); }

.btn { border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 700; font-size: 0.85rem; padding: 0.55rem 1.1rem; border-radius: 9px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.side-panel { display: flex; flex-direction: column; gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0.95rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.55rem; font-weight: 700; }
.select { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 0.45rem; font-size: 0.85rem; }

.banner { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: none; align-items: center; justify-content: center; z-index: 50; }
.banner.active { display: flex; }
.banner-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem 2rem; text-align: center; box-shadow: var(--shadow); }
.banner-card h2 { margin-bottom: 1rem; color: var(--accent); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .board { width: min(94vw, 460px); }
  .side-panel { flex-direction: row; flex-wrap: wrap; }
  .card { flex: 1 1 240px; }
}
