/* ============================================================
   NEON ROGUE - STYLESHEET
   Clean, Aesthetic, Cyberpunk/Neon Minimalist Roguelike Styling
   ============================================================ */

:root {
    --bg-dark: #0a0c14;
    --bg-card: rgba(18, 22, 36, 0.88);
    --bg-card-hover: rgba(28, 34, 56, 0.95);
    --border-color: rgba(90, 120, 200, 0.3);
    --neon-blue: #00d2ff;
    --neon-pink: #ff007f;
    --neon-purple: #9d4edd;
    --neon-green: #00ff88;
    --neon-gold: #ffb703;
    --neon-red: #ff3366;
    --text-main: #f0f4f8;
    --text-muted: #8a9bb5;
    --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-body);
    color: var(--text-main);
    touch-action: none;
    -webkit-touch-callout: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    touch-action: none;
    background: radial-gradient(circle at center, #111625 0%, #06080e 100%);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

/* ============================================================
   HUD (HEADS-UP DISPLAY)
   ============================================================ */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

#hud button {
    pointer-events: auto;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stage-badge {
    background: rgba(15, 20, 35, 0.85);
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.25);
    border-radius: 8px;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stage-badge .label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.stage-badge .value {
    font-size: 20px;
    font-weight: 800;
    color: var(--neon-blue);
    font-family: var(--font-heading);
    line-height: 1.1;
}

.hp-container {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hp-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.hp-label-row .bar-title {
    color: var(--neon-pink);
}

.hp-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 0, 127, 0.4);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.2);
}

.hp-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff007f, #ff5500);
    border-radius: 6px;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
}

.shield-indicator {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid var(--neon-blue);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: var(--font-heading);
    color: var(--neon-blue);
    animation: shieldGlow 2s infinite alternate;
}

@keyframes shieldGlow {
    from { box-shadow: 0 0 4px rgba(0, 210, 255, 0.3); }
    to { box-shadow: 0 0 14px rgba(0, 210, 255, 0.8); }
}

.hud-center {
    flex: 1;
    max-width: 420px;
    margin: 0 24px;
}

.progress-container {
    background: rgba(12, 16, 28, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    backdrop-filter: blur(8px);
}

.progress-title {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

#enemy-count {
    color: var(--neon-gold);
    font-weight: 700;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-pill {
    background: rgba(15, 20, 35, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
}

.btn-icon {
    background: rgba(20, 26, 45, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn-icon:hover {
    background: rgba(40, 52, 90, 0.9);
    border-color: var(--neon-blue);
    transform: scale(1.05);
}

/* ============================================================
   BOTTOM EXP BAR
   ============================================================ */
#exp-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#exp-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #9d4edd, #00d2ff);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.8);
    transition: width 0.2s ease-out;
}

/* ============================================================
   OVERLAY MODALS (Popups, Cards, Result, Start)
   ============================================================ */
.overlay-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 12, 0.82);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 0 35px rgba(0, 150, 255, 0.15), inset 0 0 20px rgba(0, 210, 255, 0.05);
    border-radius: 18px;
    padding: 32px 36px;
    max-width: 920px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.modal-header .tag-badge {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(90deg, #ff007f, #9d4edd);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 2px;
    border-radius: 20px;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.modal-header h2 {
    font-size: 26px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    color: #ffffff;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.modal-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* 技能卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.skill-card {
    background: rgba(14, 18, 30, 0.9);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 24px 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--neon-blue);
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--neon-blue);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.3);
}

.skill-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 12px var(--neon-blue);
}

/* 稀有度标签 */
.card-rarity {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 10px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    font-weight: 700;
}

.rarity-common { color: #8a9bb5; }
.rarity-rare { color: var(--neon-blue); text-shadow: 0 0 6px var(--neon-blue); }
.rarity-epic { color: var(--neon-purple); text-shadow: 0 0 8px var(--neon-purple); }
.rarity-legendary { color: var(--neon-gold); text-shadow: 0 0 10px var(--neon-gold); }

.card-icon {
    font-size: 44px;
    margin: 10px 0 14px 0;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
    transition: transform 0.2s ease;
}

.skill-card:hover .card-icon {
    transform: scale(1.15) rotate(4deg);
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
    font-family: var(--font-body);
}

.card-type {
    font-size: 11px;
    color: var(--neon-blue);
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 600;
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
}

.card-stack {
    margin-top: 12px;
    font-size: 11px;
    color: var(--neon-green);
    font-weight: 600;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.btn-reroll {
    background: rgba(255, 183, 3, 0.15);
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.2s ease;
}

.btn-reroll:hover {
    background: rgba(255, 183, 3, 0.35);
    box-shadow: 0 0 14px rgba(255, 183, 3, 0.6);
    transform: scale(1.04);
}

.btn-reroll:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-footer .hint-text {
    font-size: 12px;
    color: #61738e;
}

/* ============================================================
   START COVER MODAL
   ============================================================ */
.start-card {
    max-width: 620px;
    border-color: rgba(0, 210, 255, 0.4);
}

.glitch-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #00d2ff, #9d4edd, #ff007f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
    margin-bottom: 4px;
}

.logo-sub {
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--neon-gold);
    display: block;
    margin-bottom: 24px;
    font-weight: 600;
}

.instructions-panel {
    background: rgba(10, 14, 24, 0.7);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.instructions-panel h3 {
    font-size: 14px;
    color: var(--neon-blue);
    margin-bottom: 12px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}

.key-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    color: #fff;
}

/* ============================================================
   DIFFICULTY SELECTOR
   ============================================================ */
.difficulty-panel {
    background: rgba(10, 14, 24, 0.75);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: left;
}

.diff-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--neon-gold);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.diff-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btn-diff {
    background: rgba(18, 24, 40, 0.85);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    outline: none;
}

