:root {
    --void: #06060a;
    --void-light: #0d0d14;
    --panel: #0f0f18;
    --panel-light: #16161f;
    --border: #2a2640;
    --border-glow: #3d3566;
    --gold: #d4af37;
    --gold-dim: #a68a2a;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --purple: #9d4edd;
    --purple-dim: #7b2cbf;
    --purple-glow: rgba(157, 78, 221, 0.5);
    --cyan: #4cc9f0;
    --cyan-glow: rgba(76, 201, 240, 0.4);
    --text: #e8e6f0;
    --text-dim: #8a879a;
    --green: #2ecc71;
    --red: #e74c3c;
}

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

body {
    min-height: 100vh;
    background: var(--void);
    color: var(--text);
    font-family: 'Crimson Text', Georgia, serif;
    overflow-x: hidden;
}

/* Starfield Background */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(157, 78, 221, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(76, 201, 240, 0.03) 0%, transparent 70%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(212, 175, 55, 0.8), transparent),
        radial-gradient(1px 1px at 200px 50px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 250px 130px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 300px 90px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 350px 160px, rgba(157, 78, 221, 0.7), transparent);
    background-size: 400px 200px;
    animation: twinkle 8s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    background: linear-gradient(180deg, var(--panel) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow);
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow); }
    50% { text-shadow: 0 0 40px var(--gold-glow), 0 0 80px var(--gold-glow), 0 0 100px var(--gold-glow); }
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border);
    color: var(--gold);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
}

/* Tab Navigation */
.tab-nav {
    position: relative;
    z-index: 10;
    display: flex;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    overflow-x: auto;
}

.tab-btn {
    font-family: 'Cinzel', serif;
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Me Container */
.me-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Panel Base Styles */
.panel {
    position: relative;
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
}

/* Corner Decorations */
.corner-tl, .corner-tr, .corner-bl, .corner-br {
    position: absolute;
    width: 15px;
    height: 15px;
    opacity: 0.6;
}

.corner-tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--gold-dim);
    border-left: 2px solid var(--gold-dim);
}

.corner-tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid var(--gold-dim);
    border-right: 2px solid var(--gold-dim);
}

.corner-bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid var(--gold-dim);
    border-left: 2px solid var(--gold-dim);
}

.corner-br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--gold-dim);
    border-right: 2px solid var(--gold-dim);
}

/* Main Panel */
.main-panel {
    padding: 2rem;
}

