/* Visual Polish - Applied as Standard

   Pattern: var(--modern-variable, classic-fallback)
   - Classic mode: variables undefined, uses fallback
   - Modern mode: variables defined in modern/variables.css
*/

.panel {
    box-shadow: var(--panel-shadow);
    border-radius: var(--panel-radius);
    backdrop-filter: var(--panel-backdrop-filter);
    -webkit-backdrop-filter: var(--panel-backdrop-filter);
}

/* .panel-header is defined in the Colorized UI Elements section below */

.chat-tab {
    border-radius: var(--chat-tab-radius);
    padding: 4px 12px;
    transition: all 0.2s ease;
}

.progress-bar {
    border-radius: var(--progress-radius);
    overflow: hidden;
}

/* 3-Column Grid Layout */
#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

#main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 10px;
    padding: 10px;
    overflow: hidden;
    height: 100%;
}

body.interface-scale-zoomed #app {
    overflow-y: auto;
}

body.interface-scale-zoomed #main-grid {
    height: auto;
    min-height: 100%;
    overflow: visible;
    align-content: start;
}

#sidebar-stack {
    display: contents;
}

#left-column {
    grid-column: 1;
    grid-row: 1;
}

#middle-column {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
}

#right-column {
    grid-column: 3;
    grid-row: 1;
}

#left-column, #right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 0;
}

/* Keep sidebar panels at their natural height so the column scrolls instead of compressing content. */
#left-column > .panel,
#right-column > .panel {
    flex-shrink: 0;
}

/* Panel Styles */
.panel {
    border: var(--panel-border);
    background: var(--panel-bg);
    display: flex;
    flex-direction: column;
}

/* .panel-header is defined in the Colorized UI Elements section below */

/* Left Column - User Info */
.user-info-content {
    padding: var(--user-info-content-padding, 15px);
    display: flex;
    flex-direction: column;
    gap: var(--user-info-content-gap, 10px);
}

.profile-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-transform: none;
    color: var(--text-color);
    text-decoration: none;
    padding: var(--profile-link-padding, 5px);
    border: var(--profile-link-border, 1px solid var(--dim-color));
    border-color: var(--profile-link-accent-border-color, var(--special-color));
    border-radius: var(--profile-link-radius, var(--ui-radius-sm));
    background: var(--profile-link-bg, transparent);
    font-weight: var(--profile-link-font-weight, 400);
    transition: all 0.3s;
}

.profile-link-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    min-width: 0;
}

.profile-link-icon {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 1em;
    line-height: 1;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'EmojiOne Color', sans-serif;
}

.profile-link-icon-svg {
    display: block;
    width: 1.3em;
    height: 1.3em;
}

/* Button reset for profile link (when using semantic button) */
button.profile-link {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: none;
    font: inherit;
    cursor: pointer;
    box-shadow: none;
}

.profile-link:hover {
    border-color: var(--profile-link-hover-border-color, var(--profile-link-accent-border-color, var(--special-color)));
    background: var(--profile-link-hover-bg, rgba(255, 255, 255, 0.1));
    color: var(--profile-link-hover-color, var(--special-color));
    transform: var(--profile-link-hover-transform, none);
    box-shadow: var(--profile-link-hover-box-shadow, none);
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-info-progress-stack {
    display: flex;
    flex-direction: column;
    gap: var(--user-info-bars-gap, 4px);
}

.progress-label-above {
    font-size: var(--progress-label-above-font-size, 0.75em);
    text-align: center;
    font-weight: var(--progress-label-above-font-weight, 400);
    margin-bottom: var(--progress-label-above-margin-bottom, 0);
    color: var(--accent-color);
}

.progress-bar.progress-with-label {
    position: relative;
    height: var(--progress-with-label-height, 20px);
}

.progress-label-inside {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--progress-label-inside-font-size, 0.75em);
    font-weight: var(--progress-label-inside-font-weight, bold);
    z-index: 2;
    pointer-events: none;
    color: var(--progress-label-inside-color, var(--text-color));
    text-shadow: var(--progress-label-inside-text-shadow,
        -1px -1px 0 var(--bg-color),
        1px -1px 0 var(--bg-color),
        -1px 1px 0 var(--bg-color),
        1px 1px 0 var(--bg-color)
    );
}

/* Left Column - Menu */
.menu-content {
    padding: var(--menu-content-padding, 10px);
    display: flex;
    flex-direction: column;
    gap: var(--menu-content-gap, 5px);
}

