:root {
    --blue-900: #0b2f66;
    --blue-700: #1559b7;
    --blue-500: #2582f3;
    --page: #eef6ff;
    --ink: #172033;
    --line: #bad9ff;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: linear-gradient(180deg, #f7fbff, var(--page));
}

.game-shell {
    width: min(100vw, 760px);
    margin: 0 auto;
    padding: 16px;
}

.topbar,
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.back {
    color: var(--blue-700);
    font-weight: 800;
    text-decoration: none;
}

h1 {
    margin: 0;
    color: var(--blue-900);
    font-size: 24px;
}

.stats {
    display: flex;
    gap: 14px;
    color: var(--blue-900);
    font-weight: 800;
}

canvas,
.board {
    display: block;
    width: 100%;
    min-height: 520px;
    background: #10294f;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(11, 47, 102, 0.18);
}

canvas {
    aspect-ratio: 720 / 520;
}

.board {
    padding: 16px;
}

button {
    min-height: 44px;
    padding: 0 18px;
    color: #fff;
    font: inherit;
    font-weight: 900;
    background: var(--blue-700);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.pad {
    display: flex;
    gap: 10px;
}

.grid {
    display: grid;
    gap: 10px;
    height: 100%;
}

.tile {
    display: grid;
    place-items: center;
    min-height: 82px;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    background: #1559b7;
    border: 2px solid rgba(255,255,255,.22);
    border-radius: 8px;
}

.tile.open,
.tile.done {
    color: #0b2f66;
    background: #dff2ff;
}

.tile.empty {
    background: transparent;
    border-style: dashed;
}

@media (max-width: 620px) {
    .topbar,
    .controls {
        align-items: flex-start;
        flex-direction: column;
    }

    canvas,
    .board {
        min-height: 430px;
    }
}

