:root {
    /* Kolory podstawowe - Halloween Theme */
    --bg-primary: #1a0f1a;
    --bg-secondary: #2d1a2d;
    --bg-tertiary: #3d253d;
    --bg-card: #2d1a2d;
    
    /* Kolory akcentów - Halloween */
    --accent-primary: #ff6b35;
    --accent-secondary: #ff8e42;
    --accent-success: #8cc152;
    --accent-warning: #f0ad4e;
    --accent-danger: #e74c3c;
    --accent-info: #5bc0de;
    
    /* Kolory tekstu */
    --text-primary: #f8f9fa;
    --text-secondary: #e9ecef;
    --text-muted: #adb5bd;
    
    /* Kolory gradientów - Halloween */
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #ff8e42 100%);
    --gradient-secondary: linear-gradient(135deg, #2d1a2d 0%, #3d253d 100%);
    --gradient-card: linear-gradient(145deg, #2d1a2d 0%, #1a0f1a 100%);
    --gradient-orange: linear-gradient(135deg, #ff6b35 0%, #e74c3c 100%);
    --gradient-purple: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    
    /* Cienie */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.4);
    --shadow-glow-purple: 0 0 20px rgba(142, 68, 173, 0.4);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Animacje */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    /* Halloween Background */
    background-image: 
        url('../img/halloween_bck.png'),
        radial-gradient(at 0% 0%, rgba(255, 107, 53, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(142, 68, 173, 0.15) 0px, transparent 50%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Overlay dla lepszej czytelności tekstu na tle halloween */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 15, 26, 0.85);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 40px;
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--shadow-glow);
    position: relative;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Halloween-themed headings */
h1::after {
    content: '🎃';
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
}

h2::before {
    content: '👻';
    margin-right: 10px;
}

/* Formularze */
.forms-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.form-section {
    background: var(--gradient-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.form-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.form-section h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 16px;
    margin-bottom: 20px;
    background: var(--bg-tertiary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-primary);
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
    background: var(--bg-secondary);
}

input::placeholder {
    color: var(--text-muted);
}

/* Przyciski - Halloween Theme */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    margin: 5px;
    position: relative;
    overflow: hidden;
}

button::before, .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: var(--transition-slow);
}

button:hover::before, .btn:hover::before {
    left: 100%;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary {
    background: var(--gradient-purple);
}

.btn-large {
    padding: 18px 32px;
    font-size: 1.1rem;
}

.btn-start {
    background: var(--accent-success);
    font-size: 1.2rem;
    padding: 18px 36px;
}

.btn-start::before {
    content: '⚡';
    margin-right: 8px;
}

/* Komunikaty - Halloween Theme */
.error {
    background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-danger);
    box-shadow: var(--shadow-md);
}

.success {
    background: linear-gradient(135deg, #166534 0%, #052e16 100%);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-success);
    box-shadow: var(--shadow-md);
}

.warning {
    background: linear-gradient(135deg, #854d0e 0%, #422006 100%);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-warning);
    box-shadow: var(--shadow-md);
}

/* Widok dla zalogowanego użytkownika */
.user-welcome {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.welcome-header h2 {
    margin: 0;
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-actions {
    display: flex;
    gap: 16px;
}

/* Statystyki użytkownika */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--gradient-card);
    padding: 32px 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Szybkie akcje */
.quick-actions {
    background: var(--gradient-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-actions h3 {
    text-align: center;
    margin-bottom: 24px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Gra */
.game-start, .game-finished {
    text-align: center;
    padding: 60px 40px;
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    background: var(--gradient-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.info-item .label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.info-item .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-item .errors {
    color: var(--accent-danger);
}

.info-item .time {
    color: var(--accent-info);
}

.operation {
    background: var(--gradient-card);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.operation h2 {
    font-size: 3.5rem;
    margin-bottom: 40px;
    color: var(--text-primary);
    font-weight: 700;
}

.answer-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.answer-form input {
    font-size: 1.5rem;
    text-align: center;
    max-width: 240px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

/* Ranking */
.ranking-preview {
    background: var(--gradient-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-info {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(142, 68, 173, 0.1) 100%);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-secondary);
}

.top-players-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
}

.top-player {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 12px;
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.top-player::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
}

.top-player:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.top-player.podium-1 {
    border-left-color: #ff6b35;
    background: linear-gradient(135deg, #2d1a2d 0%, #7c2d12 100%);
}

.top-player.podium-2 {
    border-left-color: #ff8e42;
    background: linear-gradient(135deg, #2d1a2d 0%, #2d1a2d 100%);
}

.top-player.podium-3 {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #2d1a2d 0%, #7c2d12 100%);
}

.player-rank {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 20px;
    min-width: 50px;
    font-size: 1.2rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    font-size: 1.1rem;
}

.player-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.player-stats .stat {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.player-stats .score {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1rem;
}

.ranking-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Tabela rankingu */
.ranking table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gradient-card);
}

.ranking th,
.ranking td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.ranking th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.ranking tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.ranking tr:hover {
    background: rgba(255, 107, 53, 0.1);
}

.time-cell, .score-cell {
    font-weight: 700;
    color: var(--accent-primary);
}

/* Wyjaśnienie rankingu */
.ranking-explanation {
    background: var(--gradient-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.ranking-explanation h3 {
    color: var(--accent-primary);
    margin-bottom: 16px;
    text-align: center;
}

.ranking-explanation p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.score-examples {
    background: rgba(255, 107, 53, 0.1);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    border-left: 4px solid var(--accent-primary);
}

.score-examples ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.score-examples li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-examples li:last-child {
    border-bottom: none;
}

.score-examples strong {
    color: var(--text-primary);
}

.efficiency {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Sekcja wyjaśnienia gry */
.game-explanation {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin: 40px 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.explanation-header {
    text-align: center;
    margin-bottom: 40px;
}

.explanation-header h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 2.2rem;
}

.explanation-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Kroki wyjaśnienia */
.explanation-steps {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.step:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.08);
}

.step-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.step-content h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.step-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-content li {
    padding: 6px 0;
    color: var(--text-muted);
    position: relative;
    padding-left: 20px;
}

.step-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.step-content strong {
    color: var(--text-primary);
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.feature {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 16px;
}

.feature h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.feature p {
    color: var(--text-muted);
    line-height: 1.5;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(142, 68, 173, 0.1) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.cta-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.8rem;
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Stopka */
.footer {
    background: var(--gradient-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
    padding: 40px 0 20px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-links h4,
.footer-social h4,
.footer-stats h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent-primary);
    transform: translateX(5px);
}

.footer-links .link-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-social .social-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-link:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.footer-stats .stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 40px 0 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--accent-primary);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

/* Halloween decorations */
.halloween-decoration {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
}

.decoration-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.decoration-2 {
    top: 15%;
    right: 5%;
    animation-delay: 2s;
}

.decoration-3 {
    bottom: 10%;
    left: 10%;
    animation-delay: 4s;
}

.decoration-4 {
    bottom: 15%;
    right: 8%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(5deg); 
    }
}

/* Legend toggle - Halloween Theme */
.legend-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.legend-toggle:hover {
    background: var(--gradient-orange);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.legend {
    position: fixed;
    top: 70px;
    left: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent-primary);
    z-index: 1000;
    max-width: 300px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend.active {
    display: block;
}

.legend h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.symbol {
    background: var(--accent-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    font-size: 14px;
}

.explanation {
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
}

/* Privacy terms */
.privacy-terms-checkbox {
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.privacy-terms-checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.privacy-terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.privacy-terms-checkbox a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.privacy-terms-checkbox a:hover {
    text-decoration: underline;
}

.privacy-terms-checkbox.required {
    border-left: 3px solid var(--accent-primary);
}

.terms-info {
    background: rgba(255, 107, 53, 0.1);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin: 15px 0;
    border-left: 4px solid var(--accent-primary);
    font-size: 14px;
    color: var(--text-secondary);
}

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

@keyframes spooky {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.container {
    animation: fadeIn 0.6s ease-out;
}

.stat-card, .form-section, .top-player {
    animation: fadeIn 0.8s ease-out;
}

/* Spooky animation for errors */
.error {
    animation: spooky 0.5s ease-in-out;
}

/* Responsywność */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h1::after {
        position: static;
        display: block;
        margin-top: 10px;
    }
    
    .forms-container {
        grid-template-columns: 1fr;
    }
    
    .welcome-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .user-actions, .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .operation h2 {
        font-size: 2.5rem;
    }
    
    .top-player {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .player-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ranking-actions {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 20px 20px 0 20px;
    }
    
    .legend-toggle {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .legend {
        top: 50px;
        left: 10px;
        right: 10px;
        max-width: none;
        max-height: 60vh;
    }
    
    .halloween-decoration {
        font-size: 1.5rem;
    }
}

/* Mobile overlay for legend */
.legend-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.legend-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .legend {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
    }
}
        /* Halloween Modal Styles */
        .halloween-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 10000;
            justify-content: center;
            align-items: center;
        }

        .halloween-modal.active {
            display: flex;
        }

        .halloween-modal-content {
            background: linear-gradient(145deg, #2d1a2d 0%, #1a0f1a 100%);
            border-radius: 20px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            text-align: center;
            border: 3px solid #ff6b35;
            box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
            position: relative;
            animation: spookyFloat 3s ease-in-out infinite;
        }

        @keyframes spookyFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
        }

        .halloween-modal h2 {
            color: #ff6b35;
            font-size: 2.5rem;
            margin-bottom: 20px;
            text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
        }

        .halloween-modal p {
            color: #f8f9fa;
            margin-bottom: 25px;
            font-size: 1.1rem;
            line-height: 1.6;
        }

        .halloween-features {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
            margin: 20px 0;
        }

        .halloween-feature {
            background: rgba(255, 107, 53, 0.2);
            padding: 12px;
            border-radius: 8px;
            border-left: 3px solid #ff6b35;
            text-align: left;
        }

        .halloween-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 25px;
        }

        .btn-halloween {
            background: linear-gradient(135deg, #ff6b35 0%, #ff8e42 100%);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .btn-halloween:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
        }

        .btn-close {
            background: #6c757d;
        }

        .btn-close:hover {
            background: #5a6268;
        }

        .halloween-badge {
            position: absolute;
            top: -15px;
            right: -15px;
            background: #ff6b35;
            color: white;
            padding: 10px 15px;
            border-radius: 25px;
            font-weight: bold;
            font-size: 0.9rem;
            transform: rotate(5deg);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        /* Halloween info box on main page */
        .halloween-info {
            background: linear-gradient(135deg, #2d1a2d 0%, #1a0f1a 100%);
            border-radius: 15px;
            padding: 25px;
            margin: 30px 0;
            border: 2px solid #ff6b35;
            box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
            position: relative;
            overflow: hidden;
        }

        .halloween-info::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #ff6b35, #ff8e42, #ff6b35);
        }

        .halloween-info h3 {
            color: #ff6b35;
            margin-bottom: 15px;
            font-size: 1.8rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .halloween-info-content {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 20px;
            align-items: center;
        }

        .halloween-details {
            color: #f8f9fa;
        }

        .halloween-details p {
            margin-bottom: 15px;
            line-height: 1.6;
        }

        .halloween-actions {
            text-align: center;
        }

        .event-timer {
            background: rgba(255, 107, 53, 0.2);
            padding: 15px;
            border-radius: 10px;
            margin: 15px 0;
            border: 1px solid #ff6b35;
        }

        @media (max-width: 768px) {
            .halloween-info-content {
                grid-template-columns: 1fr;
            }
            
            .halloween-modal-content {
                padding: 25px;
            }
            
            .halloween-buttons {
                flex-direction: column;
            }
        }
