/* ==========================================================================
   Warmane Armory — Modern Dark Theme Stylesheet
   ========================================================================== */

:root {
    --bg-dark: #0b0c10;
    --bg-card: #151720;
    --bg-card-hover: #1c1e2b;
    --bg-slot: #1a1c28;
    --border-subtle: #262938;
    --border-accent: #3a3f56;

    --text-primary: #f0f2f8;
    --text-secondary: #8e95ab;
    --text-muted: #5e6478;

    --accent-blue: #4a9eff;
    --accent-gold: #f5c542;
    --accent-green: #2ecc71;
    --accent-red: #e74c3c;

    --quality-0: #9d9d9d;
    --quality-1: #ffffff;
    --quality-2: #1eff00;
    --quality-3: #0070dd;
    --quality-4: #a335ee;
    --quality-5: #ff8000;
    --quality-6: #e6cc80;
    --quality-7: #00ccff;

    --class-dk: #c41f3b;
    --class-druid: #ff7d0a;
    --class-hunter: #abd473;
    --class-mage: #69ccf0;
    --class-paladin: #f58cba;
    --class-priest: #ffffff;
    --class-rogue: #fff569;
    --class-shaman: #0070de;
    --class-warlock: #9482c9;
    --class-warrior: #c79c6e;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Landing page */
.landing-page,
.not-found-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 35%, rgba(74, 158, 255, 0.09), transparent 34rem),
        var(--bg-dark);
}

.landing-content {
    width: min(100%, 700px);
    text-align: center;
}

.landing-title {
    margin: 0 0 28px;
    color: var(--text-primary);
    font-size: clamp(3.25rem, 10vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}

.character-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 8px;
    background: rgba(21, 23, 32, 0.94);
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.character-search-input,
.character-search-realm {
    min-width: 0;
    border: 0;
    border-radius: 8px;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
}

.character-search-input {
    padding: 13px 14px;
    font-size: 1rem;
}

.character-search-input::placeholder {
    color: var(--text-muted);
}

.character-search-realm {
    padding: 0 34px 0 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.character-search-realm option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.character-search:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.12), 0 18px 60px rgba(0, 0, 0, 0.38);
}

.character-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-blue);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.character-search-button:hover {
    background: #328cf5;
}

.character-search-button:active {
    transform: translateY(1px);
}

.recent-searches {
    margin-top: 28px;
}

.recent-searches-title {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.recent-searches-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recent-character-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(21, 23, 32, 0.72);
    color: var(--text-primary);
    font-size: 0.88rem;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.recent-character-link:hover,
.recent-character-link:focus-visible {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.08);
}

.recent-character-link:focus-visible {
    outline: 3px solid rgba(74, 158, 255, 0.25);
    outline-offset: 2px;
}

.recent-character-name {
    font-weight: 600;
}

.recent-character-realm {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.landing-api-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    text-underline-offset: 3px;
}

.landing-api-link:hover,
.landing-api-link:focus-visible {
    color: var(--accent-blue);
}

/* API documentation */
.api-page {
    min-height: 100vh;
    padding: 40px 20px 72px;
    background:
        radial-gradient(circle at 50% 0%, rgba(74, 158, 255, 0.09), transparent 36rem),
        var(--bg-dark);
}

.api-container {
    width: min(100%, 880px);
    margin: 0 auto;
}

.api-nav {
    margin-bottom: 36px;
}

.api-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.api-nav a:hover,
.api-nav a:focus-visible {
    color: var(--accent-blue);
}

.api-header {
    margin-bottom: 36px;
}

