/* ══════════════════════════════════════════════════════
   NEON BEAST – Pinball Arcade CSS
   Dark neon aesthetic, full-viewport game layout
   ══════════════════════════════════════════════════════ */

:root {
    --neon-pink:    #ff2d78;
    --neon-cyan:    #00f5ff;
    --neon-yellow:  #ffe600;
    --neon-purple:  #bf5fff;
    --neon-green:   #39ff14;
    --bg-dark:      #080b14;
    --bg-panel:     #0d1225;
    --border-glow:  #1a2a4a;
    --text-dim:     #4a6080;
    --font-arcade:  'Courier New', Courier, monospace;
}

/* ── Reset / Base ─────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: var(--bg-dark);
    color: #e0e8ff;
    font-family: var(--font-arcade);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ── App wrapper ──────────────────────────────────── */
.pinball-app {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

/* ── Game root ────────────────────────────────────── */
.game-root {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    position: relative;
    background: var(--bg-dark);
}

/* ── HUD ──────────────────────────────────────────── */
.hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-glow);
    min-height: 52px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.hud::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.5;
}

.hud-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 90px;
}

.hud-center {
    align-items: center;
    min-width: 120px;
}

.hud-right {
    align-items: flex-end;
}

.hud-label {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.hud-value {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1.1;
}

.hud-mult {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 2px;
    animation: pulse-mult 0.6s ease-in-out infinite alternate;
}

@keyframes pulse-mult {
    from { opacity: 0.8; }
    to   { opacity: 1; text-shadow: 0 0 12px currentColor; }
}

/* Ball indicators */
.ball-indicators {
    display: flex;
    gap: 6px;
    margin-bottom: 3px;
}

.ball-dot {
    font-size: 14px;
    transition: color 0.3s, text-shadow 0.3s;
}

.ball-active {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

.ball-used {
    color: var(--text-dim);
    text-shadow: none;
}

/* Neon color utilities */
.neon-pink   { color: var(--neon-pink);   text-shadow: 0 0 10px var(--neon-pink); }
.neon-cyan   { color: var(--neon-cyan);   text-shadow: 0 0 10px var(--neon-cyan); }
.neon-yellow { color: var(--neon-yellow); text-shadow: 0 0 10px var(--neon-yellow); }
.neon-purple { color: var(--neon-purple); text-shadow: 0 0 10px var(--neon-purple); }
.neon-green  { color: var(--neon-green);  text-shadow: 0 0 10px var(--neon-green); }

/* ── Canvas wrap ──────────────────────────────────── */
.canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.canvas-wrap canvas {
    display: block;
    image-rendering: pixelated;
}

/* ── Controls hint ────────────────────────────────── */
.controls-hint {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-glow);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
    flex-shrink: 0;
    min-height: 28px;
}

.controls-hint span:first-child  { color: #3a90ff; }
.controls-hint span:last-child   { color: #3a90ff; }
.controls-hint span:nth-child(2) { color: var(--text-dim); }

/* ── Game Over Overlay ────────────────────────────── */
.gameover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fade-in 0.4s ease;
    backdrop-filter: blur(4px);
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.gameover-panel {
    background: var(--bg-panel);
    border: 1px solid var(--neon-pink);
    border-radius: 4px;
    padding: 28px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    min-width: 260px;
    box-shadow:
        0 0 24px rgba(255, 45, 120, 0.4),
        0 0 60px rgba(255, 45, 120, 0.15),
        inset 0 0 30px rgba(0,0,0,0.4);
    animation: panel-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panel-in {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.go-title {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 4px;
    animation: flicker 3s infinite;
}

@keyframes flicker {
    0%,19%,21%,23%,25%,54%,56%,100% { opacity: 1; }
    20%,24%,55% { opacity: 0.6; }
}

.go-score {
    text-align: center;
}

.go-label {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.go-value {
    font-size: 38px;
    font-weight: bold;
    letter-spacing: 2px;
}

.go-highscore {
    font-size: 14px;
    letter-spacing: 3px;
    font-weight: bold;
    animation: pulse-mult 0.5s ease-in-out infinite alternate;
}

.go-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* ── Arcade buttons ───────────────────────────────── */
.btn-arcade {
    display: block;
    width: 100%;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-arcade);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 3px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    border-radius: 2px;
}

.btn-arcade:hover, .btn-arcade:focus {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 16px var(--neon-cyan);
    outline: none;
}

.btn-arcade:active {
    transform: scale(0.97);
}

.btn-outline {
    border-color: var(--text-dim);
    color: var(--text-dim);
}

.btn-outline:hover, .btn-outline:focus {
    border-color: var(--neon-purple);
    background: var(--neon-purple);
    color: var(--bg-dark);
    box-shadow: 0 0 16px var(--neon-purple);
}

/* ══════════════════════════════════════════════════════
   HIGHSCORES PAGE
   ══════════════════════════════════════════════════════ */
.hs-root {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--bg-dark);
    padding: 24px 16px;
    overflow-y: auto;
}

.hs-header {
    text-align: center;
    margin-bottom: 28px;
}

.hs-title {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 5px;
    color: var(--neon-yellow);
    text-shadow: 0 0 16px var(--neon-yellow);
    margin-bottom: 4px;
}

.hs-subtitle {
    font-size: 9px;
    letter-spacing: 4px;
    color: var(--text-dim);
}

.hs-table {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-collapse: collapse;
}

.hs-table th {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-glow);
}

.hs-table th:last-child { text-align: right; }

.hs-row {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}

.hs-row:hover {
    background: rgba(255,255,255,0.03);
}

.hs-row td {
    padding: 8px 10px;
    font-size: 13px;
}

.hs-row td:last-child {
    text-align: right;
    font-size: 16px;
    font-weight: bold;
}

.hs-rank {
    color: var(--text-dim);
    font-size: 11px;
    width: 36px;
}

.hs-rank-1 { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); }
.hs-rank-2 { color: #c0c0c0; }
.hs-rank-3 { color: #cd7f32; }

.hs-score-1 { color: var(--neon-yellow); text-shadow: 0 0 8px var(--neon-yellow); }
.hs-score-2 { color: var(--neon-cyan); text-shadow: 0 0 6px var(--neon-cyan); }
.hs-score-3 { color: var(--neon-pink); text-shadow: 0 0 6px var(--neon-pink); }

.hs-name {
    color: #c0d4ff;
}

.hs-date {
    color: var(--text-dim);
    font-size: 10px;
}

.hs-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 3px;
    padding: 40px 0;
}

.hs-back {
    max-width: 480px;
    margin: 28px auto 0;
}

/* ── Loading screen ───────────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    background: var(--bg-dark);
}

.loading-progress {
    width: 80px;
    height: 80px;
    overflow: visible;
}

.loading-progress circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    animation: loading-spin 2s linear infinite;
    transform-origin: center;
}

.loading-progress circle:nth-child(1) {
    stroke: var(--border-glow);
    transform: none;
    animation: none;
}

.loading-progress circle:nth-child(2) {
    stroke: var(--neon-cyan);
    stroke-dasharray: 1px 200px;
    animation: loading-spin 2s linear infinite, loading-grow 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--neon-cyan);
}

@keyframes loading-spin {
    to { transform: rotate(1turn); }
}

@keyframes loading-grow {
    0%,100% { stroke-dasharray:  1px 200px; }
    50%      { stroke-dasharray: 80px 200px; }
}

.loading-progress-text::after {
    content: attr(style);
    content: 'LOADING...';
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-top: 16px;
    display: block;
    text-align: center;
    animation: flicker 2s infinite;
}

/* ── Blazor error UI ──────────────────────────────── */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 12px 20px;
    background: rgba(255,0,80,0.9);
    color: #fff;
    font-size: 12px;
    z-index: 1000;
    text-align: center;
}

#blazor-error-ui .reload {
    color: #fff;
    font-weight: bold;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
}

/* ══════════════════════════════════════════════════════
   TABLE INFO PAGE
   ══════════════════════════════════════════════════════ */
.ti-root {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--bg-dark);
    padding: 24px 16px 32px;
    overflow-y: auto;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.ti-header {
    text-align: center;
    margin-bottom: 32px;
}

.ti-title {
    font-size: 30px;
    font-weight: bold;
    letter-spacing: 6px;
    margin-bottom: 4px;
}

.ti-subtitle {
    font-size: 9px;
    letter-spacing: 6px;
    color: var(--text-dim);
}

.ti-section {
    margin-bottom: 28px;
}

.ti-section-title {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 5px;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-glow);
}

