/* ==========================================
   ARCANE DEPTHS - Main Stylesheet
   ========================================== */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-dark: #0a0a12;
    --bg-darker: #05050a;
    --bg-medium: #151525;
    --bg-light: #1e1e35;

    --primary: #7b4dff;
    --primary-light: #9d7aff;
    --primary-dark: #5a2dcc;

    --secondary: #00e5ff;
    --secondary-dark: #00b8d4;

    --accent: #ff4081;
    --accent-light: #ff79a8;

    --gold: #ffd700;
    --gold-dark: #b8860b;

    --health: #ff3333;
    --health-dark: #cc0000;
    --mana: #3399ff;
    --mana-dark: #0066cc;

    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-dim: #606080;

    --danger: #ff4444;
    --success: #44ff88;
    --warning: #ffaa44;

    /* Rarity Colors */
    --rarity-common: #9e9e9e;
    --rarity-rare: #2196f3;
    --rarity-epic: #9c27b0;
    --rarity-legendary: #ffd700;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-dark: linear-gradient(180deg, var(--bg-dark), var(--bg-darker));
    --gradient-glow: radial-gradient(circle, rgba(123, 77, 255, 0.3) 0%, transparent 70%);

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(123, 77, 255, 0.5);
    --shadow-text: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;

    /* Font */
    --font-pixel: 'Press Start 2P', monospace;

    /* Sizes */
    --border-radius: 4px;
}

/* =========================
 * FEEDBACK SCREEN
 * ========================= */

.feedback-content {
    max-width: 780px;
    margin: 0 auto;
    padding: 18px 18px 28px;
}

.feedback-hint {
    opacity: 0.85;
    font-size: 12px;
    line-height: 1.6;
    margin: 6px 0 18px;
}

.feedback-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0;
}

.feedback-row label {
    font-size: 12px;
    opacity: 0.9;
}

.feedback-row select,
.feedback-row textarea {
    width: 100%;
    border: 2px solid rgba(120, 90, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: inherit;
    outline: none;
}

.feedback-row textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.feedback-mailhint {
    margin: 14px 0 0;
    text-align: center;
    font-size: 11px;
    opacity: 0.8;
}

.feedback-toast {
    min-height: 18px;
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    opacity: 0.95;
}

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

/* Base */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-pixel);
    font-size: 14px;
    background: var(--bg-darker);
    color: var(--text-primary);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
}

.screen.active {
    display: flex;
}

/* ==========================================
   UPDATES SCREEN
   ========================================== */
#updates-screen {
    z-index: 1;
}

#updates-screen .screen-header,
#updates-screen .updates-list,
#updates-screen .back-btn {
    position: relative;
    z-index: 2;
}

#updates-screen .screen-header {
    margin-bottom: 20px;
}

.updates-list {
    width: 100%;
    max-width: 600px;
    background: rgba(20, 20, 30, 0.85);
    border: 1px solid rgba(123, 77, 255, 0.3);
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    backdrop-filter: blur(5px);
}

.update-entry {
    margin-bottom: 20px;
}

.update-entry h3 {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.update-entry ul {
    list-style: none;
    padding-left: 10px;
}

.update-entry li {
    font-size: 10px;
    line-height: 1.6;
    margin-bottom: 4px;
    color: #ddd;
}

.update-notes {
    font-size: 10px;
    line-height: 1.6;
    color: #ddd;
    white-space: pre-wrap;
    margin: 0;
    padding: 0 0 10px 0;
}

/* ==========================================
   MAIN MENU
   ========================================== */

#main-menu {
    position: relative;
}

.menu-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Menu background image (only affects main menu) */
    background: url('../assets/menu_bg.png') center / cover no-repeat;
    overflow: hidden;
}

.menu-background::before {
    /* Darken for readability */
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.78));
    pointer-events: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.menu-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.logo-container {
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-icon {
    font-size: 64px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--primary));
    /* Center image-based logo as well as emoji */
    display: flex;
    justify-content: center;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.game-title {
    font-size: 36px;
    color: var(--text-primary);
    text-shadow:
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        var(--shadow-text);
    letter-spacing: 4px;
    margin-top: 20px;
}

