/* ==========================================================================
   RUNIC THEME: Clockwork Reforged
   Brass housings, copper pipes, smoked glass, walnut panels, and steam-lit gauges.
   ========================================================================= */

[data-theme="clockwork"] {
    /* Core hue system */
    --hue-primary: 34;
    --hue-accent: 20;
    --hue-gm: 318;
    --hue-danger: 6;
    --hue-warning: 42;
    --hue-success: 156;
    --hue-toxicity: 96;
    --hue-neutral: 28;

    --sat-primary: 72%;
    --lit-primary: 46%;
    --lit-primary-hover: 52%;

    --sat-accent: 68%;
    --lit-accent: 42%;
    --lit-accent-hover: 48%;

    --sat-gm: 38%;
    --lit-gm: 54%;
    --lit-gm-text: 94%;

    --sat-danger: 64%;
    --lit-danger: 48%;
    --lit-danger-hover: 54%;

    --sat-warning: 78%;
    --lit-warning: 58%;

    --sat-success: 34%;
    --lit-success: 38%;

    --sat-toxicity: 42%;
    --lit-toxicity: 48%;

    --lightness-bg: 12%;

    /* Form and timing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;

    --font-sans: 'Cinzel', 'Cormorant Garamond', 'Georgia', serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

    --duration-75: 90ms;
    --duration-150: 180ms;
    --duration-250: 300ms;
    --duration-300: 420ms;
    --duration-400: 720ms;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Identity */
    --brass-bright: hsl(40 68% 62%);
    --brass-mid: hsl(34 58% 46%);
    --brass-deep: hsl(30 54% 30%);
    --copper-burn: hsl(18 56% 42%);
    --copper-glow: hsl(20 72% 54%);
    --amber-lamp: hsl(42 92% 68%);
    --patina-soft: hsl(164 24% 46%);
    --walnut-dark: hsl(22 28% 16%);
    --mahogany-deep: hsl(18 32% 12%);
    --smoke-glass: hsl(28 12% 24%);
    --iron-plate: hsl(24 10% 28%);
    --cream-parchment: hsl(38 34% 84%);
    --coal-ink: hsl(24 18% 12%);

    /* Surfaces */
    --bg-page: hsl(24 24% 12%);
    --bg-primary: hsl(24 22% 15%);
    --bg-secondary: hsl(24 18% 18% / 0.92);
    --bg-tertiary: hsl(26 18% 22% / 0.96);
    --bg-card: hsl(24 18% 18% / 0.94);
    --bg-hover: hsl(28 24% 28% / 0.56);
    --bg-input: hsl(24 16% 13%);

    --surface-elevated: hsl(28 18% 22%);
    --surface-overlay: hsl(24 18% 20% / 0.98);
    --surface-panel: hsl(26 18% 19% / 0.96);

    /* Text */
    --text-primary: hsl(36 42% 84%);
    --text-secondary: hsl(32 24% 70%);
    --text-label: hsl(38 66% 64%);
    --text-light: hsl(42 72% 96%);
    --text-muted: hsl(30 14% 56% / 0.82);

    /* Borders and shadows */
    --border-color: hsl(34 42% 40% / 0.42);
    --border-subtle: hsl(24 18% 36% / 0.26);
    --border-strong: hsl(40 72% 62% / 0.72);

    --shadow-glow-primary:
        0 14px 30px hsl(18 28% 8% / 0.42),
        0 0 24px hsl(34 62% 44% / 0.12);
    --shadow-glow-accent:
        0 12px 26px hsl(20 72% 54% / 0.18);
    --shadow-glow-danger:
        0 10px 22px hsl(6 64% 48% / 0.16);
    --shadow-glow-gold:
        0 0 22px hsl(42 92% 68% / 0.22);

    /* Icons */
    --icon-color: hsl(38 70% 62%);
    --icon-filter: brightness(0) saturate(100%) invert(78%) sepia(32%)
        saturate(792%) hue-rotate(353deg) brightness(94%) contrast(90%);

    /* Focus and tooltip */
    --color-focus-ring: hsl(40 82% 62% / 0.26);

    --color-tooltip-bg: hsl(24 18% 15% / 0.98);
    --color-tooltip-highlight: hsl(40 84% 68%);
    --color-tooltip-effect-bg: hsl(20 64% 52% / 0.12);
    --color-tooltip-text: hsl(36 34% 84%);
    --color-tooltip-label: hsl(38 52% 68%);
    --color-tooltip-muted: hsl(28 14% 60%);
    --color-tooltip-dim: hsl(28 10% 48%);
    --color-tooltip-pos: hsl(156 28% 56%);
    --color-tooltip-neg: hsl(8 70% 60%);
    --color-tooltip-separator: hsl(34 42% 44% / 0.38);
    --color-tooltip-section-bg: hsl(26 16% 20% / 0.88);

    /* Quality colors */
    --quality-0-color1: rgb(124, 108, 94);
    --quality-0-color2: rgb(86, 74, 64);
    --quality-1-color1: rgb(220, 204, 170);
    --quality-1-color2: rgb(174, 152, 116);
    --quality-2-color1: rgb(118, 188, 156);
    --quality-2-color2: rgb(78, 142, 116);
    --quality-3-color1: rgb(132, 184, 220);
    --quality-3-color2: rgb(86, 138, 176);
    --quality-4-color1: rgb(182, 138, 206);
    --quality-4-color2: rgb(134, 96, 158);
    --quality-5-color1: rgb(236, 194, 94);
    --quality-5-color2: rgb(186, 136, 42);
    --quality-6-color1: rgb(206, 92, 72);
    --quality-6-color2: rgb(148, 56, 42);
    --quality-7-color1: rgb(246, 208, 130);
    --quality-7-color2: rgb(142, 194, 184);

    /* Spell / element system */
    --element-fire-bg: hsl(18 34% 22% / 0.82);
    --element-fire-border: hsl(18 58% 50% / 0.6);
    --element-fire-hover: hsl(18 40% 28% / 0.92);
    --element-fire-glow: hsl(18 68% 56% / 0.18);

    --element-water-bg: hsl(204 18% 24% / 0.8);
    --element-water-border: hsl(202 28% 54% / 0.54);
    --element-water-hover: hsl(204 22% 30% / 0.9);
    --element-water-glow: hsl(202 34% 60% / 0.14);

    --element-earth-bg: hsl(32 22% 24% / 0.84);
    --element-earth-border: hsl(32 34% 50% / 0.58);
    --element-earth-hover: hsl(32 26% 30% / 0.92);
    --element-earth-glow: hsl(32 40% 56% / 0.14);

    --element-wind-bg: hsl(188 10% 24% / 0.76);
    --element-wind-border: hsl(188 18% 54% / 0.48);
    --element-wind-hover: hsl(188 14% 30% / 0.88);
    --element-wind-glow: hsl(188 24% 60% / 0.12);

    --element-light-bg: hsl(44 28% 26% / 0.84);
    --element-light-border: hsl(42 66% 62% / 0.64);
    --element-light-hover: hsl(44 32% 32% / 0.94);
    --element-light-glow: hsl(42 82% 68% / 0.2);

    --element-shadow-bg: hsl(284 18% 22% / 0.8);
    --element-shadow-border: hsl(284 26% 52% / 0.54);
    --element-shadow-hover: hsl(284 20% 28% / 0.9);
    --element-shadow-glow: hsl(284 28% 58% / 0.14);

    --element-death-bg: hsl(356 18% 22% / 0.8);
    --element-death-border: hsl(356 34% 54% / 0.56);
    --element-death-hover: hsl(356 22% 28% / 0.9);
    --element-death-glow: hsl(356 40% 58% / 0.14);

    --element-life-bg: hsl(154 18% 22% / 0.8);
    --element-life-border: hsl(156 26% 48% / 0.54);
    --element-life-hover: hsl(154 22% 28% / 0.9);
    --element-life-glow: hsl(156 30% 54% / 0.14);

    --element-arcane-bg: hsl(274 20% 24% / 0.82);
    --element-arcane-border: hsl(276 28% 58% / 0.56);
    --element-arcane-hover: hsl(274 24% 30% / 0.92);
    --element-arcane-glow: hsl(276 34% 62% / 0.16);

    --element-mind-bg: hsl(224 18% 24% / 0.8);
    --element-mind-border: hsl(224 24% 56% / 0.52);
    --element-mind-hover: hsl(224 20% 30% / 0.9);
    --element-mind-glow: hsl(224 30% 60% / 0.14);

    --element-physical-bg: hsl(28 20% 24% / 0.84);
    --element-physical-border: hsl(28 30% 50% / 0.56);
    --element-physical-hover: hsl(28 24% 30% / 0.92);
    --element-physical-glow: hsl(28 34% 56% / 0.14);

    --spell-temp-bg: hsl(26 20% 22%);
    --spell-temp-border: hsl(34 42% 52% / 0.78);
    --spell-temp-hover-bg: hsl(28 24% 28%);
    --spell-temp-hover-glow: hsl(42 82% 66% / 0.16);
    --spell-temp-badge-bg: hsl(20 64% 46%);
    --spell-temp-header-bg: hsl(28 18% 24%);
    --spell-temp-header-hover-bg: hsl(28 22% 28%);
    --spell-tile-hover-bg: hsl(28 24% 28%);

    /* Inventory / currency / buffs */
    --item-tile-base: hsl(28 18% 22%);
    --item-tile-border: hsl(34 30% 46% / 0.58);
    --item-tile-add-bg: hsl(26 18% 20%);
    --item-tile-add-border: hsl(24 18% 42% / 0.48);
    --item-tile-add-hover: hsl(28 24% 26%);
    --item-tile-add-border-hover: hsl(40 68% 60% / 0.78);

    --weight-display-bg: hsl(26 18% 20%);
    --weight-ok-color: hsl(156 28% 56%);
    --weight-warn-color: hsl(40 84% 66%);
    --weight-crit-color: hsl(6 68% 58%);
    --weight-bar-track-bg: hsl(24 12% 26%);

    --currency-tile-bg: hsl(28 18% 22%);
    --currency-tile-border: hsl(34 30% 46% / 0.58);
    --currency-tile-hover-bg: hsl(28 24% 26%);
    --currency-tile-hover-shadow: hsl(42 82% 68% / 0.16);
    --currency-quantity-bg: hsl(30 28% 28%);
    --currency-add-bg: hsl(26 18% 20%);
    --currency-add-border: hsl(24 18% 42% / 0.48);
    --currency-add-hover-bg: hsl(28 24% 26%);
    --currency-add-hover-border: hsl(40 68% 60% / 0.78);

    --color-buff-tile-bg: hsl(154 18% 22%);
    --color-buff-tile-border: hsl(156 26% 48% / 0.52);
    --color-buff-tile-hover: hsl(154 22% 28%);
    --color-buff-tile-glow: hsl(156 30% 54% / 0.14);
    --color-debuff-tile-bg: hsl(8 18% 22%);
    --color-debuff-tile-border: hsl(8 34% 52% / 0.54);
    --color-debuff-tile-hover: hsl(8 22% 28%);
    --color-debuff-tile-glow: hsl(8 40% 56% / 0.14);
    --color-neutral-tile-bg: hsl(28 16% 22%);
    --color-neutral-tile-border: hsl(28 22% 46% / 0.48);
    --color-neutral-tile-hover: hsl(28 22% 28%);
    --color-neutral-tile-glow: hsl(42 62% 66% / 0.1);
    --color-buff-indicator: hsl(156 28% 56%);
    --color-debuff-indicator: hsl(8 68% 58%);

    /* Common status colors */
    --color-heal: hsl(156 28% 56%);
    --color-gold: hsl(40 78% 60%);
    --color-amber: hsl(34 82% 58%);
    --color-amber-ui: hsl(34 82% 58%);
    --color-crit: hsl(8 68% 58%);
    --border-gold: hsl(42 72% 62% / 0.44);

    /* Overlays */
    --overlay-heavy: hsl(22 24% 8% / 0.74);
    --overlay-dark: hsl(24 18% 10% / 0.54);
    --overlay-medium: hsl(24 16% 12% / 0.3);
    --overlay-light: hsl(28 12% 14% / 0.14);
    --overlay-subtle: hsl(28 10% 14% / 0.08);
}

