* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #1e3c72 0%, #2a5298 40%, #7e22ce 100%);
    min-height: 100vh;
    color: #fff;
    padding: 12px;
}
.wrap { max-width: 640px; margin: 0 auto; }
.head { text-align: center; margin-bottom: 12px; }
.head h1 { font-size: 1.6rem; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.stat {
    background: rgba(0,0,0,0.25);
    padding: 8px 16px;
    border-radius: 8px;
}
.stat .lbl { opacity: 0.85; margin-right: 8px; font-size: 0.9rem; }
.canvas-wrap {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}
#game {
    display: block;
    max-width: 100%;
    height: auto;
    background: #0c1929;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    border: 3px solid rgba(255,255,255,0.2);
    touch-action: none;
    cursor: none;
    outline: none;
}
#game:focus-visible {
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.65), 0 8px 32px rgba(0,0,0,0.35);
}
.toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,0.3); }
.hint {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 12px;
    line-height: 1.5;
}
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.overlay.hidden { display: none; }
.overlay-inner {
    background: #1e293b;
    padding: 24px 28px;
    border-radius: 16px;
    text-align: center;
    max-width: 90%;
    border: 2px solid rgba(255,255,255,0.2);
}
.overlay-inner p { margin-bottom: 16px; font-size: 1.1rem; }
.overlay .btn.primary {
    background: #22c55e;
    color: #0f172a;
}
