/* fighter3.css - Dark Fantasy Theme (Dark & Darker / Baldur's Gate 3) */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&display=swap");

@font-face {
    font-family: "Greengoth";
    src: url("/fonts/Greengoth Exp SHA_0.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-deep: #0d0a08;
    --bg-surface: #1a1410;
    --bg-card: #231d18;
    --bg-elevated: #2d251f;
    --gold: #c9a96e;
    --gold-bright: #e4c580;
    --gold-dim: #a8884a;
    --parchment: #d4c5a9;
    --parchment-dim: #b8a88a;
    --crimson: #8b1a1a;
    --crimson-bright: #c62828;
    --blood: #5c0e0e;
    --steel: #6b7280;
    --steel-light: #9ca3af;
    --border-dark: #2a221c;
    --border-medium: #3d322b;
    --border-light: #5c4f44;
    --rivet: #6b5a4a;
    --text-gold: #c9a96e;
    --text-parchment: #d4c5a9;
    --text-dim: #8a7a6a;
    --text-bright: #f0e6d3;
    --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.7);
    --shadow-gold: 0 0 15px rgba(201, 169, 110, 0.15);
    --shadow-crimson: 0 0 15px rgba(139, 26, 26, 0.3);

    /* Override fighter1.css variables */
    --primary-color: #c9a96e;
    --secondary-color: #e4c580;
    --dark-bg: #0d0a08;
    --darker-bg: #1a1410;
    --card-bg: #231d18;
    --border-color: #3d322b;
    --text-primary: #d4c5a9;
    --text-secondary: #8a7a6a;
    --success: #6b8f5e;
    --warning: #c9a96e;
    --danger: #8b1a1a;
    --info: #6b7280;
    --win-color: #6b8f5e;
    --loss-color: #8b1a1a;
    --draw-color: #6b7280;
    --common: #8a7a6a;
    --rare: #6b8f5e;
    --epic: #7c5cbf;
    --legendary: #c9a96e;
    --unic: #c44a4a;
}

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

body {
    font-family: "Spectral", "Georgia", serif;
    font-weight: 400;
    background: var(--bg-deep);
    background-image:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(201, 169, 110, 0.03) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 80% 50%,
            rgba(139, 26, 26, 0.02) 0%,
            transparent 50%
        ),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Cinzel", "Georgia", serif;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* ===== Header / Navigation ===== */
.header-center .navigation {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-dark);
}

.nav-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-dim);
    text-decoration: none;
    border: none;
    border-right: 1px solid var(--border-dark);
    font-family: "Cinzel", serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn:hover {
    color: var(--gold);
    background: rgba(201, 169, 110, 0.06);
}

.nav-btn::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.nav-btn:hover::after {
    width: 60%;
}

/* ===== Auth Section ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.auth-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    border: 1px solid var(--gold);
    border-radius: 4px;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-parchment);
    font-size: 14px;
}

.logout-btn {
    padding: 6px 14px;
    background: transparent;
    color: var(--crimson-bright);
    border: 1px solid var(--crimson);
    border-radius: 4px;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: var(--crimson);
    color: var(--text-bright);
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 80px 20px;
    font-family: "Cinzel", serif;
    font-size: 18px;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

/* ===== Fighter Header ===== */
.fighter-header {
    background: linear-gradient(
        180deg,
        var(--bg-surface) 0%,
        var(--bg-card) 100%
    );
    border-bottom: 2px solid var(--border-medium);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.fighter-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-dim),
        transparent
    );
}

.fighter-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 169, 110, 0.3),
        transparent
    );
}

.fighter-basic-info {
    flex: 1;
}

.fighter-name-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.fighter-basic-info h2 {
    font-family: "Cinzel", serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-bright);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.04em;
    margin: 0;
}

.prestige-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.prestige-badge {
    position: relative;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.prestige-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: prestigeGlow 2s ease-in-out infinite;
}

.prestige-badge:hover {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 4px 12px rgba(201, 169, 110, 0.6));
}