.menu-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    padding: var(--menu-link-padding);
    border: var(--menu-link-border, 1px solid transparent);
    border-radius: var(--menu-link-radius, var(--ui-radius-sm));
    font-size: var(--menu-link-font-size, inherit);
    font-weight: var(--menu-link-font-weight, 400);
    background: var(--menu-link-bg, transparent);
    transition: all 0.3s;
    position: relative;
    overflow: visible;
}

.menu-premium-star {
    color: #f4c542;
    margin-right: 6px;
}

.menu-link:hover {
    border-color: var(--menu-link-hover-border-color, var(--accent-color));
    background: var(--menu-link-hover-bg);
    color: var(--menu-link-hover-color);
    transform: var(--menu-link-hover-transform, none);
    box-shadow: var(--menu-link-hover-box-shadow, -2px 0 0 var(--accent-color));
}

.menu-link::after {
    content: '';
    position: absolute;
    inset: var(--menu-link-hitarea-inset, 0);
    pointer-events: auto;
}

.menu-link:hover::after {
    transform: translateX(calc(var(--menu-link-hover-shift, 0px) * -1));
}

.menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: var(--menu-link-accent-bar-width, 0);
    height: 0;
    background: var(--gradient-primary, transparent);
    border-radius: 0 var(--ui-radius-xs) var(--ui-radius-xs) 0;
    transition: height var(--transition-fast);
}

.menu-link:hover::before,
.menu-link:focus::before,
.menu-link.active::before,
.menu-link[data-active="true"]::before {
    height: 60%;
}

.menu-link:focus {
    box-shadow: var(--menu-link-focus-shadow, none);
}

.menu-link.active,
.menu-link[data-active="true"] {
    background: var(--menu-link-active-bg, transparent);
    color: var(--menu-link-active-color, inherit);
    box-shadow: var(--menu-link-active-box-shadow, none);
}

