/* Modern Gaming UI - Blizzard/Riot Style */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&display=swap');

/* Critical styles - must load first to prevent layout flash */
.hidden {
    display: none !important;
}

/* Welcome Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.92) 0%, rgba(15, 20, 35, 0.95) 100%);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    animation: modalFadeIn 0.4s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 25, 40, 0.96) 0%, rgba(25, 30, 45, 0.98) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    max-width: 800px;
    max-height: 85vh;
    width: 90vw;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 24px;
    opacity: 0.4;
    z-index: -1;
}

.modal-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(155, 89, 182, 0.08) 100%);
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-gold) 50%, transparent 100%);
    opacity: 0.7;
}

.modal-header h1 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 28px;
    color: var(--primary-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    margin: 0;
    text-align: center;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 59, 59, 0.2);
    color: var(--health-red);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    max-height: calc(85vh - 200px);
    overflow-y: auto;
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 22px;
    color: var(--secondary-cyan);
    margin-bottom: 15px;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-section h2::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-cyan) 0%, transparent 100%);
}

.welcome-section p {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.step:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
    transform: translateX(5px);
}

.step-number {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #FFA500 100%);
    color: var(--dark-bg);
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
}

.step-content strong {
    color: var(--secondary-cyan);
    font-weight: 700;
}

.step-content em {
    color: var(--accent-purple);
    font-style: normal;
    font-weight: 600;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    margin-bottom: 12px;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.tips-list li:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
    transform: translateX(5px);
}

.modal-footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.3) 100%);
    padding: 25px 30px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    gap: 15px;
    justify-content: center;
}

.welcome-btn {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 16px;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    min-width: 160px;
    position: relative;
    overflow: hidden;
}

.welcome-btn.primary {
    background: linear-gradient(135deg, var(--primary-gold) 0%, #FFA500 100%);
    color: var(--dark-bg);
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.welcome-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.welcome-btn.secondary {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.8) 0%, rgba(142, 68, 173, 0.8) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(155, 89, 182, 0.5);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.welcome-btn.secondary:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--accent-purple) 0%, #8E44AD 100%);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.5);
}

.welcome-btn::before {
    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.5s;
}

.welcome-btn:hover::before {
    left: 100%;
}

/* Info Button */
.info-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    color: var(--primary-gold);
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 25;
    animation: infoPulse 3s ease-in-out infinite;
}

