/**
 * Deltaplano 3D
 */
.hg-app [hidden] { display: none !important; }

.hg-app {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    color: #f1f5f9;
    background: #0b1220;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.hg-stage {
    position: relative;
    width: 100vw;
    height: calc(100vh - 72px);
    min-height: 520px;
    overflow: hidden;
    background: #9cc3e6;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.hg-stage:fullscreen { height: 100vh; }
#hgCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#hgCanvas:active { cursor: grabbing; }

.hg-speedlines {
    position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
    background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,0) 0deg 4deg, rgba(255,255,255,0.16) 4.4deg 4.8deg, rgba(255,255,255,0) 5.2deg 11deg);
    -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 32%, #000 70%);
    mask: radial-gradient(circle at 50% 50%, transparent 0 32%, #000 70%);
    animation: hg-spin 0.5s linear infinite;
    transition: opacity 0.3s;
}
@keyframes hg-spin { to { transform: rotate(3deg); } }

/* --- HUD ------------------------------------------------------------------ */
.hg-hud-top {
    position: absolute; top: 12px; left: 12px; right: 12px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    pointer-events: none; z-index: 5;
}
.hg-chip {
    background: rgba(8, 14, 26, 0.66);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 800; font-size: 15px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.hg-brand span { color: #fde68a; }
.hg-hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.hg-btn {
    min-width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(8, 14, 26, 0.66); color: #fff;
    font-size: 19px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 10px;
}
.hg-btn-wide span { font-size: 14px; font-weight: 800; }
.hg-btn:hover { background: rgba(14, 116, 144, 0.85); }

.hg-instr {
    position: absolute; left: 12px; top: 70px; z-index: 4; pointer-events: none;
    display: flex; flex-direction: column; gap: 6px;
}
.hg-ins {
    position: relative;
    background: rgba(8, 14, 26, 0.62); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; padding: 5px 12px 6px; min-width: 112px;
    font-variant-numeric: tabular-nums;
}
.hg-ins small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.75; }
.hg-ins b { font-size: 24px; font-weight: 900; }
.hg-ins i { font-style: normal; font-size: 12px; opacity: 0.75; margin-left: 4px; }
.hg-vario.is-up b { color: #4ade80; }
.hg-vario.is-down b { color: #f87171; }
.hg-vbar { position: absolute; right: 8px; top: 8px; bottom: 8px; width: 6px; border-radius: 3px; background: rgba(255,255,255,0.15); }
.hg-vbar span { position: absolute; left: 0; right: 0; height: 0; bottom: 50%; background: #4ade80; border-radius: 3px; }
.hg-vbar span.is-down { background: #f87171; }
.hg-nitro {
    align-self: flex-start; padding: 6px 12px; border-radius: 10px; font-weight: 900; letter-spacing: 0.1em;
    background: rgba(8, 14, 26, 0.5); color: rgba(255,255,255,0.35); font-size: 13px;
}
.hg-nitro.is-on { background: linear-gradient(90deg, #f97316, #facc15); color: #1a0f00; box-shadow: 0 0 22px rgba(249,115,22,0.8); animation: hg-blink 0.25s infinite alternate; }
@keyframes hg-blink { to { filter: brightness(1.25); } }

.hg-mini {
    position: absolute; right: 14px; bottom: 14px; z-index: 4; width: 180px; height: 180px;
    border-radius: 50%; border: 3px solid rgba(255,255,255,0.75);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35); pointer-events: none;
}
.hg-ringarrow {
    position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: none;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: rgba(8, 14, 26, 0.5); border-radius: 14px; padding: 6px 14px;
}
.hg-arrow-i { display: inline-block; font-size: 26px; color: #ffd23f; transform-origin: 50% 50%; text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.hg-arrow-i { rotate: -90deg; }
.hg-arrow-t { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }

.hg-tip, .hg-toast {
    position: absolute; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none;
    background: rgba(8, 14, 26, 0.78); border-radius: 14px; padding: 10px 18px; text-align: center;
    font-weight: 700; max-width: min(92vw, 640px); opacity: 0; transition: opacity 0.35s;
}
.hg-tip { bottom: 24px; font-size: 15px; border: 1px solid rgba(255,255,255,0.15); }
.hg-toast { top: 34%; font-size: 22px; font-weight: 900; }
.hg-tip.is-on, .hg-toast.is-on { opacity: 1; }

.hg-launch {
    position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 6;
    min-height: 64px; padding: 12px 34px; border-radius: 999px; border: 0; cursor: pointer;
    font-size: 24px; font-weight: 900; letter-spacing: 0.05em; color: #06121a;
    background: linear-gradient(135deg, #fde047, #fb923c); box-shadow: 0 10px 30px rgba(251,146,60,0.5);
    animation: hg-pulse 1.2s ease-in-out infinite;
}
.hg-launch small { font-size: 13px; font-weight: 700; opacity: 0.75; }
@keyframes hg-pulse { 50% { transform: translateX(-50%) scale(1.05); } }

.hg-landed {
    position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 7;
    background: rgba(8, 14, 26, 0.86); border: 1px solid rgba(255,255,255,0.18); border-radius: 18px;
    padding: 18px 22px; text-align: center; min-width: 280px;
}
.hg-landed b { font-size: 22px; display: block; margin-bottom: 12px; color: #4ade80; }
.hg-landed-btns { display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* --- touch ------------------------------------------------------------------ */
.hg-touch { display: none; }
@media (pointer: coarse) {
    .hg-touch { display: block; }
    .hg-mini { width: 130px; height: 130px; top: 70px; bottom: auto; right: 12px; }
    .hg-tip { bottom: 230px; }
}
.hg-tleft, .hg-tright { position: absolute; bottom: 16px; z-index: 5; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.hg-tleft { left: 14px; }
.hg-tright { right: 14px; }
.hg-trow { display: flex; gap: 8px; }
.hg-tbtn {
    width: 72px; height: 64px; border-radius: 16px;
    background: rgba(8, 14, 26, 0.55); border: 2px solid rgba(255,255,255,0.35); color: #fff;
    font-size: 26px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center;
    touch-action: none; -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.hg-tbtn small { font-size: 10px; font-weight: 800; margin-top: 2px; opacity: 0.9; }
.hg-tbtn.is-down { background: rgba(14, 116, 144, 0.7); border-color: #67e8f9; }
.hg-tbtn-nitro { width: 92px; height: 92px; border-color: #fb923c; font-size: 32px; }
.hg-tbtn-nitro.is-down { background: rgba(249, 115, 22, 0.7); }
.hg-tbtn-lift { width: 92px; border-color: #4ade80; }

/* --- overlay ---------------------------------------------------------------- */
.hg-overlay {
    position: absolute; inset: 0; z-index: 10; overflow-y: auto;
    display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px 24px;
    background: rgba(5, 10, 20, 0.45);
}
.hg-overlay-dim { align-items: center; background: rgba(5, 10, 20, 0.6); }
.hg-card {
    position: relative; width: min(720px, 100%); margin: auto;
    background: rgba(10, 18, 32, 0.92); border: 1px solid rgba(255,255,255,0.14); border-radius: 22px;
    padding: 24px 26px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.hg-card-wide { width: min(1080px, 100%); }
.hg-card-small { width: min(420px, 100%); }
.hg-card-map { width: min(720px, 100%); }
.hg-card h2 { margin: 0 0 12px; font-size: 26px; color: #67e8f9; }
.hg-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,0.1); color: #fff; font-size: 20px; cursor: pointer; }
.hg-kicker { font-weight: 800; color: #fde68a; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.hg-title { margin: 6px 0 8px; font-size: clamp(32px, 5vw, 52px); font-weight: 900; letter-spacing: -0.02em; background: linear-gradient(90deg, #67e8f9, #fde047, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hg-lead { color: #cbd5e1; line-height: 1.55; margin: 0 auto 18px; max-width: 780px; }
.hg-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hg-scene {
    position: relative; min-height: 150px; border-radius: 16px; border: 2px solid rgba(255,255,255,0.2);
    padding: 12px; cursor: pointer; color: #fff; text-align: left;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; overflow: hidden;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7); transition: transform 0.15s, border-color 0.15s;
}
.hg-scene::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.6) 100%); }
.hg-scene > * { position: relative; }
.hg-scene:hover, .hg-scene:focus-visible { transform: translateY(-3px); border-color: #fde047; }
.hg-scene.is-cur { border-color: #67e8f9; }
.hg-scene-e { font-size: 34px; position: absolute; top: 10px; left: 12px; }
.hg-scene b { font-size: 16px; font-weight: 900; }
.hg-scene small { font-size: 12px; line-height: 1.35; opacity: 0.95; }
.hg-scene em { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 12px; font-weight: 800; background: rgba(0,0,0,0.5); border-radius: 999px; padding: 3px 8px; }

.hg-keys { display: grid; gap: 6px; margin: 0 auto 10px; max-width: 620px; text-align: left; }
.hg-keys div { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #e2e8f0; }
.hg-k { min-width: 150px; display: inline-flex; gap: 3px; flex-wrap: wrap; align-items: center; font-weight: 700; }
.hg-app kbd {
    display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-family: inherit;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: #fff;
}
.hg-help-text { color: #cbd5e1; line-height: 1.6; text-align: left; font-size: 14px; }
.hg-help-actions { margin-top: 12px; }
.hg-play {
    min-height: 48px; padding: 10px 26px; border-radius: 999px; border: 0; cursor: pointer;
    font-size: 17px; font-weight: 900; color: #06121a;
    background: linear-gradient(135deg, #67e8f9, #a3e635); box-shadow: 0 8px 24px rgba(103, 232, 249, 0.35);
}
.hg-play small, .hg-link small { opacity: 0.7; font-size: 12px; }
.hg-link {
    display: block; margin: 8px auto 0; min-height: 44px; padding: 8px 16px;
    background: none; border: 0; color: #cbd5e1; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: underline;
}
.hg-map-hint { color: #cbd5e1; font-size: 14px; margin: 0 0 10px; }
#hgMapCanvas { width: 100%; max-width: 640px; aspect-ratio: 1; border-radius: 14px; cursor: crosshair; display: block; margin: 0 auto; }
.hg-loading { display: flex; align-items: center; gap: 14px; font-size: 20px; font-weight: 800; background: rgba(10,18,32,0.9); padding: 18px 26px; border-radius: 16px; }
.hg-spin { width: 26px; height: 26px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.2); border-top-color: #67e8f9; animation: hg-rot 0.8s linear infinite; }
@keyframes hg-rot { to { transform: rotate(360deg); } }

.hg-info { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; color: #e2e8f0; }
.hg-info h2 { font-size: 28px; margin: 0 0 12px; color: #67e8f9; }
.hg-info p { line-height: 1.65; color: #cbd5e1; }
.hg-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.hg-info-grid div { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 16px 18px; }
.hg-info h3 { margin: 0 0 6px; font-size: 18px; color: #fde047; }

@media (max-width: 700px) {
    .hg-brand, .hg-btn-wide span { display: none; }
    .hg-ins { min-width: 92px; padding: 4px 10px; }
    .hg-ins b { font-size: 19px; }
    .hg-card { padding: 18px 14px; }
    .hg-keys { display: none; }
    .hg-scenes { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .hg-scene { min-height: 128px; }
}
