body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #3a3a3a 0%, #222222 60%, #111111 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    background: linear-gradient(145deg, #2c2c2c, #1a1a1a);
    padding: 20px;
    border-radius: 12px;
    box-shadow:
        0 0 30px rgba(200, 200, 200, 0.08),
        0 0 60px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(200, 200, 200, 0.06);
    border: 1px solid rgba(200, 200, 200, 0.15);
}

#game-container {
    position: relative;
    width: min(92vw, 1200px);
    aspect-ratio: 4 / 3;
    height: auto;
    background-color: #222222;
    border: 2px solid rgba(200, 200, 200, 0.15);
    border-radius: 6px;
    overflow: hidden;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(200, 200, 200, 0.05);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#sidebar {
    width: 250px;
    background: linear-gradient(160deg, #222222, #161616);
    padding: 20px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(200, 200, 200, 0.1);
    box-shadow: inset 0 1px 0 rgba(200, 200, 200, 0.05);
}

.hardcore-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    pointer-events: auto;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
}

.hardcore-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.hardcore-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hardcore-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #3a3a3a;
    border: 1px solid rgba(200, 200, 200, 0.2);
    border-radius: 12px;
    transition: 0.3s;
}

.hardcore-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #888888;
    border-radius: 50%;
    transition: 0.3s;
}

.hardcore-toggle input:checked + .hardcore-slider {
    background: linear-gradient(180deg, #6b2020, #4a1414);
    border-color: rgba(220, 80, 80, 0.5);
}

.hardcore-toggle input:checked + .hardcore-slider::before {
    transform: translateX(20px);
    background: #e8a8a8;
}

.hardcore-label {
    color: #aaaaaa;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.3s;
}

.hardcore-toggle input:checked ~ .hardcore-label {
    color: #e8a8a8;
}

.hardcore-toggle-container:not(.unlocked) .hardcore-toggle {
    opacity: 0.4;
    pointer-events: none;
}

.hardcore-toggle-container:not(.unlocked) .hardcore-label {
    opacity: 0.4;
}

#sidebar h2 {
    margin-top: 0;
    color: #cccccc;
    border-bottom: 2px solid rgba(200, 200, 200, 0.2);
    padding-bottom: 10px;
    margin-bottom: 0;
    text-shadow: 0 0 8px rgba(200, 200, 200, 0.2);
}

#sidebar h3 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: #aaaaaa;
    font-size: 16px;
    border-bottom: 1px solid rgba(200, 200, 200, 0.15);
    padding-bottom: 5px;
}

.control-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.key {
    background: linear-gradient(180deg, #dddddd, #bbbbbb);
    color: #222222;
    padding: 4px 0px;
    border-radius: 3px;
    font-weight: bold;
    font-family: monospace;
    box-shadow: 0 2px 0 #666666, 0 0 6px rgba(200, 200, 200, 0.15);
    display: inline-block;
    width: 45px;
    text-align: center;
    border: 1px solid #888888;
}

.key.arrow-key {
    width: 25px;
    padding: 2px 0;
    font-size: 13px;
}

.desc {
    color: #888888;
    font-size: 14px;
}

.control-tree {
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    gap: 8px;
    margin-top: -10px;
}

.tree-branch {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.tree-line {
    color: #666666;
    font-family: monospace;
    font-size: 16px;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to the canvas */
}

#score-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#survival-stopwatch {
    position: absolute;
    top: 56px;
    left: 20px;
    font-size: 20px;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#hud-top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-width: 200px;
}

#equipment-display {
    text-align: right;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #888888;
}

#grenade-ammo-display {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #ecf0f1;
}

#hud-status-bars {
    width: 160px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#weapon-status-display {
    text-align: right;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hud-bar-display {
    width: 100%;
    text-align: right;
    color: #ecf0f1;
}

.hud-bar-title {
    font-size: 13px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 4px;
    color: #cccccc;
    font-weight: 500;
}