.info-button:hover {
    transform: scale(1.1);
    border-color: var(--primary-gold);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

@keyframes infoPulse {
    0%, 100% { 
        box-shadow: 
            0 8px 25px rgba(0, 0, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(255, 215, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .modal-header h1 {
        font-size: 24px;
    }
    
    .welcome-section h2 {
        font-size: 18px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .welcome-btn {
        width: 100%;
    }
}

:root {
    /* Modern Gaming Color Palette */
    --primary-gold: #FFD700;
    --secondary-cyan: #00D4FF;
    --accent-purple: #9B59B6;
    --dark-bg: #0A0E1A;
    --dark-panel: #1A1F2E;
    --glass-bg: rgba(26, 31, 46, 0.7);
    --glass-border: rgba(255, 215, 0, 0.3);
    --health-red: #FF3B3B;
    --hunger-orange: #FF9500;
    --thirst-blue: #00A8FF;
    --success-green: #00FF88;
    --text-primary: #FFFFFF;
    --text-secondary: #B8BCC8;
    --glow-intensity: 0 0 20px;
    
    /* Dynamic safe areas for layout */
    --left-safe: 340px;
    --right-safe: 300px;
    --top-safe: 20px;
    --bottom-safe: 280px;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark-bg);
    background-image: 
        radial-gradient(ellipse at top left, rgba(155, 89, 182, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, #0A0E1A 0%, #141929 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Particles */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent);
    background-size: 50vw 50vh;
    background-repeat: repeat;
    opacity: 0.02;
    animation: drift 60s infinite;
    pointer-events: none;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-30px, -30px); }
    66% { transform: translate(30px, -30px); }
}

#game-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

/* Modern HUD with Glass-morphism */
#hud {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 41, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 8px 32px 0 rgba(0, 212, 255, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 0 rgba(0, 0, 0, 0.3);
    z-index: 20;
    width: clamp(260px, 26vw, 320px);
    animation: slideInLeft 0.5s ease-out;
}

#hud::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-gold), var(--secondary-cyan), var(--accent-purple));
    border-radius: 20px;
    opacity: 0.3;
    z-index: -1;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stat-bar {
    margin-bottom: 20px;
    position: relative;
}

.stat-label {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label::before {
    content: '';
    width: 3px;
    height: 12px;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.stat-bar-container {
    position: relative;
    width: 260px;
    height: 28px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    border-radius: 50px 50px 0 0;
    pointer-events: none;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.stat-bar-fill.health {
    background: linear-gradient(90deg, #FF3B3B 0%, #FF6B6B 100%);
    box-shadow: 
        inset 0 0 20px rgba(255, 59, 59, 0.5),
        0 0 20px rgba(255, 59, 59, 0.3);
    width: 100%;
}

.stat-bar-fill.hunger {
    background: linear-gradient(90deg, #FF9500 0%, #FFB143 100%);
    box-shadow: 
        inset 0 0 20px rgba(255, 149, 0, 0.5),
        0 0 20px rgba(255, 149, 0, 0.3);
    width: 100%;
}

.stat-bar-fill.thirst {
    background: linear-gradient(90deg, #00A8FF 0%, #00D4FF 100%);
    box-shadow: 
        inset 0 0 20px rgba(0, 168, 255, 0.5),
        0 0 20px rgba(0, 168, 255, 0.3);
    width: 100%;
}

.stat-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 11px;
    color: white;
    text-shadow: 
        0 0 10px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.9);
    z-index: 10;
    letter-spacing: 1px;
}

/* Modern Resources Panel */
#resources {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 41, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 8px 32px 0 rgba(155, 89, 182, 0.15),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    z-index: 20;
    width: clamp(240px, 24vw, 280px);
    animation: slideInRight 0.5s ease-out;
}

#resources::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--secondary-cyan) 50%, 
        transparent 100%);
    animation: scanline 3s ease-in-out infinite;
}

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

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

#resources h3 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 16px;
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.resource-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.resource-item:hover::before {
    left: 100%;
}

.resource-item:hover {
    transform: translateX(5px);
    border-color: rgba(255, 215, 0, 0.2);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.1);
}

.resource-icon {
    font-size: 24px;
    margin-right: 12px;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.resource-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resource-count {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 18px;
    color: var(--primary-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    min-width: 40px;
    text-align: right;
}

/* Modern Game World */
#game-world {
    margin: 0 auto;
    padding-top: var(--top-safe);
    padding-left: var(--left-safe);
    padding-right: var(--right-safe);
    padding-bottom: var(--bottom-safe);
    max-width: 1600px;
    min-height: calc(100vh - 420px);
}

#gathering-area, #crafting-area {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

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

#gathering-area::before, #crafting-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.03) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

#gathering-area h2, #crafting-area h2 {
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 20px;
    color: var(--secondary-cyan);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 
        0 0 30px rgba(0, 212, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
}

.gather-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gather-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 18px 24px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gather-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.6) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.gather-btn:hover::before {
    width: 300px;
    height: 300px;
}

.gather-btn:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-cyan);
    box-shadow: 
        0 10px 30px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.gather-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px currentColor);
}

/* Modern Crafting */
.craft-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.craft-item {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.craft-item::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, var(--accent-purple), transparent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
    animation: borderRotate 3s linear infinite;
}

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

.craft-item:hover::after {
    opacity: 0.5;
}

.craft-item:hover {
    transform: scale(1.02);
    border-color: var(--accent-purple);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.3);
}

.craft-item h4 {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 10px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.craft-item p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
}

.craft-btn {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #8E44AD 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(155, 89, 182, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.craft-btn::before {
    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.5s;
}

.craft-btn:hover::before {
    left: 100%;
}

.craft-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(155, 89, 182, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.craft-btn:disabled {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: #7F8C8D;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

/* Modern Messages */
#message-area {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, calc(100vw - 2rem));
    z-index: 30;
    pointer-events: none;
}

#messages {
    max-height: 200px;
    overflow-y: auto;
}

.message {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 4px solid var(--secondary-cyan);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: messageSlide 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    transform: translateX(-100%);
    animation: messageShine 0.6s ease;
}

@keyframes messageShine {
    to { transform: translateX(100%); }
}

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

.message.success {
    border-left-color: var(--success-green);
    box-shadow: 
        0 8px 20px rgba(0, 255, 136, 0.2),
        inset 0 1px 0 rgba(0, 255, 136, 0.1);
}

.message.success::after {
    content: '✓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-green);
    font-size: 20px;
    font-weight: bold;
}

