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

:root {
    --bg-dark: #0d1f0d;
    --bg-card: #1a2e1a;
    --bg-lighter: #243524;
    --primary: #4ade80;
    --primary-glow: #22c55e;
    --accent: #86efac;
    --text: #e8f5e8;
    --text-muted: #8aaa8a;
    --common: #94a3b8;
    --rare: #3b82f6;
    --epic: #a855f7;
    --legendary: #f59e0b;
    --legendary-glow: #fbbf24;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(ellipse at 20% 80%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(34, 197, 94, 0.02) 50px,
            rgba(34, 197, 94, 0.02) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(34, 197, 94, 0.02) 50px,
            rgba(34, 197, 94, 0.02) 51px
        );
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(74, 222, 128, 0.5);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    background: var(--bg-card);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* Game Area */
.game-area {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px 20px;
    margin: 20px 0;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

/* Blind Box */
.blind-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.box-shake {
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, #2d5a2d, #1a3d1a);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    border: 3px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.box-shake::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(74, 222, 128, 0.1),
        transparent,
        rgba(74, 222, 128, 0.1),
        transparent
    );
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    100% { transform: rotate(360deg); }
}

.box-shake:hover {
    transform: scale(1.05);
    box-shadow: 
        0 15px 50px rgba(74, 222, 128, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
}

.box-shake.shaking {
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-10px) rotate(-5deg); }
    75% { transform: translateX(10px) rotate(5deg); }
}

.monstera-icon {
    font-size: 4rem;
    z-index: 1;
}

.question-marks {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.box-ledge {
    width: 200px;
    height: 20px;
    background: linear-gradient(to bottom, #3d6a3d, #2d5a2d);
    border-radius: 0 0 10px 10px;
    margin-top: -5px;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 30px;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-glow), #16a34a);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-lighter);
    color: var(--text);
    border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.free-badge {
    display: block;
    font-size: 0.7rem;
    font-weight: normal;
    opacity: 0.9;
    margin-top: 4px;
}

/* Probability Info */
.probability-info {
    text-align: center;
}

.probability-info details {
    background: var(--bg-lighter);
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
}

.probability-info summary {
    color: var(--text-muted);
    outline: none;
}

.prob-table {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 8px;
}

.prob-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rarity {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.rarity.common { background: rgba(148, 163, 184, 0.3); color: var(--common); }
.rarity.rare { background: rgba(59, 130, 246, 0.3); color: var(--rare); }
.rarity.epic { background: rgba(168, 85, 247, 0.3); color: var(--epic); }
.rarity.legendary { background: rgba(245, 158, 11, 0.3); color: var(--legendary); }

/* Result Display */
.result-display {
    display: none;
    text-align: center;
    padding: 30px 20px;
}

.result-display.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.result-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: all 0.5s ease;
}

.result-card.common { border-color: var(--common); }
.result-card.rare { border-color: var(--rare); box-shadow: 0 0 30px rgba(59, 130, 246, 0.3); }
.result-card.epic { border-color: var(--epic); box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }
.result-card.legendary { 
    border-color: var(--legendary); 
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.5);
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 80px rgba(245, 158, 11, 0.7); }
}

.result-rarity {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.result-rarity.common { color: var(--common); }
.result-rarity.rare { color: var(--rare); }
.result-rarity.epic { color: var(--epic); }
.result-rarity.legendary { color: var(--legendary); }

.result-plant {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.result-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.result-desc {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.result-effect {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: bold;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Collection Gallery */
.collection-gallery {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-top: 20px;
    border: 1px solid rgba(74, 222, 128, 0.15);
}

.collection-gallery h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.gallery-item {
    aspect-ratio: 1;
    background: var(--bg-lighter);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-item.locked {
    opacity: 0.4;
}

.gallery-item.unlocked {
    border-color: var(--primary);
    cursor: pointer;
}

.gallery-item.unlocked:hover {
    transform: scale(1.05);
}

.gallery-item.common { border-color: var(--common); }
.gallery-item.rare { border-color: var(--rare); }
.gallery-item.epic { border-color: var(--epic); }
.gallery-item.legendary { 
    border-color: var(--legendary); 
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.gallery-item .plant-emoji {
    font-size: 2rem;
}

.gallery-item .plant-name {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 5px;
    color: var(--text-muted);
}

.gallery-item .count-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: var(--bg-dark);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    font-size: 1.5rem;
    animation: fall linear forwards;
    opacity: 0;
}

@keyframes fall {
    0% { 
        opacity: 1; 
        transform: translateY(-20px) rotate(0deg);
    }
    100% { 
        opacity: 0; 
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 1.8rem; }
    .stats { gap: 15px; }
    .stat { padding: 10px 15px; }
    .box-shake { width: 140px; height: 140px; }
    .monstera-icon { font-size: 3rem; }
    .controls { flex-direction: column; }
    .btn { width: 100%; }
}
