/* =============================================
   THE CHAOS TAROT - Styles
   ============================================= */

/* CSS Variables */
:root {
    --bg-dark: #0d0a14;
    --bg-medium: #1a1424;
    --bg-light: #2a2234;
    --accent-gold: #c9a227;
    --accent-gold-light: #e8c547;
    --accent-purple: #6b3fa0;
    --accent-purple-light: #9b6fd0;
    --text-light: #e8e4f0;
    --text-muted: #a8a4b0;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --card-width: min(170px, 25vw);
    --card-height: calc(var(--card-width) * 1.72);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(ellipse at top, rgba(107, 63, 160, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(201, 162, 39, 0.1) 0%, transparent 50%);
    color: var(--text-light);
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 20px);
    overflow: hidden;
}

/* Header */
.header {
    text-align: center;
    padding: clamp(10px, 2vh, 20px) 0;
    position: relative;
    flex-shrink: 0;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(201, 162, 39, 0.3);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.subtitle {
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 30px);
    min-height: 0;
    overflow: hidden;
}

/* Deck Section */
.deck-section {
    display: flex;
    justify-content: center;
    padding: clamp(5px, 1vh, 20px) 0;
    flex-shrink: 0;
}

.deck-pile {
    position: relative;
    cursor: pointer;
    transition: transform 0.6s ease;
}

.deck-pile:hover {
    transform: translateY(-8px);
}

.deck-pile .card {
    animation: deckPulse 4s ease-in-out infinite;
}

@keyframes deckPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.deck-pile::before,
.deck-pile::after {
    content: '';
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    background: linear-gradient(145deg, #1a1424, #0d0a14);
    border: 2px solid rgba(201, 162, 39, 0.4);
    border-radius: 12px;
    z-index: -1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.6s ease;
}

.deck-pile::before {
    top: 4px;
    left: 4px;
    border-color: rgba(201, 162, 39, 0.3);
}

.deck-pile::after {
    top: 8px;
    left: 8px;
    border-color: rgba(201, 162, 39, 0.2);
}

.deck-pile:hover::before {
    top: 6px;
    left: 6px;
}

.deck-pile:hover::after {
    top: 12px;
    left: 12px;
}

.deck-count {
    text-align: center;
    margin-top: 10px;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    color: var(--text-muted);
}

/* Card Base Styles */
.card {
    width: var(--card-width);
    height: var(--card-height);
    perspective: 1000px;
    cursor: pointer;
    --glow-color: var(--accent-gold);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.reversed.flipped .card-inner {
    transform: rotateY(180deg) rotate(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: visible;
    background: linear-gradient(145deg, #1a1424, #0d0a14);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 8px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Dynamic border glow effect */
.card-front::before,
.card-back::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        var(--accent-gold) 0%,
        var(--accent-purple) 25%,
        var(--accent-gold-light) 50%,
        var(--accent-purple-light) 75%,
        var(--accent-gold) 100%
    );
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.6s ease, background-position 0.6s ease;
    animation: borderGlow 8s ease infinite;
}

.card:hover .card-front::before,
.card:hover .card-back::before {
    opacity: 0.9;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Subtle inner glow on cards */
.card-front::after,
.card-back::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 30px rgba(201, 162, 39, 0.08);
    pointer-events: none;
    transition: box-shadow 0.6s ease;
}

.card:hover .card-front::after,
.card:hover .card-back::after {
    box-shadow: inset 0 0 40px rgba(201, 162, 39, 0.15);
}

.card-front {
    transform: rotateY(180deg);
}

.card-front img, .card-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    border-radius: 10px;
}

/* Flipped card glow changes to purple/mystical */
.card.flipped .card-front::before {
    background: linear-gradient(
        135deg,
        var(--accent-purple-light) 0%,
        var(--accent-gold) 25%,
        var(--accent-purple) 50%,
        var(--accent-gold-light) 75%,
        var(--accent-purple-light) 100%
    );
    background-size: 300% 300%;
}

/* Reading Section */
.reading-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    padding: clamp(5px, 1vh, 20px);
    overflow: auto;
}

.spread-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 2vw, 20px);
    max-width: 100%;
    max-height: 100%;
}