.tagline {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 15px;
    letter-spacing: 2px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-btn {
    font-family: var(--font-pixel);
    font-size: 12px;
    padding: 15px 40px;
    background: var(--bg-light);
    border: 2px solid var(--primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 280px;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.menu-btn:active {
    transform: scale(0.98);
}

.menu-btn.danger {
    border-color: var(--danger);
}

.menu-btn.danger:hover {
    background: var(--danger);
}

.btn-icon {
    font-size: 14px;
}

.version {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 8px;
    color: var(--text-dim);
}

/* Meta currency HUD (bottom-right, above version) */
.meta-essence-inline {
    position: fixed;
    bottom: 34px;
    right: 20px;
    font-size: 9px;
    color: #f5d76e;
    text-shadow: 0 0 6px rgba(245, 215, 110, 0.25);
    pointer-events: none;
}

/* Audio autoplay policy hint (browsers require a user gesture) */
.audio-hint {
    margin-top: 14px;
    font-size: 10px;
    line-height: 1.6;
    opacity: 0.85;
    color: #cfcfe8;
    padding: 10px 12px;
    border: 1px solid rgba(179, 136, 255, 0.45);
    background: rgba(21, 21, 37, 0.85);
    border-radius: 8px;
    max-width: 420px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.audio-hint.hidden {
    display: none;
}

/* ==========================================
   SLOT SELECTION
   ========================================== */

.screen-header {
    margin-bottom: 30px;
}

.screen-header h2 {
    font-size: 18px;
    color: var(--text-primary);
    text-shadow: var(--shadow-text);
}

.slots-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.slot-card {
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.slot-card.empty {
    border-style: dashed;
    text-align: center;
    color: var(--text-dim);
}

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

.slot-title {
    font-size: 12px;
    color: var(--primary-light);
}

.slot-actions {
    display: flex;
    gap: 10px;
}

.slot-action-btn {
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.slot-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.slot-action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.slot-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 8px;
    color: var(--text-secondary);
}

.slot-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slot-runes {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.slot-rune {
    width: 20px;
    height: 20px;
    background: var(--bg-dark);
    border: 1px solid var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.back-btn {
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ==========================================
   DIFFICULTY SELECTION
   ========================================== */

.difficulty-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
}

.difficulty-card {
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    padding: 25px;
    width: 250px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.difficulty-card:hover:not(.locked) {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.difficulty-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.difficulty-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.diff-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 15px;
}

.difficulty-card h3 {
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.difficulty-card p {
    font-size: 8px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.6;
}

.difficulty-card ul {
    list-style: none;
    font-size: 8px;
    color: var(--text-dim);
}

.difficulty-card li {
    padding: 3px 0;
}

.locked-overlay {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 7px;
    color: var(--danger);
    white-space: nowrap;
}

.difficulty-bottom {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.difficulty-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 9px;
    color: var(--text-secondary);
    user-select: none;
    padding: 10px 12px;
    border: 1px solid var(--bg-light);
    background: rgba(0, 0, 0, 0.25);
}

.difficulty-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================
   SETTINGS
   ========================================== */

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 10px 20px;
    background: var(--bg-medium);
    border: 2px solid var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light);
}

.tab-btn:hover {
    border-color: var(--primary);
}

.settings-content {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.settings-panel {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.settings-panel.active {
    display: flex;
}

.setting-item {
    background: var(--bg-medium);
    padding: 15px;
    border: 1px solid var(--bg-light);
}

.setting-item label {
    font-size: 10px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: var(--bg-dark);
    border-radius: 4px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    cursor: pointer;
}

.slider-value {
    font-size: 10px;
    color: var(--primary-light);
    min-width: 40px;
    text-align: right;
}

.option-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.option-btn {
    font-family: var(--font-pixel);
    font-size: 8px;
    padding: 8px 15px;
    background: var(--bg-dark);
    border: 1px solid var(--bg-light);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light);
}

.option-btn:hover {
    border-color: var(--primary);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-group label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.controls-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-dark);
    font-size: 8px;
}

.control-item .key {
    background: var(--bg-light);
    padding: 5px 10px;
    border: 1px solid var(--primary-dark);
    color: var(--primary-light);
}

.settings-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.action-btn {
    font-family: var(--font-pixel);
    font-size: 10px;
    padding: 12px 30px;
    background: var(--primary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

/* ==========================================
   GAME SCREEN
   ========================================== */

#game-screen {
    padding: 0;
    background: #000;
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* HUD */
/* ==========================================
   HUD (REDESIGNED)
   ========================================== */
#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    padding: 20px;
    z-index: 10;
}

#game-ui {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "top-left top-center top-right"
        "center-left center center-right"
        "bottom-left bottom-center bottom-right";
}

.hud-section {
    pointer-events: auto;
}

.top-left {
    grid-area: top-left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-right {
    grid-area: top-right;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.bottom-center {
    grid-area: bottom-center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-bottom: 10px;
}

.right-panel {
    grid-area: center-right;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
    justify-content: center;
    /* Vertically center */
    padding-top: 40px;
}

/* VITAL BARS */
.vital-bar-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-label {
    font-size: 10px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    font-weight: bold;
    margin-left: 2px;
}

.vital-bar {
    width: 220px;
    height: 18px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
}

.vital-bar.health .bar-fill {
    background: linear-gradient(90deg, #d32f2f, #ef5350);
}

.vital-bar.mana .bar-fill {
    background: linear-gradient(90deg, #1976d2, #42a5f5);
}

.vital-bar .bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.2s ease-out;
}

.vital-bar .bar-text {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-size: 8px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    z-index: 2;
}

/* BIOME / SALA INFO */
.biome-sala-info {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    margin-top: 8px;
    text-align: center;
    font-family: var(--font-pixel);
}

.biome-sala-info .info-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 10px;
    color: #fff;
}

.biome-sala-info .event-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    font-size: 9px;
}

.biome-sala-info .event-label {
    color: #aaa;
}

.biome-sala-info .event-name {
    color: #ffc107;
    font-weight: bold;
}

/* RUN OBJECTIVES */

/* RUN SYNERGIES (HUD) */
.synergies-panel {
    margin-top: 8px;
}

.synergies-panel.hidden {
    display: none;
}

.synergies-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.synergy-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    color: #ddd;
    background: rgba(255, 0, 255, 0.05);
    border: 1px solid rgba(255, 0, 255, 0.18);
    padding: 4px 6px;
    border-radius: 4px;
}

.synergy-item .syn-name {
    color: #ff7dff;
}

.synergy-item .syn-desc {
    opacity: 0.9;
    color: #e8e8e8;
}

/* CODEX: Synergies */
.synergies-codex {
    font-family: var(--font-pixel);
    font-size: 10px;
    line-height: 1.6;
}

.synergies-codex .syn-card {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

.synergies-codex .syn-title {
    font-size: 10px;
    color: #ff7dff;
    margin-bottom: 6px;
}

.synergies-codex .syn-recipe {
    opacity: 0.95;
    margin-bottom: 6px;
}

.synergies-codex .syn-bonus {
    opacity: 0.95;
}

.objectives-panel {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    font-family: var(--font-pixel);
}

.objectives-panel .panel-header {
    font-size: 9px;
    color: #fff;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
}

.objectives-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.objective {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    color: #ddd;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 6px;
    border-radius: 4px;
}

.objective.done {
    color: #9cff9c;
    border-color: rgba(120, 255, 120, 0.3);
    background: rgba(120, 255, 120, 0.08);
}

.objective .obj-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.objective .obj-name {
    font-weight: bold;
}

.objective .obj-progress {
    color: #ffc107;
}

.objective.done .obj-progress {
    color: #7cff7c;
}

.objective .obj-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 8px;
}

.objective .obj-reward {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.7);
}

/* ITEMS PANEL (Right Side) */
.items-panel {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px;
    min-width: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.items-panel .panel-header {
    font-size: 10px;
    color: #fff;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
    font-family: var(--font-pixel);
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
    color: #ddd;
    padding: 3px 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.item-entry .item-icon {
    font-size: 12px;
}

.item-entry.rarity-common {
    border-left: 2px solid #888;
}

.item-entry.rarity-rare {
    border-left: 2px solid #42a5f5;
}

.item-entry.rarity-epic {
    border-left: 2px solid #ab47bc;
}

.item-entry.rarity-legendary {
    border-left: 2px solid #ffd700;
}

/* STAT PILLS (Gold, Room) */
.stat-pill {
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
}

.stat-pill.gold {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.3);
}

/* RUNES CONTAINER */
.runes-container {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.rune-slot {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 4px;
    position: relative;
    transition: transform 0.1s;
    cursor: help;
}

.rune-slot:hover {
    transform: scale(1.1);
    border-color: var(--secondary);
    background: rgba(0, 229, 255, 0.1);
}

.rune-slot.empty {
    opacity: 0.5;
    border-style: dashed;
}

.rune-slot.filled {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* SKILLS CONTAINER */
.skills-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.skill-slot {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #555;
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-slot .skill-icon {
    font-size: 24px;
}

.skill-slot .key-hint {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    border: 1px solid #666;
    color: #ccc;
    font-size: 7px;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    /* animates */
    background: rgba(0, 0, 0, 0.8);
    transition: height 0.1s linear;
}

.skill-slot.locked {
    opacity: 0.4;
    border-style: dashed;
}

.potion-slot {
    width: 40px;
    height: 40px;
    background: rgba(40, 10, 10, 0.7);
    border: 2px solid #a53333;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.potion-count {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 9px;
    background: #f00;
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #fff;
}

/* SETS & PASSIVES */
.set-tracker {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.set-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
}

.set-count {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    background: #000;
    padding: 1px 3px;
    border-radius: 4px;
}

.passives-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 4px;
}

.passive-icon {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-radius: 2px;
    cursor: help;
}

/* ==========================================
   MINIMAP
   ========================================== */
#minimap {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    pointer-events: none;
}

#minimap-canvas {
    border-radius: 4px;
}

.minimap-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 8px;
    color: #ccc;
    font-family: var(--font-pixel);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.completed {
    background: #44ff88;
}

.legend-dot.incomplete {
    background: rgba(120, 120, 140, 0.75);
    border: 1px solid #888;
}

.legend-dot.shop {
    background: #42a5f5;
}

.legend-dot.miniboss {
    background: #ffd700;
}

.legend-dot.boss {
    background: #ff80b4;
}

.stat-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
    text-align: right;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
}

.dash-cooldown {
    width: 100px;
    height: 8px;
    background: var(--bg-dark);
    border: 1px solid #333;
    align-self: flex-end;
}

.cooldown-fill {
    height: 100%;
    background: var(--secondary);
    width: 100%;
    transition: width 0.1s linear;
}

.potion-slot {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border: 1px solid var(--success);
    align-self: flex-end;
    font-size: 10px;
}


.active-display {
    display: flex;
    gap: 6px;
    align-items: center;
    align-self: flex-end;
    margin-top: 6px;
}

.active-slot {
    width: 34px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary);
    font-size: 14px;
    user-select: none;
}

.active-slot.empty {
    font-size: 10px;
    opacity: 0.8;
}

.active-slot.filled {
    font-size: 16px;
    opacity: 1;
}

/* Active item cooldown clock overlay */
.active-slot {
    position: relative;
    overflow: hidden;
}

.active-slot .slot-icon {
    position: relative;
    z-index: 1;
}

.active-slot .cd-clock {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    /* fills like a clock (pie). --a is the dark covered angle */
    background: conic-gradient(from -90deg, rgba(0, 0, 0, 0.65) 0deg var(--a, 0deg), rgba(0, 0, 0, 0) var(--a, 0deg) 360deg);
}

.active-slot .cd-text {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Minimap */
#minimap {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--bg-light);
    padding: 5px;
    z-index: 100;
}

/* Under-minimap HUD (potions + dash + active skills) */
.minimap-under {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

#minimap .dash-cooldown {
    width: 64px;
    height: 8px;
    align-self: unset;
}

#minimap .potion-slot {
    padding: 3px 6px;
    font-size: 9px;
    align-self: unset;
}

#minimap .active-display {
    margin-top: 0;
    align-self: unset;
}

#minimap .active-slot {
    width: 28px;
    height: 22px;
}

/* ==========================================
   ROOM MINI HUD (bottom-left)
   ========================================== */

.room-mini {
    position: absolute;
    left: 14px;
    bottom: 10px;
    z-index: 5;
    font-family: var(--font-pixel);
    font-size: 8px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 10px;
    max-width: 260px;
    pointer-events: none;
    white-space: pre-line;
}

.room-mini .mini-title {
    color: rgba(255, 255, 255, 0.95);
}

.room-mini .mini-events {
    color: rgba(160, 255, 210, 0.9);
}

#minimap-canvas {
    display: block;
}

/* ==========================================
   OVERLAYS
   ========================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.hidden {
    display: none;
}

/* Pause Menu */
.pause-content {
    text-align: center;
}

.pause-content h2 {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.pause-info {
    display: flex;
    gap: 20px;
    font-size: 8px;
    color: var(--text-dim);
    justify-content: center;
}

/* Death Screen */
.death-content {
    text-align: center;
    animation: deathFade 1s ease-out;
}

@keyframes deathFade {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.death-title {
    font-size: 32px;
    color: var(--danger);
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5), var(--shadow-text);
    margin-bottom: 40px;
    animation: deathPulse 2s ease-in-out infinite;
}

@keyframes deathPulse {

    0%,
    100% {
        text-shadow: 0 0 30px rgba(255, 0, 0, 0.5), var(--shadow-text);
    }

    50% {
        text-shadow: 0 0 50px rgba(255, 0, 0, 0.8), var(--shadow-text);
    }
}

.death-stats {
    background: var(--bg-medium);
    padding: 25px;
    margin-bottom: 30px;
    min-width: 350px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 10px;
    border-bottom: 1px solid var(--bg-light);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.highlight {
    color: var(--gold);
    font-size: 12px;
    padding-top: 15px;
    border-top: 2px solid var(--gold);
    margin-top: 10px;
}

.big-btn {
    font-family: var(--font-pixel);
    font-size: 16px;
    padding: 20px 60px;
    background: var(--gradient-primary);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 15px;
    animation: bigBtnPulse 2s ease-in-out infinite;
}

@keyframes bigBtnPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(123, 77, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(123, 77, 255, 0.8);
    }
}

.big-btn:hover {
    transform: scale(1.1);
}

/* Reward Screen */
.reward-content {
    text-align: center;
}

.reward-title {
    font-size: 18px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), var(--shadow-text);
    margin-bottom: 40px;
}

.reward-options {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.reward-card {
    background: var(--bg-medium);
    border: 3px solid var(--bg-light);
    padding: 25px;
    width: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reward-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.reward-card.common {
    border-color: var(--rarity-common);
}

.reward-card.rare {
    border-color: var(--rarity-rare);
}

.reward-card.epic {
    border-color: var(--rarity-epic);
}

.reward-card.legendary {
    border-color: var(--rarity-legendary);
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

.reward-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.reward-name {
    font-size: 10px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.reward-desc {
    font-size: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Loading Screen */
.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    font-size: 10px;
    color: var(--text-secondary);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .game-title {
        font-size: 24px;
    }

    .menu-btn {
        font-size: 10px;
        min-width: 220px;
        padding: 12px 25px;
    }

    .difficulty-options {
        flex-direction: column;
        align-items: center;
    }

    .difficulty-card {
        width: 100%;
        max-width: 300px;
    }

    .health-bar,
    .mana-bar {
        width: 150px;
    }

    .controls-info {
        grid-template-columns: 1fr;
    }
}

.logo-icon-img{
    width:64px;
    height:64px;
    image-rendering: pixelated;
    display:block;
}

/* =============================
   Meta Upgrades (v0.1.2)
   ============================= */
.meta-essence {
    margin-top: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: #ffd54a;
    text-shadow: 0 0 8px rgba(255, 213, 74, 0.35);
}

.meta-shop-list {
    width: min(760px, 94vw);
    margin: 18px auto 0 auto;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    background: rgba(0,0,0,0.35);
    border: 2px solid rgba(255, 213, 74, 0.25);
    border-radius: 10px;
}

.meta-upgrade-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    background: rgba(15, 10, 35, 0.75);
    border: 2px solid rgba(150, 110, 255, 0.35);
    border-radius: 10px;
}

.meta-upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-upgrade-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(160, 120, 255, 0.25);
}

.meta-upgrade-desc {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    line-height: 1.35;
}

.meta-upgrade-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.meta-upgrade-level {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: rgba(255,255,255,0.85);
}

.meta-buy-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 213, 74, 0.6);
    background: rgba(255, 213, 74, 0.15);
    color: #ffd54a;
    cursor: pointer;
}

.meta-buy-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.menu-btn.small {
    font-size: 12px;
    padding: 12px 18px;
}

/* ==========================================
   MEGA UPDATE - Seeds & Sinergias
   ========================================== */

/* Seed Input Container (Main Menu) */
.seed-input-container {
    margin: 20px auto;
    max-width: 500px;
    padding: 15px;
    background: rgba(255, 170, 0, 0.1);
    border: 2px solid #ffaa00;
    border-radius: 8px;
}

.seed-input-container label {
    display: block;
    margin-bottom: 8px;
    color: #ffaa00;
    font-size: 14px;
    font-weight: bold;
}

.seed-controls {
    display: flex;
    gap: 8px;
}

.seed-controls input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #666;
    border-radius: 4px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 1px;
}

