/* ===== CSS Variables ===== */
:root {
    --bg-deep: #0a0c14;
    --bg-dark: #0d1117;
    --bg-medium: #161b22;
    --bg-light: #21262d;
    --gold-primary: #d4a853;
    --gold-bright: #f4d03f;
    --gold-glow: #ffd700;
    --gold-dim: #8b7355;
    --guardian-green: #2ea043;
    --guardian-glow: #3fb950;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --danger: #f85149;
    --success: #3fb950;
    --warning: #d29922;
    --info: #58a6ff;
    --transition-fast: 0.15s;
    --transition-medium: 0.3s;
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== Splash Screen ===== */
.splash-screen {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 30%, rgba(212, 168, 83, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(46, 160, 67, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, #0a0c14 0%, #0d1117 50%, #0a0c14 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 1s ease-out;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Guardian Badge */
.guardian-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.3);
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    animation: fadeSlideIn 1s ease-out 0.5s both;
}

/* Guardian Mode MANDATORY Badge */
.guardian-badge.guardian-mandatory {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.2), rgba(16, 185, 129, 0.1));
    border: 2px solid var(--guardian-green);
    padding: 12px 24px;
    font-size: 0.85rem;
    box-shadow: 0 0 30px rgba(46, 160, 67, 0.3);
}

.guardian-shield {
    font-size: 1.2rem;
}

/* Safety Message */
.safety-message {
    margin-top: 30px;
    padding: 16px 24px;
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 500px;
    animation: fadeSlideIn 1s ease-out 1.5s both;
}

.safety-message strong {
    color: var(--guardian-glow);
}

.safety-message p {
    margin: 4px 0;
}

/* Worlds Preview */
.worlds-preview {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    animation: fadeSlideIn 1s ease-out 2s both;
}

.world-badge {
    padding: 8px 16px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--gold-primary);
    transition: all 0.2s;
}

.world-badge:hover {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold-bright);
    transform: translateY(-2px);
}

/* Guardian Enter Button */
.guardian-enter-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: linear-gradient(135deg, var(--guardian-green), #059669);
    border: none;
    border-radius: 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(46, 160, 67, 0.4);
    animation: fadeSlideIn 1s ease-out 1s both;
}

.guardian-enter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(46, 160, 67, 0.5);
}

.btn-shield {
    font-size: 1.3rem;
}

.guardian-dot {
    width: 8px;
    height: 8px;
    background: var(--guardian-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--guardian-glow);
    animation: pulse 2s ease-in-out infinite;
}

.guardian-text { color: var(--guardian-glow); }
.guardian-age { color: var(--text-secondary); padding-left: 8px; border-left: 1px solid rgba(46, 160, 67, 0.3); }

/* Rune Particles */
.rune-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.rune-particle {
    position: absolute;
    left: var(--x);
    bottom: -50px;
    font-size: 1.5rem;
    color: var(--gold-dim);
    opacity: 0.3;
    animation: floatUp 12s linear infinite;
    animation-delay: var(--delay);
    text-shadow: 0 0 10px var(--gold-primary);
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* Logo */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: fadeSlideIn 1.2s ease-out;
}

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

.rune-circle {
    width: 180px;
    height: 180px;
    animation: gentleRotate 60s linear infinite;
}

@keyframes gentleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rune-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(212, 168, 83, 0.5));
}

.ring { fill: none; stroke: var(--gold-primary); stroke-width: 1; opacity: 0.6; }
.ring-outer { stroke-dasharray: 4 8; }
.ring-inner { stroke-dasharray: 2 6; }
.rune-circle-text { font-size: 10px; fill: var(--gold-primary); }
.anvil { fill: var(--gold-primary); }
.hammer-handle { fill: var(--gold-dim); }
.hammer-head { fill: var(--gold-bright); }
.spark { fill: var(--gold-glow); animation: sparkle 1.5s ease-in-out infinite; }
.spark-1 { animation-delay: 0s; }
.spark-2 { animation-delay: 0.5s; }
.spark-3 { animation-delay: 1s; }

