@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Gochi+Hand&display=swap');

:root {
    --bg-green: #1a2f23;
    --note-yellow: #fff9c4;
    --note-blue: #dceefb;
    --primary: #2980b9;
    --primary-dark: #1f6595;
}

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden; /* global prevent scroll */
}

html, body {
    width: 100%; height: 100%;
    background: var(--bg-green);
    background-image: url('/assets/blackboard.png');
    background-size: cover;
    background-position: center;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---- Main layout ---- */
#app {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ---- Canvas wrapper ---- */
#pixi-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#pixi-container canvas {
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ---- HUD ---- */
.ui-layer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-shrink: 0;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.hud-center {
    display: flex;
    gap: 20px;
}

.btn-quit {
    position: absolute;
    right: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 4px 0 #c0392b;
    font-family: 'Outfit';
    cursor: pointer;
    z-index: 10;
}

.btn-quit:hover { background: #c0392b; transform: translateY(2px); box-shadow: 0 2px 0 #c0392b; }

.stat-box {
    background: var(--note-yellow);
    color: #333;
    padding: 8px 22px;
    border-radius: 4px;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.25);
    text-align: center;
    min-width: 90px;
}

.stat-box:last-child { background: var(--note-blue); }

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    font-weight: 700;
}

.stat-value {
    font-size: 26px;
    font-weight: 900;
    font-family: 'Gochi Hand', cursive;
    line-height: 1;
}

/* ---- Overlays ---- */
.screen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.screen-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

/* ---- Menu card ---- */
.menu-card, .report-card {
    background: #fff;
    padding: 36px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    text-align: center;
    width: min(420px, 90vw);
}

.school-label, .victory-subtitle {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    font-weight: 700;
    margin-bottom: 4px;
}

.menu-title, .victory-title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 900;
    color: #2c3e50;
    font-family: 'Gochi Hand', cursive;
    margin-bottom: 28px;
    line-height: 1.2;
}

.credits {
    margin-top: 30px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: left;
}
#site-qr {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px solid #ddd;
}
.credits p { margin: 2px 0; }
.credits strong { color: var(--primary); font-size: 14px; }

.menu-buttons { display: flex; flex-direction: column; gap: 12px; }

button {
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 16px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 0 var(--primary-dark);
}

.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-dark); }
.btn-primary:hover  { background: var(--primary-dark); }

.btn-secondary {
    background: #f0f0f0;
    color: #444;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.btn-secondary:hover { background: #e4e4e4; }

/* ---- Timer Bar ---- */
#timer-bar-wrap {
    width: 100%;
    max-width: 600px;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

#timer-bar {
    height: 100%;
    background: #2ecc71;
    border-radius: 4px;
    transition: width 1s linear, background 0.5s ease;
}

/* ---- Difficulty buttons ---- */
.difficulty-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-diff-god {
    grid-column: 1 / -1; /* full width */
}

.setting-group { margin-bottom: 28px; text-align: left; }
.setting-group label { display: block; color: #333; font-weight: 700; margin-bottom: 10px; }

.btn-diff {
    background: #fff;
    border: 2px solid #ddd;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.diff-info {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
}

.btn-diff.active {
    border-color: var(--primary);
    background: #e8f4fd;
    color: var(--primary);
}

.btn-diff.active .diff-info { color: var(--primary); opacity: 0.7; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
}
.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ---- Timeout card ---- */
.timeout-title { font-size: clamp(26px, 5vw, 38px); font-weight: 900; color: #e74c3c; font-family: 'Gochi Hand', cursive; margin-bottom: 10px; }

/* ---- Settings card ---- */
.settings-card { max-width: 500px; }

/* ---- History card ---- */
.history-card { max-width: 600px; width: 90%; }
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; margin-bottom: 20px; }
.history-item { display: flex; justify-content: space-between; align-items: center; background: #f8f9fa; padding: 12px; border-radius: 8px; border: 1px solid #ddd; color: #333; font-size: 14px; font-weight: 600; text-align: left;}
.history-item.cheated { border-color: #e74c3c; background: #fdf3f2; }
.history-info span { display: block; font-weight: 400; font-size: 12px; color: #777;}
.btn-replay { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; font-family: 'Outfit'; font-size: 13px;}
.btn-replay:hover { background: var(--primary-dark); }
.history-empty { color: #888; font-style: italic; padding: 20px; }

/* ---- Victory card ---- */
.report-card { position: relative; }

.victory-stats {
    font-size: 20px;
    color: #555;
    font-family: 'Gochi Hand', cursive;
    margin-bottom: 28px;
}

/* ---- Hidden ---- */
.hidden { display: none !important; }


/* ---- Hyperion Web AntiCheat Badge ---- */
#hac-badge {
    position: fixed;
    bottom: 12px;
    right: 14px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 5px 12px 5px 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    color: #ccc;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

.hac-shield { font-size: 14px; }
.hac-text   { font-weight: 700; letter-spacing: 0.3px; }
.hac-ok       { color: #2ecc71; font-weight: 700; }
.hac-warn     { color: #e74c3c; font-weight: 700; }
.hac-disabled { color: #888; font-weight: 700; }

@media (max-width: 480px) {
    .menu-card, .report-card { padding: 28px 20px; }
    .stat-value { font-size: 20px; }
    .stat-box { min-width: 75px; padding: 6px 14px; }
    .ui-layer { gap: 10px; padding: 0 10px; }
    .btn-quit { padding: 6px 10px; font-size: 11px; top: 0; }
    .btn-sound { right: auto; left: 10px; }
}

/* ---- Global Footer ---- */
.global-footer {
    position: fixed;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to game if needed */
}
.global-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    pointer-events: auto; /* allow clicking the link */
}
.global-footer a:hover {
    text-decoration: underline;
}
