* {
    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;
}

.game-info {
    display: flex;
    gap: 2rem;
    font-size: 1.1rem;
    align-items: center;
}

.game-info strong {
    color: #4ecca3;
}

.turn {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.turn.white {
    color: #e0e0e0;
    text-shadow: 0 0 8px rgba(224,224,224,0.5);
}

.turn.black {
    color: #aaa;
}

.turn.ai {
    color: #f0a000;
}

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

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

.mode-btn:hover {
    background: #2a2a3e;
}

.mode-btn.active {
    background: #4ecca3;
    color: #0f0f1a;
}

.board-wrapper {
    display: inline-block;
    border: 3px solid #2a2a4e;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 320px;
    height: 320px;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
}

.square.light {
    background: #f0d9b5;
}

.square.dark {
    background: #b58863;
    cursor: pointer;
}

.square.dark:hover {
    background: #c99b75;
}

.square.selected {
    background: #f6f669 !important;
}

.square.valid-move {
    background: #cdd16f !important;
}

.square.valid-move::after {
    content: '';
    width: 28%;
    height: 28%;
    background: rgba(50, 180, 50, 0.75);
    border-radius: 50%;
    pointer-events: none;
}

.square.last-move {
    background: #aaa23a !important;
}

/* Pieces */
.piece {
    width: 78%;
    height: 78%;
    border-radius: 50%;
    position: relative;
    pointer-events: none;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.1s;
}

.piece.white-piece {
    background: radial-gradient(circle at 35% 35%, #ffffff, #c8c8c8);
    border: 2px solid #999;
}

.piece.black-piece {
    background: radial-gradient(circle at 35% 35%, #555, #1a1a1a);
    border: 2px solid #000;
}

.piece.king::after {
    content: '♛';
    font-size: 55%;
    line-height: 1;
    position: absolute;
    color: rgba(180, 140, 0, 0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.piece.white-piece.king::after {
    color: rgba(180, 140, 0, 0.9);
}

.piece.black-piece.king::after {
    color: rgba(255, 200, 0, 0.9);
}

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

.overlay.hidden {
    display: none;
}

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

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

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

.overlay .share-btn {
    background: #2a9d8f;
}

.overlay .share-btn:hover {
    background: #248c7f;
}

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

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

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

/* Content / SEO article */
.content {
    padding-top: 1rem;
    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;
}

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

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

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

.faq dt {
    font-weight: 600;
    color: #4ecca3;
    margin-top: 0.75rem;
}

.faq dd {
    margin-left: 1rem;
    color: #ccc;
}

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

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

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

.game-links a {
    color: #4ecca3;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border: 1px solid #2a2a4e;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.game-links a:hover {
    background: #2a2a4e;
}

/* Responsive */
@media (min-width: 480px) {
    .game-board {
        width: 400px;
        height: 400px;
    }

    .piece.king::after {
        font-size: 60%;
    }
}

@media (min-width: 600px) {
    main {
        padding: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    .game-board {
        width: 480px;
        height: 480px;
    }
}

@media (max-width: 360px) {
    .game-board {
        width: 280px;
        height: 280px;
    }
}

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