.hud-bar-bg {
    width: 100%;
    height: 12px;
    background-color: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(120, 120, 120, 0.4);
    border-radius: 6px;
    overflow: hidden;
}

.hud-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

.yellow-fill {
    background-color: #f1c40f;
}

.grey-fill {
    background-color: #95a5a6;
}

.purple-fill {
    background-color: #9b59b6;
}

.green-fill {
    background-color: #2ecc71;
}

#energy-display {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
}

#energy-bar-bg {
    width: 100%;
    height: 20px;
    background-color: #2a2a2a;
    border: 2px solid rgba(100, 100, 100, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

#energy-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #c8a838, #f1c40f);
    transition: width 0.1s linear;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.92), rgba(15, 15, 15, 0.95));
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    pointer-events: auto;
    min-width: 300px;
    border: 1px solid rgba(200, 200, 200, 0.2);
    box-shadow:
        0 0 30px rgba(200, 200, 200, 0.08),
        inset 0 1px 0 rgba(200, 200, 200, 0.06);
}

.hidden {
    display: none !important;
}

.full-screen-menu {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        linear-gradient(90deg, rgba(12, 26, 31, 0.92), rgba(42, 32, 22, 0.78) 48%, rgba(24, 18, 35, 0.9)),
        url('svg/galaxy.svg') 88% 18% / 210px no-repeat,
        url('svg/royalmaw.svg') 9% 78% / 190px no-repeat,
        url('svg/frosty.svg') 78% 82% / 155px no-repeat,
        url('svg/cinderbringer.svg') 22% 20% / 125px no-repeat,
        radial-gradient(ellipse at 50% 30%, rgba(200, 200, 200, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    background-blend-mode: normal, screen, screen, screen, screen, normal;
}

.full-screen-menu::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.full-screen-menu > * {
    position: relative;
    z-index: 1;
}

.full-screen-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, 0.035) 18.1% 18.2%, transparent 18.3% 81.7%, rgba(255, 255, 255, 0.035) 81.8% 81.9%, transparent 82%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(200, 200, 200, 0.015) 2px, rgba(200, 200, 200, 0.015) 4px);
    pointer-events: none;
    z-index: 0;
}

.full-screen-menu .title {
    font-size: 64px;
    margin-bottom: 60px;
    letter-spacing: 4px;
}

.full-screen-menu .menu-buttons {
    width: 400px;
    gap: 20px;
}

.full-screen-menu button {
    padding: 20px;
    font-size: 24px;
}

.full-screen-menu .menu-hotkey-button {
    position: relative;
    width: 100%;
    padding-left: 60px;
    text-align: left;
}

.title {
    color: #cccccc;
    margin-top: 0;
    margin-bottom: 30px;
    text-shadow:
        0 0 10px rgba(200, 200, 200, 0.4),
        0 0 30px rgba(200, 200, 200, 0.2),
        0 0 60px rgba(200, 200, 200, 0.1);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        text-shadow:
            0 0 10px rgba(200, 200, 200, 0.4),
            0 0 30px rgba(200, 200, 200, 0.2),
            0 0 60px rgba(200, 200, 200, 0.1);
    }

    50% {
        text-shadow:
            0 0 15px rgba(200, 200, 200, 0.5),
            0 0 40px rgba(200, 200, 200, 0.25),
            0 0 80px rgba(200, 200, 200, 0.12);
    }
}

button:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.back-btn {
    border-color: rgba(200, 200, 200, 0.15);
}

.hive-dropdown {
    display: flex;
    flex-direction: row;
    margin-top: 10px;
    gap: 5px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease-out, opacity 0.25s ease-out;
}

.hive-dropdown.expanded {
    max-height: 100px;
    opacity: 1;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-divider {
    border: none;
    border-top: 1px solid rgba(200, 200, 200, 0.15);
    margin: 10px 0;
    width: 100%;
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.06);
}

