/* ===== CATPPUCCIN MACCHIATO THEME ===== */
/* https://github.com/catppuccin/catppuccin */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Catppuccin Macchiato Palette */
    --base:     #24273a;
    --mantle:   #1e2030;
    --crust:    #181926;
    --surface0: #363a4f;
    --surface1: #494d64;
    --surface2: #5b6078;
    --overlay0: #6e738d;
    --overlay1: #8087a2;
    --overlay2: #939ab7;
    --subtext0: #a5adcb;
    --subtext1: #b8c0e0;
    --text:     #cad3f5;

    /* Catppuccin Macchiato Accent Colors */
    --lavender: #b7bdf8;
    --blue:     #8aadf4;
    --sapphire: #7dc4e4;
    --sky:      #91d7e3;
    --teal:     #8bd5ca;
    --green:    #a6da95;
    --yellow:   #eed49f;
    --peach:    #f5a97f;
    --maroon:   #ee99a0;
    --red:      #ed8796;
    --mauve:    #c6a0f6;
    --pink:     #f5bde6;
    --flamingo: #f0c6c6;
    --rosewater:#f4dbd6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--base);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

.app-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HOVER REVEAL ZONE (header + status bars) ========== */
.hover-reveal-zone {
    position: relative;
    z-index: 50;
    max-height: 4px;
    overflow: hidden;
    transition: max-height 0.35s ease, box-shadow 0.35s ease;
    background: var(--mantle);
    box-shadow: none;
}

.hover-reveal-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue), var(--lavender), var(--mauve));
    opacity: 0.5;
    z-index: 51;
    transition: opacity 0.35s ease;
}

.hover-reveal-zone:hover::before {
    opacity: 0;
}

.hover-reveal-zone:hover {
    max-height: 200px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ========== MINIMAL TOP BAR ========== */
.minimal-header {
    background: var(--mantle);
    border-bottom: 1px solid var(--surface0);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--lavender);
    letter-spacing: 0.3px;
}

.header-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    background: var(--surface0);
    border: 1px solid var(--surface1);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========== INLINE STATS ========== */
.inline-stats {
    display: flex;
    gap: 6px;
    font-size: 11px;
}

.inline-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--surface0);
    border-radius: 20px;
    border: 1px solid var(--surface1);
    transition: border-color 0.2s;
}

.inline-stat:hover {
    border-color: var(--overlay0);
}

.inline-stat-label {
    font-size: 12px;
}

.inline-stat-value {
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* ========== HEADER CONTROLS ========== */
.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--subtext0);
}

.status-chip-dot {
    width: 6px;
    height: 6px;
    background: var(--overlay0);
    border-radius: 50%;
    transition: all 0.3s;
}

.status-chip-dot.connected {
    background: var(--green);
    box-shadow: 0 0 8px rgba(166, 218, 149, 0.6);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(166, 218, 149, 0.6); }
    50%       { box-shadow: 0 0 0 5px rgba(166, 218, 149, 0); }
}

/* ========== STATUS BARS ========== */
.monitor-status-bar {
    background: rgba(238, 212, 159, 0.08);
    border-bottom: 1px solid rgba(238, 212, 159, 0.2);
    padding: 7px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--yellow);
    font-weight: 600;
}

.monitor-indicator {
    width: 7px;
    height: 7px;
    background: var(--yellow);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(238, 212, 159, 0.7);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(238, 212, 159, 0);
    }
}

.recording-indicator-bar {
    background: rgba(237, 135, 150, 0.1);
    border-bottom: 1px solid rgba(237, 135, 150, 0.25);
    padding: 7px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--red);
    letter-spacing: 1px;
}

.rec-pulse {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(237, 135, 150, 0.7); }
    50%       { box-shadow: 0 0 0 6px rgba(237, 135, 150, 0); }
}

/* ========== BATTLE DISPLAY ========== */
.battle-display {
    padding: 10px 20px;
    background: var(--mantle);
    border-bottom: 1px solid var(--surface0);
    position: relative;
}