@keyframes sparkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 4px;
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(212, 168, 83, 0.5), 0 0 20px rgba(212, 168, 83, 0.3); }
    50% { text-shadow: 0 0 20px rgba(244, 208, 63, 0.8), 0 0 40px rgba(244, 208, 63, 0.5); }
}

.nova { color: var(--gold-bright); }
.forge { color: var(--gold-primary); }
.tm { font-size: 1rem; vertical-align: super; color: var(--gold-dim); }

.tagline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tag-separator { color: var(--gold-dim); }

.enter-button {
    margin-top: 50px;
    padding: 16px 48px;
    background: transparent;
    border: 2px solid var(--gold-primary);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gold-bright);
    letter-spacing: 3px;
    cursor: pointer;
    transition: all var(--transition-medium) ease;
    animation: fadeSlideIn 1s ease-out 1.5s both;
}

.enter-button:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: var(--gold-bright);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.3);
    transform: scale(1.02);
}

/* Guardian Mode Setup Link */
.guardian-setup-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.4);
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--guardian-glow);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: fadeSlideIn 1s ease-out 2.2s both;
}

.guardian-setup-link:hover {
    background: rgba(46, 160, 67, 0.2);
    border-color: var(--guardian-glow);
    box-shadow: 0 0 20px rgba(46, 160, 67, 0.3);
    transform: scale(1.02);
}

/* Fade Overlay */
.fade-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 1s ease-in;
}

.fade-overlay.active { opacity: 1; pointer-events: all; }

/* ===== Game Interface ===== */
.game-interface {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-dark);
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.game-interface.visible { opacity: 1; }
.game-interface.hidden { display: none; }

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-medium);
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--gold-primary);
    letter-spacing: 2px;
}

.char-summary {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.guardian-badge-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.3);
    border-radius: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--guardian-glow);
}

/* Main Layout */
.game-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: var(--bg-medium); border-radius: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* Messages */
.message {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    animation: messageSlide 0.3s ease-out;
}

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

.message-dm {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1) 0%, rgba(212, 168, 83, 0.03) 100%);
    border-left: 3px solid var(--gold-primary);
}

.message-user {
    background: rgba(30, 35, 45, 0.8);
    border-left: 3px solid var(--text-muted);
    margin-left: 30px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
}

.message-dm .message-header { color: var(--gold-primary); }
.message-user .message-header { color: var(--text-secondary); }

.message-content { font-size: 1rem; line-height: 1.6; }
.message-content p { margin-bottom: 10px; }
.message-content p:last-child { margin-bottom: 0; }

/* Dice Roll Display in Chat */
.roll-result-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.15) 0%, rgba(0,0,0,0.3) 100%);
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
}

.roll-label { font-size: 0.9rem; color: var(--text-secondary); }
.roll-dice { font-size: 1.3rem; }
.roll-total {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.roll-total.critical { color: var(--success); text-shadow: 0 0 10px var(--success); }
.roll-total.fumble { color: var(--danger); }

.roll-breakdown-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Options */
.message-options {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 168, 83, 0.2);
}

.message-options h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold-dim);
    margin-bottom: 10px;
}

.option-list { list-style: none; }

.option-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: rgba(212, 168, 83, 0.05);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.option-item:hover {
    background: rgba(212, 168, 83, 0.12);
    border-color: var(--gold-primary);
    transform: translateX(4px);
}

.option-number { color: var(--gold-primary); font-weight: 600; margin-right: 8px; }

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-medium);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 8px;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
    color: var(--text-primary);
    resize: none;
}

.chat-input:focus { outline: none; border-color: var(--gold-primary); }
.chat-input::placeholder { color: var(--text-muted); }

.send-button {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dim) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) ease;
}

.send-button:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(212, 168, 83, 0.4); }
.send-icon { width: 22px; height: 22px; fill: var(--bg-deep); }

