:root {
    --bg: #1a1a2e;
    --panel: #16213e;
    --board-bg: #0f3460;
    --text: #eaeaea;
    --accent: #e94560;
    --snake: #4ecca3;
    --food: #ffd369;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    padding: 12px;
    min-height: 100vh;
    overflow-x: hidden;
}

.app {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent);
    line-height: 1;
}

.game-subtitle {
    font-size: 12px;
    color: #9aa0b5;
    margin-top: 4px;
    max-width: 200px;
}

.score-box {
    background: var(--panel);
    border-radius: 8px;
    padding: 8px 16px;
    text-align: center;
    min-width: 70px;
    display: flex;
    flex-direction: column;
}

.score-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #9aa0b5;
}

.score-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.board-wrap {
    position: relative;
    width: 100%;
}

.board {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--board-bg);
    border-radius: 10px;
    touch-action: none;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 52, 96, 0.85);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.overlay-content { text-align: center; }

.result-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.result-score {
    font-size: 16px;
    margin-bottom: 16px;
    color: #cdd3e6;
    font-weight: 700;
}

.btn-retry {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}
.btn-retry:active { transform: scale(0.96); }

.dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.dpad-mid {
    display: flex;
    gap: 48px;
}

.dpad-btn {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: none;
    background: var(--panel);
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dpad-btn:active { background: var(--accent); color: #fff; transform: scale(0.94); }

.hint {
    text-align: center;
    font-size: 12px;
    color: #9aa0b5;
    margin-bottom: 70px;
}

/* Roiify banner (also styled inline in JS as fallback) */
#roiify-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 50px;
    z-index: 99999;
    pointer-events: none;
}