@keyframes prestigeGlow {
    0%,
    100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.level-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.level-badge {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    padding: 5px 16px;
    border-radius: 3px;
    font-family: "Cinzel", serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.exp-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.exp-progress {
    flex: 1;
    height: 6px;
    background: var(--bg-deep);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bonus-points {
    color: var(--gold);
    font-family: "Cinzel", serif;
    font-weight: 600;
    font-size: 13px;
}

.bonus-exp-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.bonus-exp-progress {
    flex: 1;
    height: 5px;
    background: var(--bg-deep);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.bonus-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    width: 0%;
    transition: width 0.5s ease;
}

.bonus-exp-text {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

.fighter-type {
    margin-left: auto;
}

.npc-badge {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    padding: 4px 14px;
    border-radius: 3px;
    font-family: "Cinzel", serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.npc-badge.player {
    background: linear-gradient(135deg, var(--steel), var(--steel-light));
}

.npc-badge.elite_npc {
    background: linear-gradient(135deg, var(--epic), #9b6bff);
}

.npc-badge.boss {
    background: linear-gradient(135deg, var(--crimson), var(--crimson-bright));
}

.delete-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--crimson-bright);
    border: 1px solid var(--crimson);
    border-radius: 4px;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 11px;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: var(--crimson);
    color: var(--text-bright);
    box-shadow: var(--shadow-crimson);
}

/* ===== Achievements Bar ===== */
.achievements-bar {
    background: linear-gradient(
        180deg,
        var(--bg-card) 0%,
        var(--bg-surface) 100%
    );
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
}

.achievements-bar-label {
    font-family: "Cinzel", serif;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.achievements-bar-items {
    display: flex;
    gap: 8px;
    align-items: center;
}

.achievement-badge {
    position: relative;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.achievement-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.achievement-badge:hover {
    transform: scale(2) !important;
    z-index: 100;
    filter: drop-shadow(0 4px 12px rgba(201, 169, 110, 0.6));
}

.achievement-badge.achievement-locked {
    opacity: 0.35;
    filter: grayscale(0.8);
}

.achievement-badge.achievement-locked:hover {
    opacity: 0.7;
    filter: grayscale(0.5) drop-shadow(0 4px 12px rgba(100, 100, 100, 0.4));
}

/* ===== Theme Switcher ===== */
.theme-switcher {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    background: var(--bg-deep);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    padding: 3px;
}

.theme-btn {
    padding: 4px 12px;
    background: transparent;
    color: var(--text-dim);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.theme-btn:hover {
    color: var(--text-parchment);
    background: rgba(201, 169, 110, 0.1);
}

.theme-btn.active {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    box-shadow: var(--shadow-gold);
}

/* ===== Theme Steel ===== */
.theme-steel {
    --bg-deep: #0a0a0c;
    --bg-surface: #141418;
    --bg-card: #1c1c22;
    --bg-elevated: #24242c;
    --gold: #8a8a9a;
    --gold-bright: #a0a0b0;
    --gold-dim: #6a6a7a;
    --parchment: #b0b0c0;
    --parchment-dim: #9090a0;
    --crimson: #6b2020;
    --crimson-bright: #aa3030;
    --border-dark: #22222a;
    --border-medium: #30303a;
    --border-light: #4a4a58;
    --rivet: #50505e;
    --text-gold: #8a8a9a;
    --text-parchment: #b0b0c0;
    --text-dim: #707080;
    --text-bright: #d0d0e0;
    --shadow-gold: 0 0 15px rgba(138, 138, 154, 0.15);

    --primary-color: #8a8a9a;
    --secondary-color: #a0a0b0;
    --success: #687080;
    --warning: #8a8a9a;
    --info: #7a7a8a;
    --win-color: #687080;
    --loss-color: #6b2020;
    --common: #707080;
    --rare: #687080;
    --epic: #7a6a9a;
    --legendary: #8a8a9a;
    --unic: #9a4a4a;
}

.theme-steel .nav-btn::after {
    background: var(--steel-light);
}
.theme-steel .achievements-bar {
    border-bottom-color: var(--border-dark);
}
.theme-steel .theme-btn.active {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
}

/* ===== Main Content Layout ===== */
.main-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    padding: 20px 24px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Visual Section (Doll + Mastery) ===== */
.visual-section {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 16px;
    position: relative;
}

/* Visual Section — decorative top accent removed (engraved-line handles it) */
.visual-section::before {
    display: none !important;
}

/* Damage Calc Row */
.damage-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.tactical-damage-calc,
.weapon-damage-calc {
    background: var(--bg-surface);
    padding: 10px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    min-width: 160px;
    flex: 1;
    max-width: 250px;
}

.tactical-damage-calc {
    border-left: 2px solid var(--gold-dim);
}

.weapon-damage-calc {
    border-right: 2px solid var(--gold-dim);
}

.tactical-damage-info,
.weapon-damage-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tactical-damage-item,
.weapon-damage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.tactical-damage-label,
.weapon-damage-label {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
}

.tactical-damage-value,
.weapon-damage-value {
    font-weight: 700;
    color: var(--text-bright);
    font-size: 13px;
    text-align: right;
    font-family: "Cinzel", serif;
}

/* Doll with Exp Panels */
.doll-with-exp-panels {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    justify-content: center;
}

.tactical-mastery-panel,
.weapon-mastery-panel {
    flex: 0 0 110px;
    min-width: 100px;
}

.mastery-panel-inner {
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 160px;
    position: relative;
}

.mastery-panel-inner::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
    opacity: 0.5;
}

.mastery-panel-inner::after {
    content: "";
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    opacity: 0.5;
}

.mastery-panel-inner:hover {
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

.mastery-panel-inner.tactical-side,
.mastery-panel-inner.weapon-side {
    /* Vertical accent removed — using horizontal engraved-line instead */
}

.mastery-icon {
    font-size: 22px;
    line-height: 1;
}

.mastery-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-parchment);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mastery-level {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mastery-level-label {
    font-size: 10px;
    color: var(--text-dim);
}

.mastery-level-value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: "Cinzel", serif;
}

.mastery-exp-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.mastery-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.mastery-stats-mini {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--text-dim);
}

.mastery-stats-mini i {
    font-size: 9px;
}

/* Mastery Switch Button */
.mastery-switch-btn {
    margin-top: 6px;
    padding: 3px 8px;
    font-size: 8px;
    font-family: "Cinzel", serif;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-dark);
    border-radius: 2px;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mastery-switch-btn:hover {
    color: var(--gold);
    border-color: var(--gold-dim);
}

/* ===== Doll Container ===== */
.doll-container {
    text-align: center;
    flex: 1;
}

.doll-canvas-wrap {
    width: 280px;
    margin: 0 auto;
    position: relative;
}

.doll-canvas {
    width: 280px;
    height: 400px;
    margin: 0 auto 15px;
    position: relative;
    background: var(--bg-surface);
    border-radius: 4px;
    border: 2px solid var(--border-medium);
    overflow: hidden;
    transition: background-position 0.22s ease-out;
}

.doll-canvas::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 35%,
        rgba(201, 169, 110, 0.06) 0%,
        rgba(0, 0, 0, 0.1) 45%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 6;
}

.doll-canvas::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow:
        inset 0 -32px 45px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(201, 169, 110, 0.08);
    pointer-events: none;
    z-index: 7;
}

.doll-canvas-bottom-action {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 14px 12px 10px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.12) 100%
    );
    backdrop-filter: blur(1.5px);
}

.doll-canvas-bottom-action .doll-action-btn {
    width: 100%;
    justify-content: center;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(212, 197, 169, 0.9);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    font-family: "Cinzel", serif;
    font-size: 12px;
}

.doll-canvas-bottom-action .doll-action-btn:hover {
    background: transparent;
    color: var(--text-bright);
}

.doll-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doll-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.doll-action-btn {
    padding: 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    color: var(--text-parchment);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: "Cinzel", serif;
    font-weight: 500;
}

.doll-action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--gold-dim);
    color: var(--gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

/* ===== Skills Section ===== */
.skills-section {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 16px;
    position: relative;
}

/* Skills Section */
.skills-section::before {
    display: none !important;
}

.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
}