.battle-hide-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--surface1);
    background: var(--surface0);
    color: var(--overlay2);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
    padding: 0;
    font-family: 'Nunito', sans-serif;
}

.battle-hide-btn:hover {
    background: var(--surface1);
    color: var(--red);
    border-color: var(--red);
}

.battle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    gap: 10px;
}

/* Teams row: host + VS + guest */
.battle-teams-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    background: linear-gradient(135deg, rgba(30, 32, 48, 0.95), rgba(54, 58, 79, 0.8));
    border: 1px solid var(--surface1);
    border-radius: 12px;
    padding: 12px 20px;
}

.battle-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-member-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.team-separator {
    color: var(--overlay2);
    font-weight: 800;
    font-size: 14px;
    margin: 0 4px;
    flex-shrink: 0;
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--surface1);
    background: var(--surface0);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.battle-vs-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.battle-vs {
    font-size: 11px;
    font-weight: 800;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(237, 135, 150, 0.15);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(237, 135, 150, 0.3);
    flex-shrink: 0;
}

.battle-stream-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--overlay2);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Battle mid row: supporters | bar+timer | supporters */
.battle-mid-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.battle-mid-row .battle-bar-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.battle-mid-row .battle-participants {
    width: 140px;
    flex-shrink: 0;
}

.battle-mid-row .host-participants {
    text-align: right;
}

.battle-mid-row .host-participants .participants-list {
    justify-content: flex-end;
}

.battle-mid-row .guest-participants {
    text-align: left;
}

.battle-mid-row .guest-participants .participants-list {
    justify-content: flex-start;
}

.team-bar {
    width: 100%;
    height: 28px;
    background: var(--surface0);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    border: 1px solid var(--surface1);
}

.team-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--crust);
    font-family: 'JetBrains Mono', monospace;
}

.host-bar {
    background: linear-gradient(90deg, var(--red), var(--maroon));
    justify-content: flex-end;
    padding-right: 10px;
}

.guest-bar {
    background: linear-gradient(90deg, var(--blue), var(--sapphire));
    justify-content: flex-start;
    padding-left: 10px;
}

/* Battle timer */
.battle-timer {
    font-size: 13px;
    font-weight: 800;
    color: var(--lavender);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 4px;
}

.battle-timer-icon {
    color: var(--red);
    font-size: 10px;
}

/* Battle supporters / participants */
.battle-participants {
    min-width: 0;
}

.participants-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--overlay2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.participants-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
}

.participant-chip {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 16px;
    padding: 3px 6px 3px 3px;
    transition: background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.participant-chip:hover {
    background: var(--surface1);
}

.host-participants .participant-chip {
    border-color: rgba(237, 135, 150, 0.2);
}

.guest-participants .participant-chip {
    border-color: rgba(138, 173, 244, 0.2);
}

.participant-rank {
    font-size: 9px;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--crust);
    font-family: 'JetBrains Mono', monospace;
}

.host-participants .participant-rank {
    background: var(--red);
}

.guest-participants .participant-rank {
    background: var(--blue);
}

.participant-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface1);
    flex-shrink: 0;
}

.participant-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--subtext1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

/* ========== FLOATING CONTROL PANEL ========== */
.floating-panel {
    position: fixed;
    top: 50px;
    right: -320px;
    width: 300px;
    height: calc(100vh - 50px);
    background: var(--mantle);
    border-left: 1px solid var(--surface0);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.floating-panel:hover,
.floating-panel.open { right: 0; }

/* Panel pull-tab toggle on left edge */
.panel-pull-tab {
    position: absolute;
    left: -36px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 72px;
    background: var(--crust);
    border: 1px solid var(--surface0);
    border-right: none;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--overlay1);
    font-size: 16px;
    transition: all 0.2s;
    z-index: 101;
}

.panel-pull-tab:hover {
    background: var(--surface0);
    color: var(--lavender);
    width: 40px;
    left: -40px;
}

.panel-pull-tab .tab-icon {
    transition: transform 0.3s;
}

.floating-panel:hover .panel-pull-tab .tab-icon,
.floating-panel.open .panel-pull-tab .tab-icon {
    transform: rotate(180deg);
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--surface0);
    padding: 0 12px;
    background: var(--crust);
}

