@font-face {
    font-family: 'Leotaro';
    src: url('/fonts/Leotaro-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Ruslan+Display&family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@600;700;900&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Color Palette */
    --bg-primary: #3b2012;
    --bg-surface: rgba(26, 14, 8, 0.85);
    --bg-surface-elevated: rgba(38, 20, 12, 0.9);
    --bg-card: #fae49d;
    --bg-glass: rgba(22, 12, 6, 0.88);

    --border-subtle: rgba(245, 158, 11, 0.25);
    --border-glow: rgba(245, 158, 11, 0.4);

    /* Accents */
    --gold-primary: #f59e0b;
    --gold-glow: #fbbf24;
    --gold-gradient: linear-gradient(135deg, #fbbf24, #d97706);

    --crimson-primary: #ef4444;
    --crimson-glow: #f87171;
    --crimson-gradient: linear-gradient(135deg, #ef4444, #991b1b);

    --arcane-primary: #8b5cf6;
    --arcane-glow: #a78bfa;
    --arcane-gradient: linear-gradient(135deg, #a855f7, #6b21a8);

    --emerald-primary: #10b981;
    --emerald-glow: #34d399;
    --emerald-gradient: linear-gradient(135deg, #10b981, #047857);

    --sapphire-primary: #3b82f6;
    --sapphire-glow: #60a5fa;

    /* Clean & Medieval Typography System */
    --font-heading: 'Leotaro', 'Ruslan Display', 'Cinzel Decorative', serif;
    --font-medieval: 'Leotaro', 'Ruslan Display', 'Cinzel Decorative', serif;
    --font-serif: 'Cinzel', serif;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Shadows & Glows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
    --glow-gold: 0 0 25px rgba(245, 158, 11, 0.25);
    --glow-crimson: 0 0 25px rgba(239, 68, 68, 0.3);

    /* Animation timing */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    font-family: var(--font-sans);
}

body {
    background-color: #3b2012;
    background-image: url('/images/wooden_table_bg.svg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
}
::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.25);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.5);
}

/* App Container */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
    background: rgba(18, 10, 6, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    font-size: 24px;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.room-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.room-badge:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-1px);
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-primary);
    box-shadow: 0 0 8px var(--gold-primary);
    animation: pulse 2s infinite;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    outline: none;
    letter-spacing: 0.5px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gold-gradient);
    color: #1e1b18;
    font-weight: 700;
    box-shadow: var(--glow-gold);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--crimson-gradient);
    color: #fff;
    box-shadow: var(--glow-crimson);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    padding: 8px 11px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 16px;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 17px;
    border-radius: 14px;
}

/* ==========================================================================
   SVG Vector Icons
   ========================================================================== */
.ui-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.18em;
    stroke-width: 2.2;
    flex-shrink: 0;
}

.ui-icon-sm {
    width: 0.9em;
    height: 0.9em;
    vertical-align: -0.12em;
}

.ui-icon-lg {
    width: 1.35em;
    height: 1.35em;
    vertical-align: -0.22em;
}

.ui-icon-hero {
    width: 56px;
    height: 56px;
    color: var(--gold-primary);
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.5));
}

.btn .ui-icon {
    margin-right: 4px;
}

/* ==========================================================================
   Screen 1 & 2: Auth & Lobby Views
   ========================================================================== */
.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lobby-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.hero-emblem {
    font-size: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
    animation: float 4s ease-in-out infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #ffffff 30%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 36px;
}

.card-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 28px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    backdrop-filter: blur(16px);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    outline: none;
    transition: var(--transition-fast);
}

.input-field:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.lobby-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.divider::before {
    margin-right: 12px;
}
.divider::after {
    margin-left: 12px;
}

/* Lobby Waiting Room */
.lobby-waiting-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.player-lobby-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.player-lobby-item.is-host {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.05);
}

.player-info-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid var(--border-subtle);
}

.host-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold-primary);
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ==========================================================================
   Screen 3: Main Game Board Layout
   ========================================================================== */
.game-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 57px);
    width: 100%;
    overflow: hidden;
    position: relative;
    justify-content: space-between;
}

/* Opponents Area (Top Horizontal Bar) */
.opponents-bar {
    width: 100%;
    padding: 10px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: rgba(18, 10, 6, 0.78);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    overflow-x: auto;
    flex-shrink: 0;
    min-height: 68px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.opponent-card {
    background: rgba(28, 16, 10, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 14px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    transition: all var(--transition-normal);
    position: relative;
    flex-shrink: 0;
}

.opponent-card.is-active-turn {
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-surface));
}

.opponent-card.is-dead {
    opacity: 0.5;
    filter: grayscale(1);
}

.opponent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-subtle);
    position: relative;
}

.level-bubble {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--gold-gradient);
    color: #000;
    font-weight: 800;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 8px;
}

.opponent-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opponent-name {
    font-weight: 700;
    font-size: 14px;
}

.opponent-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Arena / Battlefield (Center) */
.battlefield-arena {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px 24px;
    gap: 40px;
    min-height: 240px;
}