.skills-header h3 {
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: var(--gold);
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.skills-view-toggle {
    display: flex;
    gap: 4px;
}

.view-btn {
    width: 34px;
    height: 34px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.view-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

.view-btn.active {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    border-color: var(--gold);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--bg-surface);
    padding: 12px 12px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    transition: all 0.25s ease;
    position: relative;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
}

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

.stat-name {
    font-size: 12px;
    color: var(--text-parchment);
    font-weight: 700;
    font-family: "Greengoth", "Cinzel", serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-info-icon {
    font-size: 11px;
    color: var(--text-dim);
    cursor: help;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.stat-info-icon:hover {
    opacity: 1;
    color: var(--gold);
}

/* ? icon hover for weapon/tactical info icons */
.weapon-dmg-info-icon:hover,
.tactical-dmg-info-icon:hover,
.weapon-exp-info-icon:hover,
.tactical-exp-info-icon:hover {
    opacity: 1 !important;
    color: var(--gold) !important;
}

.stat-info-tooltip {
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 12px;
    max-width: 350px;
    box-shadow: var(--shadow-deep);
    z-index: 10000;
    display: none;
    pointer-events: none;
}

.stat-info-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 8px;
    padding-bottom: 6px;
    font-family: "Cinzel", serif;
}

.stat-info-content {
    font-size: 12px;
    color: var(--text-parchment);
    line-height: 1.6;
}

.stat-values {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
    font-family: "Cinzel", serif;
    text-shadow: 0 0 12px rgba(201, 169, 110, 0.15);
}

.stat-base-value {
    font-size: 11px;
    color: var(--text-dim);
}

.stat-bonus {
    font-size: 11px;
    margin-left: 4px;
}

.stat-bonus.stat-bonus-positive {
    color: var(--gold);
}
.stat-bonus.stat-bonus-negative {
    color: var(--crimson-bright);
}
.stat-bonus.stat-bonus-neutral {
    color: var(--text-dim);
}

.stat-desc {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    opacity: 0.7;
    line-height: 1.3;
}

.stat-sub-line {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    opacity: 0.85;
}

.stat-sub-line strong {
    color: var(--text-parchment);
}

/* Equipment Weight Panel */
.equipment-weight-panel {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border-dark);
}

.weight-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.weight-line:last-child {
    margin-bottom: 0;
}

.weight-label {
    font-size: 12px;
    color: var(--text-dim);
}

.weight-value {
    font-weight: 600;
    color: var(--text-parchment);
    font-family: "Cinzel", serif;
    font-size: 12px;
}

.weight-value.weight-yellow {
    color: var(--gold);
}
.weight-value.weight-red {
    color: var(--crimson-bright);
}

/* Calculated Params */
.calculated-params-section {
    background: rgba(201, 169, 110, 0.04);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    padding: 14px;
    margin-top: 14px;
}

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

.calculated-params-section h4 {
    font-family: "Cinzel", serif;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.opponent-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opponent-btn {
    background: var(--bg-surface);
    color: var(--text-parchment);
    border: 1px solid var(--border-dark);
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-family: "Cinzel", serif;
    transition: all 0.3s ease;
}

.opponent-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--gold-dim);
    color: var(--gold);
}