.api-eyebrow {
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.api-header h1 {
    margin: 8px 0 12px;
    font-size: clamp(2.25rem, 7vw, 4rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.api-header p,
.api-endpoint p {
    color: var(--text-secondary);
}

.api-header p {
    max-width: 680px;
    margin: 0;
    font-size: 1.05rem;
}

.api-endpoint,
.api-notes {
    margin-top: 18px;
    padding: 26px;
    background: rgba(21, 23, 32, 0.94);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.api-endpoint-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-wrap: anywhere;
}

.api-method {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.api-method-get {
    color: #75b8ff;
    background: rgba(74, 158, 255, 0.14);
}

.api-method-post {
    color: #73df9e;
    background: rgba(46, 204, 113, 0.14);
}

.api-endpoint h2,
.api-notes h2 {
    margin: 18px 0 8px;
    font-size: 1.25rem;
}

.api-endpoint h3 {
    margin: 22px 0 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.api-endpoint p {
    margin: 0;
}

.api-page code {
    color: #b8d9ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.api-page pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: #0c0e14;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.api-notes ul {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.api-notes li + li {
    margin-top: 8px;
}

/* Character not found */
.not-found-card {
    width: min(100%, 480px);
    padding: 40px 32px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.not-found-brand {
    margin: 0 0 28px;
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.not-found-card h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    letter-spacing: -0.035em;
}

.not-found-card > p:not(.not-found-brand) {
    margin: 0 0 28px;
    color: var(--text-secondary);
}

.not-found-link {
    display: inline-flex;
    padding: 10px 16px;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.not-found-link:hover {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.08);
}

@media (max-width: 620px) {
    .character-search {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .character-search-input {
        grid-column: 1 / -1;
        border-bottom: 1px solid var(--border-subtle);
        border-radius: 0;
    }

    .character-search-button {
        min-height: 46px;
    }
}

.armory-wrapper {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 16px;
}

.character-page-search {
    margin-bottom: 20px;
}

/* Header Card */
.header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 32px;
}

.char-main-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.char-name {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.realm-badge {
    background: var(--bg-slot);
    border: 1px solid var(--border-accent);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expansion-badge {
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.4);
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

.char-details-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    display: flex;
    gap: 12px;
    align-items: center;
}

.guild-name {
    color: var(--accent-gold);
    font-weight: 600;
}

.stat-meta,
.stat-rank,
.guild-uwu-rank span,
.member-race {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.stat-rank {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.guild-header-card {
    margin-bottom: 1.25rem;
}

.guild-member-link {
    color: var(--accent-gold);
    font-weight: 700;
    text-decoration: none;
}

.guild-member-link:hover,
.guild-name:hover {
    text-decoration: underline;
}

.faction-badge {
    border-radius: 999px;
    padding: 0.26rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.faction-horde { background: rgba(190, 42, 42, 0.2); color: #ff7777; }
.faction-alliance { background: rgba(54, 110, 205, 0.2); color: #82adff; }
.rank-pending { color: var(--text-muted); font-style: italic; }

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

.stat-pill {
    background: var(--bg-slot);
    border: 1px solid var(--border-subtle);
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 110px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.gear-header-actions,
.character-tab-list,
.stats-spec-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-tab-list,
.stats-spec-tabs {
    padding: 4px;
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
    background: var(--bg-slot);
}

.character-tab,
.stats-spec-tab {
    padding: 7px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.character-tab:hover,
.stats-spec-tab:hover {
    color: var(--text-primary);
}

.character-tab.active,
.stats-spec-tab.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.model-viewer-setting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-slot);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.model-viewer-setting input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.model-viewer-setting-track {
    position: relative;
    width: 34px;
    height: 20px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--border-accent);
    transition: background-color 0.2s ease;
}

.model-viewer-setting-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-primary);
    transition: transform 0.2s ease;
}

.model-viewer-setting input:checked + .model-viewer-setting-track {
    background: var(--accent-blue);
}

.model-viewer-setting input:checked + .model-viewer-setting-track::after {
    transform: translateX(14px);
}

.model-viewer-setting input:focus-visible + .model-viewer-setting-track {
    outline: 3px solid rgba(74, 158, 255, 0.45);
    outline-offset: 2px;
}

.character-tab-panel[hidden],
.stats-spec-panel[hidden] {
    display: none;
}

.stats-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
}

.stats-panel-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.15rem;
}

.stats-panel-heading p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.achievements-panel-heading,
.icc-achievement-group-heading,
.icc-achievement-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.achievements-panel-heading {
    align-items: flex-start;
    margin-bottom: 18px;
}

.achievements-panel-heading h3,
.icc-achievement-group-heading h4,
.icc-achievement h5 {
    margin: 0;
    color: var(--text-primary);
}

.achievements-panel-heading p,
.icc-achievement p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.achievements-panel-heading a {
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.raid-group-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
    background: var(--bg-slot);
}

.raid-group-tab {
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.raid-group-tab:hover {
    color: var(--text-primary);
}

.raid-group-tab.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.raid-group-panel[hidden] {
    display: none;
}

.icc-achievement-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.icc-achievement-group {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-slot);
}

.icc-achievement-group-heading {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.icc-achievement-group-heading span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.raid-size-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.raid-size-column {
    min-width: 0;
}

.raid-size-column + .raid-size-column {
    border-left: 1px solid var(--border-subtle);
}

.raid-size-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.025);
}

.raid-size-heading h5 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.83rem;
    text-transform: uppercase;
}

.raid-size-heading span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.icc-achievement-list {
    display: grid;
}

.icc-achievement {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.icc-achievement:last-child {
    border-bottom: 0;
}

.icc-achievement.is-locked {
    opacity: 0.58;
}

.icc-achievement-icon {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border: 1px solid var(--border-accent);
    border-radius: 7px;
    background: var(--bg-card);
}

.icc-achievement-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.icc-achievement-meta {
    justify-content: flex-start;
    margin-bottom: 3px;
}

.icc-achievement-section,
.icc-difficulty {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.icc-difficulty {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.icc-difficulty-heroic {
    color: #ff8c69;
    background: rgba(255, 90, 54, 0.12);
}

.icc-difficulty-hard-mode {
    color: #c9a7ff;
    background: rgba(166, 112, 255, 0.14);
}

.icc-achievement h5 {
    font-size: 0.9rem;
}

.icc-achievement-status {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    min-width: 78px;
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.icc-achievement.is-earned .icc-achievement-status strong {
    color: var(--status-ok, #69d48f);
}

.achievements-loading,
.achievements-error {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 150px;
    color: var(--text-muted);
    text-align: center;
}

.calculated-stat-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.calculated-stat-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.calculated-stat-table th,
.calculated-stat-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.calculated-stat-table thead th {
    background: var(--bg-slot);
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.calculated-stat-table th:first-child {
    text-align: left;
}

.calculated-stat-table tbody tr:last-child th,
.calculated-stat-table tbody tr:last-child td {
    border-bottom: 0;
}

.calculated-stat-table td small {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.calculated-stat-total {
    color: var(--accent-gold);
    font-size: 1.08rem;
    font-weight: 800;
}

.secondary-stat-grid,
.rating-conversion-grid,
.hit-bonus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.secondary-stat-card,
.rating-conversion-card,
.hit-bonus-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
    background: var(--bg-slot);
}

.secondary-stat-card span,
.rating-conversion-name,
.hit-bonus-card span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.secondary-stat-card strong,
.rating-conversion-card strong,
.hit-bonus-card strong {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.hit-bonus-card strong {
    color: var(--accent-green);
}

.rating-conversion-card small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.stat-subheading {
    margin: 20px 0 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.talent-modifier-summary,
.stat-calculation-notes,
.stat-unavailable {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.talent-modifier-summary {
    margin-top: 16px;
}

.talent-modifier-summary strong {
    color: var(--text-secondary);
}

.stat-calculation-notes {
    margin: 12px 0 0;
    padding-left: 1.2rem;
}

.stats-debug-link,
.stats-debug-back {
    display: inline-flex;
    margin-top: 10px;
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.stats-debug-link:hover,
.stats-debug-back:hover {
    text-decoration: underline;
}

.stats-debug-page {
    max-width: 1320px;
}

.stats-debug-back {
    margin: 0 0 14px;
}

.stats-debug-header {
    align-items: center;
}

.stats-debug-character-line {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

.stats-debug-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.stats-debug-intro h2,
.stats-debug-intro p {
    margin: 0;
}

.stats-debug-intro p {
    max-width: 760px;
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-debug-intro code {
    color: var(--accent-gold);
}

.stats-debug-spec[hidden] {
    display: none;
}

.debug-item-list {
    display: grid;
    gap: 14px;
}

.debug-item-card {
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: rgba(10, 12, 18, 0.32);
}

.debug-item-heading,
.debug-source-row,
.debug-total-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.debug-item-heading {
    grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1fr);
    align-items: center;
    background: var(--bg-slot);
}

.debug-item-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.debug-item-heading > div > span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.debug-source-row > strong,
.debug-total-row > strong {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.debug-source-row:last-child,
.debug-total-row {
    border-bottom: 0;
}

.debug-total-row {
    margin-top: 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-slot);
}

.debug-stat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.debug-stat-chips span,
.debug-effect {
    display: inline-flex;
    gap: 4px;
    padding: 4px 7px;
    border: 1px solid rgba(74, 158, 255, 0.22);
    border-radius: 999px;
    background: rgba(74, 158, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.debug-stat-chips strong,
.debug-effect {
    color: var(--accent-blue);
}

.debug-empty {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
}

.debug-source-name {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.82rem;
}

.debug-nested-sources {
    display: grid;
    gap: 10px;
}

.debug-raw-stats {
    margin: 0 14px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(15, 17, 26, 0.55);
}

.debug-raw-stats summary {
    padding: 9px 11px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.debug-source-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.debug-source-table th,
.debug-source-table td {
    padding: 9px 11px;
    border-top: 1px solid var(--border-subtle);
    text-align: left;
    vertical-align: top;
}

.debug-source-table thead th {
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.debug-source-table a {
    color: var(--accent-blue);
}

.debug-talent-table .is-recognized th:first-child {
    color: var(--accent-green);
}

.debug-talent-table .is-ignored {
    opacity: 0.72;
}

.debug-effect {
    margin: 1px 4px 1px 0;
    color: var(--accent-green);
}

/* Actions & Timestamp */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.scraped-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stale-notice {
    display: block;
    margin-top: 3px;
    color: var(--accent-gold);
    font-size: 0.78rem;
    font-weight: 500;
}

.btn-refresh {
    background: linear-gradient(135deg, #2b3245 0%, #1c202e 100%);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

/* Banner Alert */
.alert-banner {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning {
    background: rgba(245, 197, 66, 0.1);
    border: 1px solid rgba(245, 197, 66, 0.3);
    color: var(--accent-gold);
}

/* Status Banner (Enchants/Gems) */
.status-summary-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gear-audit-status {
    margin: 16px 0 0;
}

.status-card {
    flex: 1;
    min-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.status-ok {
    border-left: 4px solid var(--accent-green);
}

.status-warn {
    border-left: 4px solid var(--accent-red);
}

/* Section Cards & Headers */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Gear Grid Layout */
.gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.gear-slot-card {
    background: var(--bg-slot);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.gear-slot-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.gear-slot-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gear-slot-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    border: 2px solid var(--border-subtle);
    object-fit: cover;
    flex-shrink: 0;
}

.gear-slot-item-icon.q-0 { border-color: var(--quality-0); }
.gear-slot-item-icon.q-1 { border-color: #d1d5db; }
.gear-slot-item-icon.q-2 { border-color: var(--quality-2); box-shadow: 0 0 6px rgba(30, 255, 0, 0.4); }
.gear-slot-item-icon.q-3 { border-color: var(--quality-3); box-shadow: 0 0 8px rgba(0, 112, 221, 0.5); }
.gear-slot-item-icon.q-4 { border-color: var(--quality-4); box-shadow: 0 0 10px rgba(163, 53, 238, 0.6); }
.gear-slot-item-icon.q-5 { border-color: var(--quality-5); box-shadow: 0 0 12px rgba(255, 128, 0, 0.7); }
.gear-slot-item-icon.q-6 { border-color: var(--quality-6); box-shadow: 0 0 12px rgba(230, 204, 128, 0.7); }
.gear-slot-item-icon.q-7 { border-color: var(--quality-7); box-shadow: 0 0 12px rgba(0, 204, 255, 0.7); }

.slot-item-title {
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    display: block;
}

.slot-item-title:hover {
    text-decoration: underline;
}

.slot-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.slot-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Spec Switcher & Talent Trees (WotLK/TBC Style) */
.spec-toggle-group {
    display: flex;
    gap: 8px;
    background: var(--bg-slot);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.spec-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spec-toggle-btn:hover {
    color: var(--text-primary);
}

.spec-toggle-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.spec-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.spec-pane.active {
    display: block;
}

/* ==========================================================================
   Talent Calculator - Classic WoW / WotLK Visual Talent Trees & Glyphs Layout
   ========================================================================== */
.talent-calculator-layout {
    display: flex;
    gap: 24px;
    background: rgba(12, 14, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.talent-trees-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.talent-trees-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.talent-tree-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.talent-tree-grid-box {
    background: rgba(5, 7, 12, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 8px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.talent-tier-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    justify-items: center;
    align-items: center;
    height: 40px;
}

.talent-slot-cell {
    width: 36px;
    height: 36px;
}

.talent-slot-cell.empty-slot {
    pointer-events: none;
}

.talent-icon-box {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: block;
    overflow: visible;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    box-sizing: border-box;
}

.talent-icon-img {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    display: block;
    object-fit: cover;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

/* Status variants */
.talent-icon-box.status-max {
    border: 1px solid #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

.talent-icon-box.status-active {
    border: 1px solid #00ff66;
    box-shadow: 0 0 6px rgba(0, 255, 102, 0.35);
}

.talent-icon-box.status-disabled {
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.talent-icon-box.status-disabled .talent-icon-img {
    filter: grayscale(100%) brightness(0.6) opacity(0.55);
}

.talent-icon-box:hover {
    transform: scale(1.12);
    z-index: 10;
    border-color: #ffd700 !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.7) !important;
}

.talent-icon-box:hover .talent-icon-img {
    filter: none !important;
    opacity: 1 !important;
}

/* Rank Badge */
.talent-rank-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    font-size: 0.7rem;
    font-weight: 800;
    font-family: monospace, sans-serif;
    padding: 0 3px;
    border-radius: 3px;
    line-height: 1.2;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.talent-rank-badge.status-max {
    background: rgba(15, 15, 15, 0.95);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.talent-rank-badge.status-active {
    background: rgba(15, 15, 15, 0.95);
    color: #00ff66;
    border: 1px solid #00ff66;
}

.talent-rank-badge.status-disabled {
    background: rgba(10, 10, 10, 0.85);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tree Summary Footer (Bottom Row) */
.talent-trees-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 16px;
    background: rgba(8, 10, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.tree-footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-footer-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.tree-footer-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tree-footer-points {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-gold);
}

/* Glyphs Sidebar (Right Column) */
.glyphs-sidebar {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.glyph-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glyph-section-header {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.4px;
}

.glyph-section-header.major-header {
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
}

.glyph-section-header.minor-header {
    color: #cca43b;
}

.glyph-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glyph-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.glyph-item:hover {
    color: var(--text-primary);
}

.glyph-ring-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.glyph-ring-dot.gold-ring {
    background: var(--accent-gold);
    box-shadow: 0 0 6px rgba(245, 197, 66, 0.6);
}

.glyph-ring-dot.blue-ring {
    background: var(--accent-blue);
    box-shadow: 0 0 6px rgba(74, 158, 255, 0.6);
}

.glyph-ring-dot.empty-ring {
    background: var(--text-muted);
    opacity: 0.3;
}

.glyph-text.muted {
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 992px) {
    .talent-calculator-layout {
        flex-direction: column;
    }
    .glyphs-sidebar {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 16px;
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .talent-trees-grid {
        grid-template-columns: 1fr;
    }
    .glyphs-sidebar {
        flex-direction: column;
    }
}

.talent-code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-slot);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.code-label {
    color: var(--text-muted);
}

.talent-code-box code {
    font-family: monospace;
    color: var(--accent-blue);
}

/* WotLK Glyphs */
.glyph-spec-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.glyph-spec-pane.active {
    display: block;
}

.glyph-spec-title {
    font-size: 1.1rem;
    color: var(--accent-gold);
    margin-top: 0;
    margin-bottom: 16px;
}

.glyphs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.glyph-group {
    background: var(--bg-slot);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 16px;
}

.glyph-group-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
}

.major-title { color: var(--accent-gold); }
.minor-title { color: var(--accent-blue); }

.glyph-sockets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glyph-socket-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: 8px;
    transition: transform 0.15s ease;
}

.glyph-socket-item:hover {
    transform: translateX(4px);
    border-color: var(--border-accent);
}

.glyph-ring {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gold-ring {
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 6px rgba(245, 197, 66, 0.4);
}

.blue-ring {
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 6px rgba(74, 158, 255, 0.4);
}

.glyph-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.empty-glyph {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Two Column Grid for Professions & Kills */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .two-col-grid {
        grid-template-columns: 1fr;
    }
}

.professions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.profession-card {
    background: var(--bg-slot);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--accent-gold);
    width: max-content;
    max-width: 100%;
}

.prof-icon {
    flex-shrink: 0;
}

.prof-name {
    white-space: nowrap;
}

/* Quality Colors */
.q-0 { color: var(--quality-0) !important; }
.q-1 { color: var(--quality-1) !important; }
.q-2 { color: var(--quality-2) !important; }
.q-3 { color: var(--quality-3) !important; }
.q-4 { color: var(--quality-4) !important; }
.q-5 { color: var(--quality-5) !important; }
.q-6 { color: var(--quality-6) !important; }
.q-7 { color: var(--quality-7) !important; }

/* Class Colors */
.class-death-knight, .class-dk { color: var(--class-dk); }
.class-druid { color: var(--class-druid); }
.class-hunter { color: var(--class-hunter); }
.class-mage { color: var(--class-mage); }
.class-paladin { color: var(--class-paladin); }
.class-priest { color: var(--class-priest); }
.class-rogue { color: var(--class-rogue); }
.class-shaman { color: var(--class-shaman); }
.class-warlock { color: var(--class-warlock); }
.class-warrior { color: var(--class-warrior); }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.guild-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.guild-sort-button:hover {
    color: var(--text-primary);
}

.guild-sort-button:focus-visible {
    border-radius: 3px;
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

.sort-indicator::after {
    color: var(--text-muted);
    content: '\2195';
    font-size: 0.9rem;
}

.guild-roster-table th[aria-sort="ascending"] .sort-indicator::after {
    color: var(--accent-blue);
    content: '\2191';
}

.guild-roster-table th[aria-sort="descending"] .sort-indicator::after {
    color: var(--accent-blue);
    content: '\2193';
}

.data-table td {
    font-size: 0.95rem;
}

/* Uwu-logs rankings */
.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.uwu-logs-header {
    gap: 20px;
}

.uwu-logs-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.uwu-spec-select,
.btn-uwu-logs {
    min-height: 42px;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
}

.uwu-spec-select {
    min-width: 150px;
    padding: 8px 34px 8px 12px;
    background: var(--bg-slot);
    cursor: pointer;
}

.btn-uwu-logs {
    padding: 8px 16px;
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%);
    border-color: rgba(167, 139, 250, 0.75);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-uwu-logs:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.35);
}

.btn-uwu-logs:disabled,
.uwu-spec-select:disabled {
    cursor: wait;
    opacity: 0.65;
}

.uwu-logs-status {
    padding: 14px 16px;
    border: 1px dashed var(--border-accent);
    border-radius: 8px;
    background: rgba(26, 28, 40, 0.55);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.uwu-logs-status.is-loading {
    color: var(--accent-blue);
    border-color: rgba(74, 158, 255, 0.45);
}

.uwu-logs-status.is-success {
    color: var(--accent-green);
    border-color: rgba(46, 204, 113, 0.4);
}

.uwu-logs-status.is-error {
    color: var(--accent-red);
    border-color: rgba(231, 76, 60, 0.45);
}

#uwu-logs-results {
    margin-top: 18px;
    animation: fadeIn 0.25s ease-in-out;
}

.uwu-overall-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.uwu-overall-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-slot);
}

.uwu-overall-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.uwu-overall-value {
    color: #c4b5fd;
    font-size: 1.45rem;
    line-height: 1.25;
}

.uwu-spec-value {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uwu-rankings-table {
    min-width: 780px;
}

.uwu-encounter-name {
    color: var(--text-primary);
    font-weight: 700;
}

.uwu-points-trigger {
    appearance: none;
    padding: 0;
    border: 0;
    border-bottom: 1px dotted currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: help;
}

.uwu-points-tooltip {
    position: fixed;
    z-index: 10000;
    width: max-content;
    max-width: calc(100vw - 16px);
    padding: 5px 7px;
    border: 2px solid #a335ee;
    border-radius: 5px;
    background: rgba(5, 5, 8, 0.98);
    box-shadow: 0 0 7px rgba(163, 53, 238, 0.95), 0 8px 24px rgba(0, 0, 0, 0.7);
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.78rem;
    line-height: 1.25;
    pointer-events: none;
}

.uwu-points-tooltip::after {
    position: absolute;
    top: 100%;
    left: 50%;
    border: 6px solid transparent;
    border-top-color: #a335ee;
    content: '';
    transform: translateX(-50%);
}

.uwu-points-tooltip.is-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #a335ee;
}

.uwu-tooltip-row {
    display: grid;
    grid-template-columns: 76px minmax(44px, auto) 10px minmax(52px, auto) 10px 42px;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.uwu-tooltip-label {
    text-align: right;
}

.uwu-tooltip-number,
.uwu-tooltip-score {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.uwu-tooltip-separator {
    color: var(--text-secondary);
    text-align: center;
}

.uwu-tooltip-score {
    font-weight: 800;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Local WotLK item tooltip */
.item-tooltip {
    position: fixed;
    z-index: 12000;
    width: max-content;
    min-width: 280px;
    max-width: min(390px, calc(100vw - 20px));
    padding: 9px 11px;
    border: 1px solid #12628a;
    border-radius: 2px;
    background: rgba(3, 12, 17, 0.98);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.78);
    color: #fff;
    font: 500 13px/1.35 'Inter', system-ui, sans-serif;
    pointer-events: none;
}

.item-tooltip-content {
    min-width: 0;
}

.item-tooltip-icon {
    position: absolute;
    top: -2px;
    right: calc(100% + 5px);
    width: 48px;
    height: 48px;
    border: 2px solid currentColor;
    border-radius: 3px;
    background: #071017;
    object-fit: cover;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.item-tooltip-name {
    padding-right: 8px;
    font-size: 14px;
    font-weight: 700;
}

.item-tooltip-line,
.item-tooltip-split,
.item-tooltip-socket,
.item-tooltip-price {
    min-height: 18px;
}

.item-tooltip-split {
    display: flex;
    justify-content: space-between;
    gap: 28px;
}

.item-tooltip-positive {
    color: #1eff00;
}

.item-tooltip-transmog {
    color: #a335ee;
}

.item-tooltip-inactive {
    color: #9d9d9d;
}

.item-tooltip-socket.is-matched { color: #fff; }
.item-tooltip-socket.is-unmatched { color: #ff8040; }

.item-tooltip-socket {
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-tooltip-socket img,
.item-tooltip-socket-empty {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 1px solid #7d8493;
    border-radius: 50%;
    object-fit: cover;
}

.socket-meta { background: #d7d7d7; }
.socket-red { background: #cf202f; }
.socket-yellow { background: #f2cf32; }
.socket-blue { background: #256bd6; }
.socket-prismatic { background: linear-gradient(135deg, #cf202f, #f2cf32, #256bd6); }

.item-tooltip-flavor {
    color: #ffd100;
    font-style: italic;
}

.item-tooltip-set-name {
    color: #ffd100;
    margin-top: 7px;
}

.item-tooltip-set-member,
.item-tooltip-set-bonus {
    padding-left: 10px;
}

.item-tooltip-set-member {
    color: #888;
}

.item-tooltip-set-member.is-equipped {
    color: #ffff98;
}

.item-tooltip-price {
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-tooltip-coin-amount {
    margin-left: 2px;
}

.item-tooltip-coin {
    width: 11px;
    height: 11px;
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.65);
}

.coin-gold { background: #d9a821; }
.coin-silver { background: #b8bec8; }
.coin-copper { background: #a86335; }

.item-tooltip-q-0 { border-color: var(--quality-0); }
.item-tooltip-q-1 { border-color: #637180; }
.item-tooltip-q-2 { border-color: var(--quality-2); }
.item-tooltip-q-3 { border-color: var(--quality-3); }
.item-tooltip-q-4 { border-color: var(--quality-4); }
.item-tooltip-q-5 { border-color: var(--quality-5); }
.item-tooltip-q-6 { border-color: var(--quality-6); }
.item-tooltip-q-7 { border-color: var(--quality-7); }

@media (max-width: 480px) {
    .item-tooltip {
        min-width: 0;
        width: calc(100vw - 20px);
    }

    .item-tooltip-icon {
        display: none;
    }
}

/* ==========================================================================
   Equipment View & Paperdoll Layout
   ========================================================================== */
.gear-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.transmog-menu {
    position: relative;
}

.transmog-menu summary {
    list-style: none;
}

.transmog-menu summary::-webkit-details-marker {
    display: none;
}

.btn-transmog {
    border: 1px solid #7540a8;
    border-radius: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #39204f, #21152e);
    color: #d9b2ff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-transmog:hover,
.transmog-menu[open] .btn-transmog {
    border-color: #b46cff;
    background: #5b2a82;
    color: #fff;
}

.transmog-list {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    gap: 4px;
    width: max-content;
    min-width: 230px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid #7540a8;
    border-radius: 8px;
    background: rgba(20, 12, 29, 0.98);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

.transmog-list-item {
    padding: 8px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.transmog-list-item:hover {
    background: rgba(180, 108, 255, 0.14);
}

.view-toggle-group {
    display: flex;
    gap: 6px;
    background: var(--bg-slot);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    color: var(--text-primary);
}

.view-toggle-btn.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.equipment-view-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.equipment-view-pane.active {
    display: block;
}

/* Paperdoll Main Container */
.paperdoll-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #0d0f16;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    user-select: none;
    width: 100%;
}

.paperdoll-main-layout {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: 920px;
    min-height: 510px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    background: radial-gradient(circle at center, #1b2032 0%, #08090f 100%);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85);
}

.paperdoll-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
    padding: 12px 10px;
}

.paperdoll-column.left-column {
    background: linear-gradient(to right, rgba(8, 9, 15, 0.96) 0%, rgba(8, 9, 15, 0.76) 72%, transparent 100%);
}

.paperdoll-column.right-column {
    background: linear-gradient(to left, rgba(8, 9, 15, 0.96) 0%, rgba(8, 9, 15, 0.76) 72%, transparent 100%);
}

.paperdoll-center-lane {
    width: 250px;
    flex: 0 0 250px;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.paperdoll-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    width: 100%;
}

.paperdoll-row.left-row {
    flex-direction: row;
}

.paperdoll-row.right-row {
    flex-direction: row;
    justify-content: flex-end;
}

.paperdoll-slot {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slot-icon-box {
    width: 52px;
    height: 52px;
    background: var(--bg-slot);
    border-radius: 6px;
    border: 2px solid var(--border-subtle);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.slot-icon-box:hover {
    transform: scale(1.08);
    z-index: 10;
}

.slot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slot-fallback-symbol {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.slot-empty {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    background: rgba(15, 17, 26, 0.6);
    opacity: 0.6;
}

.slot-empty .slot-fallback-symbol {
    opacity: 0.4;
    filter: grayscale(1);
}

/* Item Level Badge Overlay on Icon Box (matching screenshot) */
.slot-ilvl-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: 'Inter', system-ui, sans-serif;
    background: rgba(0, 0, 0, 0.85);
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.slot-ilvl-badge.q-0 { color: #9d9d9d; }
.slot-ilvl-badge.q-1 { color: #ffffff; }
.slot-ilvl-badge.q-2 { color: #1eff00; }
.slot-ilvl-badge.q-3 { color: #0070dd; }
.slot-ilvl-badge.q-4 { color: #a335ee; }
.slot-ilvl-badge.q-5 { color: #ff8000; }
.slot-ilvl-badge.q-6 { color: #e6cc80; }
.slot-ilvl-badge.q-7 { color: #00ccff; }

/* Slot Info Block (Name, Green Enchant, Gems) */
.slot-info-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.slot-info-block.align-left {
    text-align: left;
    align-items: flex-start;
}

.slot-info-block.align-right {
    text-align: right;
    align-items: flex-end;
}

.slot-info-block.align-center {
    text-align: center;
    align-items: center;
}

.slot-item-name {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    display: block;
    transition: filter 0.15s ease;
}

.slot-item-name:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.slot-empty-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Sub-line (Enchants & Gem icons) */
.slot-sub-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 0.74rem;
    flex-wrap: wrap;
}

.slot-info-block.align-left .slot-sub-line {
    justify-content: flex-start;
}

.slot-info-block.align-right .slot-sub-line {
    justify-content: flex-end;
}

.slot-sub-line.center-sub {
    justify-content: center;
}

.slot-enchant-text {
    color: #00ff66;
    font-weight: 600;
    font-size: 0.74rem;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(0, 255, 102, 0.3);
}

.slot-enchant-missing {
    color: #ff4d4d;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.slot-gems-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.gem-icon-link {
    display: inline-flex;
    text-decoration: none;
}

.gem-icon-img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid var(--border-subtle);
    object-fit: cover;
    display: block;
    transition: transform 0.15s ease;
}

.gem-icon-img:hover {
    transform: scale(1.2);
    z-index: 5;
}

.gem-icon-img.q-3 { border-color: var(--quality-3); box-shadow: 0 0 4px rgba(0, 112, 221, 0.5); }
.gem-icon-img.q-4 { border-color: var(--quality-4); box-shadow: 0 0 5px rgba(163, 53, 238, 0.6); }

/* Slot Quality Glows & Borders */
.slot-icon-box.q-0 { border-color: var(--quality-0); box-shadow: 0 0 8px rgba(157, 157, 157, 0.4); }
.slot-icon-box.q-1 { border-color: #d1d5db; box-shadow: 0 0 8px rgba(255, 255, 255, 0.25); }
.slot-icon-box.q-2 { border-color: var(--quality-2); box-shadow: 0 0 10px rgba(30, 255, 0, 0.5); }
.slot-icon-box.q-3 { border-color: var(--quality-3); box-shadow: 0 0 12px rgba(0, 112, 221, 0.6); }
.slot-icon-box.q-4 { border-color: var(--quality-4); box-shadow: 0 0 14px rgba(163, 53, 238, 0.7); }
.slot-icon-box.q-5 { border-color: var(--quality-5); box-shadow: 0 0 16px rgba(255, 128, 0, 0.8); }
.slot-icon-box.q-6 { border-color: var(--quality-6); box-shadow: 0 0 16px rgba(230, 204, 128, 0.8); }
.slot-icon-box.q-7 { border-color: var(--quality-7); box-shadow: 0 0 16px rgba(0, 204, 255, 0.75); }

/* Full-layout character viewport */
.paperdoll-viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: inherit;
}

.viewport-backdrop {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.character-model-viewer {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: grab;
}

.character-model-viewer:active {
    cursor: grabbing;
}

.character-model-viewer canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.character-model-status {
    position: absolute;
    top: 42%;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 8px 11px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: rgba(8, 9, 15, 0.86);
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-align: center;
    transform: translate(-50%, -50%);
}

.character-model-status.is-unavailable,
.character-model-status.is-error {
    color: var(--text-muted);
}

.model-loading-spinner {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: model-spin 0.8s linear infinite;
}

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

/* Paperdoll Bottom Row */
.paperdoll-bottom-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    max-width: 920px;
}

.paperdoll-bottom-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 260px;
    background: rgba(15, 17, 26, 0.7);
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .paperdoll-main-layout {
        flex-direction: column;
        align-items: center;
        min-height: 0;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .paperdoll-column {
        width: 100%;
        padding: 0;
        background: transparent !important;
    }
    .paperdoll-column.left-column {
        order: 1;
    }
    .paperdoll-column.right-column {
        order: 3;
    }
    .paperdoll-center-lane {
        display: none;
    }
    .paperdoll-viewport {
        position: relative;
        inset: auto;
        order: 2;
        width: 100%;
        max-width: 320px;
        height: 350px;
        flex: 0 0 350px;
        border: 2px solid var(--border-accent);
        border-radius: 12px;
        background: radial-gradient(circle at center, #1b2032 0%, #08090f 100%);
        box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.85);
    }
    .paperdoll-bottom-row {
        flex-direction: column;
        align-items: center;
    }
    .paperdoll-bottom-card {
        max-width: 100%;
        width: 100%;
    }
}

/* ==========================================================================
   PvP & Arena Teams Styles
   ========================================================================== */

.pvp-header-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pvp-stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 16px;
}

.pvp-stat-pill .icon {
    font-size: 1.4rem;
}

.pvp-stat-pill .val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.pvp-stat-pill .lbl {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.arena-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.arena-team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.arena-team-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-accent);
}

.arena-team-card.has-team {
    border-color: rgba(74, 158, 255, 0.3);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26, 28, 40, 0.9) 100%);
}

.arena-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bracket-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    letter-spacing: 0.08em;
}

.rank-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(245, 197, 66, 0.15);
    color: var(--accent-gold);
}

.team-name-link {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.team-name-link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.no-team-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.arena-rating-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.rating-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.rating-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Match History Table */
.outcome-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: center;
}

.outcome-win {
    background: rgba(46, 204, 113, 0.2);
    color: var(--accent-green);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.outcome-loss {
    background: rgba(231, 76, 60, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(231, 76, 60, 0.4);
}

.rating-change-pos {
    color: var(--accent-green);
    font-weight: 700;
}

.rating-change-neg {
    color: var(--accent-red);
    font-weight: 700;
}

.btn-details {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-details:hover {
    background: var(--accent-blue);
    color: #fff;
}

.match-history-actions {
    display: flex;
    justify-content: center;
    padding-top: 18px;
}

.btn-expand-matches {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    background: var(--bg-slot);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.btn-expand-matches:hover {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.12);
}

.btn-expand-matches:focus-visible,
.btn-details:focus-visible,
.btn-refresh:focus-visible,
.btn-uwu-logs:focus-visible,
.uwu-spec-select:focus-visible,
.uwu-points-trigger:focus-visible,
.character-tab:focus-visible,
.stats-spec-tab:focus-visible,
.spec-toggle-btn:focus-visible,
.modal-close:focus-visible {
    outline: 3px solid rgba(74, 158, 255, 0.45);
    outline-offset: 2px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    width: min(100%, 900px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

@media (max-width: 980px) {
    .header-card {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 20px;
    }

    .stats-row {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .armory-wrapper {
        padding: 12px 8px;
    }

    .header-card,
    .section-card {
        padding: 16px 12px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .header-card {
        align-items: stretch;
        gap: 16px;
    }

    .char-main-info,
    .header-actions,
    .header-actions form {
        width: 100%;
    }

    .char-name-row {
        gap: 8px;
    }

    .char-name {
        width: 100%;
        font-size: clamp(1.75rem, 10vw, 2.2rem);
        overflow-wrap: anywhere;
    }

    .char-details-sub {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
        font-size: 0.95rem;
    }

    .stats-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .stat-pill {
        min-width: 0;
        padding: 10px;
    }

    .uwu-rank-pill {
        grid-column: 1 / -1;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-refresh {
        justify-content: center;
        width: 100%;
        min-height: 44px;
    }

    .scraped-time {
        text-align: center;
    }

    .section-header,
    .gear-section-header,
    .spec-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .section-header h2 {
        font-size: 1.12rem;
        line-height: 1.35;
    }

    .gear-header-actions,
    .stats-panel-heading,
    .stats-debug-intro {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .character-tab-list,
    .stats-spec-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .raid-size-columns {
        grid-template-columns: 1fr;
    }

    .raid-group-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .raid-size-column + .raid-size-column {
        border-top: 1px solid var(--border-subtle);
        border-left: 0;
    }

    .icc-achievement {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .icc-achievement-icon {
        width: 44px;
        height: 44px;
    }

    .icc-achievement-status {
        align-items: flex-start;
        grid-column: 2;
    }

    .character-tab,
    .stats-spec-tab {
        min-height: 42px;
        padding: 7px 8px;
    }

    .stats-debug-header {
        align-items: flex-start;
    }

    .debug-item-heading,
    .debug-source-row,
    .debug-total-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .spec-toggle-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .spec-toggle-btn {
        min-height: 42px;
        padding: 7px 8px;
    }

    .uwu-logs-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .uwu-spec-select,
    .btn-uwu-logs {
        width: 100%;
    }

    .uwu-overall-grid {
        grid-template-columns: 1fr;
    }

    .status-summary-bar {
        gap: 8px;
    }

    .status-card {
        min-width: 0;
        width: 100%;
    }

    .paperdoll-container {
        padding: 12px 8px;
        border-radius: 10px;
    }

    .paperdoll-viewport {
        order: 1;
    }

    .paperdoll-column.left-column {
        order: 2;
    }

    .paperdoll-column.right-column {
        order: 3;
    }

    .paperdoll-bottom-row {
        gap: 10px;
        margin-top: 12px;
    }

    .talent-calculator-layout {
        padding: 10px 8px;
    }

    .talent-code-box {
        align-items: flex-start;
        flex-direction: column;
        overflow-wrap: anywhere;
    }

    .pvp-header-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .pvp-stat-pill {
        min-width: 0;
        padding: 10px;
    }

    .arena-teams-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 0;
    }

    .professions-grid {
        flex-direction: column;
    }

    .profession-card {
        width: 100%;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }

    .modal-header,
    .modal-body {
        padding: 14px 12px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 360px) {
    .prof-name {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 640px) {
    .match-history-table,
    .match-history-table tbody,
    .match-history-table tr,
    .match-history-table td {
        display: block;
        width: 100%;
    }

    .match-history-table thead {
        display: none;
    }

    .match-history-table tbody {
        display: grid;
        gap: 10px;
    }

    .match-history-table tr {
        padding: 12px;
        border: 1px solid var(--border-subtle);
        border-radius: 10px;
        background: var(--bg-slot);
    }

    .match-history-table tr[hidden] {
        display: none;
    }

    .match-history-table td {
        display: grid;
        grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
        align-items: center;
        gap: 12px;
        padding: 7px 0;
        border-bottom: 1px solid var(--border-subtle);
        text-align: right !important;
        overflow-wrap: anywhere;
    }

    .match-history-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-align: left;
        text-transform: uppercase;
    }

    .match-history-table td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .btn-details,
    .btn-expand-matches {
        min-height: 44px;
    }

    .btn-details {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .paperdoll-row {
        gap: 7px;
    }

    .paperdoll-slot,
    .slot-icon-box {
        width: 48px;
        height: 48px;
    }

    .slot-item-name {
        max-width: calc(100vw - 105px);
    }

    .pvp-header-summary {
        grid-template-columns: 1fr;
    }
}