/* ===== Sidebar ===== */
.game-sidebar {
    width: 340px;
    background: var(--bg-medium);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.sidebar-tabs {
    display: flex;
    background: var(--bg-dark);
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.sidebar-tab {
    flex: 1;
    padding: 10px 6px;
    background: transparent;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    border-bottom: 2px solid transparent;
}

.sidebar-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.02); }
.sidebar-tab.active {
    color: var(--gold-bright);
    background: rgba(212, 168, 83, 0.1);
    border-bottom-color: var(--gold-primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.sidebar-content.hidden { display: none; }

.sidebar-content::-webkit-scrollbar { width: 5px; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

/* ===== Character Sheet Styles ===== */

/* Character Header Card */
.char-header-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin-bottom: 12px;
}

.char-portrait {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2), rgba(212, 168, 83, 0.05));
    border: 2px solid var(--gold-dim);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.char-info { flex: 1; }

.char-name-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gold-dim);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold-bright);
    padding: 2px 0;
    margin-bottom: 6px;
}

.char-name-input:focus { outline: none; border-bottom-color: var(--gold-primary); }

.char-details {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.char-select-small {
    flex: 1;
    padding: 4px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.level-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.level-box input {
    width: 32px;
    padding: 4px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold-bright);
    text-align: center;
}

.char-meta-row {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.meta-input {
    width: 60px;
    background: transparent;
    border: none;
    border-bottom: 1px dotted var(--text-muted);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Combat Stats Row */
.combat-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.combat-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 6px;
}

.combat-stat label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--gold-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.combat-input {
    width: 40px;
    padding: 4px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

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

.speed-display { display: flex; align-items: center; gap: 2px; }
.speed-display span { font-size: 0.7rem; color: var(--text-muted); }

.prof-bonus {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-bright);
}

/* HP Section */
.hp-section {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    margin-bottom: 12px;
}

.hp-main { flex: 2; }
.hp-main label, .hp-temp label, .hit-dice label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--gold-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.hp-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.hp-input {
    width: 40px;
    padding: 4px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: center;
}

.hp-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #27ae60);
    border-radius: 3px;
    transition: width var(--transition-medium) ease;
    width: 100%;
}

.hp-temp, .hit-dice { flex: 1; text-align: center; }

.hp-input-small {
    width: 36px;
    padding: 4px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
}

.hit-dice-display {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Abilities Section */
.abilities-section h3, .skills-section h3, .features-section h3,
.attacks-section h3, .equipment-section h3, .proficiencies-section h3,
.treasure-section h3, .settings-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.abilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.ability-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 6px;
    position: relative;
}

.ability-label {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--gold-dim);
    letter-spacing: 1px;
}

.ability-score-input {
    width: 36px;
    padding: 2px;
    margin: 4px 0;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.ability-score-input:focus { outline: none; border-color: var(--gold-primary); }

.ability-mod {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.save-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    font-size: 0.6rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.save-btn:hover { opacity: 1; background: rgba(212, 168, 83, 0.2); }
.save-btn.proficient { opacity: 1; border-color: var(--gold-dim); background: rgba(212, 168, 83, 0.15); }

/* Skills Section */
.click-hint {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(0,0,0,0.15);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.skill-row:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: rgba(212, 168, 83, 0.3);
}

.skill-row:active { transform: scale(0.98); }

.skill-row.proficient { background: rgba(212, 168, 83, 0.08); }
.skill-row.proficient .skill-prof { color: var(--gold-primary); }

.skill-prof { width: 12px; font-size: 0.7rem; color: var(--text-muted); }
.skill-name { flex: 1; font-size: 0.8rem; color: var(--text-primary); }
.skill-ability { font-size: 0.65rem; color: var(--text-muted); }
.skill-mod {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-dim);
    min-width: 28px;
    text-align: right;
}

.passive-perception {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
}

.passive-perception span {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: var(--gold-bright);
}

/* Features Section */
.features-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feature-item {
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-left: 2px solid var(--gold-dim);
    border-radius: 0 4px 4px 0;
}

.feature-name {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin-bottom: 2px;
}

.feature-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Spells Tab ===== */
.spellcasting-header {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.spell-stat {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 6px;
}

.spell-stat label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: var(--gold-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.spell-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-bright);
}

.spell-level-section {
    margin-bottom: 16px;
}

.spell-level-section h3 {
    margin-bottom: 8px;
}

.spell-level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 168, 83, 0.2);
}