.opponent-btn i {
    color: var(--gold-dim);
}
#selectedOpponentName {
    font-weight: 500;
}

.calculated-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid var(--border-dark);
    transition: all 0.3s ease;
}

.param-item:hover {
    background: var(--bg-surface);
    border-color: var(--gold-dim);
}

.param-label {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.param-label i {
    color: var(--gold-dim);
    font-size: 12px;
}

.param-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(201, 169, 110, 0.08);
    padding: 3px 8px;
    white-space: nowrap;
    font-family: "Cinzel", serif;
    border-radius: 2px;
}

/* Bonus Points */
.bonus-points-control {
    border-top: 1px solid var(--border-dark);
    padding-top: 14px;
    margin-top: 14px;
}

.bonus-points-control h4 {
    font-family: "Cinzel", serif;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 10px;
}

.bonus-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.bonus-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-surface);
    border-radius: 3px;
    border: 1px solid var(--border-dark);
}

.bonus-stat-name {
    font-size: 13px;
    color: var(--text-parchment);
}

.bonus-stat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonus-stat-value {
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    color: var(--text-bright);
    font-family: "Cinzel", serif;
}

.bonus-btn {
    width: 26px;
    height: 26px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-parchment);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bonus-btn:hover:not(:disabled) {
    background: var(--gold-dim);
    border-color: var(--gold);
    color: var(--bg-deep);
}

.bonus-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bonus-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-primary,
.btn-secondary,
.btn-warning {
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-family: "Cinzel", serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
}

.btn-primary:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-parchment);
    border: 1px solid var(--border-dark);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--gold-dim);
}