/* ==========================================================================
   Animations
   ========================================================================= */

@keyframes pressureValve {
    0%, 100% {
        box-shadow:
            0 0 0 1px hsl(34 34% 36% / 0.24),
            0 10px 22px hsl(18 28% 8% / 0.34);
    }
    50% {
        box-shadow:
            0 0 0 1px hsl(40 72% 62% / 0.42),
            0 16px 32px hsl(18 28% 8% / 0.42),
            0 0 24px hsl(42 92% 68% / 0.14);
    }
}

@keyframes steamDrift {
    0% { transform: translate3d(0, 0, 0); opacity: 0.12; }
    50% { transform: translate3d(8px, -6px, 0); opacity: 0.2; }
    100% { transform: translate3d(-6px, -12px, 0); opacity: 0.08; }
}

@keyframes gearTurn {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Global Atmosphere
   ========================================================================= */

[data-theme="clockwork"] body,
[data-theme="clockwork"] .page-content,
[data-theme="clockwork"] .main-content,
[data-theme="clockwork"] .content-wrapper {
    background:
        radial-gradient(circle at top left, hsl(42 84% 58% / 0.08), transparent 22%),
        radial-gradient(circle at 82% 12%, hsl(20 72% 54% / 0.08), transparent 18%),
        linear-gradient(180deg, hsl(24 24% 14%), hsl(22 28% 11%) 44%, hsl(18 28% 10%) 100%);
    color: var(--text-primary);
}

[data-theme="clockwork"] body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(hsl(40 62% 58% / 0.04) 1px, transparent 1px),
        linear-gradient(90deg, hsl(40 62% 58% / 0.04) 1px, transparent 1px),
        radial-gradient(circle at 12% 22%, hsl(20 56% 42% / 0.08) 0 80px, transparent 82px),
        radial-gradient(circle at 84% 74%, hsl(34 58% 46% / 0.06) 0 120px, transparent 122px);
    background-size: 34px 34px, 34px 34px, 100% 100%, 100% 100%;
    opacity: 0.8;
    z-index: 0;
}

