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

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
}

.container {
    max-width: 460px;
    width: 100%;
}

/* ===== Header ===== */
.game-header {
    text-align: center;
    margin-bottom: 12px;
}

.game-header h1 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(102, 126, 234, 0.6);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 10px;
    min-width: 72px;
}

.score-item .label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin-bottom: 2px;
}

.score-item .value {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

/* ===== Canvas ===== */
.canvas-wrapper {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3), inset 0 0 30px rgba(0,0,0,0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #1a1a2e;
}

/* ===== Overlays ===== */
.overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
    padding: 20px;
    z-index: 10;
}

.overlay.show {
    display: flex;
}

.overlay h2 {
    font-size: 1.8rem;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.overlay .instructions {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-size: 14px;
}

.overlay p {
    margin-bottom: 16px;
    font-size: 16px;
}

.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== Mobile Controls ===== */
.mobile-controls {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.flipper-btn {
    flex: 1;
    padding: 14px 8px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: transform 0.1s;
    user-select: none;
}

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

.launch-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #f5576c 0%, #ff6b6b 100%);
    transition: transform 0.1s;
    user-select: none;
}

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

/* ===== Tip ===== */
.game-tip {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .desktop-only { display: none; }
    .mobile-only { display: inline; }
    .mobile-controls { display: flex; }
    .game-tip .desktop-only { display: none; }
}

@media (min-width: 601px) {
    .desktop-only { display: inline; }
    .mobile-only { display: none; }
    .mobile-controls { display: none; }
}

@media (max-width: 380px) {
    body { padding: 6px; }
    .game-header h1 { font-size: 1.2rem; }
    .score-item { padding: 4px 10px; min-width: 60px; }
    .score-item .value { font-size: 15px; }
    .flipper-btn { padding: 12px 4px; font-size: 12px; }
    .launch-btn { padding: 12px 12px; font-size: 12px; }
}