.seed-controls input:focus {
    border-color: #ffaa00;
    outline: none;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

.seed-controls input::placeholder {
    color: #888;
    font-style: italic;
}

.seed-btn {
    min-width: 44px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffaa00;
    border-radius: 4px;
    color: #ffaa00;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.seed-btn:hover {
    background: #ffaa00;
    color: #000;
    transform: scale(1.05);
}

.seed-btn:active {
    transform: scale(0.95);
}

/* Seed Display (in Pause/Death/Boss screens) */
.seed-display {
    margin: 20px 0;
    padding: 12px 16px;
    background: rgba(255, 170, 0, 0.15);
    border: 2px solid #ffaa00;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.seed-display span {
    color: #ffaa00;
    font-size: 14px;
}

.seed-display code {
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #ffd700;
    letter-spacing: 1px;
}

.copy-seed-btn {
    padding: 8px 14px;
    background: #ffaa00;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-seed-btn:hover {
    background: #ffcc00;
    transform: scale(1.05);
}

.copy-seed-btn:active {
    transform: scale(0.95);
}

/* Setting Row for Synergies */
.setting-row {
    margin: 15px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.setting-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
}

.setting-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-hint {
    display: block;
    margin-top: 6px;
    margin-left: 30px;
    color: #aaa;
    font-size: 12px;
    font-style: italic;
}

/* Seed containers */
#pause-seed-container,
#death-seed-container {
    margin-top: 15px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .seed-controls {
        flex-direction: column;
    }
    
    .seed-btn {
        width: 100%;
    }
    
    .seed-display {
        flex-direction: column;
        text-align: center;
    }
    
    .copy-seed-btn {
        width: 100%;
    }
}


