:root {
    --bg: #121212;
    --card: #1e1e1e;
    --border: rgba(255,255,255,0.08);
    --text: #ffffff;

    --muted-text: rgba(255,255,255,0.7);

    --badge-bg: rgba(255,255,255,0.12);
    --badge-text: #ffffff;
}

[data-theme="light"] {
    --bg: #f5f5f5;
    --card: #ffffff;
    --border: rgba(0,0,0,0.08);
    --text: #222222;

    --muted-text: #555555;

    --badge-bg: rgba(0,0,0,0.08);
    --badge-text: #222222;
}

/* =======================
   GLOBAL
======================= */

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: 0.3s ease;
}

p, span, small, h1, h2, h3, h4, h5 {
    color: inherit;
}

/* =======================
   CARD
======================= */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: 0.3s ease;
    color: var(--text);
}

.card:hover {
    transform: translateY(-5px);
}

/* =======================
   IMAGE
======================= */

.mvp-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    padding: 10px;
}

/* =======================
   TIMER BOX
======================= */

.timer-box {
    background: var(--badge-bg);
    color: var(--text);
    border-radius: 12px;
    padding: 12px;
}

/* =======================
   BADGES (FIXED)
======================= */

.badge-custom {
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    display: inline-block;
}

/* Bootstrap badge override safety */
.badge {
    color: var(--badge-text) !important;
    background: var(--badge-bg) !important;
}

/* =======================
   STATUS COLORS
======================= */

.status-red {
    color: #ff4d4f;
    font-weight: bold;
}

.status-green {
    color: #28c76f;
    font-weight: bold;
}

.status-yellow {
    color: #ff9f43;
    font-weight: bold;
    animation: pulse 1.2s infinite;
}

.status-alive {
    color: #00e676;
    font-weight: bold;
    animation: pulse 1s infinite;
}

/* =======================
   PULSE ANIMATION
======================= */

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

/* =======================
   MAP SECTION
======================= */

.map-card {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.2s;
}

.map-card:hover {
    transform: scale(1.03);
}

.map-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.map-label {
    text-align: center;
    padding: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
}

.map-preview {
    width: 100%;
    border-radius: 10px;
    margin-top: 8px;
}

/* =======================
   HEAT EFFECTS
======================= */

.heat-low {
    filter: brightness(1);
}

.heat-medium {
    filter: brightness(1.2) saturate(1.4);
}

.heat-high {
    filter: brightness(1.5) saturate(1.8) hue-rotate(10deg);
}

/* =======================
   THEME SWITCH
======================= */

.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 36px;
    margin-bottom: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4bc0c8;
    transition: .4s;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    overflow: hidden;
}

.slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: #1a1a2e;
}

input:checked + .slider:before {
    transform: translateX(34px);
}

.slider-icon {
    width: 18px;
    height: 18px;
    z-index: 1;
}

.sun {
    fill: #FFD700;
}

.moon {
    fill: #f1c40f;
}

/* =======================
   MOBILE
======================= */

@media(max-width:768px) {
    .mvp-image {
        height: 180px;
    }
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 45px;
    height: 45px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition: 0.3s ease;

    z-index: 999;
}

/* visible state */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}