#game-over h1 {
    color: #ff4444;
    margin-top: 0;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.5), 0 0 30px rgba(255, 68, 68, 0.2);
}

#game-over .menu-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#game-over .menu-buttons button {
    flex: 1;
    min-width: 130px;
    white-space: nowrap;
    padding: 15px 10px;
}

button {
    padding: 15px 20px;
    font-size: 18px;
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
    color: #dddddd;
    border: 2px solid rgba(200, 200, 200, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow:
        inset 0 1px 0 rgba(200, 200, 200, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.4);
}

button:hover {
    background: linear-gradient(180deg, #4a4a4a, #333333);
    border-color: rgba(200, 200, 200, 0.4);
    color: #eeeeee;
    box-shadow:
        0 0 15px rgba(200, 200, 200, 0.15),
        inset 0 1px 0 rgba(200, 200, 200, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Full Screen Inventory */
.full-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.93), rgba(12, 12, 12, 0.95));
    backdrop-filter: blur(8px);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
}

/* Themed menu backgrounds */
#hive-screen,
#campaign-screen {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(200, 200, 200, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

#armory-screen {
    background:
        linear-gradient(90deg, rgba(13, 25, 31, 0.96), rgba(20, 31, 36, 0.9)),
        url('svg/katana.svg') 8% 22% / 230px no-repeat,
        url('svg/exoskeleton.svg') 91% 24% / 220px no-repeat,
        url('svg/turret.svg') 88% 84% / 190px no-repeat,
        url('svg/shuriken.svg') 13% 83% / 170px no-repeat,
        linear-gradient(145deg, #1b3038, #10181d);
    background-blend-mode: normal, screen, screen, screen, screen, normal;
}

#achievements-screen {
    background:
        radial-gradient(ellipse at 50% 4%, rgba(255, 214, 112, 0.22), transparent 34%),
        linear-gradient(90deg, rgba(40, 28, 17, 0.96), rgba(67, 47, 24, 0.86) 50%, rgba(31, 22, 17, 0.96)),
        linear-gradient(180deg, #47351f, #211914 68%, #120e0b);
}

#hive-screen::after,
#campaign-screen::after,
#armory-screen::after,
#achievements-screen::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

#armory-screen::before,
#achievements-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

#armory-screen::before {
    opacity: 0.18;
    background:
        linear-gradient(90deg, transparent 0 7%, rgba(125, 210, 224, 0.32) 7.1% 7.2%, transparent 7.3% 92.7%, rgba(125, 210, 224, 0.32) 92.8% 92.9%, transparent 93%),
        repeating-linear-gradient(0deg, transparent 0 88px, rgba(125, 210, 224, 0.18) 89px, transparent 90px);
}

#achievements-screen::before {
    opacity: 0.26;
    background:
        linear-gradient(90deg, transparent 0 12%, rgba(255, 207, 106, 0.28) 12.2% 13%, transparent 13.2% 87%, rgba(255, 207, 106, 0.28) 87.2% 88%, transparent 88.2%),
        radial-gradient(ellipse at 50% 0%, transparent 0 20%, rgba(18, 10, 5, 0.62) 21% 22%, transparent 23%),
        linear-gradient(180deg, transparent 0 75%, rgba(10, 7, 4, 0.55) 76% 100%);
}

#armory-screen > *,
#achievements-screen > * {
    position: relative;
    z-index: 1;
}

#settings-screen {
    background: #1d1717;
}

.settings-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    align-content: start;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto;
    padding: 10px 0 30px;
    overflow-y: auto;
}

.settings-keybinds {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    box-sizing: border-box;
}

.settings-right-column {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    box-sizing: border-box;
}

.settings-panel {
    padding: 16px;
    background: #251d1d;
    border: 1px solid rgba(200, 160, 160, 0.16);
    border-radius: 6px;
}

@media (max-width: 620px) {
    .settings-content {
        grid-template-columns: 1fr;
    }

    .settings-keybinds,
    .settings-right-column {
        grid-column: 1;
        grid-row: auto;
        height: auto;
    }
}