.btn-warning {
    background: linear-gradient(135deg, #7a5a2a, var(--gold-dim));
    color: var(--bg-deep);
}

.btn-warning:hover {
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

/* Reset Skills */
.reset-skills-control {
    border-top: 1px solid var(--border-dark);
    padding-top: 14px;
    margin-top: 14px;
}

/* Skills Table */
.skills-table-view {
    overflow-x: auto;
}

.skills-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.skills-table th {
    background: var(--bg-surface);
    padding: 10px;
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-dark);
    font-family: "Cinzel", serif;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.skills-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-parchment);
}

.skills-table tr:hover {
    background: rgba(201, 169, 110, 0.03);
}

/* ===== Inventory Section ===== */
.inventory-section {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* Inventory Section */
.inventory-section::before {
    display: none !important;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.inventory-header h3 {
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: var(--gold);
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inventory-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.inventory-filters {
    display: flex;
    gap: 6px;
}

.filter-select {
    padding: 5px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-parchment);
    font-size: 11px;
    cursor: pointer;
    font-family: "Spectral", serif;
    min-width: 90px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--gold-dim);
}

/* Inventory Sort Controls */
.inventory-sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.inventory-sort-btn {
    padding: 5px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 11px;
    font-family: "Cinzel", serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.inventory-sort-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

.inventory-sort-btn.active {
    background: rgba(201, 169, 110, 0.12);
    border-color: var(--gold-dim);
    color: var(--gold);
}

.inventory-view-toggle {
    display: flex;
    gap: 4px;
}

/* Inventory Tiles */
.inventory-tiles-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

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

@media (min-width: 1400px) {
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.inventory-item {
    background: var(--bg-surface);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

.inventory-item:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
}

.inventory-item.equipped {
    border-color: var(--gold-dim);
    background: rgba(201, 169, 110, 0.06);
}

.inventory-item .item-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 6px;
}

.inventory-item .item-name {
    font-size: 10px;
    color: var(--text-parchment);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-item .item-type {
    font-size: 9px;
    color: var(--text-dim);
}

.inventory-item .item-rarity {
    font-size: 9px;
    margin-top: 3px;
    font-weight: 600;
}

.inventory-item .equipped-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--gold);
    color: var(--bg-deep);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

.quantity-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--bg-deep);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
}

/* Rarity Colors */
.rarity-common {
    color: var(--common);
}
.rarity-rare {
    color: var(--rare);
}
.rarity-epic {
    color: var(--epic);
}
.rarity-legendary {
    color: var(--legendary);
}
.rarity-unic {
    color: var(--unic);
}

/* Inventory Table */
.inventory-table-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.inventory-table th {
    background: var(--bg-surface);
    padding: 8px;
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-dark);
    font-family: "Cinzel", serif;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-parchment);
}

.inventory-table tr:hover {
    background: rgba(201, 169, 110, 0.03);
}
.inventory-table .equipped-check {
    color: var(--gold);
    text-align: center;
}

/* ===== Extended Stats ===== */
.extended-stats-section {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 16px;
    position: relative;
}

/* Extended Stats Section */
.extended-stats-section::before {
    display: none !important;
}

.extended-stats-section h3 {
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 14px;
    padding-bottom: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

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

.extended-stat-card {
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border-dark);
    padding: 12px;
    transition: all 0.3s ease;
}

.extended-stat-card:hover {
    transform: translateY(-1px);
    border-color: var(--gold-dim);
}

.extended-stat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 6px;
}

.extended-stat-header i {
    color: var(--gold-dim);
    font-size: 13px;
}

