:root {
    --bg: #0a0c10;
    --bg2: #12151c;
    --bg3: #1a1e28;
    --border: #2a3040;
    --border-light: #3a4560;
    --text: #8090a8;
    --text-bright: #c0cce0;
    --white: #e8edf5;
    --accent: #4fc3f7;
    --accent-dim: rgba(79,195,247,0.15);
    --green: #2ecc71;
    --green-dim: rgba(46,204,113,0.15);
    --orange: #f5a623;
    --orange-dim: rgba(245,166,35,0.15);
    --red: #e74c3c;
    --red-dim: rgba(231,76,60,0.15);
    --gold: #f0d060;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* ═══════════════════════════════════════════════════
   SELECT SCREEN – Redesigned
   ═══════════════════════════════════════════════════ */

#select-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

.ss-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 30% 20%, #0f1a2e 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, #1a0f2e 0%, transparent 50%),
                var(--bg);
}

.ss-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: ssTwinkle linear infinite;
}

@keyframes ssTwinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.ss-hex-particle {
    position: absolute;
    animation: ssFloat linear infinite;
    pointer-events: none;
}

@keyframes ssFloat {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

.ss-hex-particle svg { width: 100%; height: 100%; }

.ss-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.ss-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: rgba(10,12,16,0.85);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.ss-logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ss-logo-hex { width: 64px; height: 64px; flex-shrink: 0; }

.ss-logo-svg {
    width: 100%; height: 100%;
    filter: drop-shadow(0 0 12px rgba(79,195,247,0.3));
    animation: ssLogoBreath 4s ease-in-out infinite;
}

@keyframes ssLogoBreath {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(79,195,247,0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(79,195,247,0.5)); }
}

.ss-title-group { display: flex; flex-direction: column; gap: 2px; }

.ss-title {
    font-family: 'Orbitron', monospace;
    font-size: 24px; font-weight: 900;
    color: var(--white); letter-spacing: 6px; margin: 0;
}

.ss-subtitle {
    font-size: 12px; color: var(--text);
    letter-spacing: 1px; margin: 0;
}

.ss-header-actions { display: flex; align-items: center; gap: 12px; }

.ss-progress-box {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; background: var(--bg3);
    border: 1px solid var(--border); border-radius: 8px;
}

.ss-progress-label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--text); white-space: nowrap;
}

.ss-progress-bar {
    width: 80px; height: 6px;
    background: var(--bg); border-radius: 3px; overflow: hidden;
}

.ss-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    border-radius: 3px; transition: width 0.6s ease;
}

.ss-progress-stars {
    font-family: 'Orbitron', monospace;
    font-size: 11px; font-weight: 700;
    color: var(--gold); white-space: nowrap;
}

.ss-btn-rules, .ss-btn-home {
    padding: 8px 16px; font-size: 12px; font-weight: 600;
    color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; text-decoration: none; cursor: pointer;
    transition: all 0.2s; background: transparent; white-space: nowrap;
}

.ss-btn-rules:hover, .ss-btn-home:hover {
    color: var(--accent); border-color: var(--accent);
    background: var(--accent-dim);
}

.ss-btn-reset {
    padding: 8px 16px; font-size: 12px; font-weight: 600;
    color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3);
    border-radius: 6px; cursor: pointer;
    transition: all 0.2s; background: transparent; white-space: nowrap;
}
.ss-btn-reset:hover {
    border-color: #ff6b6b; background: rgba(255,107,107,0.1);
}
.ss-btn-reset.confirm {
    color: #fff; background: #e74c3c; border-color: #e74c3c;
    animation: resetPulse 0.6s ease;
}
@keyframes resetPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Difficulty Selector */
.ss-difficulty-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.ss-difficulty-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    opacity: 0.6;
}

.ss-difficulty-btns {
    display: flex;
    gap: 2px;
    background: var(--bg3);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--border);
}

.ss-diff-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ss-diff-btn:hover {
    color: var(--text-bright);
    background: rgba(255,255,255,0.05);
}

.ss-diff-btn.active {
    color: var(--bg);
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(79,195,247,0.3);
}

.ss-diff-btn[data-diff="easy"].active { background: #3ddc84; }
.ss-diff-btn[data-diff="normal"].active { background: var(--accent); }
.ss-diff-btn[data-diff="hard"].active { background: #ffb347; color: var(--bg); }
.ss-diff-btn[data-diff="impossible"].active { background: #e74c3c; }

.ss-level-track {
    display: flex; align-items: center; gap: 0;
    padding: 40px 48px; overflow-x: auto; overflow-y: visible;
    flex: 1; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.ss-level-track::-webkit-scrollbar { height: 6px; }
.ss-level-track::-webkit-scrollbar-track { background: transparent; }
.ss-level-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.ss-connector {
    width: 48px; height: 3px;
    background: var(--border); flex-shrink: 0;
    position: relative; border-radius: 2px;
}

.ss-connector.done {
    background: linear-gradient(90deg, var(--green), rgba(46,204,113,0.4));
}

.ss-connector::after {
    content: ''; position: absolute;
    right: -4px; top: 50%;
    width: 8px; height: 8px;
    border-top: 2px solid var(--border);
    border-right: 2px solid var(--border);
    transform: translateY(-50%) rotate(45deg);
}

.ss-connector.done::after { border-color: var(--green); }

.ss-level-node {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    flex-shrink: 0; cursor: pointer;
    transition: all 0.3s ease; position: relative;
}

.ss-level-node:hover:not(.locked) { transform: translateY(-8px); }

.ss-level-node:hover:not(.locked) .ss-node-ring {
    box-shadow: 0 0 30px rgba(79,195,247,0.4);
    border-color: var(--accent);
}

.ss-level-node.locked {
    cursor: not-allowed; opacity: 0.35; filter: grayscale(0.6);
}

.ss-level-node.ss-launch { animation: ssLaunch 0.3s ease forwards; }

@keyframes ssLaunch {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(0.9); opacity: 0.5; }
}

.ss-node-ring {
    width: 56px; height: 56px; border-radius: 50%;
    border: 3px solid var(--border); background: var(--bg2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s; position: relative; z-index: 2;
}

.ss-level-node.completed .ss-node-ring {
    border-color: var(--green); background: rgba(46,204,113,0.1);
    box-shadow: 0 0 16px rgba(46,204,113,0.2);
}

.ss-level-node.next .ss-node-ring {
    border-color: var(--accent); background: rgba(79,195,247,0.1);
    box-shadow: 0 0 24px rgba(79,195,247,0.25);
    animation: ssNodePulse 2.5s ease-in-out infinite;
}

@keyframes ssNodePulse {
    0%, 100% { box-shadow: 0 0 24px rgba(79,195,247,0.25); }
    50% { box-shadow: 0 0 40px rgba(79,195,247,0.45); }
}

.ss-node-number {
    font-family: 'Orbitron', monospace;
    font-size: 22px; font-weight: 900; color: var(--text);
}

.ss-level-node.completed .ss-node-number { color: var(--green); }
.ss-level-node.next .ss-node-number { color: var(--accent); }

.ss-node-body {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px; width: 180px;
    text-align: center; transition: all 0.3s;
    position: relative; overflow: hidden;
}

.ss-level-node.completed .ss-node-body { border-color: rgba(46,204,113,0.3); }

.ss-level-node.next .ss-node-body {
    border-color: rgba(79,195,247,0.4);
    background: linear-gradient(180deg, rgba(79,195,247,0.05) 0%, var(--bg2) 100%);
}

.ss-level-node:hover:not(.locked) .ss-node-body {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.ss-node-preview {
    width: 140px; height: 80px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
}

.ss-node-preview svg { width: 100%; height: 100%; }
.ss-node-lock { font-size: 24px; opacity: 0.4; }

.ss-node-info { display: flex; flex-direction: column; gap: 4px; }

.ss-node-name {
    font-family: 'Orbitron', monospace;
    font-size: 12px; font-weight: 700;
    color: var(--white); letter-spacing: 1px;
}

.ss-level-node.locked .ss-node-name { color: var(--text); }

.ss-node-meta {
    display: flex; justify-content: center; gap: 10px;
    font-size: 10px; font-weight: 600;
}

.ss-node-diff { letter-spacing: 0.5px; }
.ss-node-cells { color: var(--text); }

.ss-node-desc {
    font-size: 10px; color: var(--text); opacity: 0.7;
    line-height: 1.4; margin-top: 4px;
}

.ss-node-stars {
    font-size: 11px; color: var(--gold);
    margin-top: 6px; letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(240,208,96,0.4);
}

.ss-node-badge {
    font-family: 'Orbitron', monospace;
    font-size: 10px; font-weight: 700; letter-spacing: 2px;
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent), #1a8fc4);
    padding: 4px 14px; border-radius: 6px;
    margin-top: 8px; display: inline-block;
    box-shadow: 0 2px 12px rgba(79,195,247,0.3);
    animation: ssBadgePulse 2s ease-in-out infinite;
}

@keyframes ssBadgePulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(79,195,247,0.3); }
    50% { box-shadow: 0 2px 20px rgba(79,195,247,0.5); }
}

/* (Old level-grid/card styles removed — replaced by ss-* classes above) */

/* ═══════════════════════════════════════════════════
   PLAY LAYOUT (fullscreen)
   ═══════════════════════════════════════════════════ */

#play-layout {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr 280px;
    height: 100vh;
    width: 100vw;
}

/* ── Top Bar ── */
#top-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    min-height: 48px;
    gap: 16px;
}