[data-theme="clockwork"] body::after {
    content: '';
    position: fixed;
    top: 10%;
    right: 6%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(circle, transparent 44%, hsl(34 42% 34% / 0.14) 45% 52%, transparent 53%),
        radial-gradient(circle, transparent 60%, hsl(20 56% 42% / 0.1) 61% 66%, transparent 67%);
    animation: gearTurn 22s linear infinite;
    z-index: 0;
}

[data-theme="clockwork"] .navigation-bar,
[data-theme="clockwork"] .content-box,
[data-theme="clockwork"] .dashboard-panel,
[data-theme="clockwork"] .modal-content,
[data-theme="clockwork"] .character-sheet-panel,
[data-theme="clockwork"] .inventory-section {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Shared Panels
   ========================================================================= */

[data-theme="clockwork"] .content-box,
[data-theme="clockwork"] .dashboard-panel,
[data-theme="clockwork"] .modal-content,
[data-theme="clockwork"] .equipment-panel,
[data-theme="clockwork"] .inventory-section,
[data-theme="clockwork"] .spell-tooltip,
[data-theme="clockwork"] .login-container,
[data-theme="clockwork"] .widget-tile,
[data-theme="clockwork"] .character-item,
[data-theme="clockwork"] .attribute-card,
[data-theme="clockwork"] .bereich-tile,
[data-theme="clockwork"] .spell-tile,
[data-theme="clockwork"] .resistance-tile {
    background:
        linear-gradient(180deg, hsl(28 18% 22% / 0.96), hsl(22 22% 15% / 0.96));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow:
        0 16px 34px hsl(18 28% 8% / 0.4),
        inset 0 1px 0 hsl(42 54% 82% / 0.08);
}

[data-theme="clockwork"] .content-box::before,
[data-theme="clockwork"] .dashboard-panel::before,
[data-theme="clockwork"] .modal-content::before,
[data-theme="clockwork"] .widget-tile::before,
[data-theme="clockwork"] .character-item::before,
[data-theme="clockwork"] .attribute-card::before,
[data-theme="clockwork"] .login-container::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: calc(var(--radius-xl) - 6px);
    border: 1px solid hsl(40 46% 56% / 0.12);
    pointer-events: none;
}

