:root {
    --ds-bg-a: #173640;
    --ds-bg-b: #2d4d3f;
    --ds-bg-c: #7f6a3a;
    --ds-panel: rgba(18, 24, 30, 0.7);
    --ds-panel-border: rgba(255, 230, 166, 0.24);
    --ds-panel-soft: rgba(255, 255, 255, 0.04);
    --ds-title-a: #f5d690;
    --ds-title-b: #d8ac4d;
    --ds-text-main: #f8f2df;
    --ds-text-soft: #b9c3c9;
    --ds-accent: #ffd27a;
    --ds-accent-2: #6ed3b5;
    --ds-danger: #ff8f74;
    --ds-success: #9ce7a9;
    --ds-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
}

a:link,
a:visited {
    text-decoration: none;
}

a:active {
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────────
   Battle Page Theme
   ────────────────────────────────────────────────────────────────────────── */

.battle-page {
    background:
        radial-gradient(1200px 650px at -8% -18%, rgba(255, 214, 134, 0.28), rgba(255, 214, 134, 0)),
        radial-gradient(900px 620px at 105% 8%, rgba(135, 226, 200, 0.26), rgba(135, 226, 200, 0)),
        linear-gradient(136deg, var(--ds-bg-a), var(--ds-bg-b) 48%, var(--ds-bg-c));
    color: var(--ds-text-main);
    position: relative;
    overflow-x: hidden;
}

.battle-page::before,
.battle-page::after {
    content: '';
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
}

.battle-page::before {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.16;
}

.battle-page::after {
    background:
        radial-gradient(800px 300px at 50% -14%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
    opacity: 0.55;
}

.battle-page .desktopSquish {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 1650px;
    padding-bottom: 14px;
}

.battle-page .game-topbar {
    min-height: 42px;
    margin: 12px 0 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid var(--ds-panel-border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(20, 26, 32, 0.8), rgba(31, 41, 49, 0.62));
    box-shadow: var(--ds-shadow);
    backdrop-filter: blur(6px);
}

.battle-page .topBar > a,
.battle-page .topbar-links > a,
.battle-page #logoutButton,
.battle-page #playersOnlineButton {
    color: var(--ds-text-main);
    letter-spacing: 0.01em;
    text-shadow: none;
    transition: color 140ms ease, text-shadow 140ms ease;
}

.battle-page .topBar > a:hover,
.battle-page .topbar-links > a:hover,
.battle-page #logoutButton:hover,
.battle-page #playersOnlineButton:hover {
    color: var(--ds-accent);
    text-shadow: 0 0 14px rgba(255, 210, 122, 0.45);
}

.battle-page .battle-layout {
    align-items: stretch;
}

.battle-page .game-panel {
    border-color: var(--ds-panel-border) !important;
    border-width: 1px !important;
    background:
        linear-gradient(170deg, rgba(32, 42, 52, 0.86), rgba(20, 27, 34, 0.8)) !important;
    box-shadow: var(--ds-shadow);
    position: relative;
    overflow: hidden;
    animation: panel-rise 620ms cubic-bezier(.2,.7,.2,1) both;
}

.battle-page .game-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.battle-page .rail-left .game-panel:nth-child(1) {
    animation-delay: 60ms;
}

.battle-page .rail-left .game-panel:nth-child(2) {
    animation-delay: 120ms;
}

.battle-page .rail-left .game-panel:nth-child(3) {
    animation-delay: 180ms;
}

.battle-page .center-stage .game-panel:nth-child(1) {
    animation-delay: 90ms;
}

.battle-page .center-stage .game-panel:nth-child(2) {
    animation-delay: 170ms;
}

.battle-page .center-stage .game-panel:nth-child(3) {
    animation-delay: 250ms;
}

.battle-page .rail-right .game-panel:nth-child(1) {
    animation-delay: 100ms;
}

.battle-page .rail-right .game-panel:nth-child(2) {
    animation-delay: 160ms;
}

.battle-page .rail-right .game-panel:nth-child(3) {
    animation-delay: 220ms;
}

.battle-page .title {
    font-family: 'Cinzel', Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    color: #2a200f;
    background: linear-gradient(96deg, var(--ds-title-a), var(--ds-title-b));
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid rgba(91, 69, 25, 0.55);
    text-shadow: 0 1px 0 rgba(255, 247, 223, 0.45);
    margin-top: -4px;
    margin-left: -8px;
    margin-right: -8px;
    padding: 7px 10px;
}

.battle-page .menu-link {
    color: #dceef5 !important;
    font-weight: 600;
    padding: 4px 2px !important;
    transition: transform 140ms ease, color 140ms ease, text-shadow 140ms ease;
}

.battle-page .menu-card {
    overflow-y: auto;
    overflow-x: hidden;
}

.battle-page .menu-link:hover {
    color: var(--ds-accent) !important;
    text-shadow: 0 0 12px rgba(255, 210, 122, 0.35);
    transform: translateX(4px);
    font-weight: 600;
}

.battle-page .menu-link-pvp {
    color: var(--ds-danger) !important;
}

.battle-page .menu-link-quest {
    color: var(--ds-success) !important;
}

