:root {
    --bg-dark: #0a0a0c;
    --paper-dark: #16161a;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --player-color: #ef4444;
    --ai-color: #334155;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --board-light: #2a3441;
    --board-dark: #1a222e;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --save-green: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(800px, 100vw);
    height: min(800px, 100vw);
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 100%);
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
}

/* Main App Container ensures hero feel */
.app-container {
    width: 100%;
    max-width: 1200px;
    min-height: 100dvh;
    /* Hero Height */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
}

.logo-main {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-panel {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 16px;
    gap: 1rem;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.player-info.active {
    opacity: 1;
}

.disc {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.disc-player {
    background: var(--player-color);
    box-shadow: 0 0 10px var(--player-color);
}

.disc-ai {
    background: var(--ai-color);
    box-shadow: 0 0 10px var(--ai-color);
}

/* Viewport */
.game-viewport {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.board-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.draughts-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
    gap: 2px;
}

.cell {
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

.cell.light {
    background-color: var(--board-light);
}

.cell.dark {
    background-color: var(--board-dark);
}

.cell.highlight {
    background: rgba(59, 130, 246, 0.4) !important;
    cursor: pointer;
}

/* Pieces */
.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.piece.player {
    background: linear-gradient(135deg, #ef4444, #991b1b);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.piece.ai {
    background: linear-gradient(135deg, #475569, #1e293b);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.piece.selected {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 0 20px var(--accent-blue);
    z-index: 100;
}

.piece.king::before {
    content: '★';
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: min(4vw, 1.5rem);
}

/* Panels */
.controls-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-section h3,
.panel-section .panel-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    letter-spacing: 1.5px;
}

/* Visually hidden but readable by screen readers & search engines */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
}

.diff-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    cursor: pointer;
}

.diff-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.instr-list {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.instr-list b {
    color: var(--accent-blue);
}

.actions {
    display: grid;
    gap: 0.8rem;
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    padding: 1rem;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    cursor: pointer;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sound-btn.active {
    color: var(--save-green);
    border-color: var(--save-green);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--paper-dark);
    padding: 3rem;
    border-radius: 32px;
    text-align: center;
    border: 1px solid var(--glass-border);
    max-width: 400px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.overlay-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.overlay-content p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Notifications */
.save-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--paper-dark);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.save-dot {
    width: 8px;
    height: 8px;
    background: var(--save-green);
    border-radius: 50%;
}

/* SEO Content Section */
.content-section {
    background: #0f172a;
    padding: 6rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    width: 100%;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.content-wrapper h1 {
    font-size: 3rem;
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-wrapper p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 4rem 0;
}

.info-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
}

.info-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.info-card p {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Legal Footer */
.main-site-footer {
    background: #050507;
    padding: 5rem 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo.small {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links h4,
.footer-notice h4 {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.footer-notice p {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-notice strong {
    color: var(--player-color);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: #475569;
    max-width: 800px;
    margin: 0 auto;
}

/* Mobile */
@media (max-width: 900px) {
    body {
        height: auto;
        display: block;
        padding: 1rem 0;
    }

    .app-container {
        min-height: 100dvh;
        padding: 1rem;
        gap: 1.5rem;
    }

    .content-wrapper h1 {
        font-size: 2.2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .game-header {
        justify-content: center;
    }

    .logo {
        font-size: 1.8rem;
        width: 100%;
        text-align: center;
    }

    .status-panel {
        width: 100%;
        justify-content: center;
    }

    .game-viewport {
        grid-template-columns: 1fr;
    }

    .board-container {
        padding: 4px;
    }

    .difficulty-selector {
        flex-wrap: wrap;
    }

    .actions {
        grid-template-columns: 1fr 1fr;
    }

    .sound-btn {
        grid-column: span 2;
    }

    .save-indicator {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .logo {
        font-size: 1.5rem;
    }

    .status-panel {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}