.panel-tab {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: var(--overlay1);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    letter-spacing: 0.3px;
}

.panel-tab:hover { color: var(--subtext1); }

.panel-tab.active {
    color: var(--lavender);
    border-bottom-color: var(--lavender);
}

.panel-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.panel-section { display: none; }
.panel-section.active { display: block; }

/* ========== FORM CONTROLS ========== */
.field { margin-bottom: 12px; }

.field-label {
    display: block;
    font-size: 9px;
    color: var(--overlay1);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.field-input {
    width: 100%;
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 12px;
    font-family: 'Nunito', sans-serif;
    transition: border-color 0.2s;
}

.field-input::placeholder { color: var(--overlay0); }
.field-input:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 2px rgba(183, 189, 248, 0.15);
}

.action-btn {
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
    letter-spacing: 0.3px;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--lavender));
    color: var(--crust);
}

.action-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(138, 173, 244, 0.4);
}

.action-btn-secondary {
    background: var(--surface0);
    border: 1px solid var(--surface1);
    color: var(--subtext1);
}

.action-btn-secondary:hover {
    background: var(--surface1);
    color: var(--text);
    border-color: var(--overlay0);
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-size: 11px;
    color: var(--subtext0);
    cursor: pointer;
    font-weight: 600;
}

.field-checkbox input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--lavender);
}

.info-btn-mini {
    background: rgba(183, 189, 248, 0.1);
    border: 1px solid rgba(183, 189, 248, 0.25);
    border-radius: 6px;
    padding: 4px 8px;
    color: var(--lavender);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: all 0.2s;
    font-family: 'Nunito', sans-serif;
}

.info-btn-mini:hover {
    background: rgba(183, 189, 248, 0.2);
}

.info-box-mini {
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 8px;
    padding: 10px;
    font-size: 10px;
    line-height: 1.6;
    color: var(--subtext0);
    margin-top: 6px;
}

.stat-row {
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.stat-row-label { color: var(--subtext0); font-weight: 600; }
.stat-row-value {
    font-weight: 800;
    color: var(--lavender);
    font-family: 'JetBrains Mono', monospace;
}

/* ========== MAIN CONTENT GRID ========== */
.content-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1.8fr 1fr;
    gap: 10px;
    padding: 10px;
    background: var(--base);
    overflow: hidden;
}

.content-box {
    background: var(--mantle);
    border: 1px solid var(--surface0);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.box-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--surface0);
    font-size: 10px;
    font-weight: 800;
    color: var(--overlay2);
    letter-spacing: 1px;
    text-transform: uppercase;
    background: var(--crust);
}

.box-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.video-content {
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ========== TOP GIFTERS LEADERBOARD ========== */
.top-gifters-wrapper {
    position: relative;
    height: 120px;
    flex-shrink: 0;
    background: var(--crust);
    z-index: 5;
}

.top-gifters-wrapper:hover .top-gifters-expand {
    max-height: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.top-gifters-wrapper:hover .top-gifters-fade {
    opacity: 0;
}

.top-gifters-expand {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--crust);
    border-radius: 0 0 10px 10px;
    transition: max-height 0.4s ease, box-shadow 0.3s ease;
    z-index: 6;
}

.top-gifters-list {
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-gifters-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--mantle));
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 7;
}

.top-gifter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    transition: background 0.15s;
}

.top-gifter-row:hover {
    background: var(--surface0);
}

.top-gifter-rank {
    font-size: 11px;
    font-weight: 800;
    min-width: 16px;
    color: var(--overlay2);
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
}

.top-gifter-rank.rank-1 { color: var(--yellow); }
.top-gifter-rank.rank-2 { color: var(--subtext1); }
.top-gifter-rank.rank-3 { color: var(--peach); }

.top-gifter-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--surface1);
    flex-shrink: 0;
}