/* Button reset for menu links (when using semantic buttons) */
button.menu-link {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    border: var(--menu-link-border, 1px solid transparent);
    border-radius: var(--menu-link-radius, 0);
    outline: none;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

button.menu-link:hover {
    border-color: var(--menu-link-hover-border-color, var(--accent-color));
    background: var(--menu-link-hover-bg);
    color: var(--menu-link-hover-color);
    transform: var(--menu-link-hover-transform, none);
    box-shadow: var(--menu-link-hover-box-shadow, -2px 0 0 var(--accent-color));
}

button.menu-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

.menu-separator {
    border-top: var(--menu-separator-border-top, 1px solid var(--dim-color));
    margin: var(--menu-separator-margin, 8px 0);
}

/* Mobile menu dropdown - hidden by default */
.menu-mobile {
    display: none;
    padding: 10px;
}

.menu-mobile select {
    width: 100%;
    padding: var(--menu-mobile-select-padding, 8px);
    background: var(--menu-mobile-select-bg, var(--bg-color));
    color: var(--menu-mobile-select-color, var(--text-color));
    border: var(--menu-mobile-select-border, 1px solid var(--dim-color));
    border-radius: var(--menu-mobile-select-radius, 0);
    font-family: inherit;
    font-size: var(--menu-mobile-select-font-size, 0.9em);
    cursor: pointer;
}

.menu-mobile select:focus {
    border-color: var(--accent-color);
    /* outline handled by accessibility.css :focus-visible */
}

/* Left Column - New Tutorials */
.sidebar-new-tutorial-content {
    padding: var(--menu-content-padding, 10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-new-tutorial-hint {
    font-size: 0.75em;
    line-height: 1.3;
}

.sidebar-new-tutorial-list {
    display: flex;
    flex-direction: column;
    gap: var(--menu-content-gap, 5px);
}

/* Left Column - Sidebar Contracts */
.sidebar-contracts-content {
    padding: var(--menu-content-padding, 10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Left Column - Sidebar Community Events */
.sidebar-events-content {
    padding: var(--menu-content-padding, 10px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-contract-desc {
    font-size: 0.8em;
    line-height: 1.3;
}

.sidebar-contract-board-btn {
    display: block;
    width: 100%;
    padding: 6px 10px;
    background: var(--btn-bg, var(--accent-color));
    color: var(--btn-fg, var(--bg-color));
    border: var(--btn-border, none);
    border-radius: var(--btn-radius, var(--ui-radius-sm));
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
    position: relative;
    isolation: isolate;
    box-shadow: none !important;
}

.sidebar-contract-board-btn:hover {
    opacity: 0.85;
    box-shadow: none !important;
}

.sidebar-contract-board-btn:active {
    box-shadow: none !important;
}

.sidebar-contract-board-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@keyframes contractBoardGlow {
    0%, 100% {
        opacity: 0.55;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

.contract-board-glow {
    z-index: 0;
}

.contract-board-glow::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    box-shadow:
        0 0 0 1px rgba(var(--accent-color-rgb, 0, 255, 0), 0.32),
        0 0 14px rgba(var(--accent-color-rgb, 0, 255, 0), 0.75),
        0 0 24px rgba(var(--accent-color-rgb, 0, 255, 0), 0.38);
    opacity: 0.55;
    animation: contractBoardGlow 2s ease-in-out infinite;
    will-change: opacity, transform;
}

.progress-bar {
    width: 100%;
    height: var(--progress-height);
    background: var(--progress-bg);
    border: var(--progress-border, var(--ui-border-light));
    border-radius: var(--progress-radius);
    position: relative;
    box-shadow: var(--progress-shadow, var(--ui-shadow-sm));
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--progress-fill-bg);
    width: 0%;
    transition: var(--progress-fill-transition, width 0.1s linear);
    position: relative;
    z-index: 1;
}

#prog-hp {
    background: var(--prog-level-bg, var(--progress-fill-bg));
}

#prog-hack-xp {
    background: var(--prog-hack-xp-bg, var(--special-color));
}

#prog-current {
    background: var(--prog-current-bg, var(--progress-fill-bg));
    width: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
    transition: none;
}

#current-activity-name.streak-active {
    color: var(--ui-accent, var(--accent));
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--progress-shimmer-bg, linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    ));
    animation: var(--progress-shimmer-animation, none);
    opacity: var(--progress-shimmer-opacity, 0);
    pointer-events: none;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Colorized UI Elements */

/* Panel headers with accent colors */
.panel-header {
    border-radius: var(--panel-radius) var(--panel-radius) 0 0;
    padding: var(--panel-header-padding);
    background: var(--panel-header-bg);
    color: var(--panel-header-color);
    font-weight: 600;
    font-size: var(--panel-header-font-size, 0.9em);
    letter-spacing: var(--panel-header-letter-spacing, 0);
    border-bottom: var(--ui-border-subtle);
    position: relative;
    overflow: hidden;
}

/* Accent bar - hidden in classic (--panel-header-accent-width defaults to 0) */
.panel-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--panel-header-accent-width);
    background: var(--gradient-primary, transparent);
    border-radius: var(--panel-radius) 0 0 0;
}

/* Collapsible panel headers */
.panel-header-collapsible {
    cursor: pointer;
    user-select: none;
}

.panel-header-collapsible:hover {
    filter: brightness(1.2);
}

.panel-collapse-indicator {
    font-family: monospace;
    font-size: 0.85em;
    font-weight: 700;
    opacity: 0.8;
    vertical-align: middle;
    position: relative;
    top: -0.05em;
}

.panel-collapsed > *:not(.panel-header) {
    display: none !important;
}

/* Currency-specific colors in stats table */
#p-credits, #p-chips, #p-hackcoin {
    color: var(--warning-color);
}

#p-snippets, #p-cycles, #p-hashes, #p-packets {
    color: var(--success-color);
}

/* Level and Experience values with consistent color */
#lvl-hack, #lvl-code, #lvl-compute, #lvl-mine, #lvl-sniff,
#exp-hack, #exp-code, #exp-compute, #exp-mine, #exp-sniff {
    color: var(--accent-color);
}