[data-theme="clockwork"] .content-box:hover,
[data-theme="clockwork"] .dashboard-panel:hover,
[data-theme="clockwork"] .widget-tile:hover,
[data-theme="clockwork"] .character-item:hover,
[data-theme="clockwork"] .attribute-card:hover,
[data-theme="clockwork"] .bereich-tile:hover,
[data-theme="clockwork"] .spell-tile:hover {
    border-color: var(--border-strong);
    animation: pressureValve 3.2s ease-in-out infinite;
}

/* ==========================================================================
   Typography and Icons
   ========================================================================= */

[data-theme="clockwork"] h1,
[data-theme="clockwork"] h2,
[data-theme="clockwork"] h3,
[data-theme="clockwork"] .widget-title,
[data-theme="clockwork"] .character-info h3,
[data-theme="clockwork"] .bereich-title,
[data-theme="clockwork"] .attribute-name {
    color: hsl(40 72% 72%);
    text-shadow: 0 1px 0 hsl(18 28% 8%), 0 0 12px hsl(42 92% 68% / 0.08);
}

[data-theme="clockwork"] .icon-themed,
[data-theme="clockwork"] .spell-icon,
[data-theme="clockwork"] .resistance-icon,
[data-theme="clockwork"] .currency-icon,
[data-theme="clockwork"] .buff-icon,
[data-theme="clockwork"] .tab_Icon,
[data-theme="clockwork"] .tab_btn img,
[data-theme="clockwork"] .nav-icon-btn img,
[data-theme="clockwork"] #div_iconbar_left img,
[data-theme="clockwork"] #div_iconbar_right img {
    filter: var(--icon-filter);
}

/* ==========================================================================
   Headers and Category Bars
   ========================================================================= */

[data-theme="clockwork"] .discipline-header,
[data-theme="clockwork"] .info-category-header,
[data-theme="clockwork"] .info-subcategory-header,
[data-theme="clockwork"] .itemtype-header {
    background:
        linear-gradient(135deg, hsl(34 42% 28%), hsl(22 38% 20%));
    color: hsl(42 62% 80%) !important;
    border: 1px solid hsl(34 48% 46% / 0.48);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 hsl(42 52% 82% / 0.08);
}

