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

:root {
  --bg: #eef2f7; --card: #fff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --accent: #008744; --accent-soft: #e8f5e9;
  --felt: #1a7a4a; --felt-line: rgba(0, 0, 0, 0.25);
  --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);
  --felt: #0d4d2c; --felt-line: rgba(255, 255, 255, 0.12);
  --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.d1 { background: #111; }
.turn-dot.d2 { background: #fff; }

.board { display: grid; grid-template-columns: repeat(8, 1fr); direction: ltr !important; width: min(88vw, 540px); aspect-ratio: 1; background: var(--felt); border: 8px solid #7a4a21; border-radius: 10px; gap: 2px; padding: 4px; box-shadow: var(--shadow); user-select: none; margin: 0 auto; }
.cell { position: relative; background: var(--felt); display: flex; align-items: center; justify-content: center; border: 1px solid var(--felt-line); cursor: pointer; }
.cell.legal { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.4); }
.cell.last { box-shadow: inset 0 0 0 3px rgba(250, 204, 21, 0.8); }

.disc { width: 82%; height: 82%; border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); }
.disc.d1 { background: radial-gradient(circle at 35% 30%, #4b5563, #111827 70%); border: 1px solid #000; }
.disc.d2 { background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1 70%); border: 1px solid #94a3b8; }
.hint-dot { width: 22%; height: 22%; border-radius: 50%; opacity: 0.55; }
.hint-dot.h1 { background: #111; }
.hint-dot.h2 { background: #fff; }

.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; }

.score-row { display: flex; align-items: center; gap: 0.55rem; font-size: 0.85rem; color: var(--muted); font-weight: 700; padding: 0.3rem 0; }
.score-row b { margin-inline-start: auto; color: var(--accent); font-size: 1.05rem; }
.chip { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); }
.chip.black { background: #111; }
.chip.white { background: #fff; }

.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, 470px); }
  .side-panel { flex-direction: row; flex-wrap: wrap; }
  .card { flex: 1 1 240px; }
}