.extended-stat-header h4 {
    font-family: "Cinzel", serif;
    font-size: 12px;
    color: var(--text-parchment);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.extended-stat-content {
    font-size: 12px;
}

.combat-stats {
    border-left: 2px solid var(--gold-dim);
}
.damage-stats {
    border-left: 2px solid var(--crimson);
}
.favorite-weapon {
    border-left: 2px solid var(--gold);
}
.pvp-stats {
    border-left: 2px solid var(--epic);
}

.fight-record {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.fight-total {
    color: var(--text-bright);
}
.fight-wins {
    color: var(--win-color);
}
.fight-losses {
    color: var(--loss-color);
}
.fight-separator {
    color: var(--text-dim);
}

.fight-details {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.fight-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fight-detail span:first-child {
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.kd-value {
    color: var(--gold);
    font-weight: 700;
    font-family: "Cinzel", serif;
    font-size: 13px;
}

.winrate-value {
    color: var(--win-color);
    font-weight: 700;
    font-family: "Cinzel", serif;
    font-size: 13px;
}

/* Damage / Heal rows */
.damage-heal-row {
    margin-bottom: 6px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 11px;
}

.stat-label {
    color: var(--text-dim);
}
.stat-value {
    color: var(--text-parchment);
    font-weight: 600;
    font-size: 12px;
}

/* Favorite Weapon */
.favorite-weapon-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.favorite-weapon-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    padding: 4px;
    background: rgba(201, 169, 110, 0.06);
    border-radius: 3px;
    font-family: "Cinzel", serif;
}

.favorite-weapon-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.weapon-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.weapon-detail span:first-child {
    font-size: 9px;
    color: var(--text-dim);
    margin-bottom: 1px;
}

.weapon-detail span:last-child {
    font-size: 11px;
    color: var(--text-parchment);
    font-weight: 600;
}

.efficiency-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
}

.efficiency-label {
    color: var(--text-dim);
}
.efficiency-value {
    color: var(--text-parchment);
    font-weight: 600;
}

/* ===== History Section ===== */
.history-section {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 16px;
    margin: 0 24px 20px;
    position: relative;
}

/* History Section */
.history-section::before {
    display: none !important;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.history-header h3 {
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.history-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.history-filter {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 5px 12px;
    background: var(--bg-surface);
    color: var(--text-dim);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: "Cinzel", serif;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-btn:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-deep);
    border-color: var(--gold);
}

.history-stats {
    font-size: 12px;
    color: var(--text-dim);
}

.history-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.history-table th {
    background: var(--bg-surface);
    padding: 10px;
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-dark);
    white-space: nowrap;
    font-family: "Cinzel", serif;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-parchment);
    white-space: nowrap;
}

.history-table tr:hover {
    background: rgba(201, 169, 110, 0.03);
}

.result-badge {
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
    min-width: 60px;
    text-align: center;
    font-family: "Cinzel", serif;
}

.result-win {
    background: var(--win-color);
    color: var(--bg-deep);
}
.result-loss {
    background: var(--loss-color);
    color: var(--text-bright);
}
.result-draw {
    background: var(--draw-color);
    color: var(--text-bright);
}

.efficiency-badge {
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    font-family: "Cinzel", serif;
}

.efficiency-good {
    background: rgba(107, 143, 94, 0.2);
    color: var(--win-color);
    border: 1px solid var(--win-color);
}
.efficiency-average {
    background: rgba(201, 169, 110, 0.2);
    color: var(--gold);
    border: 1px solid var(--gold-dim);
}
.efficiency-poor {
    background: rgba(139, 26, 26, 0.2);
    color: var(--crimson-bright);
    border: 1px solid var(--crimson);
}

/* Duration cell */
.duration-cell {
    font-family: "Cinzel", serif;
    font-weight: 600;
}

/* ===== Modals ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 6px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-deep);
    position: relative;
}

.modal-content::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 10%,
        var(--gold-dim) 30%,
        var(--gold) 50%,
        var(--gold-dim) 70%,
        transparent 90%
    );
    opacity: 0.4;
}

.modal-content h3 {
    font-family: "Cinzel", serif;
    font-size: 16px;
    color: var(--gold);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 20px;
    max-height: 55vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 14px 20px;
    background: var(--bg-surface);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border-dark);
}

.modal-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.modal-item {
    background: var(--bg-surface);
    padding: 8px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.modal-item:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
}

.modal-item.equipped {
    border-color: var(--gold-dim);
    background: rgba(201, 169, 110, 0.06);
}

.modal-item .item-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 4px;
}

.modal-item .mi-info {
    width: 100%;
}

.modal-item .item-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-parchment);
    margin-bottom: 2px;
    line-height: 1.2;
}

.modal-item .mi-meta {
    display: flex;
    justify-content: center;
    gap: 4px;
    font-size: 9px;
    color: var(--text-dim);
    margin-bottom: 2px;
    flex-wrap: wrap;
}

.modal-item .mi-rarity {
    font-weight: 500;
}
.modal-item .mi-weight {
    opacity: 0.8;
}

.modal-item .mi-bonuses {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 2px;
}

.modal-item .mi-bonus {
    font-size: 9px;
    color: var(--gold);
    line-height: 1.3;
}

.modal-item .mi-dual {
    font-size: 8px;
    color: var(--warning);
    margin-top: 2px;
}

.modal-item .equipped-badge {
    font-size: 8px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 3px;
}

/* ===== Style Options (modal) ===== */
.style-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.style-option {
    background: var(--bg-surface);
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.style-option:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
}

.style-option.selected {
    border-color: var(--gold);
    background: rgba(201, 169, 110, 0.06);
    box-shadow: var(--shadow-gold);
}

.style-option h4 {
    font-family: "Cinzel", serif;
    font-size: 14px;
    color: var(--text-parchment);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.style-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.5;
}

.style-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
}