.btn-diff .diff-tag {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}

.btn-diff .diff-sub {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
}

.btn-diff:hover {
    border-color: var(--neon-blue);
    background: rgba(28, 38, 64, 0.9);
}

.btn-diff.active {
    border-color: var(--neon-gold);
    background: rgba(255, 183, 3, 0.15);
    box-shadow: 0 0 16px rgba(255, 183, 3, 0.4);
}

.btn-diff.active .diff-tag {
    color: var(--neon-gold);
}

/* ============================================================
   FUSION SYNERGY CARDS (超武联动)
   ============================================================ */
.skill-card.card-fusion {
    background: linear-gradient(145deg, rgba(30, 24, 15, 0.95), rgba(15, 20, 35, 0.95));
    border: 2px solid var(--neon-gold);
    box-shadow: 0 0 25px rgba(255, 183, 3, 0.35);
    animation: fusionGlow 2.5s infinite alternate;
}

@keyframes fusionGlow {
    from {
        box-shadow: 0 0 15px rgba(255, 183, 3, 0.25);
        border-color: rgba(255, 183, 3, 0.7);
    }
    to {
        box-shadow: 0 0 35px rgba(255, 183, 3, 0.75);
        border-color: #ffe600;
    }
}

.card-fusion::before {
    background: linear-gradient(90deg, #ff007f, #ffb703, #00d2ff) !important;
    height: 5px !important;
    opacity: 1 !important;
}

.fusion-prereq-badge {
    background: rgba(255, 183, 3, 0.2);
    border: 1px dashed var(--neon-gold);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--neon-gold);
    margin-bottom: 8px;
    font-weight: 700;
}

.features-list {
    text-align: left;
    margin-bottom: 28px;
    font-size: 13px;
    color: #a8b8cf;
    line-height: 1.8;
}

.btn-action {
    background: linear-gradient(135deg, #00d2ff, #0077ff);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 42px;
    font-size: 16px;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.4);
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.7);
}

.btn-action.pulse {
    animation: btnPulse 1.8s infinite;
}

@keyframes btnPulse {
    0% { box-shadow: 0 0 15px rgba(0, 210, 255, 0.4); }
    50% { box-shadow: 0 0 35px rgba(0, 210, 255, 0.85); }
    100% { box-shadow: 0 0 15px rgba(0, 210, 255, 0.4); }
}

/* ============================================================
   START SCREEN ENHANCEMENTS
   ============================================================ */
.start-crystals-bar {
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.4);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--neon-gold);
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.start-action-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   SHOP (ARMORY) MODAL
   ============================================================ */
.shop-card {
    max-width: 860px;
}

.shop-balance {
    margin-top: 10px;
    font-size: 16px;
    color: var(--neon-gold);
    font-weight: 800;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 20px 0;
    max-height: 52vh;
    overflow-y: auto;
    padding: 4px;
}