.battle-page .menu-link-vip {
    color: #ffd76f !important;
}

.battle-page .stats-row {
    border-color: rgba(255, 255, 255, 0.06) !important;
    background: transparent !important;
    color: var(--ds-text-main) !important;
    font-size: 0.86rem;
}

.battle-page .stats-row .badge {
    background: linear-gradient(120deg, #c0892b, #f0c766) !important;
    color: #2a200f;
    font-family: 'Space Mono', monospace;
    min-width: 72px;
}

.battle-page #userStats {
    margin-top: 8px;
    color: var(--ds-text-soft);
    line-height: 1.66;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.battle-page #userStats span {
    color: var(--ds-text-main);
    font-family: 'Space Mono', monospace;
    font-size: 0.86rem;
}

.battle-page #special {
    font-size: 0.98rem;
}

.battle-page .chat-shell {
    margin-left: -2px;
    margin-right: -2px;
}

.battle-page .game-chat-form .input-group {
    margin-bottom: 8px;
}

.battle-page #chatRoomSelect,
.battle-page #chatInput,
.battle-page #chatButton {
    border-color: rgba(255, 230, 166, 0.34) !important;
    color: var(--ds-text-main);
    background: rgba(17, 24, 30, 0.74);
}

.battle-page #chatRoomSelect,
.battle-page #chatButton {
    font-weight: 700;
}

.battle-page #chatInput:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(110, 211, 181, 0.42) !important;
    border-color: rgba(110, 211, 181, 0.76) !important;
}

.battle-page #messagesContainer {
    background: linear-gradient(170deg, rgba(14, 18, 23, 0.85), rgba(8, 14, 18, 0.8)) !important;
    border-color: var(--ds-panel-border) !important;
}

.battle-page #scrollableBattleWindow,
.battle-page #messagesContainer,
.battle-page #activityLog,
.battle-page #sidebarQuestList,
.battle-page .menu-card,
.battle-page .combatLog {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 208, 119, 0.6) rgba(255, 255, 255, 0.08);
}

.battle-page #scrollableBattleWindow::-webkit-scrollbar,
.battle-page #messagesContainer::-webkit-scrollbar,
.battle-page #activityLog::-webkit-scrollbar,
.battle-page #sidebarQuestList::-webkit-scrollbar,
.battle-page .menu-card::-webkit-scrollbar,
.battle-page .combatLog::-webkit-scrollbar {
    width: 10px;
}

.battle-page #scrollableBattleWindow::-webkit-scrollbar-track,
.battle-page #messagesContainer::-webkit-scrollbar-track,
.battle-page #activityLog::-webkit-scrollbar-track,
.battle-page #sidebarQuestList::-webkit-scrollbar-track,
.battle-page .menu-card::-webkit-scrollbar-track,
.battle-page .combatLog::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.battle-page #scrollableBattleWindow::-webkit-scrollbar-thumb,
.battle-page #messagesContainer::-webkit-scrollbar-thumb,
.battle-page #activityLog::-webkit-scrollbar-thumb,
.battle-page #sidebarQuestList::-webkit-scrollbar-thumb,
.battle-page .menu-card::-webkit-scrollbar-thumb,
.battle-page .combatLog::-webkit-scrollbar-thumb {
    background: rgba(255, 208, 119, 0.52);
    border-radius: 8px;
}

.battle-page .combat-rails {
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.battle-page .combat-progress {
    width: 32%;
    height: 14px;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
}

.battle-page .combat-progress::-webkit-progress-bar {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
}

.battle-page .combat-progress::-webkit-progress-value {
    border-radius: 14px;
    transition: width 180ms ease;
}

.battle-page .user-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #7fe28f, #3cbf7f);
}

.battle-page .boss-progress::-webkit-progress-value {
    background: linear-gradient(90deg, #f39a76, #d15153);
}

.battle-page .combat-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-text-main);
    font-weight: 600;
}

.battle-page .combat-select {
    display: inline;
    background: rgba(15, 25, 32, 0.72);
    color: var(--ds-text-main);
    border: 1px solid rgba(255, 230, 166, 0.34);
    border-radius: 8px;
    padding: 3px 8px;
}

.battle-page .combat-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.battle-page .combat-btn {
    border: 1px solid rgba(255, 230, 166, 0.46);
    border-radius: 10px;
    padding: 7px 14px;
    font-weight: 800;
    letter-spacing: 0.015em;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.battle-page .combat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

.battle-page .combat-btn.primary {
    background: linear-gradient(120deg, #3cbf7f, #7fe28f);
    color: #0e2418;
}

.battle-page .combat-btn.secondary {
    background: linear-gradient(120deg, #f39a76, #de6b59);
    color: #33130c;
}

.battle-page .monster-info {
    margin-bottom: 10px;
}

.battle-page .combatLog {
    margin: 12px 0;
    max-height: 160px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.88em;
    padding: 8px;
    background: rgba(5, 10, 14, 0.42);
    border: 1px solid rgba(255, 230, 166, 0.2);
    border-radius: 8px;
}

.battle-page #displayGeneral {
    color: var(--ds-text-main);
}

.battle-page #displayGeneral table {
    background: rgba(8, 13, 17, 0.34);
    border-radius: 8px;
    overflow: hidden;
}

.battle-page #displayGeneral button {
    border-radius: 8px;
}