.style-stats span {
    padding: 3px 6px;
    background: var(--bg-deep);
    border-radius: 2px;
    color: var(--text-dim);
    border: 1px solid var(--border-dark);
}

/* ===== Speech Form ===== */
.speech-form {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.speech-field {
    margin-bottom: 14px;
}

.speech-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-parchment);
    font-weight: 500;
    font-size: 13px;
    font-family: "Cinzel", serif;
}

.speech-textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-parchment);
    font-family: "Spectral", serif;
    font-size: 13px;
    resize: vertical;
    line-height: 1.5;
}

.speech-textarea:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-gold);
}

/* ===== Opponent Modal ===== */
.opponent-search {
    margin-bottom: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-parchment);
    font-family: "Spectral", serif;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold-dim);
}

.opponent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.opponent-item {
    background: var(--bg-surface);
    padding: 10px 14px;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opponent-item:hover {
    border-color: var(--gold-dim);
    background: var(--bg-elevated);
}

.opponent-item.selected {
    border-color: var(--gold);
    background: rgba(201, 169, 110, 0.06);
}

.opponent-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.opponent-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-parchment);
    display: flex;
    align-items: center;
    gap: 8px;
}

.opponent-level {
    font-size: 11px;
    color: var(--text-dim);
}

.opponent-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.opponent-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
}
.opponent-stat-label {
    color: var(--text-dim);
    margin-bottom: 2px;
}
.opponent-stat-value {
    color: var(--gold);
    font-weight: 600;
}

.opponent-link {
    color: var(--text-parchment);
    text-decoration: none;
    transition: all 0.2s ease;
}

.opponent-link:hover {
    color: var(--gold);
    text-decoration: underline;
}

.opponent-link strong {
    display: inline-block;
    transition: transform 0.2s ease;
}

.opponent-link:hover strong {
    transform: translateX(3px);
}

.opponent-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Damage Tooltips ===== */
.damage-tooltip,
.weapon-exp-tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 14px;
    width: 280px;
    z-index: 10001;
    display: none;
    box-shadow: var(--shadow-deep);
    border-left: 2px solid var(--gold-dim);
    pointer-events: auto;
}

.damage-tooltip h4,
.weapon-exp-tooltip h4 {
    margin-bottom: 10px;
    color: var(--gold);
    font-family: "Cinzel", serif;
    font-size: 13px;
    text-align: center;
    padding-bottom: 8px;
}

.damage-breakdown,
.weapon-exp-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.breakdown-item,
.weapon-exp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.breakdown-item:last-child,
.weapon-exp-row:last-child {
    border-bottom: none;
}

.breakdown-item.total {
    border-top: 2px solid var(--gold-dim);
    border-bottom: none;
    margin-top: 6px;
    padding-top: 10px;
    font-weight: bold;
}

.breakdown-label,
.weapon-exp-label {
    color: var(--text-dim);
    font-size: 12px;
}

.breakdown-value,
.weapon-exp-value {
    color: var(--text-bright);
    font-weight: 600;
    font-size: 12px;
    font-family: "Cinzel", serif;
}

.weapon-exp-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 140px;
}

.weapon-exp-bar {
    flex: 1;
    height: 5px;
    background: var(--bg-surface);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-dark);
}

.weapon-exp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
    width: 0%;
    transition: width 0.3s ease;
}

.weapon-exp-text {
    font-size: 10px;
    color: var(--text-dim);
    min-width: 45px;
    text-align: right;
}

/* Tactical tooltip special */
.tactical-exp-tooltip {
    border-left-color: var(--gold-dim) !important;
}
.tactical-exp-tooltip h4 {
    color: var(--gold) !important;
}