.top-gifter-name {
    flex: 1;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.top-gifter-value {
    font-weight: 800;
    color: var(--overlay2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    flex-shrink: 0;
}

/* ========== CHAT & NOTIFICATIONS ========== */
.toggleable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.toggleable-header:hover {
    background: var(--surface0);
}

.toggle-arrow {
    font-size: 9px;
    color: var(--overlay1);
    transition: transform 0.2s;
}

.section-hidden {
    display: none !important;
}

.chatcontainer,
.notificationcontainer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notificationcontainer {
    max-height: 320px;
    min-height: 320px;
}

.chatcontainer > div,
.notificationcontainer > div {
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.5;
    transition: background 0.15s;
}

.chatcontainer > div:hover,
.notificationcontainer > div:hover {
    background: var(--surface1);
}

.miniprofilepicture {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid var(--surface1);
    object-fit: cover;
}

.usernamelink {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

.usernamelink:hover {
    color: var(--lavender);
    text-decoration: underline;
}

/* ========== GIFTS ========== */
.giftcontainer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.giftcontainer > div {
    background: var(--surface0);
    border: 1px solid var(--surface1);
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: background 0.15s;
}

.giftcontainer > div:hover {
    background: var(--surface1);
}

.giftcontainer > div table { width: 100%; }
.giftcontainer > div td { vertical-align: middle; padding: 2px; }
.giftcontainer > div td:first-child { width: 76px; }

.gifticon {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--surface1);
}

/* ========== VIDEO PLAYER ========== */
#dplayer.player-hidden {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

#dplayer {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    background: var(--crust);
    min-height: 500px;
    position: relative;
}

#dplayer .dplayer-video-wrap {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

#dplayer video {
    max-width: 100% !important; max-height: 100% !important;
    width: 100% !important; height: 100% !important;
    object-fit: contain !important;
}

/* DPlayer accent color overrides */
#dplayer .dplayer-bar-inner { background: var(--lavender) !important; }
#dplayer .dplayer-played  { background: var(--blue) !important; }
#dplayer .dplayer-thumb   { background: var(--lavender) !important; }

#dplayer.portrait-mode { display: flex !important; justify-content: center !important; align-items: center !important; }
#dplayer.portrait-mode .dplayer-video-wrap { display: flex !important; justify-content: center !important; align-items: center !important; }
#dplayer.portrait-mode video { width: auto !important; height: 100% !important; max-width: 100% !important; object-fit: contain !important; }

#dplayer.landscape-mode video { width: 100% !important; height: auto !important; max-height: 100% !important; object-fit: contain !important; }

#dplayer.square-mode .dplayer-video-wrap { aspect-ratio: 1/1 !important; max-width: 100% !important; max-height: 100% !important; }
#dplayer.square-mode video { width: 100% !important; height: 100% !important; object-fit: cover !important; aspect-ratio: 1/1 !important; }

#dplayer .dplayer-controller { position: absolute !important; bottom: 0 !important; left: 0 !important; right: 0 !important; z-index: 10 !important; }
#dplayer .dplayer-video { width: 100% !important; height: 100% !important; }
#dplayer .dplayer-video-wrap video, #dplayer .dplayer-video video { margin: 0 auto !important; }

.video-box {
    flex: 1;
    background: var(--crust);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--overlay0);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    min-height: 500px;
}

/* ========== TOAST (if used in app.js) ========== */
.toast {
    background: var(--surface0) !important;
    border: 1px solid var(--surface1) !important;
    color: var(--text) !important;
    border-radius: 8px !important;
    font-family: 'Nunito', sans-serif !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface0); }
::-webkit-scrollbar-thumb { background: var(--surface1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--overlay0); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .content-grid { grid-template-columns: 1fr 1.6fr 1fr; }
}

@media (max-width: 1200px) {
    .content-grid { grid-template-columns: 1fr; }
    .inline-stats { gap: 8px; }
    #dplayer, .video-box { min-height: 450px; }
}

@media (max-width: 768px) {
    .minimal-header { flex-wrap: wrap; gap: 8px; }
    .inline-stats { order: 3; width: 100%; justify-content: space-around; }
    .floating-panel { width: 100%; right: -100%; }
    .floating-panel.open { right: 0; }
    #dplayer, .video-box { min-height: 400px; }
}