/* Level Section (Top, left-aligned) */
.level-section {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.level-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.level-btn {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    width: 3rem;
    height: 3rem;
    background: var(--void);
    border: 2px solid var(--gold-dim);
    color: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

.level-crest {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exp-ring-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.exp-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.exp-ring-fill {
    fill: none;
    stroke: url(#expGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 439.82;
    stroke-dashoffset: 439.82;
    transition: stroke-dashoffset 0.5s ease;
    filter: drop-shadow(0 0 8px var(--purple-glow));
}

.level-crest-inner {
    width: 70%;
    height: 70%;
    border: 1px solid var(--border-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, var(--panel-light) 0%, var(--void) 100%);
}

.level-number {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow);
    animation: levelPulse 3s ease-in-out infinite;
}

@keyframes levelPulse {
    0%, 100% { text-shadow: 0 0 30px var(--gold-glow), 0 0 60px var(--gold-glow); }
    50% { text-shadow: 0 0 40px var(--gold-glow), 0 0 80px var(--gold-glow); }
}

.level-reset-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    background: var(--void);
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.level-reset-btn:hover {
    opacity: 1;
    background: rgba(231, 76, 60, 0.15);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

/* Stats Section (Below level) */
.stats-section {
    width: 100%;
}

.stats-split {
    display: flex;
    gap: 2rem;
}

.stats-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-divider {
    width: 1px;
    background: var(--border-glow);
    min-height: 100%;
}

.stats-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    min-height: 3.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-left: 3px solid var(--border);
    transition: all 0.2s ease;
}

.stat-row:hover {
    border-left-color: var(--gold-dim);
    background: rgba(212, 175, 55, 0.05);
}

.stat-label {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.stat-link {
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.stat-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    width: 2rem;
    height: 2rem;
    background: var(--void);
    border: 1px solid var(--purple-dim);
    color: var(--purple);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-btn:hover {
    background: rgba(157, 78, 221, 0.15);
    border-color: var(--purple);
    box-shadow: 0 0 15px var(--purple-glow);
}

.stat-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    width: 5rem;
    padding: 0.4rem 0.5rem;
    background: var(--void);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 10px var(--purple-glow);
}

.stat-input.gold {
    color: var(--gold);
}

.stat-input.gold:focus {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

.stat-input.purple {
    color: var(--purple);
}

/* Hide number input spinners */
.stat-input::-webkit-outer-spin-button,
.stat-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stat-input[type=number] {
    -moz-appearance: textfield;
}

/* Panel 3: Game Management */
.game-panel {
    padding: 1rem 1.5rem;
}

.game-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.game-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-btn.save {
    background: rgba(46, 204, 113, 0.08);
    border-color: rgba(46, 204, 113, 0.4);
    color: var(--green);
}

.game-btn.save:hover {
    background: rgba(46, 204, 113, 0.15);
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.3);
}

.game-btn.load {
    background: rgba(76, 201, 240, 0.08);
    border-color: rgba(76, 201, 240, 0.4);
    color: var(--cyan);
}

.game-btn.load:hover {
    background: rgba(76, 201, 240, 0.15);
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.game-btn.new {
    background: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.4);
    color: var(--red);
}

.game-btn.new:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: var(--red);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

/* Placeholder tabs */
.tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    color: var(--text-dim);
    gap: 1rem;
}

.tab-placeholder-icon {
    font-size: 3rem;
    opacity: 0.4;
}

.tab-placeholder-text {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-glow);
}

/* ===================
   ROLL TAB STYLES
   =================== */

.roll-container {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

/* Dice Panel */
.dice-panel {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.dice-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.dice-display {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.die {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--void);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 100px;
}

.die-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.die-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 20px var(--gold-glow);
}

.die-unit {
    font-family: 'Crimson Text', serif;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.roll-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--purple-dim) 0%, var(--purple) 100%);
    border: 1px solid var(--purple);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.roll-btn:hover {
    box-shadow: 0 0 25px var(--purple-glow);
    transform: translateY(-2px);
}

.claim-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--gold-dim) 0%, var(--gold) 100%);
    border: 1px solid var(--gold);
    color: var(--void);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
}

.claim-btn.visible {
    display: block;
}

.claim-btn:hover {
    box-shadow: 0 0 25px var(--gold-glow);
    transform: translateY(-2px);
}

/* Entry Panel */
.entry-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
}

.entry-header {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.entry-stat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.entry-stat span {
    color: var(--gold);
}

.entry-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.entry-placeholder {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--text-dim);
    opacity: 0.5;
}

.entry-card {
    width: 100%;
    background: var(--void);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.entry-card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.entry-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.entry-card-meta span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.entry-card-desc {
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
}

.entry-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    display: none;
}

.entry-actions.visible {
    display: flex;
}

.action-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0.6rem 1.25rem;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.acquire {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--green);
    color: var(--green);
}

.action-btn.acquire:hover {
    background: rgba(46, 204, 113, 0.2);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

.action-btn.bookmark {
    background: rgba(76, 201, 240, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
}

.action-btn.bookmark:hover {
    background: rgba(76, 201, 240, 0.2);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.action-btn.dismiss {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--red);
    color: var(--red);
}

.action-btn.dismiss:hover {
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

.action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===================
   PERKS TAB STYLES
   =================== */

.perks-container {
    width: 100%;
}

.perks-panel {
    padding: 1.5rem;
}

.perks-table-wrapper {
    overflow-x: auto;
}

.perks-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Crimson Text', serif;
}

.perks-table thead th {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--gold);
    text-align: left;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.perks-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.perks-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

.perks-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
}

.perks-table .perk-name {
    color: var(--gold);
    font-weight: 600;
}

.perks-table .perk-cost {
    font-family: 'JetBrains Mono', monospace;
    color: var(--purple);
}

.perks-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-family: 'Cinzel', serif;
    display: none;
}