.spell-level-header h3 { margin: 0; border: none; padding: 0; }

.spell-slots {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.slot-input {
    width: 28px;
    padding: 3px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--text-primary);
    text-align: center;
}

.spells-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.spell-item:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--info);
}

.spell-item.cantrip { border-left: 2px solid var(--guardian-green); }

.spell-name {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.spell-info {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== Inventory Tab ===== */
.attacks-section { margin-bottom: 16px; }

.attacks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attack-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.attack-item.spell-attack { border-left: 2px solid var(--info); }

.attack-name {
    flex: 1;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.attack-bonus {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-bright);
}

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

.equipment-slots {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.equip-slot {
    flex: 1;
    text-align: center;
}

.equip-slot label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: var(--gold-dim);
    margin-bottom: 2px;
}

.money-input {
    width: 100%;
    padding: 4px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--text-primary);
    text-align: center;
}

.equipment-textarea, .proficiencies-textarea, .treasure-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    resize: vertical;
}

.equipment-textarea:focus, .proficiencies-textarea:focus, .treasure-textarea:focus {
    outline: none;
    border-color: var(--gold-dim);
}

.proficiencies-section, .treasure-section { margin-top: 14px; }

/* ===== Settings Tab ===== */
.settings-section { margin-bottom: 20px; }

.dice-quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.dice-btn {
    padding: 10px 6px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dice-btn:hover {
    background: rgba(212, 168, 83, 0.15);
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.dice-btn.d20 {
    grid-column: span 2;
    background: rgba(212, 168, 83, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-bright);
}

.dice-result {
    padding: 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(212, 168, 83, 0.2);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 12px;
}

.result-number {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold-bright);
    display: block;
}

.result-number.rolling { animation: diceRoll 0.08s linear infinite; }
.result-number.critical { color: var(--success); text-shadow: 0 0 20px var(--success); }
.result-number.fumble { color: var(--danger); }

@keyframes diceRoll {
    0% { transform: rotate(-3deg) scale(0.97); }
    50% { transform: rotate(3deg) scale(1.03); }
    100% { transform: rotate(-3deg) scale(0.97); }
}

.result-breakdown {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.roll-modifiers {
    display: flex;
    gap: 8px;
}

.mod-btn {
    flex: 1;
    padding: 8px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mod-btn:hover {
    background: rgba(212, 168, 83, 0.1);
    border-color: rgba(212, 168, 83, 0.3);
    color: var(--text-primary);
}

.api-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

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

.api-note {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
}

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

.action-btn {
    padding: 10px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid var(--gold-dim);
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: var(--gold-bright);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold-primary);
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold-primary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 6px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px var(--guardian-glow); opacity: 1; }
    50% { box-shadow: 0 0 12px var(--guardian-glow); opacity: 0.7; }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 900px) {
    .game-main { flex-direction: column; }
    .game-sidebar {
        width: 100%;
        max-height: 45vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .header-center { display: none; }
}

@media (max-width: 600px) {
    .logo-text { font-size: 2rem; }
    .rune-circle { width: 140px; height: 140px; }
    .tagline { flex-direction: column; gap: 6px; font-size: 0.75rem; }
    .tag-separator { display: none; }
    .guardian-badge { font-size: 0.6rem; padding: 6px 10px; }
    .enter-button { padding: 12px 32px; font-size: 0.95rem; }
    .game-header { padding: 10px 14px; }
    .game-title { font-size: 1.1rem; }
    .chat-container { padding: 12px; }
    .message { padding: 12px 14px; }
    .message-user { margin-left: 16px; }
    .abilities-grid { grid-template-columns: repeat(2, 1fr); }
}