.top-ship-name {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.top-progress {
    display: flex;
    gap: 16px;
    align-items: center;
}

.top-stat {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

.top-stat b {
    color: var(--accent);
    font-family: 'Orbitron', monospace;
    font-size: 14px;
}

.top-score {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.top-grade {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(240,208,96,0.1);
    color: var(--gold);
}

/* ── Crew Section (Top Bar) ── */
.top-crew-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.top-crew-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
}

.top-crew-mult {
    font-size: 13px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: #8ca0b8;
}

.top-swap {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.top-swap.available {
    color: var(--green);
    background: var(--green-dim);
}

.top-swap.used {
    color: var(--text);
    opacity: 0.4;
}

/* ── Recycler Status (Top Bar) ── */
.top-recycler {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
}

.top-recycler-icon {
    font-size: 14px;
    color: var(--green);
}

.top-recycler-progress {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
}

.top-recycler-remaining {
    font-size: 10px;
    color: var(--text);
    opacity: 0.7;
}

/* ── Board Area ── */
#board-area {
    grid-column: 1;
    grid-row: 2;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at center, #111520 0%, var(--bg) 60%);
    position: relative;
}

#board {
    position: relative;
    flex-shrink: 0;
    transform-origin: center center;
    transition: transform 0.15s ease;
}

/* ── Zoom Controls ── */
#zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 6px;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.zoom-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-bright);
}

.zoom-btn:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.zoom-level {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    color: var(--text);
    min-width: 40px;
    text-align: center;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 4px;
}

.zoom-level:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── Sidebar ── */
#sidebar {
    grid-column: 2;
    grid-row: 2;
    background: var(--bg2);
    border-left: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-section {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 10px;
}

/* ── Aufträge ── */
.obj-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    transition: all 0.3s;
}

.obj-icon {
    font-size: 14px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.5;
}

.obj-label {
    flex: 1;
    color: var(--text);
    font-weight: 500;
}

.obj-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.3s;
}

.obj-row.done .obj-icon { opacity: 1; }
.obj-row.done .obj-label { color: var(--green); }
.obj-row.done .obj-check {
    border-color: var(--green);
    background: var(--green-dim);
    color: var(--green);
}

/* ── Stats ── */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 4px;
}

.stat-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 4px;
    text-align: center;
}

.stat-val {
    font-family: 'Orbitron', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.stat-lbl {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
    margin-top: 1px;
}

/* ── Score Detail ── */
.score-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.score-row span:last-child {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-bright);
}

.score-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 0;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    font-weight: 700;
    color: var(--white);
    font-size: 14px;
}

.score-total span:last-child {
    font-family: 'Orbitron', monospace;
    color: var(--gold);
    font-size: 16px;
}

/* ── Sidebar Buttons ── */
.sidebar-btns {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.sidebar-btns button {
    flex: 1;
}

button {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 8px 12px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    transition: all 0.2s;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   DRAFT BAR (bottom) – Single Tile Layout
   ═══════════════════════════════════════════════════ */

#draft-bar {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    min-height: 110px;
}

.draft-single {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.draft-tile-big {
    width: 88px;
    height: 80px;
    flex-shrink: 0;
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 4px;
    background: var(--accent-dim);
}

.draft-tile-big svg {
    width: 100%;
    height: 100%;
}

.draft-tile-info {
    min-width: 140px;
}

.draft-info-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
}

.draft-info-type {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.draft-info-stats {
    font-size: 10px;
    color: var(--text);
    line-height: 1.4;
}

.draft-info-doors {
    font-size: 10px;
    color: var(--text);
    opacity: 0.6;
}

/* ── Next Tile Preview ── */
.draft-next-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-left: 1px solid var(--border);
    min-width: 80px;
    flex-shrink: 0;
}

.draft-next-label {
    font-family: 'Orbitron', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
    opacity: 0.6;
}

.draft-next-tile {
    width: 52px;
    height: 48px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.draft-next-tile svg {
    width: 100%;
    height: 100%;
}

.draft-next-preview:hover .draft-next-tile {
    opacity: 1;
}

.draft-next-name {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.draft-next-second {
    opacity: 0.6;
}

.draft-next-second .draft-next-tile {
    width: 42px;
    height: 42px;
}

.draft-next-empty {
    font-size: 20px;
    color: var(--text);
    opacity: 0.3;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draft-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.draft-rotate-btns {
    display: flex;
    gap: 4px;
}

.draft-action-btn {
    width: auto;
    padding: 8px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.draft-action-btn.swap-btn {
    color: var(--orange);
    border-color: var(--orange);
}

.draft-action-btn.swap-btn:hover {
    background: var(--orange-dim);
}

.draft-action-btn.swap-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
    border-color: var(--border);
    color: var(--text);
}

/* ── Recycler Button ── */
.draft-action-btn.recycle-btn {
    color: var(--green);
    border-color: var(--green);
    position: relative;
}

.draft-action-btn.recycle-btn:hover {
    background: var(--green-dim);
}

.draft-action-btn.recycle-btn.recycle-ready {
    color: #fff;
    border-color: var(--green);
    background: var(--green);
    animation: recycleGlow 1.5s ease infinite;
}

@keyframes recycleGlow {
    0%   { box-shadow: 0 0 4px rgba(46,204,113,0.3); }
    50%  { box-shadow: 0 0 16px rgba(46,204,113,0.7); }
    100% { box-shadow: 0 0 4px rgba(46,204,113,0.3); }
}

.recycle-progress {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    opacity: 0.8;
    margin-left: 2px;
}

.recycle-remaining {
    font-size: 9px;
    opacity: 0.6;
    margin-left: 4px;
}

.draft-action-btn.recycle-btn.recycle-exhausted {
    color: var(--text);
    border-color: var(--border);
    opacity: 0.6;
}

.draft-action-btn.recycle-btn.recycle-exhausted:hover {
    background: rgba(255,255,255,0.03);
}

/* ── Crew Toggle Button ── */
.draft-action-btn.crew-toggle-btn {
    color: var(--accent);
    border-color: var(--accent);
    position: relative;
    transition: all 0.25s;
}

.draft-action-btn.crew-toggle-btn:hover {
    background: var(--accent-dim);
}

.draft-action-btn.crew-toggle-btn.active {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 12px rgba(79,195,247,0.4);
}

.draft-action-btn.crew-toggle-btn .crew-count {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    opacity: 0.8;
    margin-left: 2px;
}

/* ── Crew Hint in Draft Bar ── */
.crew-hint-active {
    color: var(--accent);
    opacity: 1 !important;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.draft-hint {
    font-size: 10px;
    color: var(--text);
    opacity: 0.4;
    flex-shrink: 0;
    text-align: right;
    line-height: 1.4;
}

.draft-empty {
    flex: 1;
    text-align: center;
    color: var(--text);
    opacity: 0.5;
    font-size: 14px;
    padding: 20px;
}

/* (Crew-Phase-Bar entfernt — Crew ist jetzt Toggle-basiert) */

/* ═══════════════════════════════════════════════════
   HEX CELLS
   ═══════════════════════════════════════════════════ */

.hex-cell {
    position: absolute;
    cursor: pointer;
    transition: filter 0.15s;
}

.hex-cell svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hex-cell:hover { filter: brightness(1.15); z-index: 2; }
.hex-cell.occupied { cursor: default; }
.hex-cell.occupied:hover { filter: brightness(1.05); }

.hex-cell.valid-hover {
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(46,204,113,0.5));
    z-index: 3;
}

.hex-cell.perfect-hover {
    filter: brightness(1.4) drop-shadow(0 0 14px rgba(240,208,96,0.7));
    z-index: 3;
}

.hex-cell.invalid-hover {
    filter: brightness(0.7) drop-shadow(0 0 8px rgba(231,76,60,0.4));
    cursor: not-allowed;
    z-index: 3;
}

.hex-cell.flash-valid { animation: flashGreen 0.35s ease; }
.hex-cell.flash-invalid { animation: flashRed 0.4s ease; }
.hex-cell.flash-perfect { animation: flashPerfect 0.9s ease; z-index: 5; }

@keyframes flashGreen {
    0%   { filter: brightness(1); }
    30%  { filter: brightness(1.6) drop-shadow(0 0 16px rgba(46,204,113,0.8)); }
    100% { filter: brightness(1); }
}

@keyframes flashRed {
    0%   { filter: brightness(1); }
    30%  { filter: brightness(1.4) drop-shadow(0 0 16px rgba(231,76,60,0.8)); }
    100% { filter: brightness(1); }
}

@keyframes flashPerfect {
    0%   { filter: brightness(1); transform: scale(1); }
    15%  { filter: brightness(2.5) drop-shadow(0 0 28px rgba(240,208,96,1.0)); transform: scale(1.12); }
    35%  { filter: brightness(1.8) drop-shadow(0 0 20px rgba(240,208,96,0.7)); transform: scale(1.05); }
    60%  { filter: brightness(1.3) drop-shadow(0 0 12px rgba(240,208,96,0.4)); transform: scale(1.02); }
    100% { filter: brightness(1); transform: scale(1); }
}

/* ── Perfect Placement Celebration ── */
.perfect-celebrate-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    border: 3px solid #f0d060;
    animation: perfectRing 0.8s ease-out forwards;
}

.perfect-celebrate-ring.ring-delayed {
    animation: perfectRing 0.9s ease-out 0.15s forwards;
    border-color: #ffe066;
    opacity: 0;
}

@keyframes perfectRing {
    0%   { width: 10px;  height: 10px;  opacity: 1; }
    50%  { width: 100px; height: 100px; opacity: 0.6; }
    100% { width: 180px; height: 180px; opacity: 0; }
}

.perfect-celebrate-score {
    position: absolute;
    pointer-events: none;
    z-index: 21;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #f0d060;
    text-shadow: 0 0 20px rgba(240,208,96,0.9), 0 0 40px rgba(240,208,96,0.4);
    white-space: nowrap;
    animation: perfectScore 1.6s ease-out forwards;
}

@keyframes perfectScore {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.3); }
    20%  { opacity: 1;   transform: translate(-50%, -70%) scale(1.3); }
    40%  { opacity: 1;   transform: translate(-50%, -80%) scale(1.0); }
    70%  { opacity: 1;   transform: translate(-50%, -95%) scale(1.0); }
    100% { opacity: 0;   transform: translate(-50%, -120%) scale(0.8); }
}

.perfect-celebrate-particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f0d060;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(240,208,96,0.8);
    animation: perfectParticle 1.0s ease-out forwards;
}

