/* public/css/game.css */

/* ===== Base Styles ===== */
:root {
    --dark-bg: #0a0a0f;
    --dark-panel: #111118;
    --dark-border: #1e1e2e;
    --gold: #c9a84c;
    --gold-light: #e2c97e;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #1e1e2e transparent;
}

body {
    background-color: var(--dark-bg);
    color: #e5e7eb;
    font-family: 'Inter', sans-serif;
}

/* ===== Custom Scrollbar ===== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--dark-border);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #2a2a3a;
}

/* ===== Narrative Messages ===== */
.narrative-message {
    animation: fadeInUp 0.4s ease-out;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.narrative-assistant {
    background: linear-gradient(135deg, #111118, #1a1a25);
    border: 1px solid #1e1e2e;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
}

.narrative-user {
    background: linear-gradient(135deg, #1a1a20, #111118);
    border: 1px solid #2a2a3a;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    text-align: right;
    font-style: italic;
    color: #9ca3af;
}

/* ===== Action Type Badges ===== */
.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.action-combat { background: rgba(220, 38, 38, 0.2); color: #fca5a5; }
.action-explore { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.action-dialogue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.action-event { background: rgba(168, 85, 247, 0.2); color: #c4b5fd; }
.action-ending_trigger { background: rgba(245, 158, 11, 0.3); color: #fde68a; }

/* ===== Tab Active State ===== */
.tab-active {
    color: var(--gold-light) !important;
    border-bottom-color: var(--gold) !important;
}

/* ===== Rarity Colors ===== */
.rarity-common { color: #9ca3af; }
.rarity-uncommon { color: #22c55e; }
.rarity-rare { color: #3b82f6; }
.rarity-epic { color: #a855f7; }
.rarity-legendary { color: #f59e0b; }

.border-rarity-common { border-color: #9ca3af; }
.border-rarity-uncommon { border-color: #22c55e; }
.border-rarity-rare { border-color: #3b82f6; }
.border-rarity-epic { border-color: #a855f7; }
.border-rarity-legendary { border-color: #f59e0b; }

/* ===== Animations ===== */
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 5px rgba(201, 168, 76, 0.3); }
    50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.6); }
}

.animate-glow {
    animation: pulse-gold 2s ease-in-out infinite;
}

/* ===== Gacha Card Flip ===== */
.gacha-card-container {
    perspective: 1000px;
}

.gacha-card {
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.gacha-card.flipped {
    transform: rotateY(180deg);
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 2px solid var(--dark-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Ending Gallery Cards ===== */
.ending-card {
    transition: all 0.3s ease;
}
.ending-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(201, 168, 76, 0.15);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .game-layout {
        flex-direction: column;
    }
    .side-panel {
        width: 100%;
    }
}