/* Simon — Neon Red theme */
:root {
    --sg-accent: #EF4444;
    --sg-accent-light: #FCA5A5;
    --sg-bg: #160B0B;
    --sg-surface: #241010;
    --sg-surface-light: #341818;
    --sg-text: #FAEAEA;
    --sg-text-dim: #C39A9A;
    --sg-gold: #FACC15;

    --sg-g: #16a34a;       --sg-g-on: #4ade80;
    --sg-r: #dc2626;       --sg-r-on: #f87171;
    --sg-y: #ca8a04;       --sg-y-on: #facc15;
    --sg-b: #2563eb;       --sg-b-on: #60a5fa;
}

.sg-layout { display: flex; justify-content: center; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 20px; min-height: calc(100vh - 80px); }
.ad-slot { width: 160px; flex-shrink: 0; }
.ad-slot--left, .ad-slot--right { display: flex; align-items: flex-start; }
.ad-placeholder--vertical { width: 160px; height: 600px; background: var(--sg-surface); border: 1px dashed var(--sg-text-dim); display: flex; align-items: center; justify-content: center; color: var(--sg-text-dim); font-size: 12px; border-radius: 8px; }

#simongame-app { flex: 1; max-width: 720px; min-width: 320px; color: var(--sg-text); }

.screen { display: none; }
.screen.active { display: block; animation: sgFade 0.3s ease; }
@keyframes sgFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.sg-header { text-align: center; padding: 36px 0 24px; }
.sg-logo { display: grid; grid-template-columns: repeat(2, 60px); grid-template-rows: repeat(2, 60px); gap: 6px; margin: 0 auto 14px; width: 126px; }
.sg-quad { border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,0.5); animation: sgPulse 2.2s ease-in-out infinite; }
.sg-quad--g { background: var(--sg-g-on); }
.sg-quad--r { background: var(--sg-r-on); animation-delay: 0.4s; }
.sg-quad--y { background: var(--sg-y-on); animation-delay: 0.8s; }
.sg-quad--b { background: var(--sg-b-on); animation-delay: 1.2s; }
@keyframes sgPulse { 0%,100% { transform: scale(0.94); opacity: 0.78; } 50% { transform: scale(1); opacity: 1; } }
.sg-header h1 { font-family: 'Syne', sans-serif; font-size: 2.8rem; font-weight: 800; color: var(--sg-accent-light); letter-spacing: 8px; margin: 0; text-shadow: 0 0 28px rgba(239,68,68,0.55); }
.subtitle { color: var(--sg-text-dim); font-size: 1rem; margin-top: 8px; }

.card { background: var(--sg-surface); border-radius: 14px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--sg-surface-light); }
.card__title { font-family: 'Syne', sans-serif; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; color: var(--sg-accent-light); margin-bottom: 14px; }

.diff-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.diff-btn { background: var(--sg-surface-light); border: 1.5px solid transparent; color: var(--sg-text); padding: 14px 8px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform 0.12s ease, border-color 0.12s ease; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; }
.diff-btn:hover { transform: translateY(-2px); border-color: var(--sg-accent); }
.diff-btn.selected { background: linear-gradient(135deg, #7f1d1d, var(--sg-accent)); border-color: var(--sg-accent-light); }
.diff-icon { font-family: 'JetBrains Mono', monospace; font-size: 0.95rem; font-weight: 700; color: var(--sg-accent-light); }
.diff-btn.selected .diff-icon { color: #fff; }
.diff-desc { font-size: 0.72rem; color: var(--sg-text-dim); }
.diff-btn.selected .diff-desc { color: rgba(255,255,255,0.85); }

.sg-rules { margin: 0; padding-left: 1.1rem; color: var(--sg-text-dim); font-size: 0.92rem; line-height: 1.6; }
.sg-rules li + li { margin-top: 6px; }

.btn { font-family: 'DM Sans', sans-serif; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; padding: 12px 22px; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease; font-size: 0.95rem; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg, var(--sg-accent), #f97316); color: #fff; box-shadow: 0 6px 18px rgba(239,68,68,0.35); }
.btn--primary:hover { box-shadow: 0 10px 24px rgba(239,68,68,0.5); }
.btn--outline { background: transparent; border: 1.5px solid var(--sg-accent); color: var(--sg-accent-light); }
.btn--outline:hover { background: rgba(239,68,68,0.12); }
.btn--ghost { background: transparent; color: var(--sg-text-dim); }
.btn--ghost:hover { color: var(--sg-accent-light); }
.btn--lg { padding: 16px 36px; font-size: 1.05rem; }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }
.menu-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; }

#game-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: var(--sg-surface); padding: 14px; border-radius: 12px; border: 1px solid var(--sg-surface-light); margin-bottom: 18px; }
.hud__cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hud__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--sg-text-dim); }
.hud__value { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 700; color: var(--sg-accent-light); }