/* Hide empty spread container */
.spread-container:empty {
    display: none;
}

/* Spread Layouts */
.spread-container.single {
    justify-content: center;
}

.spread-container.three {
    gap: clamp(15px, 3vw, 30px);
}

.spread-container.five {
    display: grid;
    grid-template-columns: repeat(3, var(--card-width));
    grid-template-rows: repeat(3, var(--card-height));
    gap: clamp(5px, 1vw, 15px);
    justify-items: center;
    align-items: center;
}

.spread-container.five .spread-card:nth-child(1) { grid-column: 2; grid-row: 1; }
.spread-container.five .spread-card:nth-child(2) { grid-column: 1; grid-row: 2; }
.spread-container.five .spread-card:nth-child(3) { grid-column: 2; grid-row: 2; }
.spread-container.five .spread-card:nth-child(4) { grid-column: 3; grid-row: 2; }
.spread-container.five .spread-card:nth-child(5) { grid-column: 2; grid-row: 3; }

.spread-container.celtic {
    display: grid;
    grid-template-columns: repeat(6, calc(var(--card-width) * 0.7));
    grid-template-rows: repeat(4, calc(var(--card-height) * 0.6));
    gap: 5px;
    justify-items: center;
    align-items: center;
}

.spread-container.celtic .spread-card { transform: scale(0.65); }
.spread-container.celtic .spread-card:nth-child(1) { grid-column: 2; grid-row: 2; z-index: 1; }
.spread-container.celtic .spread-card:nth-child(2) { grid-column: 2; grid-row: 2; z-index: 2; transform: scale(0.65) rotate(90deg); }
.spread-container.celtic .spread-card:nth-child(3) { grid-column: 2; grid-row: 3; }
.spread-container.celtic .spread-card:nth-child(4) { grid-column: 1; grid-row: 2; }
.spread-container.celtic .spread-card:nth-child(5) { grid-column: 2; grid-row: 1; }
.spread-container.celtic .spread-card:nth-child(6) { grid-column: 3; grid-row: 2; }
.spread-container.celtic .spread-card:nth-child(7) { grid-column: 5; grid-row: 4; }
.spread-container.celtic .spread-card:nth-child(8) { grid-column: 5; grid-row: 3; }
.spread-container.celtic .spread-card:nth-child(9) { grid-column: 5; grid-row: 2; }
.spread-container.celtic .spread-card:nth-child(10) { grid-column: 5; grid-row: 1; }

/* Spread Card Wrapper */
.spread-card {
    position: relative;
    opacity: 0;
    animation: cardDeal 0.8s ease-out forwards;
}

.spread-card .card-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    color: var(--text-muted);
    white-space: nowrap;
    text-align: center;
    opacity: 0;
    animation: labelFadeIn 0.5s ease-out 0.6s forwards;
}

@keyframes labelFadeIn {
    to { opacity: 1; }
}

@keyframes cardDeal {
    0% {
        opacity: 0;
        transform: translateY(-80px) rotate(-15deg) scale(0.7);
    }
    60% {
        transform: translateY(10px) rotate(3deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1);
    }
}

/* Card Hover Effects */
.spread-card .card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.spread-card .card:hover {
    transform: translateY(-10px) scale(1.03);
}

/* Card flip shimmer effect */
.spread-card .card.flipped .card-front {
    animation: cardRevealShimmer 1.5s ease-out;
}

@keyframes cardRevealShimmer {
    0% {
        filter: brightness(1.5) saturate(1.2);
    }
    100% {
        filter: brightness(1) saturate(1);
    }
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(10px, 2vw, 30px);
    padding: clamp(10px, 2vh, 25px);
    background: var(--bg-medium);
    border-radius: 15px;
    border: 1px solid rgba(201, 162, 39, 0.2);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: var(--text-muted);
}

.control-select {
    padding: clamp(6px, 1vh, 10px) clamp(10px, 1.5vw, 15px);
    background: var(--bg-light);
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.control-select:hover, .control-select:focus {
    border-color: var(--accent-gold-light);
    outline: none;
}

.control-buttons {
    display: flex;
    gap: clamp(8px, 1.5vw, 15px);
    flex-wrap: wrap;
    justify-content: center;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: clamp(8px, 1.5vh, 12px) clamp(12px, 2vw, 24px);
    border: none;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.btn-icon {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-light));
    color: white;
    box-shadow: 0 4px 15px rgba(107, 63, 160, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 63, 160, 0.6);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.6);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--text-muted);
}