/* Active chat tab */
.chat-tab.active {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Chat tab hover */
.chat-tab:hover {
    color: var(--accent-color);
}

/* Unread chat notification */
.chat-tab.unread {
    color: var(--warning-color);
}

/* Floating text with special color */
.floating-text {
    color: var(--special-color);
    text-shadow: 0 0 5px var(--special-color);
}

/* Middle Column - Stats Table */
.stats-table-container {
    padding: var(--stats-table-container-padding, 15px);
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.stats-col {
    vertical-align: top;
    border-right: var(--stats-col-border-right, 1px solid rgba(255, 255, 255, 0.1));
    padding: var(--stats-col-padding, 0 15px);
}

.stats-col:last-child {
    border-right: none;
}

.stat-label {
    color: var(--accent-color);
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 3px;
    border-bottom: var(--stat-label-border-bottom, 1px solid var(--dim-color));
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
    padding: var(--stat-row-padding, 1px 0);
    border-radius: var(--ui-radius-xs);
    transition: background 0.15s ease;
    position: relative;
    width: fit-content;
}

.stats-table .stat-row {
    justify-content: flex-start;
}

.stats-table .stat-value {
    display: inline-block;
    width: 8ch;
    text-align: right;
}

.stat-row:hover {
    background: var(--stat-row-hover-bg, var(--surface-hover, transparent));
}

.stats-col-hacking .stat-row {
    justify-content: flex-start;
    width: fit-content;
}

.stats-col-hacking .stat-name {
    flex: 0 0 13ch;
    min-width: 13ch;
}

.stats-col-hacking .stat-value {
    width: 7ch;
    text-align: right;
}

.stat-name {
    color: var(--dim-color);
    font-size: 0.85em;
    min-width: 90px;
}

.stat-value {
    font-weight: 500;
    text-align: right;
}

.stat-value.inventory-over-cap {
    color: var(--error-color, #ff5a5a);
}

.stat-spacer {
    height: 10px;
}

/* Middle Column - Content and Chat */
#content-panel {
    flex: 1;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-panel {
    height: 350px;
    min-height: 200px;
    max-height: 600px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Chat Resize Handle */
.resize-handle {
    height: 8px;
    background: var(--dim-color);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.resize-handle:hover {
    background: var(--accent-color);
}

.resize-handle-bar {
    width: 40px;
    height: 2px;
    background: var(--text-color);
    border-radius: 1px;
}

.resize-handle:hover .resize-handle-bar {
    background: var(--bg-color);
}

.content-panel-body {
    padding: var(--content-panel-body-padding, 12px);
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1;
    overflow-y: auto;
}

.content-placeholder {
    border: var(--content-placeholder-border, 1px dashed var(--dim-color));
    border-radius: var(--content-placeholder-radius, 0);
    padding: var(--content-placeholder-padding, 12px);
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--content-placeholder-gap, 6px);
    background: var(--content-placeholder-bg, rgba(0, 0, 0, 0.2));
    align-self: center;
    margin: auto;
}

#settings-view {
    display: none;
    flex-direction: row;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
}

.settings-group {
    border: var(--settings-group-border, 1px solid var(--dim-color));
    border-radius: var(--settings-group-radius, 0);
    padding: var(--settings-group-padding, 10px);
    margin-bottom: var(--settings-group-margin-bottom, 12px);
    background: var(--settings-group-bg, rgba(0, 0, 0, 0.2));
    transition: border-color var(--settings-group-transition-speed, 0.15s) ease, background var(--settings-group-transition-speed, 0.15s) ease;
}

.settings-group:hover {
    border-color: var(--settings-group-hover-border-color, var(--text-color));
    background: var(--settings-group-hover-bg, rgba(0, 0, 0, 0.3));
}

.settings-group select {
    width: 100%;
    margin-top: var(--settings-group-select-margin-top, 8px);
}

.settings-group .stat-label {
    border-bottom: var(--settings-group-stat-label-border-bottom, var(--stat-label-border-bottom, none));
    margin-bottom: var(--settings-group-stat-label-margin-bottom, 6px);
}

.settings-group .stat-label[for] {
    display: block;
}

.settings-select-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-select-row select {
    width: auto;
    min-width: min(220px, 100%);
    max-width: 100%;
    margin-top: 0;
    margin-left: auto;
    flex: 0 1 220px;
}

.settings-select-row .stat-label {
    color: var(--text-color);
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    flex: 1 1 220px;
}

.settings-select-row .settings-hint,
.settings-select-row .settings-status-line,
.settings-select-row .settings-status-message {
    width: 100%;
}

.settings-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
}

.settings-toggle label {
    cursor: pointer;
}

.settings-hint {
    width: 100%;
    font-size: 0.8em;
    color: var(--dim-color);
    margin-top: -5px;
}

.settings-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.settings-account-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.settings-account-form input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--dim-color);
    border-radius: var(--ui-radius-sm, 0);
    color: var(--text-color);
    font-family: inherit;
}

.settings-account-form input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.settings-status-line {
    margin-bottom: 6px;
}

.settings-status-message {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--dim-color);
}

.settings-status-message.is-error {
    color: var(--error-color);
}

.settings-status-message.is-success {
    color: var(--accent-color);
}

.settings-dropdown-container {
    display: none;
}

