/* HKU Rush - Modern Cyber-Colonial Design & Glassmorphism */
:root {
    --hku-green: #005c2e;
    --hku-light-green: #008744;
    --hku-gold: #ffd700;
    --hku-red: #c8232b;
    --bg-dark: rgba(15, 23, 20, 0.85);
    --border-glass: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-muted: #b8c4be;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang HK", "Microsoft JhengHei", sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #121815;
    color: var(--text-primary);
}

#gameContainer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* HUD Overlay Layer */
#hudOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px 24px;
}

/* Top Navigation Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.stats-panel {
    display: flex;
    gap: 12px;
    background: var(--bg-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.stat-val.gold {
    color: var(--hku-gold);
}

.stat-val.alert {
    color: #ff5252;
}

/* Quest Objective Card */
.task-card {
    background: var(--bg-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.task-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--hku-gold);
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-dist {
    display: inline-block;
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 6px;
}

/* Minimap Radar */
.minimap-box {
    background: var(--bg-dark);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

#minimapCanvas {
    width: 140px;
    height: 140px;
    border-radius: 10px;
    display: block;
}

/* Controls Toolbar (Top Right) */
.quick-tools {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-glass);
    color: #ffffff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

/* Bottom HUD Area (Stamina bar & instructions) */
.bottom-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stamina-container {
    width: 320px;
    background: var(--bg-dark);
    backdrop-filter: blur(12px);
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stamina-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
}

.stamina-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

#staminaFill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00c853, #69f0ae);
    border-radius: 4px;
    transition: width 0.1s linear;
}

#staminaFill.super-sprint {
    background: linear-gradient(90deg, #ff9100, #ffd600);
    box-shadow: 0 0 10px #ffea00;
}

.controls-hint {
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Mobile Virtual Joystick & Touch Controls */
#touchZone {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 45%;
    height: 50%;
    z-index: 15;
    touch-action: none;
    display: none;
}

#joystickBase {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
}

#joystickStick {
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hku-green);
    border: 2px solid #ffffff;
    top: calc(50% - 22px);
    left: calc(50% - 22px);
    pointer-events: none;
}

#mobileActionButtons {
    position: absolute;
    right: 24px;
    bottom: 30px;
    display: none;
    flex-direction: column;
    gap: 16px;
    z-index: 20;
}

.m-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-glass);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    touch-action: none;
    cursor: pointer;
}

.m-btn.sprint.active {
    background: var(--hku-gold);
    color: #111;
}

.touch-device #touchZone,
.touch-device #mobileActionButtons {
    display: flex;
}

.touch-device .controls-hint {
    display: none;
}

/* Toast Notification */
#toast {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(20, 30, 25, 0.95);
    border: 1px solid var(--hku-gold);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modals (Start, Win, Lose, GIS) */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 14, 11, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-card {
    background: #141c18;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-tag {
    display: inline-block;
    background: var(--hku-green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff, #dcdcdc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-align: left;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hku-green), var(--hku-light-green));
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    padding: 14px 32px;
    border-radius: 14px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 92, 46, 0.4);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 92, 46, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border-glass);
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

/* Results Scorecard */
.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0 24px;
}

.score-cell {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px;
}

.score-cell .val {
    font-size: 20px;
    font-weight: 800;
    color: var(--hku-gold);
}

.score-cell .lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* GIS Modal Info Styles */
.gis-info-block {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.5;
}

.gis-code {
    background: #090e0b;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    color: #00ff88;
    word-break: break-all;
    margin-top: 6px;
}