[data-theme="clockwork"] .discipline-header:hover,
[data-theme="clockwork"] .info-category-header:hover,
[data-theme="clockwork"] .itemtype-header:hover {
    background:
        linear-gradient(135deg, hsl(36 48% 32%), hsl(22 42% 24%));
}

[data-theme="clockwork"] .subskill-item.passive {
    background: hsl(28 18% 24% / 0.66) !important;
}

/* ==========================================================================
   Navigation
   ========================================================================= */

[data-theme="clockwork"] .navigation-bar,
[data-theme="clockwork"] .tab-top-navigation {
    background:
        linear-gradient(180deg, hsl(26 24% 18% / 0.98), hsl(20 28% 12% / 0.98));
    border-bottom: 2px solid hsl(34 48% 40% / 0.56);
    box-shadow:
        0 12px 28px hsl(18 28% 8% / 0.42),
        inset 0 1px 0 hsl(42 42% 80% / 0.08);
}

[data-theme="clockwork"] .tab_btn,
[data-theme="clockwork"] .tab_btn_vertical,
[data-theme="clockwork"] .tab-buttons .tab-btn,
[data-theme="clockwork"] .tab-navigation .tab-btn,
[data-theme="clockwork"] .tab_btn_horizontal,
[data-theme="clockwork"] .tab_btn_original {
    background:
        linear-gradient(180deg, hsl(34 28% 30%), hsl(24 28% 18%)) !important;
    border: 1px solid hsl(34 38% 42% / 0.56) !important;
    color: hsl(38 40% 78%) !important;
    box-shadow:
        inset 0 1px 0 hsl(42 52% 82% / 0.12),
        0 8px 18px hsl(18 28% 8% / 0.28);
}

[data-theme="clockwork"] .tab_btn:hover,
[data-theme="clockwork"] .tab_btn_vertical:hover,
[data-theme="clockwork"] .tab-buttons .tab-btn:hover,
[data-theme="clockwork"] .tab-navigation .tab-btn:hover,
[data-theme="clockwork"] .tab_btn_horizontal:hover,
[data-theme="clockwork"] .tab_btn_original:hover {
    background:
        linear-gradient(180deg, hsl(38 34% 36%), hsl(24 32% 22%)) !important;
    border-color: hsl(40 68% 62% / 0.7) !important;
    box-shadow:
        0 10px 22px hsl(18 28% 8% / 0.32),
        0 0 16px hsl(42 92% 68% / 0.12);
}

[data-theme="clockwork"] .tab_btn.active,
[data-theme="clockwork"] .tab_btn.active-tab,
[data-theme="clockwork"] .tab_btn_vertical.active,
[data-theme="clockwork"] .tab-buttons .tab-btn.active,
[data-theme="clockwork"] .tab-navigation .tab-btn.active,
[data-theme="clockwork"] .tab_btn_horizontal.active,
[data-theme="clockwork"] .tab_btn_horizontal.main-tab,
[data-theme="clockwork"] .tab_btn_horizontal.main-tab.active,
[data-theme="clockwork"] .tab_btn_original.active,
[data-theme="clockwork"] #navi-btn-combat.tab_btn.combat-active {
    background:
        linear-gradient(135deg, hsl(40 68% 56%), hsl(24 62% 42%)) !important;
    border-color: hsl(42 86% 76%) !important;
    color: hsl(24 18% 12%) !important;
    box-shadow:
        0 0 0 3px hsl(40 82% 62% / 0.16),
        0 14px 28px hsl(18 28% 8% / 0.34),
        0 0 20px hsl(42 92% 68% / 0.18) !important;
}

[data-theme="clockwork"] .tab_btn.active-tab .tab_Icon,
[data-theme="clockwork"] .tab_btn.active-tab img,
[data-theme="clockwork"] .tab_btn_vertical.active img,
[data-theme="clockwork"] .tab-buttons .tab-btn.active .tab_Icon,
[data-theme="clockwork"] .tab-navigation .tab-btn.active .tab_Icon,
[data-theme="clockwork"] .tab_btn_horizontal.active img,
[data-theme="clockwork"] .tab_btn_horizontal.main-tab img,
[data-theme="clockwork"] .tab_btn_original.active img,
[data-theme="clockwork"] #navi-btn-combat.tab_btn.combat-active img {
    filter: brightness(0) saturate(100%) invert(13%) sepia(12%)
        saturate(1191%) hue-rotate(351deg) brightness(92%) contrast(96%) !important;
}

/* ==========================================================================
   Buttons and Inputs
   ========================================================================= */

[data-theme="clockwork"] button,
[data-theme="clockwork"] .btn,
[data-theme="clockwork"] .roll-button,
[data-theme="clockwork"] input[type="button"],
[data-theme="clockwork"] input[type="submit"] {
    background:
        linear-gradient(180deg, hsl(40 72% 56%), hsl(28 62% 34%));
    color: hsl(24 18% 12%);
    border: 1px solid hsl(42 84% 72% / 0.78);
    border-radius: var(--radius-lg);
    box-shadow:
        inset 0 1px 0 hsl(42 72% 86% / 0.28),
        0 10px 22px hsl(18 28% 8% / 0.28);
}