.settings-panel h3 {
    margin: 0 0 14px;
    color: #e0baba;
    font-size: 20px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #c8c8c8;
    font-size: 15px;
}

.settings-row select {
    width: 150px;
}

.settings-row select,
.keybind-button,
.settings-secondary-btn {
    padding: 7px 10px;
    color: #dddddd;
    background: #2d2020;
    border: 1px solid rgba(220, 170, 170, 0.3);
    border-radius: 4px;
}

.settings-row select:focus,
.keybind-button:focus,
.settings-secondary-btn:focus {
    outline: 2px solid rgba(220, 170, 170, 0.65);
    outline-offset: 2px;
}

.settings-hint {
    margin: -4px 0 12px;
    color: #999999;
    font-size: 12px;
}

.keybinds-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.keybind-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #c8c8c8;
    font-size: 14px;
}

.keybind-button {
    min-width: 76px;
    cursor: pointer;
    text-transform: capitalize;
}

.keybind-button.listening {
    color: #fff0c0;
    border-color: #d7a84c;
}

.settings-secondary-btn {
    cursor: pointer;
    font-size: 13px;
}

.settings-panel output {
    color: #e0baba;
    font-variant-numeric: tabular-nums;
}

#practice-screen {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(200, 200, 200, 0.06) 0%, transparent 60%),
        linear-gradient(145deg, rgba(30, 30, 30, 0.93), rgba(18, 18, 18, 0.95));
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(200, 200, 200, 0.2);
    padding-bottom: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(200, 200, 200, 0.03);
}

.inventory-header h2 {
    color: #cccccc;
    margin: 0;
    font-size: 32px;
    text-shadow: 0 0 10px rgba(200, 200, 200, 0.25);
}

.inventory-content {
    display: flex;
    gap: 30px;
    flex: 1;
    overflow: hidden;
}

#feats-container {
    overflow: hidden;
    width: 100%;
    height: 100%;
    padding-right: 4px;
}

.feat-category {
    margin-bottom: 24px;
}

.feat-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, rgba(60, 60, 60, 0.6), rgba(40, 40, 40, 0.3));
    border-left: 4px solid rgba(180, 180, 180, 0.5);
    border-radius: 4px;
}

.feat-category-icon {
    font-size: 20px;
    line-height: 1;
}

.feat-category-name {
    font-size: 16px;
    font-weight: bold;
    color: #ddd;
    flex: 1;
}

.feat-category-count {
    font-size: 13px;
    color: #999;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
}

.feat-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
    padding: 0 4px;
    height: 100%;
    box-sizing: border-box;
}