/* Updates screen footer (keeps Back visible under scroll list) */
#updates-screen .screen-footer{
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    margin-top: 14px;
}
#updates-screen .back-btn{
    padding: 12px 32px;
}

/* ==========================================
   Startup Loading Screen (22s) - Upgraded VFX
   ========================================== */
.loading-screen{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all; /* block clicks */
    overflow: hidden;
    background: radial-gradient(1200px 700px at 50% 40%, rgba(40,40,60,0.25), rgba(0,0,0,0.92) 65%);
}

/* Subtle animated starfield layers */
.loading-screen::before,
.loading-screen::after{
    content: "";
    position: absolute;
    inset: -30%;
    pointer-events: none;
    opacity: 0.55;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.10) 1px, transparent 2px),
        radial-gradient(circle at 80% 35%, rgba(255,255,255,0.10) 1px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.10) 1px, transparent 2px),
        radial-gradient(circle at 60% 85%, rgba(255,255,255,0.08) 1px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 1px, transparent 2px);
    background-size: 260px 260px, 320px 320px, 420px 420px, 520px 520px, 680px 680px;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
    /* Parallax driven by JS vars + gentle drift via background-position */
    transform: translate3d(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px), 0);
    animation: spellikeStarDrift 16s linear infinite;
}
.loading-screen::after{
    opacity: 0.35;
    filter: blur(0.2px);
    animation-duration: 26s;
    transform: translate3d(calc(var(--px, 0) * 1.6px), calc(var(--py, 0) * 1.6px), 0) scale(1.1);
}