[data-theme="clockwork"] button:hover,
[data-theme="clockwork"] .btn:hover,
[data-theme="clockwork"] .roll-button:hover,
[data-theme="clockwork"] input[type="button"]:hover,
[data-theme="clockwork"] input[type="submit"]:hover {
    background:
        linear-gradient(180deg, hsl(42 82% 62%), hsl(28 66% 40%));
    box-shadow:
        inset 0 1px 0 hsl(42 72% 88% / 0.34),
        0 14px 26px hsl(18 28% 8% / 0.32),
        0 0 18px hsl(42 92% 68% / 0.12);
}

[data-theme="clockwork"] input,
[data-theme="clockwork"] textarea,
[data-theme="clockwork"] select,
[data-theme="clockwork"] .select,
[data-theme="clockwork"] .form-select,
[data-theme="clockwork"] .equipment-select {
    background:
        linear-gradient(180deg, hsl(28 12% 22%), hsl(24 14% 15%));
    border: 1px solid hsl(34 24% 42% / 0.46);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 hsl(42 32% 82% / 0.06);
}

[data-theme="clockwork"] input:focus,
[data-theme="clockwork"] textarea:focus,
[data-theme="clockwork"] select:focus,
[data-theme="clockwork"] .select:focus,
[data-theme="clockwork"] .form-select:focus,
[data-theme="clockwork"] .equipment-select:focus {
    border-color: hsl(40 72% 62%);
    box-shadow:
        0 0 0 4px var(--color-focus-ring),
        0 0 18px hsl(42 92% 68% / 0.1);
    outline: none;
}

/* ==========================================================================
   Tables
   ========================================================================= */

[data-theme="clockwork"] table {
    background: hsl(24 18% 16% / 0.96);
    border: 1px solid hsl(34 22% 36% / 0.3);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

[data-theme="clockwork"] th {
    background: hsl(30 26% 24% / 0.92);
    color: hsl(40 56% 78%);
}

[data-theme="clockwork"] td {
    background: hsl(24 16% 17% / 0.92);
    color: var(--text-primary);
    border-bottom: 1px solid hsl(34 18% 34% / 0.16);
}

[data-theme="clockwork"] tr:hover td {
    background: hsl(28 20% 22% / 0.96);
}

/* ==========================================================================
   Cards, Widgets, Login
   ========================================================================= */

[data-theme="clockwork"] .widget-tile,
[data-theme="clockwork"] .character-item {
    overflow: hidden;
}

[data-theme="clockwork"] .character-item:hover,
[data-theme="clockwork"] .widget-tile:hover {
    transform: translateY(-3px);
}

[data-theme="clockwork"] .character-item::after,
[data-theme="clockwork"] .widget-tile::after,
[data-theme="clockwork"] .login-container::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, hsl(42 82% 82%), hsl(34 58% 46%) 62%, hsl(24 18% 18%) 100%);
    box-shadow:
        16px 0 0 -3px hsl(42 72% 62% / 0.72),
        0 16px 0 -3px hsl(20 56% 42% / 0.68);
}

[data-theme="clockwork"] .login-container {
    border-radius: var(--radius-2xl);
}

/* ==========================================================================
   Attribute Cards and Stats
   ========================================================================= */

[data-theme="clockwork"] .attribute-cards-container {
    background:
        linear-gradient(180deg, hsl(28 18% 20% / 0.42), hsl(24 16% 16% / 0.42));
    border-radius: var(--radius-2xl);
}

[data-theme="clockwork"] .attribute-icon-container {
    background:
        linear-gradient(135deg, hsl(38 44% 36%), hsl(24 32% 24%));
    color: hsl(42 62% 82%);
}

[data-theme="clockwork"] .attribute-value,
[data-theme="clockwork"] .stat-value,
[data-theme="clockwork"] .tt-total-label,
[data-theme="clockwork"] .tt-total-value {
    color: hsl(40 72% 66%);
}

[data-theme="clockwork"] .attribute-bonus {
    background: hsl(156 18% 24%);
    color: hsl(156 28% 62%);
}

[data-theme="clockwork"] .attribute-subskills,
[data-theme="clockwork"] .roll-result {
    background: hsl(24 16% 16% / 0.9);
    border: 1px solid hsl(34 18% 34% / 0.22);
    border-radius: var(--radius-lg);
}

[data-theme="clockwork"] .subskill-item {
    border-bottom-color: hsl(34 18% 34% / 0.16);
}