@keyframes perfectParticle {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.2); }
}

.perfect-celebrate-star {
    position: absolute;
    pointer-events: none;
    z-index: 21;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #f0d060;
    text-shadow: 0 0 10px rgba(240,208,96,0.7);
    animation: perfectStar 1.2s ease-out forwards;
}

@keyframes perfectStar {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.5) rotate(0deg); }
    50%  { opacity: 1; transform: translate(var(--px), var(--py)) scale(1.2) rotate(180deg); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.6) rotate(360deg); }
}

/* ── Objective Toast ── */
.section-toast.objective-toast {
    border-width: 2px;
    box-shadow: 0 0 30px rgba(46,204,113,0.2);
}

.section-toast.perfect-toast {
    border-width: 2px;
    box-shadow: 0 0 30px rgba(240,208,96,0.25);
}

.hex-cell .ghost-preview {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0.4;
    pointer-events: none;
}

.hex-cell .ghost-preview svg {
    width: 100%;
    height: 100%;
}

/* ── Crew Hover (Crew-Modus auf belegtem Tile) ── */
.hex-cell.crew-hover {
    filter: brightness(1.25) drop-shadow(0 0 10px rgba(79,195,247,0.6));
    cursor: pointer !important;
    z-index: 3;
}

.hex-cell.occupied.crew-hover {
    cursor: pointer !important;
}

.hex-cell.crew-target {
    cursor: pointer !important;
    outline: 2px dashed rgba(79,195,247,0.35);
    outline-offset: -2px;
    border-radius: 4px;
}

/* ── Abgeschlossene Sektionen ── */
.hex-cell.section-done {
    filter: brightness(1.08) drop-shadow(0 0 4px rgba(46,204,113,0.25));
}

.hex-cell.section-complete-flash {
    animation: sectionFlashBig 1.1s ease;
    z-index: 4;
}

@keyframes sectionFlashBig {
    0%   { filter: brightness(1); }
    15%  { filter: brightness(2.2) drop-shadow(0 0 28px rgba(46,204,113,1.0)); }
    45%  { filter: brightness(1.6) drop-shadow(0 0 14px rgba(46,204,113,0.7)); }
    100% { filter: brightness(1.08) drop-shadow(0 0 4px rgba(46,204,113,0.25)); }
}

/* ── Section Celebration: Ring Shockwave ── */
.section-celebrate-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    animation: celebrateRing 0.9s ease-out forwards;
}

@keyframes celebrateRing {
    0%   { width: 20px;  height: 20px;  opacity: 0.9; border: 3px solid currentColor; }
    60%  { width: 120px; height: 120px; opacity: 0.5; border: 2px solid currentColor; }
    100% { width: 200px; height: 200px; opacity: 0;   border: 1px solid currentColor; }
}

/* ── Section Celebration: Score Pop ── */
.section-celebrate-score {
    position: absolute;
    pointer-events: none;
    z-index: 21;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 20px currentColor;
    animation: celebrateScore 1.4s ease-out forwards;
}

@keyframes celebrateScore {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.5); }
    25%  { opacity: 1;   transform: translate(-50%, -60%) scale(1.2); }
    60%  { opacity: 1;   transform: translate(-50%, -80%) scale(1.0); }
    100% { opacity: 0;   transform: translate(-50%, -110%) scale(0.9); }
}

/* ── Section Celebration: Particles ── */
.section-celebrate-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 20;
    transform: translate(-50%, -50%);
    animation: celebrateParticle 1.1s ease-out forwards;
}

@keyframes celebrateParticle {
    0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0;   transform: translate(var(--px), var(--py)) scale(0.3); }
}

/* ── Cluster Labels ── */
/* In-Tile Cluster Tags */
.tile-cluster-tag {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -2px;
    font-size: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0.5;
    text-shadow: 0 0 4px rgba(0,0,0,1), 0 0 8px rgba(0,0,0,0.8);
    z-index: 15;
}
.tile-cluster-tag.tag-complete {
    opacity: 0.65;
}

/* ═══════════════════════════════════════════════════
   SECTION TOAST
   ═══════════════════════════════════════════════════ */

.section-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(10,12,16,0.95);
    border: 2px solid;
    border-radius: 10px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease, top 0.3s ease;
    backdrop-filter: blur(8px);
    pointer-events: none;
}

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

.toast-icon {
    font-size: 20px;
    font-weight: 700;
}

.toast-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.toast-sub {
    font-size: 11px;
    opacity: 0.7;
}

.toast-pts {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   FLYAWAY SEQUENCE
   ═══════════════════════════════════════════════════ */

#flyaway-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.75);
    z-index: 1900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    backdrop-filter: blur(3px);
}

#flyaway-overlay.show { opacity: 1; }

/* Starfield background */
.flyaway-starfield {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.flyaway-star {
    position: absolute;
    width: var(--star-size, 2px);
    height: var(--star-size, 2px);
    background: #fff;
    border-radius: 50%;
    opacity: 0.4;
    animation: flyawayStar 3s linear infinite;
}

@keyframes flyawayStar {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; transform: scale(1); }
}

/* When active: stars streak to the left */
.flyaway-starfield.active .flyaway-star {
    animation: flyawayStarStreak 0.6s linear infinite;
}