@keyframes spellikeStarDrift{
    from{ background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    to{ background-position: -120px -160px, -180px -120px, -220px -260px, -280px -240px, -340px -320px; }
}

.loading-screen.hidden{
    display: none;
}

/* Fade-in / fade-out polish */
.loading-screen{
    opacity: 0;
    transition: opacity 300ms ease;
}
.loading-screen.active{
    opacity: 1;
}

.loading-panel{
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 18px;
    width: min(620px, 92vw);
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(10,10,14,0.62);
    backdrop-filter: blur(10px);
    box-shadow:
        0 18px 60px rgba(0,0,0,0.62),
        inset 0 0 0 1px rgba(255,255,255,0.06);
    transform: translateY(6px) scale(0.98);
    transition: transform 300ms ease;
}

.loading-screen.active .loading-panel{
    transform: translateY(0) scale(1);
}

/* Soft glow ring */
.loading-panel::before{
    content:"";
    position:absolute;
    inset:-2px;
    border-radius: 20px;
    background: radial-gradient(600px 200px at 50% -20%, rgba(120,160,255,0.12), transparent 60%);
    pointer-events:none;
}

/* Top icon + spinner combo */
.loading-top{
    display: flex;
    align-items: center;
    gap: 14px;
}

.loading-rune{
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
    animation: spellikeFloat 2.6s ease-in-out infinite;
}
.loading-rune img{
    width: 30px;
    height: 30px;
    image-rendering: pixelated;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.55));
}