[data-theme="clockwork"] .subskill-name {
    color: hsl(40 58% 74%);
}

[data-theme="clockwork"] .subskill-effect,
[data-theme="clockwork"] .stat-label {
    color: hsl(32 20% 68%);
}

[data-theme="clockwork"] .attribute-card.physical {
    border-left-color: hsl(156 28% 56%);
}

[data-theme="clockwork"] .attribute-card.mental {
    border-left-color: hsl(204 34% 58%);
}

[data-theme="clockwork"] .attribute-card.social {
    border-left-color: hsl(34 82% 58%);
}

[data-theme="clockwork"] .attribute-card.special {
    border-left-color: hsl(284 26% 56%);
}

[data-theme="clockwork"] .stat-item {
    background: hsl(26 16% 18% / 0.9);
    border: 1px solid hsl(34 18% 34% / 0.24);
    border-radius: var(--radius-lg);
}

[data-theme="clockwork"] .stat-item:hover {
    background: hsl(28 20% 22% / 0.94);
}

/* ==========================================================================
   Inventory, Spellbook, Resistances
   ========================================================================= */

[data-theme="clockwork"] .currency-tile,
[data-theme="clockwork"] .resistance-tile,
[data-theme="clockwork"] .buff-tile,
[data-theme="clockwork"] .inventory-slot,
[data-theme="clockwork"] .inventory-item {
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 0 hsl(42 32% 82% / 0.05);
}

[data-theme="clockwork"] .currency-add-icon {
    color: hsl(40 72% 62%);
}

[data-theme="clockwork"] .buff-duration {
    background-color: hsl(28 20% 26% / 0.72);
    color: hsl(38 32% 74%);
}

[data-theme="clockwork"] .no-buffs-message,
[data-theme="clockwork"] .resistance-stat-label {
    color: hsl(30 14% 56%);
}

[data-theme="clockwork"] .equipped-indicator-icon {
    background-color: hsl(20 64% 46%);
    filter: drop-shadow(0 0 6px hsl(20 72% 54% / 0.46));
}

[data-theme="clockwork"] .spell-tile.temp-spell {
    border-color: var(--spell-temp-border) !important;
    background:
        linear-gradient(180deg, var(--spell-temp-bg), hsl(24 20% 18%)) !important;
}

[data-theme="clockwork"] .spell-tile.temp-spell:hover {
    background:
        linear-gradient(180deg, var(--spell-temp-hover-bg), hsl(26 22% 22%)) !important;
}

[data-theme="clockwork"] .spell-name,
[data-theme="clockwork"] .spell-progress {
    color: hsl(38 34% 82%);
}

[data-theme="clockwork"] .spell-cost {
    color: hsl(42 62% 62%);
}

/* ==========================================================================
   Bars and Progress
   ========================================================================= */

[data-theme="clockwork"] .progress-container,
[data-theme="clockwork"] .bar-track,
[data-theme="clockwork"] .resource-bar,
[data-theme="clockwork"] .weight-bar-container {
    background:
        linear-gradient(180deg, hsl(24 14% 14%), hsl(18 18% 10%)) !important;
    border: 1px solid hsl(34 18% 34% / 0.44) !important;
    border-radius: 999px !important;
    box-shadow:
        inset 0 2px 6px hsl(18 28% 8% / 0.48),
        inset 0 1px 0 hsl(42 32% 82% / 0.04);
}

[data-theme="clockwork"] #healthText,
[data-theme="clockwork"] #magicText,
[data-theme="clockwork"] #enduranceText {
    color: hsl(42 42% 88%);
    text-shadow: 0 1px 0 hsl(18 28% 8% / 0.8);
}

[data-theme="clockwork"] .progress-bar,
[data-theme="clockwork"] .progress-fill,
[data-theme="clockwork"] .bar-fill {
    border-radius: 999px !important;
    overflow: hidden;
}

[data-theme="clockwork"] .health-bar,
[data-theme="clockwork"] .hp-bar-fill {
    background:
        linear-gradient(90deg, hsl(8 62% 38%) 0%, hsl(20 72% 50%) 54%, hsl(34 82% 58%) 100%) !important;
    box-shadow: 0 0 14px hsl(20 72% 50% / 0.14) !important;
}

[data-theme="clockwork"] .magic-bar,
[data-theme="clockwork"] .mana-bar-fill,
[data-theme="clockwork"] .energy-bar-fill {
    background:
        linear-gradient(90deg, hsl(206 24% 38%) 0%, hsl(194 34% 52%) 56%, hsl(164 24% 56%) 100%) !important;
    box-shadow: 0 0 14px hsl(194 34% 52% / 0.12) !important;
}