/* Simon Pads */
.sg-board {
    position: relative;
    width: min(420px, 90vw);
    height: min(420px, 90vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    padding: 18px;
    background: var(--sg-surface);
    border-radius: 50%;
    border: 4px solid var(--sg-surface-light);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.sg-pad {
    border: none;
    cursor: pointer;
    transition: filter 0.08s ease, transform 0.08s ease;
    position: relative;
}
.sg-pad--g { background: var(--sg-g); border-top-left-radius: 100%; }
.sg-pad--r { background: var(--sg-r); border-top-right-radius: 100%; }
.sg-pad--y { background: var(--sg-y); border-bottom-left-radius: 100%; }
.sg-pad--b { background: var(--sg-b); border-bottom-right-radius: 100%; }
.sg-pad:disabled { cursor: not-allowed; }
.sg-pad.lit { filter: brightness(1.9); transform: scale(0.98); box-shadow: 0 0 30px currentColor; }
.sg-pad--g.lit { background: var(--sg-g-on); box-shadow: 0 0 36px var(--sg-g-on); }
.sg-pad--r.lit { background: var(--sg-r-on); box-shadow: 0 0 36px var(--sg-r-on); }
.sg-pad--y.lit { background: var(--sg-y-on); box-shadow: 0 0 36px var(--sg-y-on); }
.sg-pad--b.lit { background: var(--sg-b-on); box-shadow: 0 0 36px var(--sg-b-on); }
.sg-pad:not(:disabled):hover { filter: brightness(1.2); }

.sg-center {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 36%; height: 36%;
    background: var(--sg-bg);
    border-radius: 50%;
    border: 4px solid var(--sg-surface-light);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.sg-center-label {
    font-family: 'Syne', sans-serif;
    color: var(--sg-accent-light);
    letter-spacing: 4px;
    font-weight: 800;
    font-size: 1.1rem;
    text-shadow: 0 0 18px rgba(239,68,68,0.6);
}

.sg-actions { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

.result-card, .lb-card { background: var(--sg-surface); border-radius: 16px; padding: 36px 28px; border: 1px solid var(--sg-surface-light); text-align: center; max-width: 480px; margin: 40px auto; box-shadow: 0 18px 36px rgba(0,0,0,0.4); }
.result-card h2 { font-family: 'Syne', sans-serif; font-size: 2rem; color: var(--sg-accent-light); letter-spacing: 4px; margin: 0 0 12px; text-shadow: 0 0 24px rgba(239,68,68,0.55); }
.result-score { font-family: 'JetBrains Mono', monospace; font-size: 3rem; font-weight: 700; color: var(--sg-gold); margin: 8px 0; }
.result-detail { color: var(--sg-text-dim); font-size: 0.95rem; margin-bottom: 18px; line-height: 1.6; }
#nickname { width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--sg-bg); color: var(--sg-text); border: 1.5px solid var(--sg-surface-light); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; margin-bottom: 12px; box-sizing: border-box; }
#nickname:focus { outline: none; border-color: var(--sg-accent); }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }

.lb-card h2 { font-family: 'Syne', sans-serif; color: var(--sg-accent-light); letter-spacing: 4px; margin-bottom: 18px; text-shadow: 0 0 24px rgba(239,68,68,0.55); }
#leaderboard-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; counter-reset: lb; }
#leaderboard-list li { counter-increment: lb; display: flex; justify-content: space-between; padding: 10px 14px; background: var(--sg-bg); margin-bottom: 6px; border-radius: 8px; border: 1px solid var(--sg-surface-light); }
#leaderboard-list li::before { content: counter(lb); color: var(--sg-accent-light); font-weight: 700; margin-right: 10px; min-width: 24px; }
#leaderboard-list li:nth-child(1) { border-color: var(--sg-gold); }
#leaderboard-list li:nth-child(1)::before { color: var(--sg-gold); }
#leaderboard-list .lb-score { font-family: 'JetBrains Mono', monospace; color: var(--sg-accent-light); font-weight: 600; }

@media (max-width: 900px) {
    .sg-layout { flex-direction: column; padding: 12px; }
    .ad-slot { width: 100%; }
    .ad-placeholder--vertical { width: 100%; height: 90px; }
    .diff-grid { grid-template-columns: repeat(2, 1fr); }
    .sg-header h1 { font-size: 2.2rem; letter-spacing: 6px; }
    #game-hud { grid-template-columns: repeat(3, 1fr); }
}