@keyframes spellikeFloat{
    0%,100%{ transform: translateY(0); }
    50%{ transform: translateY(-6px); }
}

.loading-spinner{
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 4px solid rgba(255,255,255,0.14);
    border-top-color: rgba(255,255,255,0.92);
    animation: spellikeSpin 0.85s linear infinite;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55));
}

@keyframes spellikeSpin{
    from{ transform: rotate(0deg); }
    to{ transform: rotate(360deg); }
}

.loading-text{
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
    color: rgba(255,255,255,0.92);
    max-width: min(560px, 86vw);
    word-break: break-word;
    text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

/* Glitch/pulse effect on “Error” style lines */
.loading-text.fx-glitch{
    animation: spellikeGlitch 420ms steps(2,end) 1;
}
@keyframes spellikeGlitch{
    0%{ transform: translateX(0); filter: none; }
    20%{ transform: translateX(-2px); filter: contrast(1.2); }
    40%{ transform: translateX(2px); filter: contrast(1.25); }
    60%{ transform: translateX(-1px); filter: contrast(1.15); }
    100%{ transform: translateX(0); filter: none; }
}

/* Progress bar */
.loading-bar{
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    overflow: hidden;
}
.loading-bar-fill{
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(120,160,255,0.75), rgba(255,255,255,0.92));
    box-shadow: 0 0 18px rgba(120,160,255,0.22);
    transform-origin: left center;
}

.loading-screen.active .loading-bar-fill{
    animation: spellikeLoadFill 22s linear forwards;
}
@keyframes spellikeLoadFill{
    from{ width: 0%; }
    to{ width: 100%; }
}

.loading-sub{
    width: 100%;
    display:flex;
    justify-content: space-between;
    gap: 10px;
    opacity: 0.85;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: rgba(255,255,255,0.75);
}

.loading-dots{
    display:inline-block;
    min-width: 14px;
    text-align:left;
}
.loading-dots::after{
    content: "...";
}

