/* TSI Adventure Game Styles */
:root {
    --tsi-orange: #FF6600;
    --tsi-green: #00FF00;
    --tsi-bg: #121820;
    --tsi-glass: rgba(18, 24, 32, 0.85);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.adventure-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.adventure-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.adventure-canvas.babylon { z-index: 1; }
.adventure-canvas.threejs { z-index: 2; pointer-events: none; background: transparent; }

.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 220px 1fr 220px;
    padding: 15px;
    gap: 15px;
}

.hud-overlay > * { pointer-events: auto; }

.glass-panel {
    background: var(--tsi-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
}

.hud-top {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back {
    background: var(--tsi-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 6px;
    padding: 8px 16px;
    color: var(--tsi-orange);
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    transition: all 0.3s;
}

.btn-back:hover { background: rgba(255, 102, 0, 0.2); }

.game-title { text-align: center; }
.game-title h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--tsi-orange);
    text-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
    margin: 0;
    letter-spacing: 0.1em;
}

.game-title span {
    font-family: 'Barlow', sans-serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.hud-score-container {
    background: var(--tsi-glass);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 6px;
    padding: 8px 20px;
    text-align: center;
}

.hud-score-container .label {
    display: block;
    font-family: 'Barlow', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2em;
}

.hud-score-container .value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem;
    color: var(--tsi-green);
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
}

.hud-left .glass-panel, .hud-right .glass-panel { text-align: center; }

.hud-left .label, .hud-right .label {
    display: block;
    font-family: 'Barlow', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.15em;
    margin-bottom: 4px;
}

.distance-display .value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    color: var(--tsi-orange);
    text-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.phase-display .value {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
}

.alert-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.alert-fill {
    height: 100%;
    background: linear-gradient(90deg, #00FF00 0%, #FFFF00 40%, #FF6600 70%, #FF0000 100%);
    transition: width 0.3s;
}

.call-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.call-btn {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 5px;
    padding: 8px 12px;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.call-btn:hover { background: rgba(255, 102, 0, 0.2); border-color: var(--tsi-orange); }
.call-btn.active { background: rgba(255, 102, 0, 0.3); border-color: var(--tsi-orange); box-shadow: 0 0 12px rgba(255, 102, 0, 0.3); }

.hud-bottom {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.record-button {
    background: linear-gradient(180deg, #FF6600 0%, #CC5200 100%);
    border: 3px solid #FF8533;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 25px rgba(255, 102, 0, 0.3);
}

.record-button:hover { transform: scale(1.05); box-shadow: 0 0 35px rgba(255, 102, 0, 0.5); }
.record-button.recording { background: linear-gradient(180deg, #FF0000 0%, #CC0000 100%); border-color: #FF3333; animation: pulse 0.5s infinite; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.record-button .icon { font-size: 1.8rem; }
.record-button .text { font-family: 'Oswald', sans-serif; font-size: 0.7rem; color: #fff; margin-top: 4px; }
.record-button .hint { font-family: 'Barlow', sans-serif; font-size: 0.55rem; color: rgba(255, 255, 255, 0.6); }

.hud-feedback {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.hud-feedback.visible { opacity: 1; }
.hud-feedback.excellent { color: #00FF00; text-shadow: 0 0 20px rgba(0, 255, 0, 0.5); }
.hud-feedback.good { color: #FFFF00; text-shadow: 0 0 20px rgba(255, 255, 0, 0.5); }
.hud-feedback.fair { color: #FF6600; text-shadow: 0 0 20px rgba(255, 102, 0, 0.5); }
.hud-feedback.poor { color: #FF3333; text-shadow: 0 0 20px rgba(255, 51, 51, 0.5); }

.overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
}

.overlay.visible { opacity: 1; visibility: visible; }

.overlay-content {
    text-align: center;
    padding: 35px 50px;
    max-width: 450px;
}

.overlay-content h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.win-overlay h1 { color: #00FF00; text-shadow: 0 0 30px rgba(0, 255, 0, 0.5); }
.fail-overlay h1 { color: #FF3333; text-shadow: 0 0 30px rgba(255, 51, 51, 0.5); }

.phase-overlay .phase-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    color: var(--tsi-orange);
    margin-bottom: 8px;
}

.phase-overlay .phase-description {
    font-family: 'Barlow', sans-serif;
    color: rgba(255, 255, 255, 0.7);
}

.stats { display: flex; justify-content: center; gap: 35px; margin: 25px 0; }
.stat .label { display: block; font-family: 'Barlow', sans-serif; font-size: 0.75rem; color: rgba(255, 255, 255, 0.5); margin-bottom: 4px; }
.stat .value { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--tsi-orange); }

.actions { display: flex; gap: 12px; justify-content: center; }

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-primary { background: linear-gradient(180deg, #FF6600 0%, #CC5200 100%); border: 2px solid #FF8533; color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255, 102, 0, 0.4); }
.btn-secondary { background: transparent; border: 2px solid rgba(255, 255, 255, 0.3); color: #fff; }
.btn-secondary:hover { border-color: var(--tsi-orange); color: var(--tsi-orange); }

.notification {
    position: fixed;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 102, 0, 0.9);
    color: #fff;
    padding: 12px 25px;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 200;
}

.notification.visible { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
    .hud-overlay { grid-template-columns: 1fr; grid-template-rows: auto auto auto 1fr auto; }
    .hud-left, .hud-right { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .hud-left .glass-panel, .hud-right .glass-panel { flex: 1; min-width: 90px; }
    .game-title h1 { font-size: 1.5rem; }
    .record-button { width: 85px; height: 85px; }
}