.settings-dropdown {
    width: 100%;
    padding: var(--dropdown-padding, 8px);
    font-family: inherit;
    font-size: var(--dropdown-font-size, 0.9em);
    background: var(--dropdown-bg, var(--bg-color));
    color: var(--dropdown-color, var(--text-color));
    border: var(--dropdown-border, 1px solid var(--dim-color));
    border-radius: var(--dropdown-radius, 0);
    cursor: pointer;
}

.settings-dropdown:focus {
    border-color: var(--dropdown-focus-border-color, var(--accent-color));
    box-shadow: var(--dropdown-focus-shadow, none);
}

.settings-tabs {
    flex-shrink: 0;
    width: 160px;
}

.settings-tab-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    width: 100%;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

.settings-premium-panel-shell {
    position: relative;
}

.settings-premium-content {
    transition: filter 0.18s ease, opacity 0.18s ease;
}

.settings-premium-content.is-locked {
    filter: blur(1.5px);
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
}

.settings-premium-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(2px);
}

.settings-premium-overlay[hidden] {
    display: none;
}

.settings-premium-overlay-card {
    max-width: 420px;
    border: 1px solid var(--dim-color);
    border-radius: var(--settings-group-radius, 0);
    padding: 18px;
    background: rgba(8, 14, 24, 0.9);
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.settings-premium-overlay-title {
    margin-bottom: 8px;
    font-size: 0.92em;
    letter-spacing: 0.08em;
    color: var(--text-color);
}

.settings-premium-overlay-copy {
    color: var(--dim-color);
    line-height: 1.45;
}

.settings-premium-overlay-link {
    margin-top: 14px;
}

.settings-apply-hint {
    margin-top: 8px;
}

.custom-sound-slot-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.custom-sound-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid var(--dim-color);
    background: rgba(0, 0, 0, 0.12);
}

.custom-sound-slot-empty {
    opacity: 0.5;
}

.custom-sound-slot-label {
    flex-shrink: 0;
    font-size: 0.85em;
    letter-spacing: 0.03em;
    min-width: 50px;
}

.custom-sound-slot-filename {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85em;
}

.custom-sound-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--dim-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.8em;
    line-height: 1;
}

.custom-sound-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.custom-sound-btn-remove:hover {
    color: var(--error-color, #ff4444);
    border-color: var(--error-color, #ff4444);
}

.custom-sound-add-btn {
    margin-top: 4px;
}

.loot-filter-sound-alert-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.loot-filter-sound-alert-row select {
    flex: 1;
    min-width: 0;
}

.loot-filter-sound-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loot-filter-sound-volume-row input[type="range"] {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.loot-filter-sound-volume-label {
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
    font-size: 0.85em;
}

.notification-settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.notification-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--dim-color);
    padding: 8px;
    background: rgba(0, 0, 0, 0.12);
}

.notification-settings-name {
    font-size: 0.9em;
    letter-spacing: 0.03em;
}

.notification-settings-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 360px;
}

.notification-settings-controls select {
    margin-top: 0;
    flex: 1;
    min-width: 150px;
}

.chat-accolade-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.chat-accolade-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.chat-accolade-table th,
.chat-accolade-table td {
    border: 1px solid var(--dim-color);
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
}

.chat-accolade-table th {
    color: var(--dim-color);
    font-size: 0.78em;
    letter-spacing: 0.08em;
}

.chat-accolade-row-selected {
    background: rgba(125, 243, 198, 0.08);
}

.chat-accolade-cell-select {
    width: 110px;
    white-space: nowrap;
}

.chat-accolade-cell-icon {
    width: 68px;
    text-align: center;
}

.chat-accolade-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    min-height: 1.4em;
    font-size: 1.1em;
    line-height: 1;
}

.chat-accolade-icon-preview-svg {
    display: block;
    width: 1.3em;
    height: 1.3em;
}

.chat-accolade-icon-preview-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-accolade-select-btn {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--dim-color);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-color);
    font-family: inherit;
    cursor: pointer;
}

.chat-accolade-select-btn:hover,
.chat-accolade-select-btn:focus-visible {
    border-color: var(--accent-color);
    outline: none;
}

