/* ===========================
   倍倍FIGHT! - Main Styles
   =========================== */

:root {
    --primary-dark: #0a0015;
    --primary-purple: #6B46C1;
    --primary-gold: #FFD700;
    --accent-emerald: #50C878;
    --accent-red: #FF3860;
    --accent-blue: #3B82F6;
    
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --gradient-dark: linear-gradient(180deg, #0a0015 0%, #1a0033 50%, #2d1b69 100%);
    --gradient-neon: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00);
    
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 60px rgba(107, 70, 193, 0.6);
    --shadow-gold: 0 0 40px rgba(255, 215, 0, 0.8);
    
    --font-display: 'Cinzel', serif;
    --font-body: 'Poppins', sans-serif;
    
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
    font-family: var(--font-body);
    background: var(--primary-dark);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===========================
   Canvas & Background
   =========================== */

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.stars {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(2px 2px at 10% 10%, white, transparent),
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 70%, white, transparent),
        radial-gradient(2px 2px at 90% 10%, white, transparent);
    background-size: 200px 200px;
    animation: moveStars 120s linear infinite;
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(107, 70, 193, 0.1) 0%, 
        transparent 50%);
    animation: pulse 10s ease-in-out infinite;
}

.aurora {
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(0, 255, 255, 0.05) 50%,
        transparent 70%
    );
    animation: aurora 15s ease-in-out infinite;
}

/* ===========================
   Screens
   =========================== */

.screen {
    position: relative;
    min-height: 100vh;
    display: none;
    z-index: 2;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ===========================
   Start Screen
   =========================== */

#startScreen {
    padding: 2rem;
}

.logo-container {
    position: relative;
    margin-bottom: 4rem;
    animation: float 3s ease-in-out infinite;
}

.game-logo {
    font-family: var(--font-display);
    text-align: center;
    position: relative;
    z-index: 2;
}

.logo-text {
    display: block;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    background: linear-gradient(
        45deg,
        var(--primary-gold) 0%,
        #fff 25%,
        var(--primary-gold) 50%,
        #fff 75%,
        var(--primary-gold) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    text-shadow: 0 0 60px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.1em;
}

.logo-subtitle {
    display: block;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 215, 0, 0.3) 0%,
        transparent 70%
    );
    filter: blur(40px);
    animation: pulse 3s ease-in-out infinite;
}

/* ===========================
   Start Form
   =========================== */

.start-form {
    background: linear-gradient(
        135deg,
        rgba(107, 70, 193, 0.1) 0%,
        rgba(255, 215, 0, 0.05) 100%
    );
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 
        var(--shadow-xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.start-form::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-neon);
    border-radius: 20px;
    opacity: 0;
    z-index: -1;
    animation: neonBorder 3s linear infinite;
}

.input-group {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s var(--transition-smooth);
}

.input-wrapper:focus-within {
    border-color: var(--primary-gold);
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.currency-symbol {
    padding: 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-gold);
}

.amount-input {
    flex: 1;
    padding: 1.2rem 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
}

.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===========================
   Premium Buttons
   =========================== */

.premium-button {
    position: relative;
    padding: 1.5rem 3rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary-dark);
    background: var(--gradient-gold);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.premium-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(255, 215, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.premium-button:active {
    transform: translateY(-1px) scale(1.02);
}

.button-text {
    position: relative;
    z-index: 2;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.8) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.premium-button:hover .button-glow {
    opacity: 1;
    animation: pulse 1s ease-in-out infinite;
}

.button-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0;
}

.premium-button:hover .button-particles {
    animation: particleBurst 0.8s ease-out;
}

/* ===========================
   Floating Chips
   =========================== */