.perks-empty.visible {
    display: block;
}

/* Perk Level Cell */
.perk-level-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.perk-level-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--void);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perk-level-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

.perk-level-display {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perk-exp-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.perk-exp-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.perk-exp-ring-fill {
    fill: none;
    stroke: var(--purple);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.3s ease;
}

.perk-level-number {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
}

/* Perk Popup */
.perk-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.perk-popup-overlay.visible {
    display: flex;
}

.perk-popup-card {
    position: relative;
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.perk-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s ease;
}

.perk-popup-close:hover {
    color: var(--red);
}

.perk-popup-content {
    color: var(--text);
}

/* ===================
   ITEMS TAB STYLES
   =================== */

.items-container {
    width: 100%;
}

.items-panel {
    padding: 1.5rem;
}

.items-table-wrapper {
    overflow-x: auto;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Crimson Text', serif;
}

.items-table thead th {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--gold);
    text-align: left;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.items-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.items-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

.items-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
}

.items-table .item-name {
    color: var(--gold);
    font-weight: 600;
}

.items-table .item-cost {
    font-family: 'JetBrains Mono', monospace;
    color: var(--purple);
}

.items-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-family: 'Cinzel', serif;
    display: none;
}

.items-empty.visible {
    display: block;
}

/* Item Level Cell - same as perk */
.item-level-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-level-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--void);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-level-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
}

.item-level-display {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-exp-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.item-exp-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.item-exp-ring-fill {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.3s ease;
}

.item-level-number {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
}

/* Inventory Icon */
.inventory-icon {
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-icon.in-inventory {
    color: var(--green);
}

.inventory-icon.not-in-inventory {
    color: var(--text-dim);
    opacity: 0.4;
}

.inventory-icon:hover {
    transform: scale(1.2);
}

/* Item Popup */
.item-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.item-popup-overlay.visible {
    display: flex;
}

.item-popup-card {
    position: relative;
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.item-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s ease;
}

.item-popup-close:hover {
    color: var(--red);
}

.item-popup-content {
    color: var(--text);
}

/* Inventory Confirm Popup */
.inventory-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.inventory-confirm-overlay.visible {
    display: flex;
}

.inventory-confirm-card {
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.inventory-confirm-text {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.inventory-confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ===================
   INVENTORY TAB STYLES
   =================== */

.inventory-container {
    width: 100%;
}

.inventory-panel {
    padding: 1.5rem;
}

.inventory-header {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.inventory-slots {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.inventory-slots span {
    color: var(--gold);
}

.inventory-table-wrapper {
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Crimson Text', serif;
}

.inventory-table thead th {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--gold);
    text-align: left;
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.inventory-table tbody tr {
    transition: all 0.2s ease;
}

.inventory-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

.inventory-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
}

.inventory-table .inv-item-name {
    color: var(--gold);
    font-weight: 600;
}

.inventory-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-dim);
    font-family: 'Cinzel', serif;
    display: none;
}

.inventory-empty.visible {
    display: block;
}

.remove-inv-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-inv-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* Alert Popup */
.alert-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.alert-popup-overlay.visible {
    display: flex;
}

.alert-popup-card {
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-light) 100%);
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

.alert-popup-text {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-split {
        flex-direction: column;
    }

    .stats-divider {
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .game-buttons {
        flex-direction: column;
    }

    .level-crest {
        width: 120px;
        height: 120px;
    }

    .level-number {
        font-size: 2.5rem;
    }
}