/* ============================================================
   CROSSOVER X — runner.css
   The Smuggler — Endless Runner
   ============================================================ */

/* ============================================================
   TOP BAR — minimal navigation, nicht ablenkend
   ============================================================ */
.run-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: 80px;
    background: rgba(0,0,0,0.92);
    border-bottom: 1px solid rgba(0,229,255,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(8px);
}

.run-topbar-logo {
    height: 44px;
    width: auto;
    opacity: 0.95;
}

.run-topbar-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(11px, 1.6vw, 14px);
    color: rgba(0,229,255,0.75);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.run-topbar-back {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(0,229,255,0.85);
    text-decoration: none;
    border: 2px solid rgba(0,229,255,0.35);
    padding: 10px 20px;
    border-radius: 5px;
    background: rgba(0,229,255,0.06);
    transition: all 0.2s;
}
.run-topbar-back:hover {
    color: #00e5ff;
    border-color: rgba(0,229,255,0.8);
    background: rgba(0,229,255,0.14);
}
.run-topbar-back img {
    width: 24px; height: 24px;
    image-rendering: pixelated;
}

/* ============================================================
   PAGE — full viewport, game centered
   ============================================================ */
.run-page {
    background: #000;
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(0,30,50,0.8) 0%, #000 70%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 96px 16px 24px;   /* 96px = 80px topbar + 16px gap */
    box-sizing: border-box;
}

/* ============================================================
   GAME FRAME — outer glow + label
   ============================================================ */
.run-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 980px;
}

/* Neon corner decorations */
.run-frame::before,
.run-frame::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-color: rgba(0,229,255,0.5);
    border-style: solid;
    z-index: 5;
    pointer-events: none;
}
.run-frame::before {
    top: -4px; left: -4px;
    border-width: 2px 0 0 2px;
}
.run-frame::after {
    top: -4px; right: -4px;
    border-width: 2px 2px 0 0;
}

/* Bottom corners via wrapper */
.run-frame-inner {
    position: relative;
    width: 100%;
}
.run-frame-inner::before,
.run-frame-inner::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-color: rgba(0,229,255,0.5);
    border-style: solid;
    z-index: 5;
    pointer-events: none;
}
.run-frame-inner::before {
    bottom: -4px; left: -4px;
    border-width: 0 0 2px 2px;
}
.run-frame-inner::after {
    bottom: -4px; right: -4px;
    border-width: 0 2px 2px 0;
}

/* ============================================================
   GAME WRAPPER — the actual canvas container
   ============================================================ */
.run-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 960 / 520;      /* matches canvas 960×520 */
    background: #000;
    border: 1px solid rgba(0,229,255,0.25);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.8),
        0 0 24px rgba(0,229,255,0.12),
        0 0 60px rgba(0,0,0,0.9),
        inset 0 0 40px rgba(0,0,0,0.5);
    overflow: hidden;
}

/* Scanline overlay on entire game */
.run-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0,0,0,0.12) 3px,
        rgba(0,0,0,0.12) 4px
    );
    pointer-events: none;
    z-index: 50;
}

@media (max-width: 768px) {
    /* Page: kein padding unten — Controls brauchen Platz */
    .run-page {
        padding: 90px 0 0;
        justify-content: flex-start;
    }
    .run-frame  { max-width: 100vw; }
    .run-wrap {
        aspect-ratio: 960 / 520;
        border-left: none;
        border-right: none;
    }
    .run-frame::before, .run-frame::after,
    .run-frame-inner::before, .run-frame-inner::after { display: none; }
    .run-topbar-title { display: none; }
    /* Mobile: logo kleiner */
    .run-topbar-logo  { height: 28px; }
    .run-topbar-back  { font-size: 10px; padding: 8px 12px; }
    .run-topbar-back img { width: 16px; height: 16px; }
    .run-topbar { height: 60px; }
}

/* ============================================================
   CANVAS
   ============================================================ */
.run-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ============================================================
   HUD — Score, Leben, Controls
   ============================================================ */
.run-hud {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}
.run-hud-left, .run-hud-right {
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}
.run-hud-center { text-align: center; }

/* Lives — number icon + pips */
.run-lives-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,50,80,0.3);
    border-radius: 4px;
    padding: 4px 10px 4px 6px;
}
.run-life-num {
    width: 36px;
    height: 36px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 6px rgba(255,80,80,0.8));
}
.run-life-pips {
    display: flex;
    gap: 3px;
    align-items: center;
}
.run-pip {
    display: block;
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(255,50,80,0.7));
    transition: opacity 0.3s, transform 0.3s;
}
.run-pip::before { content: '❤'; }
.run-pip.lost {
    opacity: 0.2;
    transform: scale(0.65);
    filter: grayscale(1);
}
.run-pip.lost::before { content: '🖤'; }

/* Score */
.run-score-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(6px, 1vw, 8px);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(0,229,255,0.6);
}
.run-score-val {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 2vw, 16px);
    color: #ffaa00;
    text-shadow: 0 0 8px rgba(255,170,0,0.6);
    line-height: 1;
}

/* Pixel icon buttons — HUD */
.run-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(0,229,255,0.25);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-decoration: none;
    padding: 0;
}
.run-icon-btn img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}
.run-icon-btn:hover {
    border-color: rgba(0,229,255,0.7);
    background: rgba(0,229,255,0.1);
}
.run-icon-btn.muted img { opacity: 0.35; }

/* ============================================================
   OVERLAYS — Start / Game Over / Pause
   ============================================================ */
.run-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(2px);
}

.run-overlay--hidden {
    display: none;
}

.run-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 2vh, 20px);
    padding: 20px;
    text-align: center;
}