.btn-secondary:hover {
    background: var(--bg-medium);
    border-color: var(--text-light);
}

.btn-export {
    background: linear-gradient(135deg, #2d5a27, #4a8f42);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 143, 66, 0.4);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 143, 66, 0.6);
}

.btn-export:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-history {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.4);
}

.btn-history:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 62, 80, 0.6);
}

/* =============================================
   HISTORY PANEL STYLES
   ============================================= */

.history-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    padding: 20px;
}

.history-panel.active {
    display: flex;
}

.history-container {
    background: var(--bg-medium);
    border: 2px solid var(--accent-gold);
    border-radius: 15px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

.history-header h2 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 1.3rem;
    margin: 0;
}

.history-close {
    background: var(--bg-light);
    border: 1px solid var(--text-muted);
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.history-close:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Tabs */
.history-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.history-tab {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-light);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.history-tab:hover {
    border-color: var(--accent-gold);
    color: var(--text-light);
}

.history-tab.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--bg-dark);
    border-color: var(--accent-gold);
}

.history-tab-content {
    display: none;
}

.history-tab-content.active {
    display: block;
}

/* Analytics Summary */
.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-light);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(107, 63, 160, 0.3), rgba(201, 162, 39, 0.2));
    border-color: var(--accent-purple);
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 5px;
}

/* Analytics Sections */
.analytics-section {
    background: var(--bg-light);
    border: 1px solid rgba(201, 162, 39, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.analytics-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent-gold);
    font-size: 1rem;
    margin: 0 0 15px 0;
}

/* Energy Bars */
.energy-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.energy-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.energy-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.energy-label {
    width: 50px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.energy-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
}

.energy-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px currentColor;
}

.energy-count {
    width: 35px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Reversals Gauge */
.reversals-gauge {
    padding: 10px 0;
}

.gauge-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--bg-dark);
}

.gauge-fill {
    transition: width 0.8s ease;
}