/* Decks Area */
.decks-dock {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

.deck-slot {
    width: 120px;
    height: 170px;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
}

.deck-slot:hover {
    transform: translateY(-5px) scale(1.03);
}

.deck-card-back {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    padding: 12px 6px;
    text-align: center;
    border: 2px solid transparent;
}

.deck-card-back::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

.door-deck .deck-card-back {
    background: radial-gradient(circle at 50% 30%, #5c1111 0%, #200505 100%);
    border-color: rgba(239, 68, 68, 0.6);
}

.door-deck:hover .deck-card-back {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
    border-color: #ef4444;
}

.treasure-deck .deck-card-back {
    background: radial-gradient(circle at 50% 30%, #854d0e 0%, #291003 100%);
    border-color: rgba(245, 158, 11, 0.6);
}

.treasure-deck:hover .deck-card-back {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
    border-color: #f59e0b;
}

.deck-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.deck-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

.door-deck .deck-title {
    color: #fecaca;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.treasure-deck .deck-title {
    color: #fef08a;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.deck-count {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Center Table / Encounter Zone */
.encounter-zone {
    flex: 1;
    min-width: 340px;
    max-width: 920px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.empty-encounter {
    border: 2px dashed rgba(245, 158, 11, 0.35);
    background: rgba(14, 8, 4, 0.45);
    border-radius: 18px;
    padding: 30px 40px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Player Dashboard Area (Bottom) */
.player-dashboard {
    width: 100%;
    background: rgba(18, 10, 6, 0.88);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    padding: 10px 24px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    flex-shrink: 0;
    overflow: visible !important;
    position: relative;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

/* Assistant Hints Banner */
.hints-banner {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    line-height: 1.45;
    color: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
    position: relative;
    z-index: 1;
    margin-bottom: 2px;
}

.hints-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
    flex-shrink: 0;
}

.hints-content {
    flex: 1;
}

/* Active Curses Banner */
.curses-banner {
    background: linear-gradient(90deg, rgba(147, 51, 234, 0.22), rgba(192, 132, 252, 0.1));
    border: 1.5px solid rgba(192, 132, 252, 0.5);
    border-radius: 12px;
    padding: 9px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #f3e8ff;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.25);
    animation: fadeIn 0.3s ease;
    position: relative;
    z-index: 1;
    margin-top: 2px;
    margin-bottom: 8px;
}

.curses-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.8));
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.curses-content {
    flex: 1;
}

.stat-curse {
    background: rgba(147, 51, 234, 0.2);
    border: 1px solid rgba(192, 132, 252, 0.5);
    color: #d8b4fe;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
    cursor: default;
    transition: all 0.2s ease;
}

.stat-curse:hover {
    background: rgba(147, 51, 234, 0.35);
    transform: scale(1.04);
}

.opponent-curse-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(147, 51, 234, 0.25);
    border: 1px solid rgba(192, 132, 252, 0.4);
    border-radius: 6px;
    color: #e9d5ff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    animation: pulseCurse 2s infinite ease-in-out;
}

@keyframes pulseCurse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(192, 132, 252, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(192, 132, 252, 0.8);
    }
}

.btn-icon.hints-active {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
    color: #fef08a !important;
}

.player-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    position: relative;
    z-index: 2;
    padding-top: 2px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hero-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 19px;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.stat-level {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--gold-primary);
}

.stat-power {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.action-dock {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ==========================================================================
   Left Edge Floating Tab & Slide-Out Equipment Drawer (Large RPG Grid)
   ========================================================================== */
.equipment-drawer-tab {
    position: fixed;
    left: 0;
    bottom: 30px;
    top: auto;
    transform: none;
    background: linear-gradient(135deg, rgba(28, 16, 10, 0.96), rgba(16, 9, 5, 0.98));
    border: 2.5px solid rgba(245, 158, 11, 0.5);
    border-left: none;
    border-radius: 0 16px 16px 0;
    padding: 16px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 120;
    box-shadow: 6px 6px 22px rgba(0, 0, 0, 0.75), 0 0 18px rgba(245, 158, 11, 0.25);
    transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.equipment-drawer-tab:hover {
    background: linear-gradient(135deg, rgba(45, 25, 15, 0.98), rgba(24, 12, 6, 1));
    border-color: var(--gold-primary);
    box-shadow: 8px 8px 28px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.5);
}

.equipment-drawer-tab.tab-open {
    left: 393px;
    border-left: none;
    border-radius: 0 16px 16px 0;
    box-shadow: 6px 6px 22px rgba(0, 0, 0, 0.75);
}

.tab-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

.tab-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 800;
    color: var(--gold-primary);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    line-height: 1;
}

.tab-badge {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 800;
    color: #10b981;
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(16, 185, 129, 0.55);
    padding: 2px 6px;
    border-radius: 8px;
    margin: 2px 0;
}

.tab-arrow {
    font-size: 11px;
    color: var(--gold-primary);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.equipment-drawer-tab.tab-open .tab-arrow {
    transform: rotate(180deg);
}

/* Large RPG Style Equipment Drawer (Square, Bottom Left Position) */
.equipment-drawer {
    position: fixed;
    bottom: 20px;
    top: auto;
    left: -405px;
    width: 395px;
    height: auto;
    max-height: calc(100vh - 100px);
    background: rgba(18, 10, 6, 0.97);
    backdrop-filter: blur(24px);
    border: 2.5px solid rgba(245, 158, 11, 0.5);
    border-left: none;
    border-radius: 0 20px 20px 0;
    box-shadow: 10px 10px 40px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    z-index: 115;
    transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.equipment-drawer.drawer-open {
    left: 0;
}

.equipment-drawer-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Large Minecraft Style Paper Doll Grid */
.large-doll-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    padding: 14px;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.7);
}

.large-doll-mid-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.large-doll-slot {
    width: 106px;
    min-height: 106px;
    height: auto;
    background: rgba(0, 0, 0, 0.65);
    border: 2px dashed rgba(245, 158, 11, 0.4);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: all var(--transition-normal);
    user-select: none;
    overflow: hidden;
}

.large-doll-slot.slot-occupied {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(16, 185, 129, 0.2));
    border: 2px solid var(--emerald-primary);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.5);
    cursor: pointer;
}