.floating-chips {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.chip {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(
        circle at 30% 30%,
        var(--primary-gold),
        #B8860B
    );
    border-radius: 50%;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.chip::before {
    content: '¥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-dark);
}

.chip-1 {
    top: 10%;
    left: 10%;
    animation: floatChip1 20s infinite ease-in-out;
}

.chip-2 {
    top: 70%;
    right: 15%;
    animation: floatChip2 25s infinite ease-in-out;
}

.chip-3 {
    bottom: 20%;
    left: 20%;
    animation: floatChip3 22s infinite ease-in-out;
}

/* ===========================
   Game Screen
   =========================== */

#gameScreen {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.game-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.score-display {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.2), rgba(0, 0, 0, 0.5));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.score-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

.score-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.score-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.currency {
    font-size: 1.5rem;
    color: var(--primary-gold);
}

.amount-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    transition: all 0.3s var(--transition-bounce);
}

.multiplier-indicator {
    margin-top: 0.5rem;
    font-size: 1.2rem;
    color: var(--accent-emerald);
    font-weight: 600;
}

.round-display {
    text-align: center;
}

.round-label {
    font-family: var(--font-display);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.round-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.round-separator {
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.round-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 10px;
    transition: width 0.5s var(--transition-smooth);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.next-multiplier {
    text-align: center;
    background: rgba(80, 200, 120, 0.1);
    border: 2px solid rgba(80, 200, 120, 0.3);
    border-radius: 15px;
    padding: 1rem 2rem;
}

.next-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.next-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-emerald);
    text-shadow: 0 0 20px rgba(80, 200, 120, 0.5);
}

/* ===========================
   Game Table
   =========================== */

.game-table {
    position: relative;
    margin: 3rem auto;
    max-width: 1000px;
}

.table-felt {
    background: radial-gradient(ellipse at center, #0d4f0d, #082808);
    border-radius: 30px;
    padding: 4rem 2rem;
    box-shadow: 
        inset 0 5px 30px rgba(0, 0, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
    border: 3px solid #2a1810;
}

.table-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.decoration-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--primary-gold);
    opacity: 0.5;
}

.decoration-corner.top-left {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 30px;
}

.decoration-corner.top-right {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 30px;
}

.decoration-corner.bottom-left {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 30px;
}

.decoration-corner.bottom-right {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 30px;
}

/* ===========================
   Card Container
   =========================== */

.card-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    min-height: 250px;
    align-items: center;
}

/* ===========================
   Game Controls
   =========================== */

.game-controls {
    text-align: center;
    margin-top: 3rem;
}

.cash-out-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    margin-bottom: 1rem;
}

.cash-out-btn:hover {
    box-shadow: 
        0 15px 40px rgba(16, 185, 129, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.hint-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin-top: 1rem;
}

/* ===========================
   Multiplier Chart
   =========================== */

.multiplier-chart {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.1), rgba(0, 0, 0, 0.5));
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.chart-title {
    font-family: var(--font-display);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    text-align: center;
}

.multiplier-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.multiplier-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.multiplier-item.active {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.multiplier-item.completed {
    opacity: 0.5;
}

.multiplier-round {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.multiplier-value {
    font-weight: 600;
    color: var(--accent-emerald);
}

/* ===========================
   Sound Controls
   =========================== */

.sound-controls {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.sound-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--primary-gold);
}

.sound-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ===========================
   Modal Overlay
   =========================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

/* ===========================
   Result Screen
   =========================== */

#resultScreen {
    padding: 2rem;
}

.result-container {
    background: linear-gradient(
        135deg,
        rgba(107, 70, 193, 0.2) 0%,
        rgba(255, 215, 0, 0.1) 100%
    );
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255, 215, 0, 0.5);
    border-radius: 30px;
    padding: 3rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out, victoryGlow 2s ease-in-out infinite;
}

.result-container.defeat {
    border-color: rgba(255, 56, 96, 0.5);
    animation: fadeIn 0.5s ease-out;
    background: linear-gradient(
        135deg,
        rgba(255, 56, 96, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

.result-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.result-title.victory {
    background: linear-gradient(
        45deg,
        var(--primary-gold) 0%,
        #fff 25%,
        var(--primary-gold) 50%,
        #fff 75%,
        var(--primary-gold) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
}

.result-title.defeat {
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(255, 56, 96, 0.5);
}

.result-amount-wrapper {
    margin: 2rem 0;
}

.result-label {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.result-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.currency-large {
    font-size: 2rem;
    color: var(--primary-gold);
}

.amount-large {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    color: white;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: moneyGlow 2s ease-in-out infinite;
}

.result-multiplier {
    font-size: 1.5rem;
    color: var(--accent-emerald);
    font-weight: 600;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.stat-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 1rem 2rem;
    flex: 1;
    max-width: 200px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.replay-btn {
    background: var(--gradient-gold);
}

.share-button {
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, #1DA1F2, #0A66C2);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(29, 161, 242, 0.3);
}

/* Fireworks Container */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: firework 1.5s ease-out forwards;
}

.firework-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: fireworkParticle 1s ease-out forwards;
}

/* Lost Amount Styles */
.lost-amount-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 56, 96, 0.3);
}

.lost-label {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-red);
    margin-bottom: 1rem;
    font-weight: 600;
}

.lost-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.currency-lost {
    font-size: 1.5rem;
    color: var(--accent-red);
    opacity: 0.8;
}

.amount-lost {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(255, 56, 96, 0.5);
    text-decoration: line-through;
    opacity: 0.9;
}