[data-theme="clockwork"] .endurance-bar,
[data-theme="clockwork"] .stamina-bar-fill {
    background:
        linear-gradient(90deg, hsl(34 58% 40%) 0%, hsl(40 78% 58%) 55%, hsl(48 84% 68%) 100%) !important;
    box-shadow: 0 0 14px hsl(40 78% 58% / 0.14) !important;
}

[data-theme="clockwork"] .weight-progress-bar.weight-ok,
[data-theme="clockwork"] .weight-fill,
[data-theme="clockwork"] .encumbrance-fill {
    background:
        linear-gradient(90deg, hsl(156 22% 40%) 0%, hsl(164 28% 54%) 100%) !important;
}

[data-theme="clockwork"] .weight-progress-bar.weight-warn {
    background:
        linear-gradient(90deg, hsl(34 58% 40%) 0%, hsl(44 82% 64%) 100%) !important;
}

[data-theme="clockwork"] .weight-progress-bar.weight-crit {
    background:
        linear-gradient(90deg, hsl(8 58% 38%) 0%, hsl(18 72% 54%) 100%) !important;
}

/* ==========================================================================
   Tooltips
   ========================================================================= */

[data-theme="clockwork"] .unified-tooltip,
[data-theme="clockwork"] .spell-tooltip,
[data-theme="clockwork"] #item-tooltip {
    background:
        linear-gradient(180deg, hsl(24 18% 18% / 0.98), hsl(18 20% 12% / 0.98));
    border: 1px solid hsl(34 28% 42% / 0.52);
    border-radius: var(--radius-xl);
    color: var(--color-tooltip-text);
    box-shadow:
        0 18px 40px hsl(18 28% 8% / 0.5),
        0 0 18px hsl(42 92% 68% / 0.08);
}

[data-theme="clockwork"] .itooltip-title,
[data-theme="clockwork"] .skilltooltip-title,
[data-theme="clockwork"] .attrtooltip-title,
[data-theme="clockwork"] .stattooltip-title,
[data-theme="clockwork"] .unified-tooltip .tooltip-title {
    color: hsl(40 84% 68%) !important;
}

[data-theme="clockwork"] .tt-section {
    background: hsl(28 16% 20% / 0.72);
    border-radius: var(--radius-md);
}

[data-theme="clockwork"] .tt-sep-accent {
    border-top-color: hsl(40 72% 62%);
}

/* ==========================================================================
   Toggles and Controls
   ========================================================================= */

[data-theme="clockwork"] .twohanded-toggle {
    background: transparent !important;
    border: 2px solid hsl(34 34% 44%);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 hsl(42 32% 82% / 0.05);
}

[data-theme="clockwork"] .twohanded-toggle:hover {
    background: hsl(34 24% 22% / 0.42) !important;
    border-color: hsl(40 72% 62%);
    box-shadow: 0 0 14px hsl(42 92% 68% / 0.08);
}

[data-theme="clockwork"] .twohanded-toggle.active {
    background:
        linear-gradient(135deg, hsl(40 68% 56%), hsl(24 62% 42%)) !important;
    border-color: hsl(42 86% 76%);
    box-shadow:
        0 0 0 3px hsl(40 82% 62% / 0.16),
        0 0 18px hsl(42 92% 68% / 0.14);
}

[data-theme="clockwork"] .twohanded-toggle.active .twohanded-toggle-icon {
    filter: brightness(0) saturate(100%) invert(13%) sepia(12%)
        saturate(1191%) hue-rotate(351deg) brightness(92%) contrast(96%) !important;
}

/* ==========================================================================
   Scrollbars and Selection
   ========================================================================= */

[data-theme="clockwork"] ::-webkit-scrollbar-track {
    background: hsl(24 14% 14%);
    border-radius: 999px;
}

[data-theme="clockwork"] ::-webkit-scrollbar-thumb {
    background:
        linear-gradient(180deg, hsl(34 42% 38%), hsl(24 44% 28%));
    border-radius: 999px;
    border: 2px solid hsl(24 14% 14%);
}

[data-theme="clockwork"] ::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg, hsl(40 52% 46%), hsl(24 50% 34%));
}

[data-theme="clockwork"] ::selection {
    background: hsl(40 72% 62% / 0.28);
    color: hsl(22 28% 12%);
}

/* ==========================================================================
   Utility
   ========================================================================= */

[data-theme="clockwork"] hr,
[data-theme="clockwork"] .divider {
    border: none;
    border-top: 1px solid hsl(34 18% 34% / 0.24);
}
[data-theme="clockwork"] .toxicity-container {
    border-color: var(--color-toxicity) !important;
}

[data-theme="clockwork"] .toxicity-bar {
    background: var(--gradient-toxicity-resource) !important;
    box-shadow: var(--shadow-glow-toxicity) !important;
}

[data-theme="clockwork"] #toxicityText {
    color: var(--text-light);
}
