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

html {
    overflow-x: hidden;
    max-width: 100%;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-panel: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --accent-color: #9146ff;
    --success-color: #00c853;
    --warning-color: #ffa726;
    --error-color: #f44336;
    --progress-bg: #e0e0e0;
}

body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-panel: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #444444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Header */
header {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 3px solid #9147ff;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(145, 70, 255, 0.07);
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 0;
}

header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #9147ff;
    letter-spacing: -0.2px;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.header-brand-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-meta {
    display: flex;
    align-items: center;
    padding: 10px 20px 14px;
    gap: 12px;
}

.language-selector {
    display: flex;
    align-items: center;
}

.language-selector select {
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.language-selector select:hover {
    border-color: #9147ff;
    color: var(--text-primary);
}

.language-selector select:focus {
    outline: none;
    border-color: #9147ff;
    box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.2);
}

.status-bar {
    display: flex;
    align-items: flex-start;
    padding: 8px 20px 10px;
    background: rgba(0, 0, 0, 0.06);
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    gap: 8px;
    flex-wrap: wrap;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.status-center {
    flex: 1;
    min-width: 80px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#connection-indicator {
    font-size: 0.78rem;
    font-weight: 600;
}

#connection-indicator.connected {
    color: var(--success-color);
}

#connection-indicator.disconnected {
    color: var(--error-color);
}

.proxy-badge {
    background: #4a90e2;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}


.full-width {
    width: 100%;
}

.help-text-inline {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
}

.secondary-btn {
    padding: 8px 12px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.secondary-btn:hover {
    background-color: var(--hover-bg);
}

.verify-result {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
}

.verify-result.success {
    color: var(--success-color);
}

.verify-result.error {
    color: var(--error-color);
}

.verify-result.loading {
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.tab-button {
    flex: 1;
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.tab-button:hover {
    background: var(--bg-secondary);
}

.tab-button.active {
    background: #9147ff;
    color: white;
    border-color: #9147ff;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.panel h2 {
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #9147ff;
    padding-bottom: 8px;
}

/* Main Tab Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto auto auto auto;
    gap: 20px;
    min-height: 70vh;
    width: 100%;
    min-width: 0;
}
.main-grid > * { min-width: 0; }

.stats-panel {
    grid-column: 1 / -1;
    grid-row: 1;
}

.quick-controls-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 12px 16px;
}

.progress-panel {
    grid-column: 1;
    grid-row: 3;
}

.channel-points-panel-main {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
}

.login-panel {
    grid-column: 1 / -1;
    grid-row: 4;
}

.cp-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cp-header-row h2 {
    margin: 0;
    border: none;
    padding: 0;
    white-space: nowrap;
}

.cp-divider {
    height: 1px;
    background: var(--border-color, rgba(255,255,255,0.08));
    margin: 10px 0 8px;
}

.login-panel.is-logged-in {
    display: none;
}
.login-panel.is-logged-in ~ .channel-points-panel-main {
    grid-column: 2;
}

.channels-panel {
    grid-column: 1;
    grid-row: 5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.wanted-panel {
    grid-column: 2;
    grid-row: 5;
}

.console-panel {
    grid-column: 1 / -1;
    grid-row: 6;
}

/* When logged in, login panel is hidden — collapse rows */
.main-grid:has(.login-panel.is-logged-in) .channels-panel { grid-row: 4; }
.main-grid:has(.login-panel.is-logged-in) .wanted-panel  { grid-row: 4; }
.main-grid:has(.login-panel.is-logged-in) .console-panel { grid-row: 5; }

/* Quick Controls */
.quick-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
    width: 100%;
}
.quick-controls-row > * { min-width: 0; }

.qc-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
    min-height: 62px;
}

.qc-btn:hover {
    background: #9147ff;
    border-color: #9147ff;
    color: #fff;
}

.qc-btn-warning:hover {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.qc-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.qc-labels {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
}

.qc-labels strong {
    font-size: 0.85rem;
    font-weight: 600;
}

.qc-labels small {
    font-size: 0.72rem;
    color: #adadb8;
}

.qc-btn:hover .qc-labels small {
    color: rgba(255,255,255,0.8);
}

.qc-btn--active {
    background: #9147ff;
    border-color: #9147ff;
    color: #fff;
}

.qc-btn--active .qc-labels small {
    color: rgba(255,255,255,0.75);
}

.qc-btn--active:hover {
    background: #7d3ce0;
    border-color: #7d3ce0;
}

.qc-btn--active-warn {
    background: #e09900;
    border-color: #e09900;
    color: #fff;
}

.qc-btn--active-warn .qc-labels small {
    color: rgba(255,255,255,0.75);
}

.qc-btn--active-warn:hover {
    background: #c98800;
    border-color: #c98800;
}

.qc-btn--active-green {
    background: #1a7a3a;
    border-color: #22a050;
    color: #fff;
}

.qc-btn--active-green .qc-labels small {
    color: rgba(255,255,255,0.75);
}

.qc-btn--active-green:hover {
    background: #22a050;
    border-color: #22a050;
}

.qc-status {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: #adadb8;
    font-style: italic;
    text-align: center;
}

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

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 12px 12px;
    text-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: background 0.15s;
}
.stat-card:hover { background: rgba(145, 70, 255, 0.06); border-color: #9147ff; }

.stat-icon {
    font-size: 1.4rem;
    line-height: 1;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #9147ff;
    line-height: 1;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.62rem;
    color: #adadb8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.3;
}

/* Login */
#login-form input {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#login-form button,
#oauth-confirm {
    width: 100%;
    padding: 12px;
    background: #9147ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#login-form button:hover,
#oauth-confirm:hover {
    opacity: 0.9;
}

.oauth-code {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 15px 0;
    letter-spacing: 4px;
}

/* Drop Progress */
.drop-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.drop-game {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 13px;
}

.drop-info-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.drop-game-thumb {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.drop-info-body {
    flex: 1;
    min-width: 0;
}

.drop-campaign-link {
    color: #9147ff;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-bottom: 1px dashed rgba(145,70,255,0.4);
}

.drop-campaign-link:hover {
    color: #b066ff;
    border-bottom-color: rgba(145,70,255,0.8);
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 22px;
    background: var(--progress-bg);
    border-radius: 11px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9147ff, var(--success-color));
    transition: width 0.3s ease;
}

.progress-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    pointer-events: none;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}

.progress-text {
    color: var(--text-secondary);
}

.progress-time {
    color: var(--text-secondary);
}

.progress-drops-left {
    text-align: center;
    font-size: 0.78rem;
    color: #9147ff;
    font-weight: 600;
    margin-top: 4px;
    transition: opacity 0.15s;
}
.progress-drops-left[title]:hover {
    opacity: 0.75;
    text-decoration: underline dotted;
}

/* Console Output */
.console-output {
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
}

.console-output div {
    margin-bottom: 2px;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.panel-header-row h2 { margin-bottom: 0; }

.collapse-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 8px;
    transition: all 0.15s;
    line-height: 1;
}
.collapse-toggle:hover {
    border-color: #9147ff;
    color: #9147ff;
}
.collapse-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
}