/* Controls grid */
.ti-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ti-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 3px;
    padding: 10px 14px;
    flex: 1 1 140px;
}

.ti-card-wide {
    flex-basis: 100%;
}

.ti-card-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.ti-card-name {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 3px;
}

.ti-card-desc {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* Table elements list */
.ti-element {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.ti-elem-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.ti-elem-name {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.ti-elem-desc {
    font-size: 11px;
    color: #8090b0;
    line-height: 1.5;
}

/* Scoring table */
.ti-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.ti-table th {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-glow);
}

.ti-table td {
    padding: 7px 8px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #c0d4ff;
}

.ti-pts {
    text-align: right;
    font-weight: bold;
}

.ti-note {
    font-size: 11px;
    color: #8090b0;
    line-height: 1.5;
    padding: 10px 12px;
    background: var(--bg-panel);
    border-left: 2px solid var(--neon-cyan);
    border-radius: 2px;
}

/* Special features */
.ti-feature {
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 3px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.ti-feature-header {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.ti-feature-desc {
    font-size: 11px;
    color: #8090b0;
    line-height: 1.55;
}

/* Tips list */
.ti-tips {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ti-tips li {
    font-size: 11px;
    color: #8090b0;
    line-height: 1.5;
    padding-left: 18px;
    position: relative;
}

.ti-tips li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--neon-yellow);
}

/* Back buttons */
.ti-back {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* ── Not found ────────────────────────────────────── */
.not-found {
    color: var(--text-dim);
    text-align: center;
    padding: 40px;
    letter-spacing: 3px;
    font-size: 12px;
}
