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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: #4ecca3;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

h1 {
    text-align: center;
    color: #4ecca3;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Score bar: black left, white right */
.score-bar {
    display: flex;
    gap: 0;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.score-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
}

.score-side.black-side {
    border-right: 1px solid #2a2a4e;
}

.score-disc {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.score-disc.black {
    background: #1a1a1a;
    border: 1px solid #444;
}

.score-disc.white {
    background: #f0f0f0;
    border: 1px solid #ccc;
}

.score-name {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-count {
    font-size: 1.6rem;
    font-weight: 700;
    min-width: 2ch;
    text-align: center;
}

.score-side.black-side .score-count {
    color: #c0c0c0;
}

.score-side.white-side .score-count {
    color: #f0f0f0;
}

/* WLD stats */
.wld-bar {
    display: flex;
    gap: 2rem;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
}

.wld-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.wld-label {
    font-size: 0.72rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wld-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.wld-value.wins  { color: #4ecca3; }
.wld-value.draws { color: #888; }
.wld-value.losses{ color: #e94560; }

.game-info {
    font-size: 1rem;
    font-weight: 600;
    min-height: 1.8rem;
}

.turn {
    padding: 0.25rem 0.9rem;
    border-radius: 4px;
}

.turn.black-turn { color: #c0c0c0; }
.turn.white-turn { color: #aaa; font-style: italic; }
.turn.skipped    { color: #e9a045; }

/* Board */
.board-wrapper {
    position: relative;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 44px);
    grid-template-rows: repeat(8, 44px);
    gap: 1px;
    padding: 6px;
    background: #0d2b1a;
    border: 3px solid #0d2b1a;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.cell {
    width: 44px;
    height: 44px;
    background: #1a472a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background-color 0.15s;
}

.cell:hover {
    background: #1f5530;
}

.cell.no-move {
    cursor: default;
}

/* Discs */
.disc {
    width: 76%;
    height: 76%;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.disc.black {
    background: radial-gradient(circle at 35% 35%, #555, #1a1a1a);
    box-shadow: 0 2px 6px rgba(0,0,0,0.7), inset 0 1px 2px rgba(255,255,255,0.05);
}

.disc.white {
    background: radial-gradient(circle at 35% 35%, #fff, #d8d8d8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.7);
}

/* Flip animation */
.disc.flipping-out {
    animation: flip-out 0.15s ease-in forwards;
}

.disc.flipping-in {
    animation: flip-in 0.15s ease-out forwards;
}

@keyframes flip-out {
    from { transform: translate(-50%, -50%) rotateY(0deg); }
    to   { transform: translate(-50%, -50%) rotateY(90deg); }
}

@keyframes flip-in {
    from { transform: translate(-50%, -50%) rotateY(90deg); }
    to   { transform: translate(-50%, -50%) rotateY(0deg); }
}

/* Valid move hint dot */
.hint {
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(78, 204, 163, 0.45);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cell:hover .hint {
    background: rgba(78, 204, 163, 0.7);
}

/* Overlay */
.overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 26, 0.97);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    border: 2px solid #4ecca3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    text-align: center;
    min-width: 220px;
}

.overlay.hidden {
    display: none;
}

.overlay p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ecca3;
}

.overlay p.loss-text {
    color: #e94560;
}

.overlay p.draw-text {
    color: #888;
}

.overlay .result-detail {
    font-size: 1rem;
    font-weight: 400;
    color: #aaa;
    margin-top: -0.5rem;
}

.overlay button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    background: #4ecca3;
    color: #0f0f1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.overlay button:hover {
    background: #3db892;
}

.share-btn {
    background: #1a1a2e !important;
    color: #4ecca3 !important;
    border: 2px solid #4ecca3 !important;
}

.share-btn:hover {
    background: #4ecca3 !important;
    color: #0f0f1a !important;
}

.new-game-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    background: #1a1a2e;
    color: #4ecca3;
    border: 2px solid #4ecca3;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.new-game-btn:hover {
    background: #4ecca3;
    color: #0f0f1a;
}

.instructions {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
}

/* Article / SEO content */
.content {
    padding-top: 1.5rem;
    border-top: 1px solid #2a2a4e;
}

.last-updated {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.content h2 {
    color: #4ecca3;
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.content h2:first-of-type {
    margin-top: 1rem;
}

.content p {
    margin-bottom: 0.75rem;
    color: #c0c0c0;
}

.content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: #c0c0c0;
}

.content li {
    margin-bottom: 0.5rem;
}

.faq {
    margin: 0.5rem 0 1rem;
}

.faq dt {
    font-weight: 600;
    color: #e0e0e0;
    margin-top: 1rem;
}

.faq dd {
    color: #c0c0c0;
    margin-left: 1rem;
    margin-top: 0.25rem;
}

.related-games {
    margin-top: 2rem;
    padding: 1rem;
    background: #1a1a2e;
    border: 1px solid #2a2a4e;
    border-radius: 8px;
}

.related-games h3 {
    color: #4ecca3;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.game-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-links a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: #0f0f1a;
    color: #4ecca3;
    border: 1px solid #2a2a4e;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.game-links a:hover {
    background: #4ecca3;
    color: #0f0f1a;
    border-color: #4ecca3;
}

/* Responsive */
@media (min-width: 600px) {
    main {
        padding: 2rem;
    }
    h1 {
        font-size: 2rem;
    }
    .instructions {
        font-size: 1rem;
    }
}

@media (max-width: 420px) {
    .game-board {
        grid-template-columns: repeat(8, 36px);
        grid-template-rows: repeat(8, 36px);
    }
    .cell {
        width: 36px;
        height: 36px;
    }
    .wld-bar {
        gap: 1rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 320px) {
    .game-board {
        grid-template-columns: repeat(8, 30px);
        grid-template-rows: repeat(8, 30px);
    }
    .cell {
        width: 30px;
        height: 30px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    main { padding-top: 0.5rem; }
    h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
}