.large-doll-slot.slot-occupied:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 0 26px rgba(16, 185, 129, 0.75);
    border-color: #34d399;
}

.large-doll-slot .slot-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    gap: 4px;
    padding: 8px 4px;
}

.large-doll-slot .slot-empty-state .slot-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.large-doll-slot .slot-empty-state .slot-icon .ui-icon {
    width: 32px;
    height: 32px;
    stroke-width: 1.8;
}

.large-doll-slot .slot-empty-state .slot-label {
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}

.large-doll-slot .slot-empty-state .slot-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.large-doll-slot .slot-filled-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-height: 100px;
    padding: 6px 4px;
    text-align: center;
    position: relative;
}

.large-doll-slot .slot-item-img {
    max-height: 42px;
    max-width: 42px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
}

.large-doll-slot .slot-item-name {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    max-width: 98px;
    word-break: break-word;
    white-space: normal;
    text-align: center;
    overflow: visible;
    margin: 2px 0 1px;
}

.large-doll-slot .slot-item-bonus {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    color: #34d399;
    line-height: 1;
}

.large-doll-slot .slot-unequip-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 14px;
    color: #f87171;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    opacity: 0.75;
}

.large-doll-slot .slot-unequip-btn:hover {
    opacity: 1;
    transform: scale(1.3);
}

/* Equipped Items Detail List */
.equipped-items-list-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 12px;
}

.equipped-list-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

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

.equipped-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.equipped-list-row:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Player Hand Carousel (Full Width) */
.hand-carousel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px 2px;
    overflow: visible !important;
    min-height: 242px;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Event Log Drawer */
.event-log-drawer {
    position: fixed;
    top: 57px;
    right: 0;
    width: 340px;
    height: calc(100vh - 57px);
    background: rgba(14, 19, 31, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.event-log-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
}

.log-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.4;
    border-left: 3px solid var(--gold-primary);
    animation: slideInRight 0.2s ease;
}

.log-entry.combat { border-left-color: var(--crimson-primary); }
.log-entry.level { border-left-color: var(--emerald-primary); }
.log-entry.turn { border-left-color: var(--sapphire-primary); }
.log-entry.treasure { border-left-color: var(--gold-primary); }

.log-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Keyframe Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes modalPop {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 28px; }
    .lobby-options { grid-template-columns: 1fr; }
    .battlefield-arena { flex-direction: column; gap: 20px; }
    .decks-dock { flex-direction: row; }
    .deck-slot { width: 80px; height: 110px; }
    .player-status-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ==========================================================================
   Dice Roll & Escape Result Modal
   ========================================================================== */
.dice-modal-box {
    max-width: 440px;
    width: 90%;
    text-align: center;
    padding: 30px 24px;
    background: linear-gradient(135deg, rgba(28, 16, 10, 0.98), rgba(16, 9, 5, 0.99));
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(245, 158, 11, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dice-cube {
    width: 96px;
    height: 96px;
    background: #f8edd1;
    border: 5px solid #3c1e14;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 54px;
    font-weight: 900;
    color: #1a0802;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(180, 130, 60, 0.3);
    margin: 8px 0;
    position: relative;
    user-select: none;
    transition: all 0.3s ease;
}

.dice-cube.rolling {
    animation: diceSpin 0.15s linear infinite;
}

.dice-cube.dice-win {
    border-color: #059669;
    color: #059669;
    background: #ecfdf5;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6), inset 0 0 15px rgba(16, 185, 129, 0.3);
    transform: scale(1.08);
}

.dice-cube.dice-fail {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.6), inset 0 0 15px rgba(239, 68, 68, 0.3);
    transform: scale(1.08);
}

@keyframes diceSpin {
    0% { transform: rotate(0deg) scale(0.95); }
    50% { transform: rotate(180deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(0.95); }
}

.dice-result-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
}

.dice-result-title.win {
    color: #34d399;
}

.dice-result-title.fail {
    color: #f87171;
}

.dice-result-detail {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.dice-bad-stuff-alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fca5a5;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    text-align: left;
}
