:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #10b981;
    --accent-color: #ef4444;
    --board-bg: #1e293b;
    --board-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --btn-color: #10b981;
    --btn-hover: #059669;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

.page-container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.seo-header {
    text-align: center;
    background: rgba(30, 41, 59, 0.7);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.seo-header h1 {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.seo-header p {
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.seo-header strong {
    color: var(--accent-color);
}

.game-wrapper {
    background: var(--board-bg);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--board-shadow);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.game-ui {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 700;
}

.score-board,
.high-score-board {
    background: rgba(15, 23, 42, 0.8);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.value {
    color: var(--primary-color);
    margin-left: 8px;
    font-weight: 900;
    font-size: 1.3rem;
}

.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    background: var(--board-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-overlay.hidden .overlay-content {
    transform: scale(0.9);
}

.overlay-content h2 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 10px;
}

.overlay-content p {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 25px;
}

.btn-primary {
    background: var(--btn-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-primary:hover {
    background: var(--btn-hover);
}

/* Mobile Controls */
.mobile-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.horizontal {
    display: flex;
    gap: 50px;
}

.d-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.1s, transform 0.1s;
}

.d-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
}

@media (min-width: 768px) {
    .mobile-controls {
        display: none;
        /* Hide on larger screens */
    }
}

.seo-article {
    background: rgba(30, 41, 59, 0.7);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    line-height: 1.6;
}

.seo-article h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #fff;
}

.seo-article ul {
    list-style-position: inside;
    color: #cbd5e1;
}

.seo-article li {
    margin-bottom: 10px;
}

.seo-article strong {
    color: #fff;
}

.back-link {
    margin-top: 10px;
    margin-bottom: 30px;
}

.back-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.back-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}