.battle-page .blackGlowText,
.battle-page .whiteGlowText,
.battle-page .orangeGlowText,
.battle-page .blueGlowText,
.battle-page .greenGlowText,
.battle-page .redGlowText {
    text-shadow: none;
}

.allChatContainer {
    font-size: 15px;
}

@keyframes panel-rise {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ──────────────────────────────────────────────────────────────────────────
   Existing utility classes used on non-battle pages
   ────────────────────────────────────────────────────────────────────────── */

.negativeMargin {
    margin-left: -8px;
    margin-right: -8px;
}

.leftChat {
    margin-left: -8px;
}

.rightChat {
    margin-left: 0;
    margin-right: -16px;
}

.whiteGlowHeader {
    text-shadow: 0 0 5px white, 0 0 10px white, 0 0 20px white, 0 0 40px white;
}

.whiteGlowText {
    text-shadow: 0 0 5px white, 0 0 10px white, 0 0 10px white, 0 0 10px white;
}

.softWhiteGlowText {
    text-shadow: 0 0 2px white, 0 0 2px white, 0 0 2px white, 0 0 2px white;
}

.blackGlowHeader {
    text-shadow: 0 0 5px black, 0 0 10px black, 0 0 10px black, 0 0 10px black;
}

.blackGlowText {
    text-shadow: 0 0 5px black, 0 0 10px black, 0 0 10px black, 0 0 10px black;
}

.redGlowHeader {
    text-shadow: 0 0 5px red, 0 0 10px red, 0 0 10px red, 0 0 10px red;
}

.redGlowText {
    text-shadow: 0 0 5px red, 0 0 10px red, 0 0 10px red, 0 0 10px red;
}

.orangeGlowHeader {
    text-shadow: 0 0 5px orange, 0 0 10px orange, 0 0 10px orange, 0 0 10px orange;
}

.orangeGlowText {
    text-shadow: 0 0 5px orange, 0 0 10px orange, 0 0 10px orange, 0 0 10px orange;
}

.blueGlowHeader {
    text-shadow: 0 0 5px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184);
}

.blueGlowText {
    text-shadow: 0 0 5px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184), 0 0 10px rgb(10, 10, 184);
}

.greenGlowHeader {
    text-shadow: 0 0 5px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2);
}

.greenGlowText {
    text-shadow: 0 0 5px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2), 0 0 10px rgb(2, 75, 2);
}

.blueDragon {
    width: 69% !important;
    margin: auto;
}

.ammit {
    width: 57% !important;
    margin: auto;
}

.malphite {
    width: 68% !important;
    margin: auto;
}

#privacyPolicyModalButton:hover,
#gameRulesModalButton:hover,
#chatRulesModalButton:hover {
    text-decoration: underline !important;
    cursor: pointer !important;
}

.flex-container {
    display: flex;
    justify-content: space-evenly;
}

.alignCenter {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ──────────────────────────────────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────────────────────────────────── */

@media only screen and (max-width: 1200px) {
    .battle-page .desktopSquish {
        margin-left: 12px;
        margin-right: 12px;
    }
}

@media only screen and (max-width: 768px) {
    .desktopSquish {
        margin-left: 8px;
        margin-right: 8px;
    }

    .battle-page .topBar {
        flex-wrap: wrap;
        height: auto !important;
        gap: 6px;
    }

    .battle-page .row > [class^="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .rightChat,
    .leftChat {
        margin-left: 0;
        margin-right: 0;
    }

    .battle-page .negativeMargin {
        margin-left: 0;
        margin-right: 0;
    }

    .battle-page .game-panel {
        height: auto !important;
        min-height: 180px;
    }

    .battle-page #scrollableBattleWindow {
        min-height: 460px !important;
    }

    .battle-page #messagesContainer {
        height: 240px !important;
    }

    .battle-page .combat-rails {
        flex-wrap: wrap;
        justify-content: center;
    }

    .battle-page .combat-progress {
        width: 46%;
    }

    .dontSquishPhones {
        width: auto;
        height: auto !important;
    }
}

@media only screen and (max-width: 480px) {
    .battle-page .input-group {
        flex-wrap: wrap;
    }

    .battle-page .input-group > .btn,
    .battle-page .input-group > .form-control,
    .battle-page .input-group > select {
        flex: 1 0 100%;
        width: 100%;
        margin-bottom: 6px;
    }

    .battle-page #chatButton {
        margin-right: 0 !important;
    }

    .battle-page .combat-progress {
        width: 100%;
    }

    .battle-page .combat-actions {
        flex-wrap: wrap;
    }

    .battle-page .combat-btn {
        flex: 1 0 100%;
    }
}

@media only screen and (min-width: 1000px) {
    .desktopSquish {
        margin-left: 100px;
        margin-right: 100px;
    }
}

@media only screen and (min-width: 1500px) {
    .desktopSquish {
        margin-left: 180px;
        margin-right: 180px;
    }
}