@keyframes flyawayStarStreak {
    0% {
        opacity: 1;
        transform: translateX(0) scaleX(1);
        width: var(--star-size, 2px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50vw) scaleX(40);
        width: var(--star-size, 2px);
    }
}

/* Stats Container */
.flyaway-stats-container {
    position: relative;
    z-index: 10;
    max-width: 420px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flyaway-title {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin-bottom: 8px;
    opacity: 0;
    animation: flyawayTitleIn 0.6s ease 0.3s forwards;
}

.flyaway-title-jump {
    animation: flyawayTitlePulse 0.4s ease forwards !important;
    color: var(--gold) !important;
    font-size: 20px !important;
    letter-spacing: 8px !important;
}

@keyframes flyawayTitleIn {
    from { opacity: 0; transform: translateY(-10px); letter-spacing: 12px; }
    to { opacity: 1; transform: translateY(0); letter-spacing: 6px; }
}

@keyframes flyawayTitlePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { transform: scale(1.15); text-shadow: 0 0 30px rgba(240,208,96,0.6); }
    100% { opacity: 1; transform: scale(1); text-shadow: 0 0 20px rgba(240,208,96,0.3); }
}

/* Individual Stat Card */
.flyaway-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(20, 25, 40, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    backdrop-filter: blur(8px);
}

.flyaway-stat-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    filter: drop-shadow(0 2px 8px rgba(255,255,255,0.15));
}

.flyaway-stat-info {
    flex: 1;
    min-width: 0;
}

.flyaway-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 4px;
}

.flyaway-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

/* Animated stat bar with max track */
.flyaway-stat-bar-track {
    position: relative;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}

.flyaway-stat-bar-max {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
}

.flyaway-stat-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: none;
    box-shadow: 0 0 8px rgba(255,255,255,0.15);
}

.flyaway-stat-fill.animate {
    width: var(--target-width);
    transition: width 2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Legend below bar */
.flyaway-stat-legend {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text);
    opacity: 0.5;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.flyaway-stat-pct {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--text-bright);
    opacity: 1;
}

/* Skip button */
.flyaway-skip {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1910;
    font-size: 12px;
    color: var(--text);
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 1px;
}

.flyaway-skip:hover {
    opacity: 1;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════
   LEVEL END OVERLAY
   ═══════════════════════════════════════════════════ */

#level-end-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(6px);
}

#level-end-overlay.show { opacity: 1; }

#level-end-overlay.success .level-end-modal {
    border-color: var(--gold);
    box-shadow: 0 0 60px rgba(240,208,96,0.15), 0 24px 80px rgba(0,0,0,0.6);
}

#level-end-overlay.failure .level-end-modal {
    border-color: var(--red);
    box-shadow: 0 0 60px rgba(231,76,60,0.1), 0 24px 80px rgba(0,0,0,0.6);
}

.level-end-modal {
    background: var(--bg2);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 36px 40px;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    text-align: center;
}

.level-end-stars {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.level-end-title {
    font-family: 'Orbitron', monospace;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

#level-end-overlay.success .level-end-title { color: var(--gold); }
#level-end-overlay.failure .level-end-title { color: var(--red); }

.level-end-subtitle {
    font-size: 13px;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.level-end-ship {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: var(--text);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 24px;
}

/* Score Rows */
.level-end-scores {
    text-align: left;
    margin-bottom: 20px;
}

.level-end-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-bright);
    border-radius: 6px;
    opacity: 0;
    animation: scoreRowIn 0.35s ease forwards;
}

.level-end-score-row:nth-child(odd) { background: var(--bg3); }

@keyframes scoreRowIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.le-score-icon {
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.le-score-label { flex: 1; }

.le-score-value {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
}

.level-end-score-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px 0;
    margin-top: 8px;
    border-top: 2px solid var(--border);
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
    opacity: 0;
    animation: scoreRowIn 0.4s ease forwards;
}

.level-end-score-total span:last-child {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    color: var(--gold);
}

/* Ship Stats in End Modal */
.level-end-shipstats {
    text-align: left;
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.le-shipstat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: var(--text-bright);
}

.le-shipstat-icon { width: 22px; text-align: center; font-size: 14px; }
.le-shipstat-label { flex: 1; color: var(--text); }

.le-shipstat-value {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

/* Objectives */
.level-end-objectives {
    text-align: left;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 24px;
}

.le-obj-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 8px;
}

.le-obj-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text);
}

.le-obj-row.done { color: var(--green); }

.le-obj-icon { width: 18px; text-align: center; font-size: 13px; }
.le-obj-label { flex: 1; }
.le-obj-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.le-obj-row.done .le-obj-check {
    border-color: var(--green);
    background: var(--green-dim);
    color: var(--green);
}

.le-obj-row:not(.done) .le-obj-check {
    color: var(--red);
    opacity: 0.5;
}

/* Buttons */
.level-end-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.le-btn-primary {
    width: auto;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bg);
    background: var(--gold);
    border: none;
    border-radius: 8px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.le-btn-primary:hover {
    background: #ffe580;
    box-shadow: 0 4px 20px rgba(240,208,96,0.3);
    transform: translateY(-1px);
}

#level-end-overlay.failure .le-btn-primary {
    background: var(--accent);
    color: var(--bg);
}

#level-end-overlay.failure .le-btn-primary:hover {
    background: #7dd3fc;
    box-shadow: 0 4px 20px rgba(79,195,247,0.3);
}

.le-btn-secondary {
    width: auto;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.le-btn-secondary:hover {
    color: var(--text-bright);
    border-color: var(--border-light);
    background: rgba(255,255,255,0.03);
}

/* Scrollbar */
.level-end-modal::-webkit-scrollbar { width: 6px; }
.level-end-modal::-webkit-scrollbar-track { background: transparent; }
.level-end-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.level-end-modal::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Legende (in sidebar) ── */
.legend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    padding: 3px 4px;
    border-radius: 4px;
    cursor: default;
}

.legend-item:hover {
    background: rgba(255,255,255,0.03);
}

.legend-dot {
    width: 22px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* ── Panel Hint ── */
.panel-hint {
    font-weight: 400;
    opacity: 0.5;
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Rules Button (Top Bar) ── */
.rules-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 14px;
    font-weight: 900;
    border-radius: 50%;
    border: 2px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rules-btn:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 12px rgba(79,195,247,0.3);
}

/* (Old select-rules styles removed — replaced by ss-btn-* above) */

/* ═══════════════════════════════════════════════════
   RULES OVERLAY
   ═══════════════════════════════════════════════════ */

#rules-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

#rules-overlay.show {
    opacity: 1;
}

.rules-modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.rules-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.rules-close:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
}

.rules-title {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 24px;
    text-align: center;
}

.rules-section {
    margin-bottom: 20px;
}

.rules-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.rules-section p {
    font-size: 12px;
    color: var(--text-bright);
    line-height: 1.6;
    margin-bottom: 6px;
}

.rules-section p b {
    color: var(--white);
}

/* ── Rules Steps ── */
.rules-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rules-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--text-bright);
    line-height: 1.5;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rules-step b {
    color: var(--white);
}

/* ── Rules Type Grid ── */
.rules-types {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rules-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg3);
}

.rules-type-dot {
    width: 28px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.rules-type-name {
    font-size: 12px;
    font-weight: 700;
    min-width: 80px;
}

.rules-type-desc {
    font-size: 11px;
    color: var(--text);
    flex: 1;
}

/* ── Rules Score Table ── */
.rules-score-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rules-score-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-bright);
    border-radius: 4px;
}

.rules-score-row:nth-child(odd) {
    background: var(--bg3);
}

.rules-score-row span:last-child {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
}

.rules-score-row.negative span:last-child {
    color: var(--red);
}

/* ── Rules Actions ── */
.rules-actions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-bright);
    line-height: 1.5;
}

.rules-actions-list b {
    color: var(--white);
}

/* ── Custom scrollbar for rules ── */
.rules-modal::-webkit-scrollbar {
    width: 6px;
}

.rules-modal::-webkit-scrollbar-track {
    background: transparent;
}

.rules-modal::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.rules-modal::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ═══════════════════════════════════════════════════
   TUTORIAL OVERLAY
   ═══════════════════════════════════════════════════ */

#tutorial-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

#tutorial-overlay.show { opacity: 1; }

.tutorial-modal {
    background: var(--bg2);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 36px 40px 28px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 80px rgba(79,195,247,0.15), 0 24px 80px rgba(0,0,0,0.6);
    animation: tutorialModalIn 0.4s ease;
}