.message.error {
    border-left-color: var(--health-red);
    box-shadow: 
        0 8px 20px rgba(255, 59, 59, 0.2),
        inset 0 1px 0 rgba(255, 59, 59, 0.1);
}

.message.error::after {
    content: '⚠';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--health-red);
    font-size: 20px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--secondary-cyan) 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-cyan) 0%, var(--accent-purple) 100%);
}

/* Responsive Design */
/* Large Desktop */
@media (max-width: 1440px) {
    :root {
        --left-safe: 340px;
        --right-safe: 320px;
        --top-safe: 260px;
        --bottom-safe: 280px;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    :root {
        --left-safe: 300px;
        --right-safe: 280px;
        --top-safe: 240px;
        --bottom-safe: 260px;
    }
    
    #building-tab .building-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    #hud {
        width: clamp(240px, 24vw, 300px);
        padding: 20px;
    }
    
    #resources {
        width: clamp(220px, 22vw, 260px);
        padding: 20px;
    }
}

/* Large Tablet Landscape */
@media (max-width: 1024px) {
    :root {
        --left-safe: 280px;
        --right-safe: 260px;
        --top-safe: 220px;
        --bottom-safe: 240px;
    }
    
    .building-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .consumable-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tab-btn {
        font-size: 14px;
        padding: 12px 18px;
    }
}

/* Small Tablet / Large Phone Landscape */
@media (max-width: 900px) {
    :root {
        --left-safe: 60px;
        --right-safe: 60px;
        --top-safe: 180px;
        --bottom-safe: 200px;
    }
    
    #hud, #resources {
        width: clamp(200px, 28vw, 240px);
        padding: 15px;
        top: 15px;
    }
    
    #hud {
        left: 15px;
    }
    
    #resources {
        right: 15px;
    }
    
    #buildings-display {
        bottom: 15px;
        right: 15px;
        min-width: 200px;
        max-width: 280px;
    }
    
    #survival-tab.active {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gather-btn, .consume-btn, .build-btn, .battle-action-btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly size */
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    :root {
        --left-safe: 20px;
        --right-safe: 20px;
        --top-safe: 20px;
        --bottom-safe: 20px;
    }
    
    #hud, #resources, #buildings-display {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 15px;
        width: calc(100% - 30px);
        max-width: none;
    }
    
    #survival-tab.active {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-bar-container {
        width: 100%;
    }
    
    #message-area {
        width: calc(100% - 30px);
        max-width: none;
        bottom: 15px;
    }
    
    #building-tab .building-items {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .consumable-items {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tab-navigation {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
        padding: 14px 12px;
        font-size: 13px;
    }
}

/* Large Phone */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    
    .modal-content {
        margin: 10px;
        padding: 20px;
        max-width: calc(100vw - 20px);
    }
    
    #gathering-area h2, #building-area h2, #battle-area h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .gather-buttons {
        gap: 10px;
    }
    
    .consumable-item, .building-item {
        padding: 15px;
    }
    
    .stat-bar {
        margin-bottom: 12px;
    }
    
    .resource-item {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .battle-players {
        flex-direction: column;
        gap: 15px;
    }
    
    .battle-player {
        min-width: auto;
        width: 100%;
    }
    
    .versus {
        font-size: 24px;
    }
}

/* Small Phone */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    #hud, #resources, #buildings-display {
        margin: 10px;
        padding: 12px;
        width: calc(100% - 20px);
    }
    
    .tab-btn {
        padding: 12px 8px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .gather-btn, .consume-btn, .build-btn, .battle-action-btn {
        padding: 14px 16px;
        font-size: 13px;
        width: 100%;
    }
    
    .consumable-item h4, .building-item h4 {
        font-size: 14px;
    }
    
    .consumable-item p, .building-item p {
        font-size: 12px;
    }
    
    #message-area {
        width: calc(100% - 20px);
        bottom: 10px;
    }
    
    .message {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .modal-header h1 {
        font-size: 20px;
    }
    
    .welcome-section h2 {
        font-size: 16px;
    }
    
    .step-content {
        font-size: 13px;
    }
}