/* Titel */
.run-pixel-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(16px, 4vw, 32px);
    color: #00e5ff;
    text-shadow:
        0 0 20px rgba(0, 229, 255, 0.7),
        0 0 40px rgba(0, 229, 255, 0.3),
        3px 3px 0 rgba(0,0,0,0.8);
    line-height: 1.3;
    animation: runTitlePulse 3s ease-in-out infinite;
}

.run-pixel-title--red {
    color: #ff2244;
    text-shadow:
        0 0 20px rgba(255, 34, 68, 0.7),
        3px 3px 0 rgba(0,0,0,0.8);
}

@keyframes runTitlePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.85; }
}

.run-pixel-sub {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(8px, 1.5vw, 12px);
    font-weight: 700;
    letter-spacing: 0.3em;
    color: rgba(255, 170, 0, 0.8);
    text-transform: uppercase;
}

/* Hi-Score im Start-Screen */
.run-hiscore-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 170, 0, 0.3);
    padding: 6px 16px;
    border-radius: 3px;
}

.run-hi-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(7px, 1vw, 9px);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 170, 0, 0.5);
}

.run-hi-val {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 1.8vw, 14px);
    color: #ffaa00;
    text-shadow: 0 0 6px rgba(255, 170, 0, 0.5);
}

/* Controls Info */
.run-controls-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.run-ctrl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.run-ctrl-key {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(6px, 0.9vw, 8px);
    color: rgba(0, 229, 255, 0.8);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 3px 7px;
    border-radius: 2px;
    background: rgba(0, 229, 255, 0.06);
    min-width: 100px;
    text-align: center;
}

.run-ctrl-desc {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(7px, 1vw, 9px);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
}

/* Start Button — replaced by .run-big-btn system */
.run-big-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(9px, 1.5vw, 12px);
    color: #00e5ff;
    background: rgba(0,229,255,0.08);
    border: 2px solid rgba(0,229,255,0.5);
    border-radius: 4px;
    padding: clamp(10px,1.5vh,16px) clamp(18px,3vw,32px);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    letter-spacing: 0.08em;
    animation: runBtnPulse 2s ease-in-out infinite;
}
.run-big-btn:hover {
    background: rgba(0,229,255,0.18);
    border-color: #00e5ff;
    box-shadow: 0 0 20px rgba(0,229,255,0.3);
    animation: none;
}
.run-big-btn--secondary {
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.15);
    animation: none;
}
.run-big-btn--secondary:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    box-shadow: none;
}
.run-btn-icon {
    width: 32px; height: 32px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
.run-btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes runBtnPulse {
    0%,100% { border-color: rgba(0,229,255,0.5); }
    50%      { border-color: rgba(0,229,255,0.9);
               box-shadow: 0 0 12px rgba(0,229,255,0.25); }
}

.run-link-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(7px,1vw,9px);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}
.run-link-back:hover { color: rgba(255,255,255,0.7); }
.run-link-icon { width: 18px; height: 18px; image-rendering: pixelated; opacity: 0.4; }

/* Pause grid */
.run-pause-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 280px;
}
.run-pause-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(0,229,255,0.2);
    border-radius: 6px;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: rgba(255,255,255,0.6);
}
.run-pause-btn:hover {
    border-color: rgba(0,229,255,0.6);
    background: rgba(0,229,255,0.08);
    color: #fff;
}
.run-pause-icon { width: 32px; height: 32px; image-rendering: pixelated; }
.run-pause-btn span {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(7px,1vw,9px);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Overlay icons */
.run-overlay-icon { width: 24px; height: 24px; image-rendering: pixelated; opacity: 0.7; }
.run-summary-icon { width: 18px; height: 18px; image-rendering: pixelated; opacity: 0.6; }

/* Game Over Summary */
.run-score-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px 24px;
    border-radius: 4px;
    min-width: 200px;
}

.run-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.run-summary-label {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(7px, 1vw, 9px);
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.4);
}

.run-summary-val {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 1.6vw, 13px);
    color: #fff;
}

.run-summary-val--gold {
    color: #ffaa00;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.run-new-record {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(8px, 1.2vw, 10px);
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.7);
    display: none;
    animation: runBlink 0.8s step-end infinite;
    margin-top: 4px;
    text-align: center;
}

.run-new-record.visible { display: block; }

@keyframes runBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ============================================================
   MOBILE CONTROLS — unter dem Spielfeld, 3 Buttons
   ============================================================ */
.run-mobile-controls {
    display: none;   /* default: hidden on desktop */
    width: 100%;
    background: rgba(0,0,0,0.92);
    border-top: 1px solid rgba(0,229,255,0.15);
    padding: 12px 20px 20px;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    /* NOT absolute — sits below the canvas in normal flow */
}

@media (max-width: 768px) {
    .run-mobile-controls { display: flex; }
}
.run-mobile-controls.touch-active { display: flex; }

.run-mobile-btn {
    flex: 1;
    height: 64px;
    max-width: 140px;
    background: rgba(0,229,255,0.08);
    border: 2px solid rgba(0,229,255,0.35);
    border-radius: 8px;
    color: rgba(0,229,255,0.9);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.08s, border-color 0.08s;
}
.run-mobile-btn:active,
.run-mobile-btn.pressed {
    background: rgba(0,229,255,0.22);
    border-color: rgba(0,229,255,0.8);
}

/* Jump button in center — bigger */
.run-mobile-btn--jump {
    flex: 1.4;
    height: 72px;
    background: rgba(0,229,255,0.12);
    border-color: rgba(0,229,255,0.5);
    border-width: 2px;
}

.run-mobile-btn img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    pointer-events: none;
}
.run-mobile-btn span {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(0,229,255,0.6);
    pointer-events: none;
}