@keyframes tutorialModalIn {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.tutorial-progress {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s;
}

.tutorial-dot.active {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(79,195,247,0.5);
    transform: scale(1.3);
}

.tutorial-dot.done {
    background: var(--green);
}

.tutorial-icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.tutorial-title {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.tutorial-text {
    font-size: 14px;
    color: var(--text-bright);
    line-height: 1.7;
    margin-bottom: 28px;
    padding: 0 8px;
}

.tutorial-text b {
    color: var(--white);
}

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

.tutorial-btn-primary {
    width: auto;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bg);
    background: var(--accent);
    border: none;
    border-radius: 8px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-btn-primary:hover {
    background: #7dd3fc;
    box-shadow: 0 4px 20px rgba(79,195,247,0.3);
    transform: translateY(-1px);
}

.tutorial-btn-secondary {
    width: auto;
    padding: 12px 20px;
    font-size: 13px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.tutorial-btn-secondary:hover {
    color: var(--text-bright);
    border-color: var(--border-light);
    background: rgba(255,255,255,0.03);
}

.tutorial-skip {
    margin-top: 16px;
    min-height: 20px;
}

.tutorial-skip span {
    font-size: 11px;
    color: var(--text);
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tutorial-skip span:hover {
    opacity: 1;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   Energy Grid Visuals
   ═══════════════════════════════════════════════════════════════ */

.hex-cell.tile-powered {
    filter: drop-shadow(0 0 6px rgba(0, 220, 255, 0.5));
}

.hex-cell.tile-unpowered {
    filter: brightness(0.5) saturate(0.4);
}
.hex-cell.tile-unpowered::after {
    content: '⚡';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: #ff4c4c;
    opacity: 0.8;
    pointer-events: none;
    z-index: 5;
}

/* Beschädigte Tiles (Verwundbarkeits-Topologie) */
.hex-cell.tile-damaged {
    filter: brightness(0.6) hue-rotate(-15deg);
}
.hex-cell.tile-damaged::before {
    content: '';
    position: absolute;
    inset: 15%;
    background: repeating-linear-gradient(
        -45deg,
        transparent, transparent 3px,
        rgba(231, 76, 60, 0.25) 3px, rgba(231, 76, 60, 0.25) 5px
    );
    border-radius: 4px;
    pointer-events: none;
    z-index: 4;
}
.hex-cell.tile-damaged::after {
    content: '🔥';
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    opacity: 0.9;
    pointer-events: none;
    z-index: 5;
}

.hex-cell.energy-flow {
    animation: energyPulse 2s ease-in-out infinite;
}

@keyframes energyPulse {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(0, 180, 255, 0.2)); }
    50% { filter: drop-shadow(0 0 8px rgba(0, 180, 255, 0.5)); }
}

/* Energy Panel */
.energy-panel { display: flex; flex-direction: column; gap: 4px; }
.energy-row { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.energy-balance { font-weight: 700; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 4px; margin-top: 2px; }
.energy-warning { font-size: 11px; color: #ff6b6b; margin-top: 4px; padding: 4px 6px; background: rgba(255,75,75,0.1); border-radius: 4px; border: 1px solid rgba(255,75,75,0.2); }

/* ═══════════════════════════════════════════════════════════════
   Synergy Visuals
   ═══════════════════════════════════════════════════════════════ */

.synergy-line {
    stroke: #ffd700;
    stroke-width: 2;
    stroke-dasharray: 6 4;
    opacity: 0.6;
    animation: synergyPulse 2.5s ease-in-out infinite;
}

@keyframes synergyPulse {
    0%, 100% { opacity: 0.4; stroke-width: 1.5; }
    50% { opacity: 0.8; stroke-width: 2.5; }
}

/* Synergy Panel */
.synergy-panel { display: flex; flex-direction: column; gap: 3px; }
.synergy-row { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 0; }
.synergy-icon { font-size: 13px; min-width: 24px; text-align: center; }
.synergy-name { color: #ffd700; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   Journey Overlay — "Die Reise"
   ═══════════════════════════════════════════════════════════════ */

#journey-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: radial-gradient(ellipse at center, #0a0e1a 0%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}
#journey-overlay.show { opacity: 1; }

.journey-starfield {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.journey-star {
    position: absolute;
    width: var(--star-size, 2px);
    height: var(--star-size, 2px);
    background: white;
    border-radius: 50%;
    opacity: 0.3;
}
.journey-starfield.active .journey-star {
    animation: journeyStarStreak 0.8s linear infinite;
}
@keyframes journeyStarStreak {
    0% { transform: translateX(0); opacity: 0.6; }
    100% { transform: translateX(-120vw); opacity: 0; }
}

.journey-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 600px;
    width: 90%;
}

.journey-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 8px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 180, 255, 0.5);
    margin-bottom: 10px;
}

/* Progress bar */
.journey-progress-wrap {
    width: 100%;
    position: relative;
    padding: 0 30px;
}
.journey-ship {
    position: absolute;
    top: -24px;
    left: 0;
    font-size: 20px;
    transition: left 0.15s linear;
    filter: drop-shadow(0 0 6px rgba(0, 180, 255, 0.6));
    animation: journeyBob 1.5s ease-in-out infinite;
}
@keyframes journeyBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.journey-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.journey-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #00b4ff, #3ddc84);
    border-radius: 4px;
    transition: width 0.15s linear;
    box-shadow: 0 0 8px rgba(0, 180, 255, 0.4);
}
.journey-dist {
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-top: 6px;
}

/* Live stats */
.journey-stats {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    flex-wrap: wrap;
    justify-content: center;
}
.journey-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,0.05);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}
.journey-stats b { color: #fff; font-weight: 600; min-width: 12px; text-align: center; }

/* Event card */
.journey-event-area {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
/* ═══════════════════════════════════════════════════════════════
   Decision Overlay — Verkaufen / Reisen
   ═══════════════════════════════════════════════════════════════ */

#decision-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(15, 20, 35, 0.95) 0%, rgba(5, 8, 15, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#decision-overlay.show { opacity: 1; }

.decision-content { text-align: center; max-width: 640px; padding: 20px; }
.decision-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 6px;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(240, 208, 96, 0.4);
}
.decision-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 32px;
}

.decision-cards {
    display: flex;
    gap: 28px;
    justify-content: center;
    margin-bottom: 24px;
}

.decision-card {
    width: 260px;
    padding: 32px 24px 24px;
    border-radius: 16px;
    background: rgba(20, 30, 50, 0.7);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.decision-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}
.decision-card:hover {
    transform: translateY(-6px) scale(1.03);
}
.decision-card:hover::before { opacity: 1; }
.decision-card:active { transform: translateY(-2px) scale(0.98); }
.decision-card.chosen {
    transform: scale(1.08);
    filter: brightness(1.3);
    transition: all 0.4s ease;
}

.decision-card.sell { border-color: rgba(61, 220, 132, 0.4); }
.decision-card.sell:hover { border-color: rgba(61, 220, 132, 0.8); box-shadow: 0 0 30px rgba(61, 220, 132, 0.3), inset 0 0 30px rgba(61, 220, 132, 0.05); }
.decision-card.sell::before { background: radial-gradient(ellipse at center bottom, rgba(61, 220, 132, 0.1) 0%, transparent 70%); }

.decision-card.travel { border-color: rgba(240, 208, 96, 0.4); }
.decision-card.travel:hover { border-color: rgba(240, 208, 96, 0.8); box-shadow: 0 0 30px rgba(240, 208, 96, 0.3), inset 0 0 30px rgba(240, 208, 96, 0.05); }
.decision-card.travel::before { background: radial-gradient(ellipse at center bottom, rgba(240, 208, 96, 0.1) 0%, transparent 70%); }

.decision-card-icon { font-size: 48px; margin-bottom: 12px; }
.decision-card-title { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 3px; margin-bottom: 12px; }
.decision-card-score { font-size: 32px; font-weight: 900; color: #fff; margin-bottom: 4px; }
.decision-card.sell .decision-card-score { color: #3ddc84; }
.decision-card.travel .decision-card-score { color: #f0d060; font-size: 24px; }
.decision-card-unit { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 2px; }

.decision-card-range {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}
.range-plus { color: #3ddc84; }
.range-divider { color: rgba(255,255,255,0.3); }
.range-minus { color: #ff4c4c; }

.decision-card-desc { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; margin-bottom: 16px; }

.decision-card-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.decision-card-tag.safe { background: rgba(61, 220, 132, 0.15); color: #3ddc84; border: 1px solid rgba(61, 220, 132, 0.3); }
.decision-card-tag.risky { background: rgba(240, 208, 96, 0.15); color: #f0d060; border: 1px solid rgba(240, 208, 96, 0.3); }

.decision-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════════════════════
   Journey Event Cards — verbessert
   ═══════════════════════════════════════════════════════════════ */

.journey-event-card {
    background: rgba(20, 30, 50, 0.9);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 28px 32px 24px;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    max-width: 380px;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.journey-event-card.show { transform: translateY(0) scale(1); opacity: 1; }
.journey-event-card.je-rarity-rare { border-color: rgba(124, 58, 237, 0.5); box-shadow: 0 0 20px rgba(124, 58, 237, 0.15); }
.journey-event-card.je-rarity-epic { border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 0 30px rgba(245, 158, 11, 0.2); animation: epicCardGlow 2s ease-in-out infinite; }
.journey-event-card.je-rarity-common { border-color: rgba(255,255,255,0.15); }

@keyframes epicCardGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 50px rgba(245, 158, 11, 0.4), 0 0 80px rgba(245, 158, 11, 0.1); }
}

.je-rarity-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.je-rarity-badge.je-rarity-common { background: rgba(74, 85, 104, 0.6); color: #a0aec0; }
.je-rarity-badge.je-rarity-rare { background: rgba(124, 58, 237, 0.3); color: #a78bfa; }
.je-rarity-badge.je-rarity-epic { background: rgba(245, 158, 11, 0.3); color: #fbbf24; }

.je-icon { font-size: 48px; margin-bottom: 10px; }
.je-name { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: 0.5px; }
.je-desc { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 16px; line-height: 1.5; font-style: italic; }

.je-check {
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    margin-bottom: 14px;
    transition: opacity 0.4s ease;
}
.je-check-label { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.je-check-value { font-size: 15px; font-weight: 700; }
.je-check-value.check-pass { color: #3ddc84; }
.je-check-value.check-fail { color: #ff4c4c; }

.je-result { font-size: 14px; font-weight: 600; transition: opacity 0.4s ease; }
.je-result-text { margin-bottom: 8px; }
.je-success { color: #3ddc84; }
.je-fail { color: #ff4c4c; }

.je-points-fly {
    font-size: 36px;
    font-weight: 900;
    animation: pointsFlyIn 0.6s cubic-bezier(0.2, 0, 0.2, 1);
}
.je-points-plus { color: #3ddc84; text-shadow: 0 0 20px rgba(61, 220, 132, 0.5); }
.je-points-minus { color: #ff4c4c; text-shadow: 0 0 20px rgba(255, 76, 76, 0.5); }

@keyframes pointsFlyIn {
    0% { transform: translateY(30px) scale(0.5); opacity: 0; }
    60% { transform: translateY(-5px) scale(1.1); opacity: 1; }
    100% { transform: translateY(0) scale(1); }
}

.je-success-glow {
    animation: successGlow 0.8s ease;
}
@keyframes successGlow {
    0% { box-shadow: 0 0 0 rgba(61, 220, 132, 0); }
    50% { box-shadow: 0 0 40px rgba(61, 220, 132, 0.5), inset 0 0 20px rgba(61, 220, 132, 0.1); }
    100% { box-shadow: 0 0 15px rgba(61, 220, 132, 0.15); }
}

.je-fail-shake {
    animation: failShake 0.5s ease;
}
@keyframes failShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

/* Journey log */
.journey-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 380px;
    margin: 0 auto;
}
.journey-log-entry {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.log-success { color: #3ddc84; border-left: 3px solid rgba(61,220,132,0.4); }
.log-fail { color: #ff4c4c; border-left: 3px solid rgba(255,76,76,0.4); }

/* Skip */
.journey-skip {
    position: absolute;
    bottom: 20px;
    right: 24px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    z-index: 2;
    transition: color 0.2s;
}
.journey-skip:hover { color: rgba(255,255,255,0.8); }

/* Journey stat consume marker */
.je-consume {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Journey Event — Choice Buttons */
.je-choices {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    transition: opacity 0.4s ease;
    flex-wrap: wrap;
    justify-content: center;
}
.je-choice {
    flex: 1 1 0;
    min-width: 100px;
    max-width: 160px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    color: #e8edf5;
    font-family: inherit;
}
.je-choice:hover:not(.disabled) {
    background: rgba(79,195,247,0.15);
    border-color: #4fc3f7;
    transform: translateY(-2px);
}
.je-choice.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.je-choice.selected {
    background: rgba(79,195,247,0.25);
    border-color: #4fc3f7;
    box-shadow: 0 0 12px rgba(79,195,247,0.3);
}
.je-choice.risky {
    border-color: rgba(231,76,60,0.4);
}
.je-choice.risky:hover:not(.disabled) {
    border-color: #e74c3c;
    background: rgba(231,76,60,0.12);
}
.je-choice-icon {
    font-size: 22px;
}
.je-choice-label {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}
.je-choice-risk {
    font-size: 9px;
    color: #e74c3c;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.je-choice-costs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}
.je-choice-cost {
    font-size: 10px;
    color: #ff6b6b;
    background: rgba(231,76,60,0.12);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Journey stats flash when consumed */
.js-stat-flash {
    animation: jsStatFlash 0.6s ease;
}
.js-stats-flash b {
    animation: jsStatFlash 0.6s ease;
}
@keyframes jsStatFlash {
    0% { color: inherit; transform: scale(1); }
    30% { color: #fbbf24; transform: scale(1.3); }
    100% { color: inherit; transform: scale(1); }
}

/* Sidebar stat journey hints */
.stat-journey-hint {
    font-size: 9px;
    color: rgba(160, 200, 255, 0.5);
    margin-top: 1px;
    line-height: 1.1;
    transition: opacity 0.3s;
    white-space: nowrap;
}

/* Stat feedback toast (after tile placement) */
.stat-feedback-toast {
    border-color: rgba(100, 180, 255, 0.5) !important;
    color: rgba(180, 210, 255, 0.9) !important;
    font-size: 12px;
    max-width: 320px;
}
.stat-feedback-lines {
    line-height: 1.6;
}

/* Journey report in end modal */
.level-end-journey {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 180, 255, 0.05);
    border: 1px solid rgba(0, 180, 255, 0.15);
    border-radius: 8px;
}
.le-journey-summary {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin: 4px 0 6px;
}
.le-journey-event {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #ff6b6b;
    padding: 2px 0;
}
.le-journey-event.done { color: #3ddc84; }

/* ═══════════════════════════════════════════════════
   VERSION BADGE
   ═══════════════════════════════════════════════════ */

.ss-version, .top-version {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    opacity: 0.5;
    cursor: pointer;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    letter-spacing: 1px;
    white-space: nowrap;
}
.ss-version:hover, .top-version:hover {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════════
   CHANGELOG OVERLAY
   ═══════════════════════════════════════════════════ */

#changelog-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#changelog-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.changelog-modal {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
#changelog-overlay.show .changelog-modal {
    transform: translateY(0);
}

.changelog-close {
    position: absolute;
    top: 16px; right: 20px;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    line-height: 1;
}
.changelog-close:hover { opacity: 1; color: var(--accent); }

.changelog-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.changelog-title {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.changelog-current {
    font-size: 12px;
    color: var(--accent);
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

.changelog-entry {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.changelog-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.changelog-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.changelog-version {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
}
.changelog-date {
    font-size: 11px;
    color: var(--text);
    opacity: 0.6;
}
.changelog-entry-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}
.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.changelog-list li {
    font-size: 12px;
    color: var(--text-bright);
    padding: 3px 0 3px 16px;
    position: relative;
    line-height: 1.5;
}
.changelog-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   ENDLESS MODE
   ═══════════════════════════════════════════════════ */

/* Select Screen — Endless Node */
.endless-node {
    cursor: pointer;
}
.endless-node .ss-node-ring {
    border-color: #4fc3f7 !important;
    box-shadow: 0 0 12px rgba(79,195,247,0.4);
}
.endless-ring {
    animation: endless-pulse 2.5s ease-in-out infinite;
}
@keyframes endless-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(79,195,247,0.3); }
    50% { box-shadow: 0 0 20px rgba(79,195,247,0.6), 0 0 40px rgba(79,195,247,0.2); }
}
.endless-preview-icon {
    font-size: 36px;
    color: #4fc3f7;
    text-align: center;
    line-height: 80px;
    opacity: 0.6;
    font-weight: 700;
}

/* Play Screen — Surrender Button */
.surrender-btn {
    background: transparent;
    border: 1px solid rgba(231,76,60,0.4);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.2s;
}
.surrender-btn:hover {
    background: rgba(231,76,60,0.15);
    border-color: #e74c3c;
}
.surrender-btn.confirm {
    background: rgba(231,76,60,0.25);
    border-color: #e74c3c;
    color: #ff6b6b;
    animation: surrender-blink 0.5s ease infinite;
}
@keyframes surrender-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Endless Endscreen */
.endless-end-modal .level-end-title {
    font-size: 18px;
}
.endless-rank-badge {
    text-align: center;
    margin-bottom: 12px;
}
.endless-rank-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 4px;
}
.endless-rank-label {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
}
.endless-new-highscore {
    text-align: center;
    color: #f0d060;
    font-size: 16px;
    font-weight: 700;
    margin: 8px 0;
    animation: highscore-glow 1.5s ease-in-out infinite;
}
@keyframes highscore-glow {
    0%, 100% { text-shadow: 0 0 4px rgba(240,208,96,0.3); }
    50% { text-shadow: 0 0 16px rgba(240,208,96,0.7), 0 0 30px rgba(240,208,96,0.3); }
}
.endless-prev-highscore {
    text-align: center;
    font-size: 11px;
    color: var(--text);
    margin-top: 6px;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Crew Panel (Sidebar)                                           */
/* ═══════════════════════════════════════════════════════════════ */

.crew-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crew-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}
.crew-member:hover {
    background: rgba(255,255,255,0.06);
}
.crew-member.crew-assigning {
    border-color: #f0d060;
    background: rgba(240,208,96,0.1);
    animation: crew-pulse 1s ease infinite;
}
@keyframes crew-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240,208,96,0); }
    50% { box-shadow: 0 0 8px 2px rgba(240,208,96,0.3); }
}
.crew-portrait {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.crew-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.crew-name {
    font-size: 11px;
    font-weight: 600;
    color: #d0d8e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.crew-spec {
    font-size: 10px;
    color: #8ca0b8;
    display: flex;
    gap: 4px;
    align-items: center;
}
.crew-xp {
    background: rgba(240,208,96,0.15);
    color: #f0d060;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 9px;
}

/* Crew-Portrait auf Tile */
.tile-crew-portrait {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 16px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    z-index: 5;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Campaign Overlay (Rekrutierung, Markt, Salvage)               */
/* ═══════════════════════════════════════════════════════════════ */

.campaign-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    transition: opacity 0.4s;
}
.campaign-overlay.show {
    opacity: 1;
}
.campaign-modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}
.campaign-title {
    font-size: 22px;
    font-weight: 700;
    color: #d0d8e0;
    margin-bottom: 6px;
}
.campaign-subtitle {
    font-size: 13px;
    color: #8ca0b8;
    margin-bottom: 20px;
}
.campaign-skip-btn {
    margin-top: 16px;
    background: transparent;
    border: 1px solid var(--border);
    color: #8ca0b8;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.campaign-skip-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #d0d8e0;
}

/* Recruit Cards */
.recruit-candidates {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.recruit-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 12px;
    width: 130px;
    cursor: pointer;
    transition: all 0.3s;
}
.recruit-card:hover {
    border-color: #f0d060;
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(240,208,96,0.15);
}
.recruit-card.recruit-selected {
    border-color: #3ddc84;
    background: rgba(61,220,132,0.1);
    transform: scale(1.05);
}
.recruit-card.recruit-dismissed {
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0.95);
}
.recruit-portrait {
    font-size: 36px;
    margin-bottom: 8px;
}
.recruit-name {
    font-size: 13px;
    font-weight: 600;
    color: #d0d8e0;
    margin-bottom: 4px;
}
.recruit-spec {
    font-size: 11px;
    color: #8ca0b8;
    margin-bottom: 4px;
}
.recruit-bonus {
    font-size: 10px;
    color: #f0d060;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Market Screen                                                  */
/* ═══════════════════════════════════════════════════════════════ */

.market-modal {
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
}
.market-salary {
    font-size: 12px;
    color: #ff6b6b;
    margin-bottom: 12px;
}
.market-section {
    margin-bottom: 16px;
    text-align: left;
}
.market-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #8ca0b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.market-offers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.market-tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.market-tile:hover:not(.market-bought):not(.market-cant-afford) {
    border-color: #f0d060;
    background: rgba(240,208,96,0.05);
}
.market-tile.market-bought {
    opacity: 0.4;
    pointer-events: none;
    border-color: #3ddc84;
}
.market-tile.market-cant-afford {
    opacity: 0.35;
    cursor: not-allowed;
}
.market-tile-name {
    font-size: 12px;
    font-weight: 600;
    color: #d0d8e0;
    margin-bottom: 2px;
}
.market-tile-stats {
    font-size: 11px;
    color: #8ca0b8;
    margin-bottom: 4px;
}
.market-tile-price {
    font-size: 12px;
    color: #f0d060;
    font-weight: 600;
}
.market-repairs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.market-repair {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: #d0d8e0;
    cursor: pointer;
    transition: all 0.2s;
}
.market-repair:hover:not(.market-bought):not(.market-cant-afford) {
    border-color: #3ddc84;
}
.market-repair.market-bought {
    opacity: 0.4;
    pointer-events: none;
}
.market-repair.market-cant-afford {
    opacity: 0.35;
    cursor: not-allowed;
}
.market-upgrades {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.market-upgrade {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.market-upgrade:hover:not(.market-cant-afford) {
    border-color: #a080e0;
}
.market-upgrade.market-cant-afford {
    opacity: 0.35;
    cursor: not-allowed;
}
.market-upgrade-icon {
    font-size: 20px;
}
.market-upgrade-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.market-upgrade-name {
    font-size: 12px;
    font-weight: 600;
    color: #d0d8e0;
}
.market-upgrade-desc {
    font-size: 10px;
    color: #8ca0b8;
}
.market-upgrade-price {
    font-size: 12px;
    color: #f0d060;
    font-weight: 600;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Salvage Screen                                                 */
/* ═══════════════════════════════════════════════════════════════ */

.salvage-modal {
    max-width: 500px;
}
.salvage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 12px;
}
.salvage-tile {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}
.salvage-tile:hover {
    border-color: #f0d060;
}
.salvage-tile.salvage-selected {
    border-color: #f0d060;
    background: rgba(240,208,96,0.1);
    box-shadow: 0 0 8px rgba(240,208,96,0.2);
}
.salvage-tile.salvage-damaged {
    border-color: #ff4c4c50;
}
.salvage-tile-name {
    font-size: 11px;
    color: #d0d8e0;
    font-weight: 500;
}
.salvage-tile-dmg {
    font-size: 9px;
    color: #ff6b6b;
    display: block;
    margin-top: 2px;
}
.salvage-tile-check {
    position: absolute;
    top: 2px;
    right: 4px;
    color: #f0d060;
    font-size: 14px;
    font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════════
   SHIPYARD (Werft-Screen)
   ═══════════════════════════════════════════════════════════════ */

.sy-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
    max-width: 700px;
    margin: 0 auto;
}

.sy-resources {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
}
.sy-credits {
    color: #f0d060;
    font-weight: 700;
    font-size: 15px;
}
.sy-material {
    font-size: 12px;
    opacity: 0.7;
}

/* Schiff-Karte */
.sy-ship-card {
    display: flex;
    gap: 20px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    align-items: center;
}
.sy-ship-preview {
    width: 160px;
    height: 140px;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.sy-ship-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sy-ship-title {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.sy-ship-phase {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--text);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.sy-ship-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    font-family: 'Orbitron', monospace;
    color: var(--text-bright);
}
.sy-ship-stats span {
    white-space: nowrap;
}
.sy-crew-info {
    font-size: 12px;
    color: var(--text);
    margin-top: 4px;
}

/* Kein Schiff */
.sy-no-ship {
    text-align: center;
    padding: 48px 24px;
}
.sy-no-ship-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float-gentle 3s ease-in-out infinite;
}
@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.sy-no-ship-text {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    color: var(--text-bright);
    margin-bottom: 8px;
}
.sy-no-ship-sub {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.sy-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}
.sy-btn {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg2);
    color: var(--text-bright);
}
.sy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.sy-btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #1a4a6a, #0e3a55);
    border-color: var(--accent);
    color: var(--accent);
    font-size: 15px;
}
.sy-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e5a7a, #124a65);
    border-color: #6ad0ff;
}
.sy-btn-large {
    padding: 16px 32px;
    font-size: 16px;
}
.sy-btn-expedition {
    flex: 1;
    background: linear-gradient(135deg, #3d2a08, #2a1d05);
    border-color: #ffb347;
    color: #ffb347;
}
.sy-btn-expedition:hover:not(:disabled) {
    background: linear-gradient(135deg, #4d3a18, #3a2d15);
}
.sy-btn-expedition.disabled {
    opacity: 0.3;
}
.sy-btn-sell {
    background: linear-gradient(135deg, #2a1520, #1e1018);
    border-color: #cc6688;
    color: #cc6688;
}
.sy-btn-sell:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a2530, #2e1828);
}
.sy-btn-sell.confirm {
    border-color: #e74c3c;
    color: #e74c3c;
    animation: pulse-warn 0.5s ease;
}
.sy-btn-secondary {
    background: var(--bg3);
    color: var(--text);
}
.sy-btn-reset {
    background: var(--bg3);
    color: var(--red);
    border-color: transparent;
    font-size: 11px;
}
.sy-btn-reset.confirm {
    border-color: var(--red);
    color: var(--red);
}
.sy-side-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

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

/* ═══════════════════════════════════════════════════════════════
   TILE SHOP (Einkauf vor Bauphase)
   ═══════════════════════════════════════════════════════════════ */

.tileshop-modal {
    max-width: 800px;
    width: 95%;
}
.tileshop-modal h2 {
    font-family: 'Orbitron', monospace;
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 4px;
}
.shop-subtitle {
    color: var(--text);
    font-size: 13px;
    margin-bottom: 16px;
}
.shop-subtitle b {
    color: #f0d060;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}
.shop-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}
.shop-tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.shop-tile.in-cart {
    border-color: #3ddc84;
    background: rgba(61, 220, 132, 0.08);
}
.shop-tile.too-expensive {
    opacity: 0.35;
    cursor: not-allowed;
}
.shop-tile-preview {
    width: 70px;
    height: 70px;
    margin: 0 auto 6px;
}
.shop-tile-preview svg {
    width: 100%;
    height: 100%;
}
.shop-tile-name {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: var(--text-bright);
    font-weight: 600;
    margin-bottom: 2px;
}
.shop-tile-type {
    font-size: 10px;
    margin-bottom: 2px;
}
.shop-tile-stats {
    font-size: 9px;
    color: var(--text);
    margin-bottom: 4px;
}
.shop-tile-stats span {
    margin: 0 2px;
}
.shop-tile-price {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: #f0d060;
    font-weight: 700;
}
.shop-tile-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    color: #3ddc84;
    font-weight: bold;
}
.shop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.shop-cart-info {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--text);
}
.shop-buttons {
    display: flex;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   RARITY SYSTEM (Tiles + Crew)
   ═══════════════════════════════════════════════════════════════ */

/* Shop Rarity Label */
.shop-rarity-label {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

/* Shop Rarity Borders */
.shop-tile.rarity-uncommon { border-color: #2a8a52; }
.shop-tile.rarity-rare { border-color: #2a7ab0; }
.shop-tile.rarity-epic { border-color: #7744cc; }
.shop-tile.rarity-legendary { border-color: #cc9900; }

.shop-tile.rarity-uncommon:hover { border-color: #3ddc84; }
.shop-tile.rarity-rare:hover { border-color: #4fc3f7; }
.shop-tile.rarity-epic:hover { border-color: #bb88ff; }
.shop-tile.rarity-legendary:hover { border-color: #ffcc00; }

/* Animated glow for legendary */
.shop-tile.rarity-legendary {
    animation: legendary-pulse 2s ease-in-out infinite;
}
@keyframes legendary-pulse {
    0%, 100% { box-shadow: 0 0 12px #ffcc0040; }
    50% { box-shadow: 0 0 24px #ffcc0070; }
}

.shop-tile.rarity-epic {
    animation: epic-pulse 3s ease-in-out infinite;
}
@keyframes epic-pulse {
    0%, 100% { box-shadow: 0 0 8px #bb88ff30; }
    50% { box-shadow: 0 0 16px #bb88ff50; }
}

/* Special Effect Tag */
.shop-tile-special {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    font-weight: 600;
    margin-top: 2px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    display: inline-block;
}

/* Board: Rarity tag on placed tiles */
.tile-rarity-tag {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', monospace;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* Crew Recruit Rarity */
.recruit-rarity {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.recruit-card.rarity-uncommon { border-color: #2a8a5260; }
.recruit-card.rarity-rare { border-color: #2a7ab060; }
.recruit-card.rarity-epic { border-color: #7744cc60; }
.recruit-card.rarity-legendary { border-color: #cc990080; }

.recruit-card.rarity-legendary {
    animation: legendary-pulse 2s ease-in-out infinite;
}
.recruit-card.rarity-epic {
    animation: epic-pulse 3s ease-in-out infinite;
}

/* Crew Traits */
.recruit-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    justify-content: center;
}
.recruit-trait {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    white-space: nowrap;
    color: var(--text-bright);
}

/* ═══════════════════════════════════════════════════════════════
   Player Badge, Login Modal, Ranking
   ═══════════════════════════════════════════════════════════════ */

.player-badge-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.player-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
}

.player-badge-name {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: #4fc3f7;
    font-weight: 600;
}

.player-badge-pts {
    font-size: 11px;
    color: #f0d060;
    font-weight: 600;
}

.player-badge-btn {
    background: none;
    border: none;
    color: #8090a8;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    transition: color 0.2s;
}
.player-badge-btn:hover { color: #e74c3c; }

.player-login-btn {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 8px;
    color: #4fc3f7;
    cursor: pointer;
    transition: all 0.2s;
}
.player-login-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: #4fc3f7;
}

.player-ranking-btn {
    background: rgba(240, 208, 96, 0.1);
    border: 1px solid rgba(240, 208, 96, 0.25);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}
.player-ranking-btn:hover {
    background: rgba(240, 208, 96, 0.2);
    border-color: #f0d060;
    transform: scale(1.1);
}

/* Login Modal */
.login-modal {
    max-width: 360px;
    width: 90vw;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.login-modal-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    color: #4fc3f7;
}

.login-close {
    background: none;
    border: none;
    color: #8090a8;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}
.login-close:hover { color: #e74c3c; }

.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.login-tab {
    flex: 1;
    padding: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: #8090a8;
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.login-tab.active {
    background: rgba(79, 195, 247, 0.12);
    border-color: rgba(79, 195, 247, 0.3);
    color: #4fc3f7;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form input {
    padding: 10px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #e8edf5;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: #4fc3f7; }

.login-form-error {
    color: #e74c3c;
    font-size: 12px;
    min-height: 16px;
}

.login-submit-btn {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 12px;
    background: linear-gradient(135deg, #1a4a6a, #0e3a55);
    border: 1px solid #4fc3f7;
    border-radius: 8px;
    color: #4fc3f7;
    cursor: pointer;
    transition: all 0.2s;
}
.login-submit-btn:hover {
    background: linear-gradient(135deg, #1e5a7a, #124a65);
    box-shadow: 0 4px 16px rgba(79, 195, 247, 0.2);
}

/* Ranking Modal */
.ranking-modal {
    max-width: 440px;
    width: 92vw;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.ranking-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    color: #f0d060;
}

.ranking-list {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ranking-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    transition: background 0.15s;
}

.ranking-row.ranking-top3 {
    background: rgba(240, 208, 96, 0.06);
    border: 1px solid rgba(240, 208, 96, 0.15);
}

.ranking-row.ranking-me {
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

.ranking-pos {
    width: 48px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #8090a8;
    flex-shrink: 0;
}

.ranking-top3 .ranking-pos { color: #f0d060; }
.ranking-me .ranking-pos { color: #4fc3f7; }

.ranking-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #e8edf5;
}

.ranking-pts {
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    color: #f0d060;
    font-weight: 600;
}

.ranking-my-pos {
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    color: #4fc3f7;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ranking-empty {
    text-align: center;
    padding: 32px 16px;
    color: #8090a8;
    font-size: 13px;
}

.ranking-hint {
    text-align: center;
    padding: 10px;
    color: #8090a8;
    font-size: 12px;
    font-style: italic;
}

.ranking-loading {
    text-align: center;
    padding: 32px;
    color: #8090a8;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
}