.gauge-fill.upright {
    background: linear-gradient(90deg, #c9a227, #e8c547);
}

.gauge-fill.reversed {
    background: linear-gradient(90deg, #6b3fa0, #9b6fd0);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.gauge-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.upright-label {
    color: var(--accent-gold);
}

.reversed-label {
    color: var(--accent-purple-light);
}

/* Spread Usage Chart */
.spread-usage-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 120px;
    padding: 10px 0;
    gap: 10px;
}

.spread-usage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.spread-usage-bar {
    width: 100%;
    max-width: 50px;
    border-radius: 8px 8px 0 0;
    transition: height 0.8s ease;
    min-height: 10px;
    margin-top: auto;
}

.spread-usage-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

.spread-usage-value {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Suit Donut Chart */
.suit-donut-chart {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.donut-hole {
    width: 80px;
    height: 80px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-total {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: 700;
}

.donut-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-text {
    font-size: 0.8rem;
    color: var(--text-light);
    flex: 1;
}

.legend-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Activity Timeline */
.activity-timeline {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100px;
    padding: 10px 0;
    gap: 8px;
}

.timeline-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.timeline-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-purple));
    border-radius: 6px 6px 0 0;
    transition: height 0.8s ease;
    min-height: 5px;
    margin-top: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.timeline-count {
    font-size: 0.7rem;
    color: var(--bg-dark);
    font-weight: 700;
}

.timeline-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.no-activity {
    text-align: center;
    color: var(--text-muted);
    width: 100%;
    padding: 20px;
}

/* Top Cards with bars */
.top-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-card-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.top-card-rank {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
    color: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.top-card-name {
    width: 120px;
    color: var(--text-light);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.top-card-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(201, 162, 39, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.top-card-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.8s ease;
}

.top-card-count {
    color: var(--accent-gold);
    font-size: 0.85rem;
    font-weight: 600;
    width: 35px;
    text-align: right;
}

/* =============================================
   LOGIN / DRM GATE STYLES
   ============================================= */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    overflow: hidden;
}

.login-overlay.hidden {
    display: none;
}

/* Animation Toggle Button */
.animation-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(26, 20, 36, 0.8);
    border: 1px solid rgba(201, 162, 39, 0.3);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

.animation-toggle:hover {
    border-color: var(--accent-gold);
    color: var(--text-light);
}

.animation-toggle .toggle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    transition: background 0.3s ease;
}

.animation-toggle.paused .toggle-dot {
    background: var(--text-muted);
}

/* Reduced motion support */
.reduce-motion .prismatic-orb,
.reduce-motion .ink-swirl,
.reduce-motion .temptation-image,
.reduce-motion .card-glow,
.reduce-motion .card-shimmer,
.reduce-motion .login-container::before,
.reduce-motion .login-title {
    animation: none !important;
}

.reduce-motion .temptation-image {
    transform: rotate(-2deg);
}

/* Animated Background Effects */
.login-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.prismatic-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orbFloat 40s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, 
        rgba(155, 89, 182, 0.5) 0%, 
        rgba(107, 63, 160, 0.3) 40%,
        rgba(201, 162, 39, 0.15) 70%,
        transparent 100%);
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    background: radial-gradient(circle, 
        rgba(201, 162, 39, 0.4) 0%, 
        rgba(232, 197, 71, 0.25) 40%,
        rgba(155, 89, 182, 0.15) 70%,
        transparent 100%);
    animation-delay: -14s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    top: 40%;
    left: 20%;
    background: radial-gradient(circle, 
        rgba(52, 152, 219, 0.3) 0%, 
        rgba(155, 89, 182, 0.2) 50%,
        transparent 100%);
    animation-delay: -28s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.35; }
    25% { transform: translate(20px, -25px) scale(1.05); opacity: 0.4; }
    50% { transform: translate(-15px, 15px) scale(0.98); opacity: 0.3; }
    75% { transform: translate(25px, 20px) scale(1.02); opacity: 0.38; }
}

/* Ink Swirls */
.ink-swirl {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse at center,
        rgba(13, 10, 20, 0.9) 0%,
        rgba(26, 20, 36, 0.4) 30%,
        transparent 70%);
    animation: swirlRotate 120s linear infinite;
}

.swirl-1 {
    top: -200px;
    left: -200px;
    animation-direction: normal;
}

.swirl-2 {
    bottom: -200px;
    right: -200px;
    animation-direction: reverse;
    animation-duration: 100s;
}

@keyframes swirlRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Login Wrapper */
.login-wrapper {
    display: flex;
    align-items: center;
    gap: clamp(30px, 5vw, 60px);
    z-index: 1;
    animation: loginFadeIn 1.5s ease-out;
}

/* Temptation Card */
.temptation-card {
    position: relative;
    display: none;
    animation: cardReveal 2s ease-out 0.5s both;
}

@media (min-width: 900px) {
    .temptation-card {
        display: block;
    }
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: translateX(-30px) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: translateX(0) rotateY(0);
    }
}

.temptation-image {
    width: clamp(200px, 20vw, 280px);
    height: auto;
    border-radius: 15px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(107, 63, 160, 0.2),
        0 0 100px rgba(201, 162, 39, 0.15);
    animation: cardFloat 12s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0) rotate(-1.5deg); }
    50% { transform: translateY(-10px) rotate(1.5deg); }
}

/* Card Glow Effect */
.temptation-card .card-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: conic-gradient(
        from 0deg,
        rgba(201, 162, 39, 0.3),
        rgba(155, 89, 182, 0.3),
        rgba(52, 152, 219, 0.3),
        rgba(46, 204, 113, 0.3),
        rgba(231, 76, 60, 0.3),
        rgba(201, 162, 39, 0.3)
    );
    border-radius: 20px;
    filter: blur(30px);
    opacity: 0.5;
    animation: glowRotate 20s linear infinite;
    z-index: -1;
}

@keyframes glowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Card Shimmer Effect */
.temptation-card .card-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    background: linear-gradient(
        135deg,
        transparent 30%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        transparent 70%
    );
    background-size: 200% 200%;
    animation: shimmerMove 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerMove {
    0% { background-position: 200% 200%; }
    100% { background-position: -200% -200%; }
}