.feat-chip {
    background: linear-gradient(180deg, #2a2a33 0%, #15151c 100%);
    border: 2px solid #3a3a44;
    border-radius: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: default;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Medal color strip at the top of the trophy box */
.feat-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: #3a3a44;
    transition: all 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.feat-chip .feat-medallion {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding-top: 8px;
    box-sizing: border-box;
}

.feat-chip .feat-icon {
    font-size: 32px;
    line-height: 1;
    opacity: 0.3;
    filter: grayscale(100%) contrast(70%);
    transition: all 0.25s ease;
}

.feat-chip .feat-icon img {
    width: 34px;
    height: 34px;
    vertical-align: middle;
}
.feat-chip .feat-icon img.feat-icon-large {
    width: 46px;
    height: 46px;
}

.feat-chip .feat-composite-icon {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 34px;
    vertical-align: middle;
}

.feat-chip .feat-composite-icon img {
    position: absolute;
    top: 1px;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.feat-chip .feat-composite-icon img:first-child {
    left: 0;
}

.feat-chip .feat-composite-icon img:last-child {
    left: 20px;
    opacity: 0.85;
}

.feat-triangle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.feat-triangle img {
    width: 18px;
    height: 18px;
}
.feat-triangle img.feat-icon-large {
    width: 26px;
    height: 26px;
}
.feat-triangle > img {
    margin-bottom: -6px;
    z-index: 1;
    position: relative;
}
.feat-triangle .feat-triangle-row {
    display: flex;
}
.feat-triangle .feat-triangle-row img:first-child {
    margin-right: -7px;
}

.feat-chip:hover {
    border-color: #5a5a68;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.feat-chip:hover .feat-icon {
    opacity: 0.5;
}

/* Tier medal colors (top strip + border on unlocked trophy boxes) */
.feat-chip.unlocked {
    background: linear-gradient(180deg, #2e2e3a 0%, #1a1a22 100%);
}

.feat-chip.tier-bronze.unlocked {
    border-color: #cd7f32;
    box-shadow: 0 0 8px rgba(205, 127, 50, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.feat-chip.tier-bronze.unlocked::before {
    background: linear-gradient(180deg, #e89344 0%, #cd7f32 100%);
}

.feat-chip.tier-silver.unlocked {
    border-color: #c0c0c0;
    box-shadow: 0 0 8px rgba(192, 192, 192, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.feat-chip.tier-silver.unlocked::before {
    background: linear-gradient(180deg, #e6e6e6 0%, #c0c0c0 100%);
}

.feat-chip.tier-gold.unlocked {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.feat-chip.tier-gold.unlocked::before {
    background: linear-gradient(180deg, #ffe455 0%, #ffd700 100%);
}

.feat-chip.tier-diamond.unlocked {
    border-color: #7df9ff;
    box-shadow: 0 0 12px rgba(125, 249, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.feat-chip.tier-diamond.unlocked::before {
    background: linear-gradient(180deg, #d5ffff 0%, #4dabf7 100%);
}

.feat-chip.unlocked .feat-icon {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.feat-chip.tier-bronze.unlocked .feat-icon {
    filter: drop-shadow(0 0 4px rgba(205, 127, 50, 0.6));
}
.feat-chip.tier-silver.unlocked .feat-icon {
    filter: drop-shadow(0 0 4px rgba(220, 220, 220, 0.6));
}
.feat-chip.tier-gold.unlocked .feat-icon {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7));
}
.feat-chip.tier-diamond.unlocked .feat-icon {
    filter: drop-shadow(0 0 6px rgba(125, 249, 255, 0.85));
}

.feat-chip.unlocked .feat-icon img {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}

.feat-chip.feat-gadget-white .feat-icon,
.feat-chip.feat-gadget-white .feat-icon img,
.feat-chip .feat-icon img[src$="turret.svg"],
.feat-chip .feat-icon img[src$="cinderbringer.svg"] {
    filter: brightness(0) invert(1);
}

.feat-chip.tier-bronze.unlocked:hover {
    border-color: #e89344;
    box-shadow: 0 0 14px rgba(205, 127, 50, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.feat-chip.tier-silver.unlocked:hover {
    border-color: #e6e6e6;
    box-shadow: 0 0 14px rgba(192, 192, 192, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.feat-chip.tier-gold.unlocked:hover {
    border-color: #ffe455;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.feat-chip.tier-diamond.unlocked:hover {
    border-color: #d5ffff;
    box-shadow: 0 0 20px rgba(125, 249, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.feat-tooltip {
    display: none;
    position: fixed;
    z-index: 10000;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(150, 150, 150, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    max-width: 260px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.feat-tooltip-name {
    font-size: 14px;
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 2px;
}

.feat-tooltip-cat {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
}

.feat-tooltip-tier {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
}
.feat-tooltip-tier.tier-bronze { color: #e89344; border: 1px solid rgba(205, 127, 50, 0.5); }
.feat-tooltip-tier.tier-silver { color: #dcdcdc; border: 1px solid rgba(192, 192, 192, 0.5); }
.feat-tooltip-tier.tier-gold   { color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.6); }
.feat-tooltip-tier.tier-diamond { color: #7df9ff; border: 1px solid rgba(125, 249, 255, 0.7); }

.feat-tooltip-desc {
    font-size: 12px;
    color: #aaaaaa;
    line-height: 1.4;
}

.feat-tooltip-status {
    margin-top: 6px;
    font-size: 11px;
    font-weight: bold;
    color: #2ecc71;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feat-tooltip-status.locked {
    color: #777777;
}

.gameover-feats {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.gameover-feat-item {
    background: rgba(20, 20, 30, 0.85);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 400px;
    animation: featSlideIn 0.4s ease-out;
}

@keyframes featSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gameover-feat-icon {
    font-size: 20px;
    color: #ffd700;
}

.gameover-feat-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.gameover-feat-name {
    font-size: 14px;
    font-weight: bold;
    color: #ffd700;
}

.gameover-feat-desc {
    font-size: 11px;
    color: #aaa;
}

.armory-lists {
    flex: 3;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 10px;
}

.category-title {
    color: #cccccc;
    border-bottom: 1px solid rgba(200, 200, 200, 0.15);
    margin-bottom: 15px;
    margin-top: 20px;
    padding-bottom: 5px;
    text-shadow: 0 0 6px rgba(200, 200, 200, 0.2);
}

.category-title:first-child {
    margin-top: 0;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

#gear-campaign-grid,
#colorwars-campaign-grid,
#waterworld-grid,
#fireandice-grid {
    grid-template-columns: repeat(4, 1fr);
}

.campaign-btn {
    padding: 15px 10px 15px 50px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid transparent;
    opacity: 1 !important; /* Ensure buttons are fully opaque */
    color: #ffffff;
    position: relative;
}

.hotkey-box {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.campaign-btn-locked .hotkey-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #555555;
}

.campaign-btn-title {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.campaign-btn-subtitle {
    font-size: 13px;
    color: #dddddd;
}

.campaign-btn-stats {
    font-size: 12px;
    color: #bbbbbb;
    margin-top: 4px;
}

.campaign-btn-cleared {
    color: #2ecc71;
    font-weight: bold;
}

.campaign-btn-locked-tag {
    font-size: 12px;
    color: #aaaaaa;
}

/* Unlocked campaign level styling - solid, flat */
.campaign-btn-unlocked {
    background-color: #2c3e50;
    border-color: #3498db;
}

.campaign-btn-unlocked:hover {
    background-color: #34495e;
    border-color: #5dade2;
}

/* Completed campaign level styling - solid, flat */
.campaign-btn-completed {
    background-color: #1b4f72;
    border-color: #2ecc71;
}

.campaign-btn-completed:hover {
    background-color: #226088;
    border-color: #2ecc71;
}

/* Locked campaign level styling - solid, flat */
.campaign-btn-locked {
    background-color: #1a1a1a;
    border-color: #444444;
    cursor: not-allowed;
    color: #777777;
}

.campaign-btn-locked .campaign-btn-title,
.campaign-btn-locked .campaign-btn-subtitle {
    color: #777777;
}

.item-card {
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.6), rgba(25, 25, 25, 0.6));
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(200, 200, 200, 0.03);
    position: relative;
    height: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-card.equipped {
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.3), inset 0 1px 0 rgba(200, 200, 200, 0.03);
}

.item-card.clickable {
    cursor: pointer;
}

.item-card.clickable:hover {
    border-color: rgba(200, 200, 200, 0.6);
}

.item-actions button.equipped {
    border-color: #cccccc;
    box-shadow: 0 0 10px rgba(200, 200, 200, 0.25);
    color: #cccccc;
    background: linear-gradient(180deg, #3a3a3a, #2a2a2a);
}

.item-card h4 {
    margin: 0;
    color: #dddddd;
    font-size: 16px;
    border-bottom: 1px solid rgba(100, 100, 100, 0.2);
    padding-bottom: 5px;
    text-align: center;
}

.item-icon-display {
    font-size: 26px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
    min-height: 42px;
}

.item-icon-display img,
.item-icon-display svg {
    height: 38px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    image-rendering: auto;
    filter: none;
    color: #ffffff;
    font-size: 0;
}

.feat-medallion img,
.feat-medallion svg {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

#armory-tooltip {
    position: absolute;
    width: max-content;
    max-width: 240px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(150, 150, 150, 0.35);
    padding: 8px 12px;
    border-radius: 6px;
    color: #dddddd;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(2px);
    transition: opacity 0.08s linear, transform 0.08s linear;
    text-align: center;
    white-space: normal;
}

#armory-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.armory-inline-row .item-card {
    height: 100%;
    box-sizing: border-box;
}

#gadgets-grid {
    grid-template-columns: repeat(3, 1fr);
    width: 75%;
}

#gadgets-grid .item-card {
    height: 100%;
    box-sizing: border-box;
}

.tier-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

.tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    border: 1px solid rgba(100, 100, 100, 0.5);
}

.tier-dot.tier-unlocked {
    background: #2ecc71;
    border-color: #27ae60;
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.4);
}

.item-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
}

.item-actions button {
    padding: 5px 10px;
    font-size: 14px;
    flex: 1;
}

.loadout-panel {
    flex: 1;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.8), rgba(18, 18, 18, 0.8));
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 1px 0 rgba(200, 200, 200, 0.03);
}

.loadout-panel h3 {
    margin-top: 0;
    color: #aaaaaa;
    border-bottom: 1px solid rgba(200, 200, 200, 0.2);
    padding-bottom: 10px;
    text-shadow: 0 0 6px rgba(200, 200, 200, 0.2);
}

.loadout-panel h4 {
    color: #aaaaaa;
    margin-top: 20px;
    margin-bottom: 10px;
}

.loadout-slot {
    font-size: 18px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(100, 100, 100, 0.15);
}

#loadout-passives {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#loadout-passives li {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    color: #888888;
    border: 1px solid rgba(100, 100, 100, 0.15);
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 10px;
}

.trophy-card {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 10px;
    padding: 16px 10px;
    border: 2px solid rgba(100, 100, 100, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}

.trophy-card:hover {
    border-color: rgba(200, 200, 200, 0.3);
    box-shadow: 0 0 12px rgba(200, 200, 200, 0.1);
}

.trophy-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.practice-enemy-card {
    background-color: rgba(24, 24, 24, 0.9);
    background-image:
        linear-gradient(rgba(120, 120, 120, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 120, 120, 0.12) 1px, transparent 1px),
        linear-gradient(160deg, rgba(42, 42, 42, 0.78), rgba(22, 22, 22, 0.82));
    background-size: 14px 14px, 14px 14px, 100% 100%;
    background-position: 0 0, 0 0, 0 0;
    border: 1px solid rgba(140, 140, 140, 0.28);
    border-radius: 10px;
    padding: 12px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    user-select: none;
    min-height: 170px;
    box-shadow: inset 0 1px 0 rgba(220, 220, 220, 0.03);
}

.practice-enemy-card:hover {
    border-color: rgba(200, 200, 200, 0.5);
    box-shadow: 0 0 12px rgba(200, 200, 200, 0.12);
}

.practice-enemy-card.selected {
    border-color: #cccccc;
    background: linear-gradient(165deg, rgba(58, 58, 58, 0.9), rgba(30, 30, 30, 0.92));
    box-shadow: 0 0 12px rgba(220, 220, 220, 0.2);
}

.practice-enemy-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.practice-enemy-card.locked:hover {
    border-color: rgba(100, 100, 100, 0.3);
}

.practice-enemy-icon {
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.practice-enemy-preview {
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.practice-enemy-card h4 {
    margin-top: auto;
    margin: 0;
    font-size: 14px;
    color: #dddddd;
    text-align: center;
}

#practice-enemy-grid {
    overflow-y: auto;
    padding-right: 10px;
}