html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #111;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#game,
#game canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#reticle {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 24px;
    line-height: 1;
    pointer-events: none;
    text-shadow: 0 1px 3px #000;
    z-index: 20;
}

#hud {
    position: fixed;
    top: 14px;
    left: 14px;
    width: min(390px, calc(100vw - 28px));
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9px;
    background: rgba(10, 10, 10, 0.72);
    color: #f4f4f4;
    z-index: 15;
    backdrop-filter: blur(4px);
}

#hud.hidden {
    display: none;
}

#statusLabel {
    margin-top: 7px;
    color: #ffd88a;
}

.hud-help,
.small {
    margin-top: 8px;
    font-size: 0.85rem;
    opacity: 0.78;
}

.overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    z-index: 50;
}

.overlay.visible {
    display: flex;
}

.panel {
    width: min(460px, calc(100vw - 32px));
    padding: 26px;
    box-sizing: border-box;
    text-align: center;
    color: #f7f7f7;
    background: rgba(24, 24, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
}

.panel h1,
.panel h2 {
    margin-top: 0;
}

.mode-buttons {
    display: grid;
    gap: 12px;
    margin: 22px 0 8px;
}

.review-confirm {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;

    display: none;

    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;

    background: rgba(20, 20, 20, 0.9);
    color: white;

    font-size: 16px;
    cursor: pointer;
}

.review-confirm.visible {
    display: block;
}

.review-clear {
    position: fixed;
    right: 24px;
    bottom: 72px;
    z-index: 50;

    display: none;

    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;

    background: rgba(20, 20, 20, 0.9);
    color: white;

    font-size: 14px;
    cursor: pointer;
}

.review-clear.visible {
    display: block;
}

.review-resume {
    position: fixed;
    right: 24px;
    bottom: 120px;
    z-index: 50;
    display: none;
}

.review-resume.visible {
    display: block;
}

button {
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    padding: 11px 15px;
    background: #333;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background: #444;
}

.stop-ai-button {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 60;

    display: none;

    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 8px;

    background: rgba(20,20,20,0.9);
    color: white;

    font-size: 14px;
    cursor: pointer;
}

.stop-ai-button.visible {
    display: block;
}

.ai-halt-panel {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);

    z-index: 70;

    display: none;

    padding: 14px 18px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;

    background: rgba(20,20,20,0.94);
    color: white;

    text-align: center;
}

.ai-halt-panel.visible {
    display: block;
}

.ai-halt-title {
    margin-bottom: 10px;
    font-weight: bold;
}

.ai-halt-panel button {
    margin: 0 4px;
    padding: 9px 14px;
    cursor: pointer;
}