/* Extra Small Phone */
@media (max-width: 360px) {
    .tab-navigation {
        gap: 4px;
    }
    
    .tab-btn {
        font-size: 11px;
        padding: 10px 6px;
        min-width: 70px;
    }
    
    .gather-btn, .consume-btn, .build-btn {
        font-size: 12px;
        padding: 12px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .resource-name {
        font-size: 12px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Glow Effects for Interactive Elements */
button:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(0, 212, 255, 0.3),
        0 0 20px rgba(0, 212, 255, 0.2);
}

/* Performance Optimizations */
.stat-bar-fill,
.resource-item,
.gather-btn,
.craft-btn {
    will-change: transform;
}

/* Critical Health/Hunger/Thirst Animations */
.stat-bar-fill.critical {
    animation: criticalPulse 1s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { 
        opacity: 1;
        filter: brightness(1);
    }
    50% { 
        opacity: 0.7;
        filter: brightness(1.3);
    }
}

@keyframes criticalScreenGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Particle Effects Container */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: particleFloat 8s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 41, 0.9) 100%);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 12px 30px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--secondary-cyan) 100%);
    color: var(--dark-bg);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#survival-tab.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Consumables Styling */
#consumables-area {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 24px;
    padding: 30px;
    margin-top: 30px;
}

.consumable-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.consumable-item {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.consumable-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.item-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.consume-btn {
    background: linear-gradient(135deg, var(--success-green) 0%, #00CC70 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    margin-top: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consume-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.5);
}

.cost {
    color: var(--secondary-cyan);
    font-size: 12px;
    margin: 5px 0;
}

/* Buildings Display */
#buildings-display {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 41, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 20px;
    padding: 20px;
    width: auto;
    min-width: 280px;
    max-width: 400px;
    max-height: none;
    overflow: visible;
    z-index: 15;
}

#buildings-display h3 {
    font-family: 'Orbitron', monospace;
    color: var(--accent-purple);
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    min-height: 60px;
    width: 100%;
    justify-content: start;
}

.built-structure {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.3) 0%, rgba(0, 212, 255, 0.3) 100%);
    border: 2px solid var(--primary-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    animation: buildingAppear 0.5s ease-out;
    position: relative;
    cursor: pointer;
}

.built-structure:hover::after {
    content: attr(data-name);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--primary-gold);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
}

@keyframes buildingAppear {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Building Area */
#building-area {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    padding: 30px;
}

.building-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.building-item {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.building-item:hover {
    transform: scale(1.05);
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.building-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
}

.building-type {
    color: var(--secondary-cyan);
    font-size: 12px;
    margin: 5px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.build-btn {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #8E44AD 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 10px;
    padding: 10px 25px;
    margin-top: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.build-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.5);
}

.victory-building {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
    border: 2px solid var(--primary-gold);
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

/* Battle Area */
#battle-area {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 41, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 59, 59, 0.3);
    border-radius: 24px;
    padding: 30px;
}

.battle-section {
    margin-bottom: 30px;
}

#battle-lobby input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
}

.battle-action-btn {
    background: linear-gradient(135deg, var(--health-red) 0%, #FF5555 100%);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.battle-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 59, 59, 0.5);
}

.battle-players {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
}

.battle-player {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 2px solid rgba(255, 59, 59, 0.3);
    min-width: 200px;
}

.battle-player h4 {
    font-family: 'Orbitron', monospace;
    color: var(--primary-gold);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.battle-health-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--health-red);
    border-radius: 15px;
    overflow: hidden;
}

.battle-health-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--health-red) 0%, #FF6B6B 100%);
    width: 100%;
    transition: width 0.5s ease;
}

.versus {
    font-family: 'Orbitron', monospace;
    font-size: 36px;
    font-weight: 900;
    color: var(--primary-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: versusPulse 1s ease-in-out infinite;
}

@keyframes versusPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

#battle-log {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.battle-log-entry {
    padding: 5px;
    margin: 5px 0;
    color: var(--text-secondary);
    border-left: 3px solid var(--health-red);
    padding-left: 10px;
}

/* Victory Modal */
#victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

#victory-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95) 0%, rgba(0, 212, 255, 0.95) 100%);
    border: 3px solid var(--text-primary);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    animation: victoryAnimation 1s ease-out;
    box-shadow: 0 0 100px rgba(255, 215, 0, 0.8);
    max-width: 500px;
    width: 90%;
}

#victory-banner h1 {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    color: var(--dark-bg);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
}

#victory-banner p {
    font-size: 20px;
    color: var(--dark-bg);
    margin-bottom: 15px;
}

.victory-stats {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.victory-stats p {
    margin: 10px 0;
    font-weight: bold;
    font-size: 18px;
}

.victory-buttons {
    margin-top: 30px;
}

#victory-modal.hidden {
    display: none;
}

@keyframes victoryAnimation {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.survival-time {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.survival-time span {
    display: block;
}