/* ===== Item Popup ===== */
.item-popup {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 10px 12px;
    max-width: 260px;
    z-index: 1001;
    display: none;
    box-shadow: var(--shadow-deep);
    font-size: 12px;
    line-height: 1.4;
}

.item-popup h4 {
    font-size: 14px;
    font-family: "Cinzel", serif;
    margin: 0 0 6px 0;
    color: var(--text-parchment);
    font-weight: 600;
}

.item-popup div {
    font-size: 11px;
    margin-bottom: 3px;
    color: var(--text-dim);
}

.item-popup strong {
    color: var(--text-parchment);
    font-weight: 600;
}

.item-popup-separator {
    border-top: 1px solid var(--border-dark);
    margin: 5px 0;
}

.item-popup-separator-dashed {
    border-top: 1px dashed var(--border-dark);
    margin: 5px 0 3px;
}

/* ===== Prestige Tooltip ===== */
.prestige-tooltip {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-parchment);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1.35;
    min-width: 200px;
    max-width: 340px;
    white-space: normal;
    text-align: center;
    overflow-wrap: anywhere;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    z-index: 1000;
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-deep);
}

.prestige-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--bg-elevated);
}

.prestige-badge:hover .prestige-tooltip {
    opacity: 1;
}

/* ===== Fight Summary ===== */
.fight-summary {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(201, 169, 110, 0.04);
    border-bottom: 1px solid var(--border-dark);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.summary-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "Cinzel", serif;
}

.summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-bright);
    font-family: "Cinzel", serif;
}

/* ===== Messages ===== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    font-size: 13px;
    font-family: "Cinzel", serif;
    border-left: 3px solid;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    background: rgba(107, 143, 94, 0.9);
    color: var(--text-bright);
    border-left-color: var(--win-color);
}
.message.error {
    background: rgba(139, 26, 26, 0.9);
    color: var(--text-bright);
    border-left-color: var(--crimson);
}
.message.warning {
    background: rgba(201, 169, 110, 0.9);
    color: var(--bg-deep);
    border-left-color: var(--gold);
}
.message.info {
    background: rgba(107, 128, 144, 0.9);
    color: var(--text-bright);
    border-left-color: var(--info);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== Animations ===== */
.fade-in {
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.bonus-points.updated {
    animation: pulse 0.5s ease-in-out;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-dim);
    font-style: italic;
    grid-column: 1 / -1;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 12px;
        gap: 14px;
    }
    .fighter-header {
        padding: 14px 16px;
    }
    .achievements-bar {
        padding: 8px 16px;
    }
    .history-section {
        margin: 0 12px 14px;
        padding: 12px;
    }
    .extended-stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-btn {
        font-size: 11px;
        padding: 10px 14px;
    }
    .fighter-basic-info h2 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .level-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .exp-bar {
        min-width: 100%;
    }
    .doll-with-exp-panels {
        flex-wrap: wrap;
    }
    .fighter-name-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .inventory-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Collapsible Panels ===== */
[data-collapsible="true"] {
    position: relative;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.visual-section > .collapsible-header,
.skills-section > .collapsible-header,
.inventory-section > .collapsible-header,
.extended-stats-section > .collapsible-header,
.history-section > .collapsible-header {
    /* Spacing handled by engraved-line divider */
}

.collapsible-title {
    font-family: "Cinzel", serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.collapsible-title i {
    font-size: 13px;
    color: var(--gold-dim);
}

.collapsible-toggle {
    background: transparent;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    color: var(--text-dim);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.collapsible-toggle:hover {
    border-color: var(--gold-dim);
    color: var(--gold);
    background: rgba(201, 169, 110, 0.06);
}

.collapsible-toggle i {
    transition: transform 0.3s ease;
    font-size: 11px;
}

[data-collapsible="true"].collapsed .collapsible-content {
    display: none !important;
}

[data-collapsible="true"].collapsed .collapsible-toggle i {
    transform: rotate(180deg);
}

/* ===== Mastery Panel Detail Mode ===== */
.mastery-panel-inner.showing-details .mastery-switch-icon {
    transform: rotate(180deg);
}

.mastery-panel-inner.showing-details .mastery-details-content {
    max-height: 500px !important;
}

.mastery-details-content {
    max-height: 0;
}

.mastery-details-content > div {
    padding: 0;
}