.shop-item {
    background: rgba(15, 20, 36, 0.9);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    transition: all 0.2s ease;
}

.shop-item:hover {
    border-color: var(--neon-blue);
    background: rgba(24, 32, 56, 0.95);
}

.shop-item-icon {
    font-size: 32px;
    width: 44px;
    text-align: center;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.5));
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.shop-item-level {
    font-size: 11px;
    color: var(--neon-gold);
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #ffb703, #ff8800);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 14px rgba(255, 183, 3, 0.6);
}

.shop-buy-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #777;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   HANGAR & FIGHTER SKINS
   ============================================================ */
.hangar-card {
    max-width: 900px;
}

.hangar-layout {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    text-align: left;
}

.skin-preview-box {
    width: 250px;
    background: rgba(10, 14, 25, 0.85);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#skinPreviewCanvas {
    background: radial-gradient(circle, rgba(0, 210, 255, 0.1) 0%, rgba(5, 8, 16, 0.9) 70%);
    border-radius: 12px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    margin-bottom: 12px;
}

.preview-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--neon-blue);
    margin-bottom: 6px;
}

.preview-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}

.skin-list-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 52vh;
    overflow-y: auto;
}

.skin-card-item {
    background: rgba(15, 20, 36, 0.85);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.skin-card-item:hover {
    border-color: var(--neon-blue);
    background: rgba(25, 34, 60, 0.95);
    transform: translateY(-2px);
}

.skin-card-item.active {
    border-color: var(--neon-gold);
    background: rgba(255, 183, 3, 0.15);
    box-shadow: 0 0 15px rgba(255, 183, 3, 0.3);
}

.skin-item-icon {
    font-size: 28px;
}

.skin-item-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
}

.skin-item-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.skin-equipped-badge {
    color: var(--neon-green);
    font-weight: 800;
    font-size: 10px;
    border: 1px solid var(--neon-green);
    padding: 1px 6px;
    border-radius: 4px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 30px;
    font-size: 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   RESULTS & PAUSE
   ============================================================ */
.result-card {
    max-width: 500px;
}

.result-title {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.text-red {
    color: var(--neon-red);
    text-shadow: 0 0 16px rgba(255, 51, 102, 0.6);
}

.text-gold {
    color: var(--neon-gold);
    text-shadow: 0 0 18px rgba(255, 183, 3, 0.7);
}

.result-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.stats-summary {
    background: rgba(10, 14, 24, 0.75);
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-row .stat-label {
    color: var(--text-muted);
}

.stat-row .stat-val {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
}

.pause-card {
    max-width: 600px;
}

.pause-skills-list {
    margin: 20px 0;
    text-align: left;
}

.pause-skills-list h3 {
    font-size: 13px;
    color: var(--neon-blue);
    font-family: var(--font-heading);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.active-perks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.perk-tag {
    background: rgba(20, 30, 50, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.perk-tag .perk-count {
    background: var(--neon-blue);
    color: #000;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 10px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

/* ============================================================
   TOUCH CONTROLS (MOBILE FRIENDLY)
   ============================================================ */
.touch-only {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

@media (pointer: coarse), (max-width: 850px) {
    .touch-only {
        display: block;
    }
}

#virtual-joystick {
    position: absolute;
    bottom: 40px;
    left: 40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 210, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    pointer-events: auto;
    touch-action: none;
}

#joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-blue) 0%, #0077ff 100%);
    box-shadow: 0 0 10px var(--neon-blue);
}

.touch-dash-btn {
    position: absolute;
    bottom: 50px;
    right: 40px;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff007f 0%, #a0004f 100%);
    border: 2px solid #ff77b4;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 14px;
    pointer-events: auto;
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.5);
    outline: none;
}

.touch-dash-btn:active {
    transform: scale(0.92);
}

/* ============================================================
   RESPONSIVENESS
   ============================================================ */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-height: 55vh;
        overflow-y: auto;
    }

    .modal-card {
        padding: 20px 16px;
    }

    .glitch-title {
        font-size: 32px;
    }

    .hud-center {
        display: none;
    }

    .hp-container {
        width: 110px;
    }

    .diff-options {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .shop-grid {
        grid-template-columns: 1fr;
    }

    .hangar-layout {
        flex-direction: column;
        align-items: center;
    }

    .skin-preview-box {
        width: 100%;
    }

    .skin-list-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }
}