.chat-accolade-select-btn.is-selected {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.chat-accolade-description {
    margin-bottom: 4px;
}

.chat-accolade-earned {
    color: var(--dim-color);
    font-size: 0.85em;
}

.chat-accolade-empty {
    margin-top: 10px;
    color: var(--dim-color);
}

@media (max-width: 860px) {
    .notification-settings-row {
        flex-direction: column;
        align-items: stretch;
    }

    .notification-settings-controls {
        min-width: 0;
        width: 100%;
        flex-direction: column;
    }

    .chat-accolade-table {
        min-width: 520px;
    }
}

@media (max-width: 768px) {
    #settings-view {
        flex-direction: column;
        gap: 0;
    }

    .settings-tabs {
        display: none;
    }

    .settings-dropdown-container {
        display: block;
        margin-bottom: 1rem;
    }
}

/* Reconnection Banner */
.reconnect-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning-color);
    color: var(--bg-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 9999;
    font-size: 0.9em;
    font-weight: 600;
}

.reconnect-banner.manual {
    background: var(--error-color);
}

#reconnect-text {
    flex: 0 0 auto;
}

#reconnect-countdown {
    font-family: monospace;
    min-width: 30px;
}

.reconnect-btn {
    padding: 5px 15px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--bg-color);
    font-family: inherit;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.reconnect-btn:hover {
    background: transparent;
    color: var(--bg-color);
    border-color: var(--bg-color);
}

/* Remember Me Checkbox */
.remember-me-container {
    margin-top: 10px;
    text-align: left;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--dim-color);
}

.remember-me-label:hover {
    color: var(--text-color);
}

.remember-me-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

/* ============================================================
   Contracts
   ============================================================ */

#contracts-view {
    display: none;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    width: 100%;
}

.contracts-header {
    margin-bottom: 1rem;
}

.contracts-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.contracts-reset-row {
    flex-wrap: wrap;
    align-items: center;
}

.contracts-reset-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#contracts-reset-select {
    min-width: 140px;
}

/* Card grid layout */
.contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Individual contract card */
.contracts-card {
    background: var(--surface-secondary, rgba(0, 0, 0, 0.2));
    border: var(--ui-border-light);
    border-radius: var(--ui-radius-md);
    padding: var(--card-padding, 1rem);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.contracts-card:hover {
    border-color: var(--accent-color);
    background: var(--surface-hover, rgba(0, 0, 0, 0.3));
    transform: var(--ui-transform-hover-lift);
}

.contracts-card.active {
    border-left: 3px solid var(--accent-color);
}

.contracts-card.completed {
    border-left: 3px solid var(--success-color);
}

.contracts-card.claimed {
    border-left: 3px solid var(--warning-color);
    opacity: 0.75;
}

.contracts-card.claimed:hover {
    opacity: 0.9;
}

/* Card header with icon */
.contracts-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.contracts-card-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 1.25em;
}

.contracts-card.claimed .contracts-card-icon {
    filter: grayscale(1);
    opacity: 0.5;
}

.contracts-card-title-group {
    flex: 1;
    min-width: 0;
}

.contracts-card-name {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contracts-card.active .contracts-card-name {
    color: var(--accent-color);
}

.contracts-card.completed .contracts-card-name {
    color: var(--success-color);
}

.contracts-card.claimed .contracts-card-name {
    color: var(--warning-color);
}

.contracts-card-duration {
    font-size: 0.8em;
}

.contracts-carryover-badge {
    font-size: 0.75em;
    color: var(--warning-color);
    opacity: 0.9;
}

/* Card description */
.contracts-card-desc {
    color: var(--text-color);
    font-size: 0.85em;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Card progress bar */
.contracts-card-progress {
    margin-bottom: 0.75rem;
}

.contracts-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.contracts-progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.contracts-card.completed .contracts-progress-fill,
.contracts-card.claimed .contracts-progress-fill {
    background: var(--success-color);
}

.contracts-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-color);
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}

/* Card rewards */
.contracts-card-rewards {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    flex: 1;
}

.contracts-reward-item {
    font-size: 0.83em;
    color: var(--success-color);
    font-variant-numeric: tabular-nums;
}

/* Card action button */
.contracts-card-action {
    margin-top: auto;
}

.contracts-btn {
    width: 100%;
    padding: 7px;
    text-align: center;
    border: 1px solid var(--dim-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88em;
    background: transparent;
    color: var(--text-color);
    font-family: inherit;
}

.contracts-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

.contracts-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.contracts-btn:disabled:hover {
    background: transparent;
    border-color: var(--dim-color);
}

.contracts-btn.claimable {
    border-color: var(--success-color);
    color: var(--success-color);
}

.contracts-btn.claimable:hover {
    background: rgba(0, 255, 0, 0.1);
}

.contracts-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}