.login-container {
    background: var(--bg-medium);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: clamp(30px, 5vw, 50px) clamp(25px, 4vw, 40px);
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(201, 162, 39, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: containerReveal 1.2s ease-out 0.3s both;
    position: relative;
    overflow: hidden;
}

/* Pearlescent border animation */
.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        var(--accent-gold),
        var(--accent-purple),
        rgba(52, 152, 219, 0.8),
        var(--accent-gold-light),
        var(--accent-purple-light),
        var(--accent-gold)
    );
    background-size: 300% 300%;
    border-radius: 22px;
    z-index: -1;
    animation: pearlBorder 12s ease infinite;
}

@keyframes pearlBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes containerReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-header {
    margin-bottom: clamp(20px, 4vh, 35px);
}

.login-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 
        0 0 30px rgba(201, 162, 39, 0.3),
        0 0 60px rgba(201, 162, 39, 0.1);
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    animation: titleGlow 6s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 30px rgba(201, 162, 39, 0.3), 0 0 60px rgba(201, 162, 39, 0.1); }
    50% { text-shadow: 0 0 40px rgba(201, 162, 39, 0.4), 0 0 80px rgba(201, 162, 39, 0.15); }
}

.login-subtitle {
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.form-group input {
    width: 100%;
    padding: clamp(12px, 2vh, 15px) clamp(15px, 2vw, 20px);
    background: var(--bg-light);
    border: 2px solid rgba(201, 162, 39, 0.3);
    border-radius: 10px;
    color: var(--text-light);
    font-family: inherit;
    font-size: clamp(1rem, 2vw, 1.1rem);
    letter-spacing: 0.2em;
    text-align: center;
    transition: all 0.4s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 
        0 0 20px rgba(201, 162, 39, 0.2),
        0 0 40px rgba(201, 162, 39, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.login-error {
    color: #e74c3c;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    min-height: 1.2em;
    margin: 0;
}

.login-btn {
    width: 100%;
    padding: clamp(12px, 2vh, 16px) 24px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.login-btn:hover::after {
    left: 100%;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.3), transparent);
}

.login-divider span {
    padding: 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.buy-btn {
    width: 100%;
    padding: clamp(12px, 2vh, 16px) 24px;
    text-decoration: none;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.buy-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.buy-btn:hover::after {
    left: 100%;
}

.login-info {
    margin-top: clamp(20px, 3vh, 30px);
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: var(--text-muted);
    opacity: 0.7;
}

/* Logout Button */
.logout-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-light);
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    cursor: pointer;
    transition: var(--transition-smooth);
    opacity: 0.6;
    color: var(--text-light);
}

.logout-btn:hover {
    opacity: 1;
    border-color: var(--accent-gold);
    background: var(--bg-medium);
}

/* Modal */
.card-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: clamp(20px, 4vw, 40px);
    max-width: 90%;
    max-height: 90vh;
    animation: modalFadeIn 0.4s ease;
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: clamp(2rem, 5vw, 2.5rem);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-gold);
}

.modal-card {
    max-width: min(340px, 80vw);
    max-height: 60vh;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(107, 63, 160, 0.2),
        0 0 120px rgba(201, 162, 39, 0.1);
    border: 3px solid var(--accent-gold);
    animation: modalCardEnter 0.5s ease-out;
    position: relative;
}

@keyframes modalCardEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0);
    }
}

/* Modal card glow */
.modal-card::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: conic-gradient(
        from 0deg,
        var(--accent-gold),
        var(--accent-purple),
        var(--accent-gold-light),
        var(--accent-purple-light),
        var(--accent-gold)
    );
    border-radius: 18px;
    z-index: -1;
    animation: modalGlowRotate 10s linear infinite;
    opacity: 0.7;
}

@keyframes modalGlowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.modal-card img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.modal-card img:not([src]), 
.modal-card img[src=""] {
    display: none;
}

.modal-card img.reversed {
    transform: rotate(180deg);
}

/* Hide images with empty src */
img:not([src]),
img[src=""] {
    visibility: hidden;
    height: 0;
    width: 0;
}