/* Channels List */
.channels-list {
    flex: 1;
    overflow-y: auto;
    min-height: 150px;
}

/* Channel Game Cards (WQ style) */
.ch-game-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
    transition: border-color 0.15s;
    position: relative;
}
.ch-game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ch-cover, none) center/cover no-repeat;
    filter: blur(24px) saturate(0.7);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 0;
}
.ch-game-card.has-cover::before { opacity: 0.28; }
.ch-game-card:hover { border-color: #6d6d7a; }
.ch-game-card--open { border-color: #9147ff; }
.ch-game-card--open:hover { border-color: #9147ff; }

.ch-game-header {
    position: relative;
    z-index: 1;
}

.ch-game-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    user-select: none;
}

.game-group-chevron {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.game-icon {
    width: 28px;
    height: 37px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.game-group-info {
    flex: 1;
}

.game-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.game-group-stats {
    font-size: 11px;
    color: var(--text-secondary);
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    z-index: 1;
}
.channel-item:hover { background: var(--bg-panel); }
.channel-item.watching { background: rgba(145, 70, 255, 0.1); }
.channel-item.offline { opacity: 0.55; }

.channel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #9147ff;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.channel-item.watching .channel-avatar {
    box-shadow: 0 0 0 2px #9147ff;
}

.channel-body { flex: 1; min-width: 0; }

.channel-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.channel-name {
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ch-badge--watching {
    font-size: 0.65rem;
    font-weight: 700;
    color: #9147ff;
    background: rgba(145, 70, 255, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
}

.channel-viewers-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 2px 7px;
    flex-shrink: 0;
    white-space: nowrap;
}
.channel-item.watching .channel-viewers-pill {
    background: #9147ff;
}

.channel-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 0;
}
.channel-badge.drops {
    background: var(--success-color);
    color: white;
}
.channel-badge.acl {
    background: #9147ff;
    color: white;
}

/* Inventory Filters */
.inventory-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.filter-checkbox span {
    font-size: 14px;
    color: var(--text-primary);
}

.filter-search {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.game-dropdown-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.game-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 0;
}

.game-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #9147ff;
    color: white;
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.2s;
}

.game-tag:hover {
    background: #7d39e0;
}

.game-tag-name {
    line-height: 1.2;
}

.game-tag-remove {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.game-tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

#inventory-game-search {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
}

.game-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.focused {
    background: var(--bg-secondary);
}

.dropdown-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.dropdown-item label {
    flex: 1;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
}

.dropdown-item.no-results {
    color: var(--text-secondary);
    cursor: default;
    text-align: center;
    font-style: italic;
}

.dropdown-item.no-results:hover {
    background: none;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.campaign-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.campaign-header {
    padding: 12px 14px;
    background: var(--bg-secondary);
}

.campaign-game {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 15px;
    min-width: 0;
}

.campaign-game-name {
    flex: 1;
    min-width: 0;
}

.campaign-game .game-icon {
    width: 44px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 4px;
}

.campaign-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.campaign-name-link {
    font-size: 12px;
    color: #9147ff;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 5px;
}

.campaign-name-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.external-link-icon {
    font-size: 12px;
    opacity: 0.7;
}

.campaign-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

.campaign-badge.linked {
    background: rgba(0, 200, 83, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(0, 200, 83, 0.3);
    cursor: default;
}

.campaign-badge.not-linked {
    background: rgba(255, 167, 38, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(255, 167, 38, 0.4);
    cursor: pointer;
}

.campaign-badge.not-linked:hover {
    background: rgba(255, 167, 38, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255, 167, 38, 0.25);
}

.farm-toggle-btn {
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    min-width: 88px;
    text-align: center;
}
.farm-toggle-btn .farm-action-label { display: none; }
.farm-toggle-btn:hover .farm-state-label { display: none; }
.farm-toggle-btn:hover .farm-action-label { display: inline; }
.farm-toggle-btn.farming {
    background: rgba(61, 220, 132, 0.12);
    border-color: rgba(61, 220, 132, 0.35);
    color: #3ddc84;
}
.farm-toggle-btn.farming:hover {
    background: rgba(220, 80, 80, 0.12);
    border-color: rgba(220, 80, 80, 0.35);
    color: #e05555;
}
.farm-toggle-btn.skipped {
    background: rgba(220, 80, 80, 0.1);
    border-color: rgba(220, 80, 80, 0.3);
    color: #e05555;
}
.farm-toggle-btn.skipped:hover {
    background: rgba(61, 220, 132, 0.12);
    border-color: rgba(61, 220, 132, 0.35);
    color: #3ddc84;
}

.campaign-status {
    padding: 8px 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--border-color);
}
.campaign-status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.campaign-status-text {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}
.campaign-claimed-count {
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}
.campaign-status-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.campaign-timing {
    padding: 4px 15px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: auto;
}

.campaign-progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px 8px;
    font-size: 0.8rem;
}
.campaign-remaining-drops {
    color: #9147ff;
    font-weight: 600;
}
.campaign-time-est {
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.75rem;
}

.campaign-drops {
    padding: 15px;
}


.empty-message-small {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
    grid-column: 1 / -1;
}

/* Wanted Items Tree / Groups */
/* ── Wanted Queue (compact list) ── */
#wanted-items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wq-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.1s;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    cursor: default !important;
    gap: 0 !important;
    position: relative;
}
.wq-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--wq-cover, none) center/cover no-repeat;
    filter: blur(20px) saturate(0.6);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 0;
}
.wq-row.has-cover::before { opacity: 0.18; }
.wq-row:first-child { border-color: #9147ff; }
.wq-row.dragging { opacity: 0.4; }
.wq-row:hover {
    border-color: #6d6d7a;
    transform: translateY(-1px);
}
.wq-row:first-child:hover { border-color: #9147ff; }

.wq-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
}

.wq-drag-handle {
    color: #4d4d5a;
    cursor: grab;
    font-size: 1rem;
    flex-shrink: 0;
    padding: 0 2px;
}
.wq-drag-handle:hover { color: #adadb8; }

.wq-badge {
    background: #9147ff;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.wq-icon {
    width: 28px;
    height: 37px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.wq-icon-placeholder {
    width: 24px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.wq-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wq-count {
    font-size: 0.75rem;
    color: #adadb8;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 7px;
    flex-shrink: 0;
}

.wq-toggle {
    font-size: 0.75rem;
    color: #adadb8;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.wq-move {
    background: none;
    border: none;
    color: #4d4d5a;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.wq-move:hover:not(:disabled) { color: #9147ff; }
.wq-move:disabled { opacity: 0.2; cursor: default; }

.wq-remove {
    background: none;
    border: none;
    color: #4d4d5a;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.wq-remove:hover { color: #eb4a4a; }

.wq-body {
    border-top: 1px solid var(--border-color);
    padding: 8px 12px 10px 46px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wq-campaign { }

.wq-campaign-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #9147ff;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}
.wq-campaign-link:hover { text-decoration: underline; }

.wq-drop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    background: var(--bg-panel);
    border-radius: 5px;
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.wq-drop-name {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}

.wq-benefit {
    background: rgba(145,70,255,0.15);
    color: #9147ff;
    border-radius: 8px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}


.drop-item {
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border-left: 3px solid var(--border-color);
}

.drop-item.claimed {
    border-left-color: var(--success-color);
    opacity: 0.7;
}

.drop-item.active {
    border-left-color: #9147ff;
}

.drop-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sub-required-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(156, 39, 176, 0.85);
    border: 1px solid rgba(156, 39, 176, 0.5);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.drop-item-info {
    flex: 1;
    min-width: 0;
}

.benefits-list {
    margin-top: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-panel);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.benefit-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.benefit-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.benefit-type {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Settings */
.settings-container {
    max-width: 100%;
}

.settings-category-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9147ff;
    padding: 6px 2px 4px;
    margin-top: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.settings-grid > .settings-section {
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.settings-row-label {
    min-width: 160px;
    color: #adadb8;
    font-size: .88rem;
    flex-shrink: 0;
}
.settings-select {
    flex: 1;
    background: #0e0e10;
    border: 1px solid #3d3d4a;
    border-radius: 6px;
    padding: 6px 10px;
    color: #efeff1;
    font-size: .88rem;
}
@media (max-width: 600px) {
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .settings-row-label {
        min-width: unset;
    }
    .settings-select, .settings-row input[type="number"] {
        width: 100%;
        max-width: 100% !important;
    }
}

.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.form-label {
    min-width: 72px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.form-input {
    flex: 1;
    min-width: 0;
}

.settings-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.settings-section h2 {
    margin-bottom: 15px;
}

.settings-section label {
    display: block;
    margin-bottom: 15px;
}

.settings-section input[type="checkbox"] {
    margin-right: 8px;
}

.settings-section select,
.settings-section input[type="number"],
.settings-section input[type="text"],
.settings-section input[type="password"] {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    margin-left: 10px;
}
.form-row .form-input {
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: .9rem;
    margin-left: 0;
    outline: none;
    transition: border-color 0.15s;
}
.form-row .form-input:focus {
    border-color: #9147ff;
}

.list-manager {
    margin-top: 20px;
}

.game-list {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
}

.game-item {
    padding: 8px;
    margin-bottom: 5px;
    background: var(--bg-panel);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-item button {
    padding: 4px 8px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.action-button {
    padding: 12px 24px;
    margin-right: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
}

.action-button.primary {
    background: #9147ff;
    color: white;
    border-color: #9147ff;
}

.action-button:hover {
    opacity: 0.9;
}

/* Help Wiki */
.help-wiki {
    width: 100%;
}

.help-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Sidebar TOC */
.help-toc {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.help-toc-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.help-toc-link {
    display: block;
    padding: 5px 8px;
    margin-bottom: 2px;
    border-radius: 5px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

.help-toc-link:hover {
    background: var(--bg-secondary);
    color: #9147ff;
    text-decoration: none;
}

/* Main body */
.help-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Section */
.help-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 16px;
}

.help-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.help-section-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.help-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9147ff;
    margin: 0;
}

.help-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.help-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 12px;
}

.help-intro {
    font-size: 0.95rem !important;
    color: var(--text-primary) !important;
}

.help-section a {
    color: #9147ff;
    text-decoration: none;
}

.help-section a:hover {
    text-decoration: underline;
}

/* Steps */
.help-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.help-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.help-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #9147ff;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.help-step-body {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-step-body strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.help-step-body p {
    margin: 4px 0 0;
    font-size: 0.88rem !important;
}

/* Cards grid */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.help-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
}

.help-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.help-card p {
    font-size: 0.83rem !important;
    margin: 0 !important;
    color: var(--text-secondary);
}

/* Table */
.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    margin: 12px 0 16px;
}

.help-table thead tr {
    background: var(--bg-secondary);
}

.help-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
}

.help-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: top;
}

.help-table tr:last-child td {
    border-bottom: none;
}

.help-table code {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: monospace;
    font-size: 0.85em;
    color: #9147ff;
}

/* Inline list */
.help-list {
    margin: 8px 0 8px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.help-list li {
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Code block */
.help-code {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #9147ff;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin: 10px 0;
    word-break: break-all;
}

/* Remote Access step blocks */
.help-step-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    margin: 12px 0;
}
.help-step-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9147ff;
    margin-bottom: 8px;
}
.help-step-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.help-tab-btn {
    padding: 4px 12px;
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.help-tab-btn.active, .help-tab-btn:hover {
    background: #9147ff;
    color: #fff;
    border-color: #9147ff;
}

/* Remote Access Accordion */
.help-accordion {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
}
.help-accordion-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    transition: background 0.15s;
}
.help-accordion-btn:hover {
    background: var(--bg-tertiary, var(--bg-secondary));
    filter: brightness(1.08);
}
.help-accordion-badge {
    font-size: 0.72rem;
    font-weight: 500;
    color: #3ddc84;
    background: rgba(61,220,132,0.12);
    border-radius: 4px;
    padding: 2px 7px;
}
.help-accordion-arrow {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}
.help-accordion-body {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
}

/* Note / callout */
.help-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid #9147ff;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 14px 0 0;
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-note.help-note-warn {
    border-left-color: var(--warning-color);
}

.help-note strong {
    color: var(--text-primary);
}

.help-note-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Footer links */
.help-links {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.help-links a {
    display: inline-block;
    padding: 8px 16px;
    background: #9147ff;
    color: white !important;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity 0.15s;
}

.help-links a:hover {
    opacity: 0.85;
    text-decoration: none !important;
}

/* Responsive: collapse TOC on small screens */
@media (max-width: 720px) {
    .help-layout {
        flex-direction: column;
    }
    .help-toc {
        width: 100%;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .help-toc-title {
        width: 100%;
        margin-bottom: 4px;
    }
    .help-section {
        padding: 20px 18px;
    }
    .help-cards {
        grid-template-columns: 1fr;
    }
}

/* Games to Watch Styles */
.help-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.games-filter {
    margin-bottom: 20px;
}

.games-filter input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    margin-left: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.small-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.small-btn:hover {
    background: #9147ff;
    color: white;
    border-color: #9147ff;
}

.games-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.selected-games,
.available-games {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background: var(--bg-secondary);
}

.selected-games h3,
.available-games h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

/* Sortable list for selected games */
.sortable-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.sortable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s;
    user-select: none;
}

.sortable-item:hover {
    border-color: #9147ff;
    background: rgba(145, 70, 255, 0.1);
}

.sortable-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.drag-handle {
    font-size: 18px;
    color: var(--text-secondary);
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.priority-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #9147ff;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.game-name {
    flex: 1;
    font-weight: 500;
}

.remove-btn {
    padding: 4px 8px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
}

/* Checkbox list for available games */
.checkbox-list {
    max-height: 400px;
    overflow-y: auto;
}

.game-checkbox {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: var(--bg-panel);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.game-checkbox:hover {
    background: rgba(145, 70, 255, 0.1);
}

.game-checkbox input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.game-checkbox span {
    user-select: none;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top-color: #9147ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 10px;
}

/* Manual Mode Styles */
.mode-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

#auto-mode-badge {
    background: rgba(145, 70, 255, 0.15);
    color: #9147ff;
    border: 1px solid #9147ff;
}

#manual-mode-badge {
    background: rgba(255, 167, 38, 0.15);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.manual-mode-controls {
    background: rgba(255, 167, 38, 0.1);
    border: 2px solid var(--warning-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.manual-mode-info {
    color: var(--text-primary);
    font-size: 14px;
}

.manual-mode-info strong {
    color: var(--warning-color);
}

.exit-manual-btn {
    padding: 8px 16px;
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.exit-manual-btn:hover {
    background: #9147ff;
    color: white;
    border-color: #9147ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(145, 70, 255, 0.3);
}

/* Utilities */
.hidden {
    display: none !important;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .login-panel,
    .channel-points-panel-main,
    .stats-panel,
    .progress-panel,
    .console-panel,
    .channels-panel,
    .wanted-panel {
        grid-column: 1;
        grid-row: auto;
    }

    /* Override high-specificity desktop rules */
    .login-panel.is-logged-in ~ .channel-points-panel-main { grid-column: 1; grid-row: auto; }
    .main-grid:has(.login-panel.is-logged-in) .channels-panel { grid-row: auto; }
    .main-grid:has(.login-panel.is-logged-in) .wanted-panel  { grid-row: auto; }
    .main-grid:has(.login-panel.is-logged-in) .console-panel { grid-row: auto; }

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

@media (max-width: 1100px) and (min-width: 769px) {
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer */
.footer {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 20px;
    padding: 15px 20px;
    font-size: 13px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-version {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-version span {
    color: var(--text-secondary);
}

#current-version {
    font-weight: 500;
    color: var(--text-primary);
}

.update-indicator {
    padding: 4px 10px;
    background: var(--warning-color);
    color: white;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.update-indicator a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.update-indicator a:hover {
    text-decoration: underline;
}

#latest-version {
    font-weight: 500;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    color: #9147ff;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
/* System Tab */
.system-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.system-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    flex: 1;
    min-width: 200px;
}

.system-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.system-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.system-card.danger {
    border-color: #eb4a4a44;
}

.btn-primary {
    background: #9147ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover { background: #7d3ce0; }

.btn-danger {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-danger:hover { background: #a93226; }

.btn-secondary {
    background: var(--bg-tertiary, #2d2d35);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-secondary:hover { background: var(--border-color); }

.system-status {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.system-status.success {
    display: block;
    background: #1a3a1a;
    color: #4caf50;
    border: 1px solid #4caf5044;
}

.system-status.error {
    display: block;
    background: #3a1a1a;
    color: #eb4a4a;
    border: 1px solid #eb4a4a44;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-grid { gap: 12px; }
    .panel { padding: 14px; }
    .stats-grid { gap: 6px; }
    .stat-icon { display: none; }
    .stat-card { padding: 10px 6px 8px; }
    .stat-value { font-size: 1.2rem; }
    .stat-label { font-size: 0.55rem; }

    .qc-status {
        display: none;
    }

    header {
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .header-brand {
        padding: 12px 14px 0;
        flex-wrap: nowrap;
        gap: 8px;
    }

    header h1 {
        font-size: 0.95rem;
        gap: 8px;
        white-space: nowrap;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }

    header h1 span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-logo {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }

    .header-brand-right {
        flex-shrink: 0;
        gap: 6px;
    }

    .language-selector select {
        max-width: 70px;
    }

    .header-meta {
        padding: 8px 14px 12px;
    }

    .status-bar {
        padding: 7px 14px 9px;
        font-size: 0.78rem;
        gap: 6px;
    }

    /* Hide connection text + language selector on mobile */
    .conn-text,
    .language-selector {
        display: none;
    }

    /* Tabs: single scrollable row */
    .tabs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        margin-bottom: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-button {
        flex: 1 1 0;
        padding: 10px 8px;
        font-size: 12px;
        border-radius: 8px;
        white-space: nowrap;
        text-align: center;
    }

    /* Inventory filters */
    .inventory-filters {
        padding: 8px;
    }

    .filter-checkboxes {
        gap: 6px;
        flex-wrap: wrap;
    }

    .filter-checkbox {
        font-size: 12px;
        gap: 4px;
    }

    .filter-separator {
        display: none;
    }

    #inventory-game-search {
        font-size: 13px;
    }

    /* Campaign cards */
    .campaign-card {
        padding: 12px;
        border-radius: 8px;
    }

    .campaign-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .campaign-game-art {
        width: 48px !important;
        height: 64px !important;
        border-radius: 4px;
    }

    .campaign-badges {
        flex-wrap: wrap;
        gap: 4px;
    }

    .campaign-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .drop-item {
        padding: 8px;
        gap: 8px;
    }

    /* Settings */
    .settings-section {
        padding: 12px;
    }

    .settings-section h2 {
        font-size: 1.1rem;
    }

    .games-container {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .small-btn {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1 1 auto;
        text-align: center;
        white-space: nowrap;
    }

    #games-filter {
        font-size: 13px;
    }

    /* System tab */
    .system-controls {
        flex-direction: column;
        gap: 10px;
    }

    .system-card {
        min-width: unset;
        padding: 14px;
    }

    /* Progress bars */
    .progress-bar-container {
        height: 6px;
    }

    /* Console */
    .console-output {
        font-size: 11px;
        max-height: 150px;
    }

    /* Channels list */
    .channel-item {
        padding: 8px 10px;
        gap: 8px;
    }

    /* Footer */
    .footer {
        padding: 10px 12px;
        font-size: 12px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Drop History rows */
.history-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color);
    min-width: 0;
}
.history-ts {
    font-size: 0.8rem;
    color: #adadb8;
    white-space: nowrap;
    min-width: 110px;
    flex-shrink: 0;
}
.history-game {
    color: #9147ff;
    font-weight: 500;
    min-width: 100px;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-drop {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.history-reward {
    font-size: 0.85rem;
    color: #0f9;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .quick-controls-row {
        grid-template-columns: 1fr 1fr;
    }

    #account-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    #account-tabs::-webkit-scrollbar { display: none; }

    .history-row {
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 8px 10px;
    }
    .history-ts {
        min-width: unset;
        flex: 0 0 auto;
    }
    .history-game {
        min-width: unset;
        flex: 1 1 auto;
    }
    .history-drop {
        flex: 1 1 100%;
        font-size: 0.9rem;
    }
    .history-reward {
        flex: 0 0 auto;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 6px;
    }

    header h1 {
        font-size: 0.95rem;
    }

    .header-brand-right {
        gap: 6px;
    }

    .tab-button {
        font-size: 12px;
        padding: 7px 4px;
    }

    .campaign-card {
        padding: 8px;
    }

    .campaign-game-art {
        width: 36px !important;
        height: 48px !important;
    }

    .drop-game-thumb { display: none !important; }

    .channel-avatar { width: 28px; height: 28px; font-size: 0.75rem; }
    .channel-item { padding: 7px 9px; gap: 8px; }

    /* Compact campaign progress on mobile */
    .progress-panel {
        padding: 14px 16px 16px;
    }
    .progress-panel h2 {
        font-size: 15px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }
    .progress-bar {
        height: 22px;
        border-radius: 11px;
        margin-bottom: 6px;
    }
    .progress-text {
        font-size: 12px;
        margin-bottom: 1px;
    }
    .progress-time {
        font-size: 11px;
    }
    .progress-drops-left {
        font-size: 0.74rem;
        margin-top: 2px;
    }
    .drop-name {
        font-size: 0.9rem;
    }
    .drop-game {
        font-size: 0.78rem;
        margin-bottom: 6px;
    }
    .stats-grid { gap: 4px; }
    .stat-card { padding: 7px 4px 6px; }
    .stat-value { font-size: 0.95rem; }
    .stat-label { font-size: 0.52rem; margin-top: 2px; }
}

.skip-game-btn {
    margin-top: 10px;
    padding: 6px 14px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.skip-game-btn:hover {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.skip-game-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Account Management */
.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: .88rem;
}

.account-item.active {
    border-color: #9147ff;
    color: #9147ff;
    font-weight: 600;
}

.account-label { flex: 1; }

.account-action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 3px 8px;
    font-size: .78rem;
    cursor: pointer;
    transition: all 0.15s;
}

.account-action-btn:hover {
    background: #9147ff;
    color: white;
    border-color: #9147ff;
}

.account-action-btn.danger:hover {
    background: #c0392b;
    border-color: #c0392b;
}

.scheduler-times {
    padding: 8px 0;
}
.scheduler-times input[type="time"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.9rem;
}

#account-tabs {
    display: flex;
    gap: 3px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.acc-tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 6px;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.acc-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(145, 70, 255, 0.12);
}

.acc-tab-btn.active-acc {
    background: #9147ff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(145, 70, 255, 0.35);
}

/* Stats Tab */
.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
}
.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #9147ff;
    word-break: break-all;
}
.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

@media (max-width: 480px) {
    .stat-card {
        padding: 10px 8px;
    }
    #stats-summary .stat-value {
        font-size: 1.3em;
    }
    #stats-summary .stat-label {
        font-size: 0.75em;
    }
}
.stats-section h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
}
.stats-game-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.stats-game-bar-label {
    width: 160px;
    font-size: 0.85em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stats-game-bar-track {
    flex: 1;
    height: 18px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
}
.stats-game-bar-fill {
    height: 100%;
    background: #9147ff;
    border-radius: 4px;
    transition: width 0.4s;
}
.stats-game-bar-count {
    width: 32px;
    text-align: right;
    font-size: 0.85em;
    color: var(--text-secondary);
}
.stats-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.stats-recent-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--border-color);
}
.stats-recent-info { flex: 1; }
.stats-recent-reward { font-weight: 600; font-size: 0.9em; color: var(--text-primary); }
.stats-recent-meta { font-size: 0.8em; color: var(--text-secondary); }


/* ── WQ mobile compact + reward modal ── */
@media (max-width: 768px) {
    .wq-drag-handle { display: none; }
    .wq-header { padding: 7px 10px; gap: 6px; }
    .wq-name { font-size: 0.82rem; }
    .wq-badge { font-size: 0.65rem; padding: 1px 5px; }
    .wq-icon, .wq-icon img { width: 22px !important; height: 29px !important; }
    .wq-count { font-size: 0.72rem; padding: 1px 6px; }
    .wq-body { padding: 6px 10px; }
    .drop-info-layout { gap: 10px; }
    .drop-game-thumb { width: 44px; height: 59px; border-radius: 4px; }
}

/* Benefit with image */
.wq-benefit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wq-benefit img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Clickable drop row */
.wq-drop {
    cursor: pointer;
    transition: background 0.12s;
}
.wq-drop:hover { background: rgba(145,70,255,0.12); }

/* Reward modal */
.wq-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.wq-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    max-width: 360px;
    width: 100%;
    position: relative;
}
.cdm-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.cdm-drop-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}
.wq-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.wq-modal-close:hover { color: var(--text-primary); }
.wq-modal-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 14px;
    padding-right: 24px;
    color: var(--text-primary);
}
.wq-modal-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wq-modal-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 10px 12px;
}
.wq-modal-benefit img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.wq-modal-benefit-name {
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* Mobile overflow fixes */
@media (max-width: 768px) {
    .quick-controls-row { gap: 6px; }
    .qc-btn { padding: 8px 10px; gap: 6px; min-height: 52px; }
    .qc-labels small { font-size: 0.65rem; }
    .qc-labels strong { font-size: 0.8rem; }
    .qc-icon { font-size: 1.1rem; }
    .container { overflow-x: hidden; }
}

/* Inventory toggle button */
.inv-toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: #9147ff;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.inv-toggle-btn:hover {
    background: rgba(145,70,255,0.15);
    border-color: #9147ff;
}
.campaign-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Analytics 2-col desktop layout */
.analytics-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 16px;
    align-items: stretch;
    min-width: 0;
}
.analytics-stats-col { grid-column: 1; grid-row: 1; min-width: 0; }
.analytics-history-col { grid-column: 2; grid-row: 1; min-width: 0; max-height: 80vh; overflow-y: auto; }
.analytics-cp-full { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.analytics-pred-full { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
.range-btn{background:#18181b;border:1px solid #3d3d4a;color:#adadb8;padding:4px 10px;border-radius:6px;cursor:pointer;font-size:.82rem}
.range-btn:hover,.active-range{background:#9147ff;color:#fff;border-color:#9147ff}
@media (max-width: 768px) {
    .analytics-layout { grid-template-columns: 1fr; }
    .analytics-stats-col,
    .analytics-history-col,
    .analytics-cp-full,
    .analytics-pred-full { grid-column: 1; grid-row: auto; max-height: none; }
}
@media (hover: none) {
    .wq-row:hover { transform: none; }
    .channel-item:hover { background: var(--bg-secondary); border-color: var(--border-color); }
}
