
:root {
    --bg-dark: #2c3e50;
    --bg-panel: #34495e;
    --text-light: #ecf0f1;
    --accent: #2ecc71;
    --success: #2ecc71;
    --danger: #e74c3c;
    
    --key-none: #444;
    --key-steel: #bdc3c7;
    --key-gold: #f1c40f;
    --key-diamond: #00d2d3;
    
    --nav-height: 50px; /* Wysokość paska nawigacyjnego */
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }
html { overscroll-behavior: none; height: 100%; }
body { display: flex; flex-direction: column; height: 100%; overflow: hidden; background-color: var(--bg-dark); color: var(--text-light); overscroll-behavior: none; }

/* OKIENKA MODALNE */
#custom-modal, #confirm-modal, #homework-modal, #goal-resolve-modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); z-index:99999; justify-content:center; align-items:center; }
#custom-modal { z-index:1000001; }
.modal-box { background:#2f3640; padding:30px; border-radius:10px; border:2px solid var(--accent); text-align:center; max-width:400px; box-shadow:0 0 30px rgba(241, 196, 15, 0.3); }
.modal-title { color:var(--accent); margin-bottom:15px; text-transform:uppercase; font-size:1.2rem; font-weight:bold; }
.modal-text { color:#fff; margin-bottom:25px; font-size:1rem; line-height:1.5; }
.modal-btn { border:none; padding:10px 25px; font-weight:bold; cursor:pointer; border-radius:5px; margin:0 5px; text-transform:uppercase; }
.btn-yes { background: var(--danger); color: white; }
.btn-no { background: #555; color: white; }
.btn-ok { background: var(--accent); color: #000; }

/* MODAL SZCZEGÓŁÓW PRZEDMIOTU */
#subject-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(70,75,85,0.88);
    z-index: 99999;
    overflow-y: auto;
    padding: 20px;
}

.subject-modal-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #555d6b;
    border-radius: 10px;
    border: 2px solid var(--accent);
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.subject-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--accent);
    background: #1a1a1a;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
    gap: 10px;
}

.subject-modal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.subject-nav-btn {
    padding: 8px 15px;
    border: 2px solid;
    border-radius: 5px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.subject-nav-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.subject-nav-btn.active {
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px;
    transform: scale(1.05);
}

/* Kolory przycisków przedmiotów */
.subject-nav-btn.color-purple {
    border-color: #9b59b6;
}
.subject-nav-btn.color-purple:hover,
.subject-nav-btn.color-purple.active {
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6);
}

.subject-nav-btn.color-red {
    border-color: #e74c3c;
}
.subject-nav-btn.color-red:hover,
.subject-nav-btn.color-red.active {
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

.subject-nav-btn.color-blue {
    border-color: #3498db;
}
.subject-nav-btn.color-blue:hover,
.subject-nav-btn.color-blue.active {
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

.subject-nav-btn.color-green {
    border-color: #2ecc71;
}
.subject-nav-btn.color-green:hover,
.subject-nav-btn.color-green.active {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

.subject-modal-close {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.subject-modal-close:hover {
    background: var(--danger);
    color: #fff;
    transform: rotate(90deg);
}

.subject-modal-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

/* Style dla tabel w modalu - lepsza czytelność */
#subject-modal-content .report-template-table {
    font-size: 0.9rem;
    border-width: 3px;
}

#subject-modal-content .report-template-table th,
#subject-modal-content .report-template-table td {
    padding: 8px;
    font-weight: 500;
}

/* Podsumowanie przedmiotu - złote obramowanie */
#subject-modal-content .report-template-table:first-of-type {
    border: 4px solid #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

#subject-modal-content .report-template-table:first-of-type .rt-header-pink {
    background: #ffe599;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Tabele kampanii - niebieskie obramowanie */
#subject-modal-content .report-template-table:not(:first-of-type) {
    border: 3px solid #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

#subject-modal-content .report-template-table:not(:first-of-type) .rt-header-pink {
    background: #d6eaf8;
    font-size: 1rem;
}

/* Responsywność */
@media (max-width: 768px) {
    #subject-details-modal {
        padding: 10px;
    }
    
    .subject-modal-header {
        padding: 15px;
    }
    
    .subject-modal-content {
        padding: 20px;
    }
    
    .subject-nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* SKILLS MATRIX MODAL */
.student-name-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.btn-rune {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 1px solid #d35400;
    color: #fff;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s;
    flex-shrink: 0;
}
.btn-rune:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}
.rune-trigger-btn {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: none;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.rune-trigger-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(241, 196, 15, 0.5);
}
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.skill-tile {
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    color: #fff;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.skill-tile:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}
.skill-tile:active {
    transform: scale(1.02);
}
.skill-tile.explorer {
    background: linear-gradient(135deg, #00b09b, #96c93d);
    box-shadow: 0 4px 15px rgba(0, 176, 155, 0.4);
    border: 1px solid #a8e063;
}
.skill-tile.explorer:hover {
    box-shadow: 0 6px 20px rgba(0, 176, 155, 0.6);
}
.skill-tile.hero {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
    border: 1px solid #ff9a9e;
}
.skill-tile.hero:hover {
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.6);
}
.skill-tile.creator {
    background: linear-gradient(135deg, #f7971e, #ffd200);
    box-shadow: 0 4px 15px rgba(247, 151, 30, 0.4);
    border: 1px solid #ffe259;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.skill-tile.creator:hover {
    box-shadow: 0 6px 20px rgba(247, 151, 30, 0.6);
}
.skill-tile.leader {
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    box-shadow: 0 4px 15px rgba(33, 147, 176, 0.4);
    border: 1px solid #00d2ff;
}
.skill-tile.leader:hover {
    box-shadow: 0 6px 20px rgba(33, 147, 176, 0.6);
}
.skill-tile-edit-mode {
    position: relative;
    cursor: pointer !important;
}
.skill-tile-edit-mode:hover {
    opacity: 0.8;
}
.skill-tile-content {
    flex: 1;
    text-align: center;
}
.skill-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s;
    z-index: 10;
}
.skill-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
#toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #2ecc71;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000002;
    font-weight: bold;
    display: none;
    animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* EKRAN POWITALNY */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#start-overlay.active {
    display: flex;
}

.start-content {
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid var(--accent);
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(241, 196, 15, 0.5);
    backdrop-filter: blur(10px);
    max-width: 600px;
}

.start-title {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
    font-family: 'Segoe UI', serif;
    letter-spacing: 2px;
}

.start-subtitle {
    font-size: 1.2rem;
    color: #bbb;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-info {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 40px;
    font-style: italic;
}

.btn-enter-throne {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: #000;
    border: 3px solid #d35400;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(241, 196, 15, 0.5);
    letter-spacing: 1px;
}

.btn-enter-throne:hover {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 8px 30px rgba(241, 196, 15, 0.8);
    transform: scale(1.05);
}

.btn-enter-throne:active {
    transform: scale(0.98);
}

/* LOGOWANIE - NOWY WYGLĄD */
#login-screen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100dvh; 
    background: #ffffff; /* Białe tło */
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
    align-items: center; 
    padding: 40px 20px;
}

/* Wielki zielony tytuł na górze */
.login-main-title {
    font-size: 3rem;
    font-weight: bold;
    color: #4a7c3f; /* Ciemna zieleń jak na obrazku */
    text-align: center;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* Kontener na logo i panel logowania */
.login-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 80px;
    flex: 1;
    width: 100%;
    max-width: 1200px;
}

/* Logo po lewej */
.login-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    max-width: 350px;
    max-height: 350px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Panel logowania po prawej */
.login-box { 
    background: #2f3640; 
    padding: 40px; 
    border-radius: 10px; 
    border: 2px solid var(--accent); 
    text-align: center; 
    width: 350px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.login-input { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border-radius: 5px; 
    border: 1px solid #555; 
    font-size: 1rem;
    background: #fff;
    color: #000;
}

.login-btn { 
    background: var(--accent); 
    border: none; 
    padding: 12px 20px; 
    font-weight: bold; 
    cursor: pointer; 
    width: 100%; 
    margin-top: 10px; 
    border-radius: 5px;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

#login-error { 
    color: var(--danger); 
    margin-top: 10px; 
    font-size: 0.9rem; 
}

/* Informacje o szkole na dole */
.login-school-info {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4a7c3f; /* Ciemna zieleń */
    text-align: center;
    text-transform: uppercase;
    line-height: 1.5;
    margin-top: 20px;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 1024px) {
    .login-content-wrapper {
        flex-direction: column;
        gap: 40px;
    }
    
    .login-logo {
        max-width: 250px;
        max-height: 250px;
    }
    
    .login-main-title {
        font-size: 2rem;
    }
    
    .login-school-info {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .login-main-title {
        font-size: 1.5rem;
    }
    
    .login-logo {
        max-width: 180px;
        max-height: 180px;
    }
    
    .login-box {
        width: 90%;
        max-width: 350px;
        padding: 30px;
    }
    
    .login-school-info {
        font-size: 0.8rem;
    }
}

/* WIRTUALNY FULLSCREEN DLA iOS */
body.virtual-fullscreen .top-nav {
    display: none !important;
}

body.virtual-fullscreen .main-content {
    height: 100dvh !important;
    padding: 0 !important;
}

body.virtual-fullscreen #page-game {
    height: 100dvh !important;
}

body.virtual-fullscreen .game-screen {
    height: 100dvh !important;
    max-height: 100dvh !important;
}

/* Przycisk zamknięcia wirtualnego fullscreen */
#exit-virtual-fullscreen {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid var(--accent);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

body.virtual-fullscreen #exit-virtual-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
}

#exit-virtual-fullscreen:hover {
    background: rgba(241, 196, 15, 0.9);
    color: #000;
    transform: scale(1.1);
}

#exit-virtual-fullscreen:active {
    transform: scale(0.95);
}

/* FANTASY SIDEBAR - Left side of game screen */
.game-sidebar {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9999;
    display: none; /* Hidden by default, shown only on game page */
    flex-direction: column;
    gap: 12px;
}

#page-game .game-sidebar {
    display: flex;
}

.sidebar-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, #444 0%, #111 100%);
    border: 2px solid var(--accent);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    color: var(--accent);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sidebar-btn:hover {
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.8), 0 0 30px rgba(241, 196, 15, 0.4);
    transform: scale(1.1);
    border-color: #f39c12;
    background: radial-gradient(circle, #555 0%, #222 100%);
}

.sidebar-btn:active {
    transform: scale(0.95);
}

/* UNIFIED HUD CONTROLS */
.hud-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px; /* Zmniejszony odstęp między listą, levelem i tarczą */
}

.hud-btn {
    height: 44px;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    white-space: nowrap;
}

.hud-btn:hover {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f39c12;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
    transform: translateY(-2px);
}

.hud-select-wrapper {
    display: none;
}

.hud-select {
    height: 44px;
    padding: 0 40px 0 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23f1c40f" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.hud-select:hover {
    background-color: rgba(241, 196, 15, 0.2);
    border-color: #f39c12;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
}

.hud-select:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.7);
}

/* NAWIGACJA */
.top-nav { height: 50px; background: #111; display: none; align-items: center; padding: 0 20px; justify-content: space-between; border-bottom: 3px solid var(--accent); z-index: 1000; flex-shrink: 0; }

/* Wszystkie przyciski z zielonym obramowaniem */
.nav-btn { 
    background: #333; 
    color: #fff; 
    border: 2px solid var(--accent); 
    padding: 8px 15px; 
    cursor: pointer; 
    font-weight: bold; 
    border-radius: 4px; 
    transition: 0.3s; 
    margin-right: 5px; 
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.nav-btn:hover, .nav-btn.active { 
    background: var(--accent); 
    color: #000;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

/* RETURN BUTTON IN TOP NAV - dodatkowy margines */
.nav-btn-return {
    margin-right: 15px;
}

select { padding: 5px; font-weight: bold; border-radius: 4px; border: none; }

/* KONTENER */
.main-content { flex: 1; position: relative; overflow: hidden; display: none; min-height: 0; }
.page { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; overflow-y: auto; padding: 20px; background: var(--bg-dark); z-index: 1; }
.page.active { display: block; }
#page-journal { background: #f5f5f5; }

/* WIOSKA */
#page-village {
    padding: 0;
    background: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
#village-container {
    position: relative;
    width: 100%;
    max-width: 177.78vh;
    height: 100%; /* Wypełnia dostępną wysokość */
    max-height: 100vh; /* Nie przekracza wysokości viewport */
    /* Usunięto sztywne aspect-ratio - kontener dopasowuje się do naturalnych proporcji grafiki */
    background-image: url('main-map.jpg'); /* Placeholder - użytkownik podmieni plik */
    background-size: contain; /* Zmienione z cover na contain - pokazuje całą grafikę bez ucinania */
    background-repeat: no-repeat;
    background-position: center;
    background-color: #000; /* Czarne tło dla pustych przestrzeni po bokach */
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* STREFY KLIKALNE - Bez wizualnych wskaźników */
.building-zone {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
}
/* Wyłączone efekty hover - czysta mapa bez podświetleń */
/* .building-zone:hover {
    background: rgba(241, 196, 15, 0.3);
    transform: scale(1.02);
} */

/* Skalibrowane pozycje stref na mapie wioski */
#zone-castle { top: 60.8%; left: 77.9%; width: 22.2%; height: 36.7%; }
#zone-school { top: 36.4%; left: 0.0%; width: 20.0%; height: 25.0%; }
#zone-admin { top: 0.0%; left: 0.0%; width: 23.4%; height: 26.3%; }
#zone-market { top: 35.0%; left: 85.1%; width: 15.0%; height: 20.0%; }
#zone-tavern { 
    /* Karczma całkowicie ukryta - nie ma współrzędnych */
    display: none !important;
}

/* Skalibrowane pozycje nowych stref (Ctrl+K do ponownej kalibracji) */
#zone-planner { top: 3.4%; left: 25.7%; width: 23.4%; height: 27.5%; }
#zone-board { top: 55.9%; left: 24.6%; width: 21.7%; height: 30.1%; }
#zone-report { top: 4.6%; left: 59.6%; width: 11.2%; height: 31.5%; }
#zone-logout { top: 84.3%; left: 48.0%; width: 17.6%; height: 15.6%; }

/* ============================================================================
   EASTER EGG: Strefy w budowie (Krasnolud)
   Użyj Ctrl+K do kalibracji - te pozycje są placeholder'ami
   ============================================================================ */
.construction-zone {
    /* Niewidoczne ramki - strefy aktywne bez wizualnego oznaczenia */
}

/* Pozycje skalibrowane przez użytkownika */
#zone-construction-1 { top: 6.2%; left: 82.1%; width: 14.1%; height: 23.4%; }
#zone-construction-2 { top: 62.3%; left: 58.7%; width: 13.8%; height: 21.7%; }
#zone-construction-3 { top: 69.2%; left: 1.9%; width: 17.3%; height: 19.9%; }

/* #zone-planner::after {
    content: '📅 PLANER';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
} */

/* GRA */
#page-game.active { 
    display: flex !important; 
    justify-content: center; 
    align-items: center; 
    background: #000; 
    background-color: #1a1a1a; 
}
.game-screen { 
    position: relative; 
    width: 177.78vh; /* Wymuszenie aspect ratio 16:9 względem wysokości */
    max-width: 100%; /* Ogranicz do szerokości ekranu jeśli za duże */
    height: 100vh;
    max-height: 100vh;
    aspect-ratio: 16 / 9; /* Nowoczesne wymuszenie aspect ratio */
    background: url('tlo.jpg') no-repeat center center; 
    background-size: cover; 
    box-shadow: 0 0 50px rgba(0,0,0,0.8); 
    overflow: hidden; 
    container-type: size;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* DZIENNIK */
.journal-container { max-width: 1100px; margin: 0 auto; padding-bottom: 100px; }
.editor-box { background: var(--bg-panel); padding: 15px; border-radius: 8px; margin-bottom: 20px; border-left: 5px solid var(--accent); margin-right: auto; max-width: 100%; }

.add-chapter-box { margin-bottom:20px; padding:15px; background:rgba(0,0,0,0.1); border-radius:8px; border: 2px dashed #7f8c8d; text-align:center; }

/* NOWE PALETY 3-KOLOROWE */
/* Format: --theme-border (najciemniejszy), --theme-header (średni), --theme-bg (najjaśniejszy) */
.theme-red { /* Dziedzictwo */
    --theme-border: #7b241c; /* Ciemne bordo */
    --theme-header: #c0392b; /* Klasyczna czerwień */
    --theme-bg:     #fadbd8; /* Bardzo jasny róż */
}
.theme-purple { /* Dyplomacja */
    --theme-border: #4a235a; /* Ciemny fiolet */
    --theme-header: #8e44ad; /* Fiolet */
    --theme-bg:     #f4ecf7; /* Jasny wrzos */
}
.theme-blue { /* Magia */
    --theme-border: #154360; /* Ciemny granat */
    --theme-header: #2980b9; /* Niebieski */
    --theme-bg:     #d6eaf8; /* Błękit */
}
.theme-green { /* Żywioły */
    --theme-border: #145a32; /* Ciemna zieleń */
    --theme-header: #27ae60; /* Zieleń */
    --theme-bg:     #d5f5e3; /* Mięta */
}

/* STYLIZACJA KONTENERA (RAMKI) */
/* Kontener kampanii - baza dla pozycjonowania */
.chapter-box {
    position: relative !important; /* Ważne dla przycisku usuwania */
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 0;
    padding-bottom: 0;
    background: var(--theme-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 3px solid var(--theme-border); /* Najciemniejszy kolor */
}
/* ZEBRA - nie używane w light mode */
.zebra-odd { background: #ffffff; }
.zebra-even { background: #ffffff; }

/* Paski Kampanii - ukryte w light mode */
.camp-stripe { display: none; }
.camp-stripe-right { display: none; }

.chapter-header { background: rgba(0,0,0,0.2); padding: 10px; font-weight: bold; color: #fff; display: flex; justify-content: space-between; align-items: center; }

.lesson-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 15px; background: rgba(0,0,0,0.1); margin-bottom: 2px; }
.lesson-info { flex-grow: 1; margin-right: 10px; display: flex; flex-direction: column; gap: 5px; }

.edit-date { min-width: 140px; width: 140px; padding: 4px 8px; border: 1px solid rgba(0,0,0,0.2); border-radius: 4px; background-color: #ffffff; color: #333; text-align: center; font-size: 13px; }
.edit-date:focus { border: 1px solid #f1c40f; outline: none; }
.edit-topic { width: 100%; padding: 4px 8px; border: 1px solid rgba(0,0,0,0.2); border-radius: 4px; background-color: #ffffff; color: #333; font-weight: 600; font-size: 0.95rem; }
.edit-topic:focus { border: 1px solid #2196f3; outline: none; }

.chapter-footer { padding: 12px 16px; background: transparent; font-size: 12px; display: flex; gap: 15px; align-items: center; border-top: 1px solid #e0e0e0; }
.score-input { width: 50px; padding: 5px; text-align: center; border-radius: 3px; border: 1px solid #e0e0e0; background: #fff; color: #333; }
.rank-badge { font-size: 11px; padding: 4px 8px; border-radius: 4px; margin-left: 10px; color: #fff; font-weight: bold; text-transform: uppercase; }
.progress-bar-container { display: flex; align-items: center; gap: 10px; }
.progress-bar-wrapper { flex: 1; height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: #ff9800; border-radius: 3px; transition: width 0.3s ease; }

/* PRZYCISKI OCEN (Długie) */
.grade-btn-long { display: block; width: 100%; padding: 6px 10px; margin-bottom: 4px; border: none; border-radius: 4px; color: white; font-weight: bold; font-size: 0.75rem; text-align: left; cursor: pointer; opacity: 0.7; transition: 0.2s; text-transform: uppercase; position: relative; }
.grade-btn-long:hover { opacity: 1; transform: translateX(5px); }
.grade-btn-long.active { opacity: 1; border: 2px solid #fff; box-shadow: 0 0 10px rgba(0,0,0,0.5); transform: scale(1.02); z-index: 2; }

/* --- NOWE STYLE PRZYCISKÓW (PILLS) --- */
.grade-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end; /* Wyrównanie do prawej jak na projekcie */
}

.grade-pill {
    padding: 6px 14px;
    border: 2px solid transparent;
    border-radius: 50px; /* Kształt tabletki */
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
    min-width: 40px;
}

/* 1. STANY NIEAKTYWNE (PASTELOWE / STONOWANE) */
.pill-1  { background: #fdf6bd; color: #a8a058; } /* Pastel Yellow */
.pill-2  { background: #c6ebc5; color: #6a8c69; } /* Pastel Green */
.pill-ps { background: #e3d396; color: #8c7f4b; } /* Pastel Gold */
.pill-nb { background: #e0e0e0; color: #999999; } /* Pastel Grey */
.pill-0  { background: #f5b7b1; color: #a95e5e; } /* Pastel Red */
.pill-x  { background: #555555; color: #aaaaaa; } /* Black/Dark (Druga wersja 0) */
.pill-pd { background: #d6eaf8; color: #2980b9; } /* Pastel Blue */

/* 2. STANY AKTYWNE (NEONOWE / ŚWIECĄCE + GLOW) */
.grade-pill.active { transform: scale(1.1); font-weight: 900; color: #000; border: 2px solid #fff; }

.pill-1.active  { background: #ffff00; box-shadow: 0 0 15px #ffff00; color: #000; }
.pill-2.active  { background: #00ff00; box-shadow: 0 0 15px #00ff00; color: #000; }
.pill-ps.active { background: #ffd700; box-shadow: 0 0 15px #ffd700; color: #000; }
.pill-nb.active { background: #bdc3c7; box-shadow: 0 0 15px #bdc3c7; color: #fff; }
.pill-0.active  { background: #ff0000; box-shadow: 0 0 15px #ff0000; color: #fff; }
.pill-x.active  { background: #000000; box-shadow: 0 0 15px #000000; color: #fff; border: 2px solid #555; }
.pill-pd.active { background: #3498db; box-shadow: 0 0 15px #3498db; color: #fff; }


.grade-btn { padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 11px; transition: all 0.15s; }
.g-pd { background: #bdc3c7; color: #424242; opacity: 0.8; min-width: 90px; text-align: center; }
.g-pd.active { background: #27ae60; color: #fff; opacity: 1.0; }
.grade-btn:hover { opacity: 1; }

.btn-add-mission { background: #27ae60; color: white; border: none; padding: 8px 15px; font-weight: bold; cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 5px; }
.btn-action-add { background: #27ae60; color: white; border: none; padding: 8px 15px; font-weight: bold; cursor: pointer; border-radius: 4px; display: inline-block; }
.btn-action-add:hover { background: #229954; }
.btn-add-craft { 
    padding: 4px 12px; 
    font-size: 0.85em; 
    background: #3498db; 
    color: #fff; 
    border: none; 
    border-radius: 3px; 
    cursor: pointer; 
    transition: background 0.2s; 
}
.btn-add-craft:hover { 
    background: #2980b9; 
}
.crafting-config-section {
    background: #fff;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}
.btn-del-lesson-header {
    padding: 4px 10px;
    font-size: 0.85em;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-del-lesson-header:hover {
    background: #c0392b;
}
.campaign-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--theme-border);
}
.camp-tab-btn {
    background: #34495e;
    color: #fff;
    padding: 8px 15px;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9em;
    transition: background 0.2s;
}
.camp-tab-btn:hover {
    background: #2c3e50;
}
.camp-tab-btn.active {
    background-color: #f1c40f !important;
    color: #000 !important;
    font-weight: bold;
    border-bottom: none;
}
.btn-remove-camp { background: transparent; border: 1px solid #e0e0e0; color: #757575; width: 28px; height: 28px; cursor: pointer; border-radius: 4px; font-weight:bold; font-size: 12px; }
.btn-remove-camp:hover { background: #f5f5f5; color: #f44336; border-color: #f44336; }

/* Przycisk usuwania w prawym górnym rogu */
.btn-chapter-delete-corner {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-chapter-delete-corner:hover {
    background: var(--danger);
    color: white;
}

.mission-section { background: rgba(0,0,0,0.3); padding: 15px; margin-top: 0; display: none; border-bottom: 1px solid #555; }
.mission-section.open { display: block; }
.sq-item { background: rgba(0,0,0,0.2); padding: 8px; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; border-radius: 4px; }
.sq-input { background-color: #ffffff; border: 1px solid rgba(0,0,0,0.2); color: #333; padding: 8px; flex-grow: 1; border-radius: 4px; font-size: 13px; min-width: 0; }
.sq-input:focus { border: 1px solid #f1c40f; outline: none; box-shadow: 0 0 0 2px rgba(241,196,15,0.2); }

/* NOWY UKŁAD DZIENNIKA */
.campaign-header-wrapper { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; margin-bottom: 8px; }
.campaign-title-large { font-size: 15px; font-weight: bold; color: #2c3e50; text-transform: uppercase; text-align: left; margin: 0; }
.progress-card { background: #ffffff; padding: 10px 16px; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.progress-card-text { color: #2c3e50; font-size: 13px; font-weight: 500; }

/* Graficzny pasek postępu kampanii */
/* Wrapper dla paska */
.campaign-progress-wrapper {
    margin-top: 40px; /* Większy odstęp od przycisków */
    padding: 0 10px 15px 10px;
}

/* Tekst nad paskiem (Postęp / Procenty) */
.progress-text-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 800; /* Gruby font */
    font-size: 1.1rem; /* Większa czcionka */
    color: #2c3e50 !important; /* WYMUSZENIE CIEMNEGO KOLORU (Ciemny granat/szary), aby był widoczny na pastelowym tle */
    text-transform: uppercase;
    text-shadow: none; /* Usunięcie cieni, jeśli były */
}

/* Tło paska (Pusta część - Track) */
.progress-track {
    background: rgba(0, 0, 0, 0.2) !important; /* Półprzezroczysty czarny - przyciemnia tło, zawsze widoczny */
    height: 36px; /* 3x wyższy niż wcześniej (było ~12px) */
    border-radius: 18px; /* Idealne zaokrąglenie dla wysokości 36px */
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); /* Wewnętrzny cień dla głębi */
    border: 1px solid rgba(0,0,0,0.1);
}

/* Wypełnienie paska (Fill) */
.progress-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 5px rgba(0,0,0,0.2); /* Lekki cień na końcu paska */
}

/* Neon Glow dla >100% */
.neon-glow {
    box-shadow: 0 0 15px currentColor, inset 0 0 10px rgba(255,255,255,0.5) !important;
    filter: brightness(1.2);
}

/* STYLE DZIENNIKA KLASOWEGO */
/* Akordeon lekcji */
.lesson-accordion {
    margin-bottom: 15px;
}
.lesson-accordion-checkbox {
    display: none;
}
.lesson-accordion-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    background-color: var(--theme-header);
    color: #ffffff !important; /* Wymuszony biały */
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.2s;
    gap: 15px; /* Dodane dla równomiernego odstępu */
}
.lesson-accordion-header span {
    color: #ffffff !important; /* Wymuszony biały dla wszystkich spanów */
}
.lesson-accordion-header:hover {
    background-color: var(--theme-border);
    color: #ffffff !important; /* Biały również na hover */
}
.lesson-accordion-header::after {
    content: '▼';
    margin-left: auto;
    transition: transform 0.3s;
}
.lesson-accordion-checkbox:checked + .lesson-accordion-header::after {
    transform: rotate(180deg);
}
.lesson-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.lesson-accordion-checkbox:checked ~ .lesson-accordion-content {
    max-height: 5000px;
    transition: max-height 0.5s ease-in;
}

/* Tabela dziennika klasowego */
.class-journal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    font-size: 0.9rem;
}
.class-journal-table thead th {
    background-color: var(--theme-header);
    color: #fff;
    border: 1px solid var(--theme-border);
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
}
.class-journal-table tbody tr {
    transition: background 0.2s;
}
.class-journal-table tbody td {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 8px 10px;
    vertical-align: middle;
    color: #2c3e50 !important;
}
.form-square { width: 16px; height: 16px; border-radius: 3px; display: inline-block; cursor: pointer; position: relative; }
.form-square:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: normal;
    z-index: 9999;
    pointer-events: none;
    width: max-content;
    max-width: 200px;
    text-align: center;
    margin-bottom: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.form-row { margin-bottom: 4px; }
.form-grid {
    display: grid;
    gap: 2px;
    margin-bottom: 30px;
}
.form-grid-header {
    background: rgba(255,255,255,0.15);
    padding: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: #333;
    border-bottom: 2px solid #e1b12c;
}
.form-grid-cell.subject-name {
    background: rgba(255,255,255,0.1);
    padding: 8px;
    font-weight: bold;
    text-align: right;
    font-size: 0.85rem;
    color: #333;
}
.month-cell {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    min-height: 40px;
    overflow: visible;
}
.student-row-even {
    background-color: var(--theme-bg);
}
.student-row-odd {
    background-color: rgba(255,255,255,0.7);
}
.student-row-even:hover,
.student-row-odd:hover {
    background-color: var(--theme-header);
    opacity: 0.8;
}

/* Statystyki na żywo */
.live-stats {
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
    color: inherit; /* Dziedziczy z inline style, ale zapewnia czytelność */
}

/* Tabela podsumowująca kampanię */
.campaign-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    font-size: 0.9rem;
}
.campaign-summary-table thead th {
    background-color: var(--theme-header);
    color: #fff;
    border: 2px solid var(--theme-border);
    padding: 12px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}
.campaign-summary-table tbody tr {
    transition: background 0.2s;
}
.campaign-summary-table tbody td {
    border: 1px solid rgba(0,0,0,0.15);
    padding: 10px;
    text-align: center;
    vertical-align: middle;
    color: #2c3e50 !important;
}
.campaign-summary-table tbody tr.student-row-even {
    background-color: var(--theme-bg);
}
.campaign-summary-table tbody tr.student-row-odd {
    background-color: rgba(255,255,255,0.7);
}
.campaign-summary-table tbody tr:hover {
    background-color: var(--theme-header);
    opacity: 0.8;
}
/* STYLIZACJA TABELI (EXCEL STYLE) */
.chapter-header, 
.basic-missions-header {
    background-color: var(--theme-header) !important; /* Średni kolor */
    color: #fff !important;
    border-bottom: none;
    border-color: var(--theme-border);
    padding: 10px 15px;
}

.basic-missions-header { font-size: 14px; font-weight: bold; text-transform: uppercase; padding: 12px 16px; margin: 0; }
.campaign-title-centered { text-align: center; font-size: 18px; font-weight: bold; color: #2c3e50; text-transform: uppercase; padding: 20px; margin: 20px 0 10px 0; }
.journal-table { width: 100%; border-collapse: collapse; border: 2px solid var(--theme-border); margin-bottom: 0; background: #fff; }
.journal-table thead th {
    background-color: var(--theme-header); /* Średni kolor */
    color: #fff;
    border: 1px solid var(--theme-border);
    padding: 12px;
    text-align: center;
    font-weight: bold;
}
.journal-table thead th:first-child { border-left: none; }
.journal-table thead th:last-child { border-right: none; }
.journal-table tbody tr {
    background-color: var(--theme-bg) !important; /* Najjaśniejszy kolor */
    transition: background 0.2s;
}
.journal-table tbody tr:hover {
    background-color: var(--theme-header); /* Średni kolor na hover */
    opacity: 0.8;
}
.journal-table td {
    border: 1px solid rgba(0,0,0,0.1); /* Delikatne linie siatki */
    color: #333;
    padding: 10px 12px;
    vertical-align: top;
}
.journal-table td:first-child { border-left: none; }
.journal-table td:last-child { border-right: none; }
.journal-table tbody tr:last-child td {
    border-bottom: none;
}
.journal-table tbody tr:last-child {
    border-bottom: none;
}

/* STOPKA DODAWANIA (INPUTY) */
/* Stopka formularza - Układ Pionowy (Kolumna) */
.chapter-footer-inputs {
    display: flex;
    flex-direction: column; /* Inputy góra, przycisk dół */
    align-items: center;    /* Wyśrodkowanie */
    gap: 15px;
    padding: 20px;
    background-color: var(--theme-bg) !important; /* Najjaśniejszy kolor */
    border-top: none;
    margin-top: 0;
    margin-bottom: 30px;
}
.chapter-footer-inputs input {
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* Wrapper dla inputów - żeby były w jednym rzędzie */
.inputs-row-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}
.mission-list-item { display: flex; align-items: center; gap: 15px; padding: 10px 16px; color: #333; font-size: 14px; margin-bottom: 0; border-bottom: 1px solid #e0e0e0; }
.mission-row-top { border-bottom: 1px solid #e0e0e0; }
.mission-list-item .mission-code { font-weight: bold; color: #2c3e50; min-width: 100px; font-size: 13px; }
.mission-list-item .mission-date { color: #757575; min-width: 90px; font-weight: 500; }
.mission-list-item .mission-topic { flex-grow: 1; color: #333; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; }
.sidequests-section { background: transparent; padding: 16px; margin-top: 0; border-top: 1px solid #e0e0e0; }
.sidequests-title { font-size: 14px; font-weight: bold; color: #2c3e50; text-transform: uppercase; margin-bottom: 10px; text-align: left; border-bottom: 2px solid #f1c40f; padding: 12px 16px; }
.sidequest-item { background: transparent; padding: 10px 16px; margin-bottom: 0; border-radius: 0; display: flex; align-items: center; gap: 8px; color: #333; border-bottom: 1px solid #e0e0e0; transition: background 0.15s; font-size: 13px; }
.sidequest-item:hover { background: #fafafa; }
.mission-layout-container { display: flex; flex-direction: column; gap: 0; padding: 0; }
.mission-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; padding: 10px 16px; width: 100%; }
.mission-row-bottom { display: flex; width: 100%; padding: 0 16px 10px 16px; }
.mission-info-column { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.mission-grades-column { display: flex; align-items: center; flex-shrink: 0; }
.crafting-section { margin-top: 4px; padding-left: 12px; border-left: 2px solid #e0e0e0; font-size: 12px; color: #757575; }
.add-crafting-hint { color: #95a5a6; font-size: 0.85rem; margin-top: 8px; font-style: italic; padding-left: 5px; }

/* RAPORT */
.report-grid { display: grid; grid-template-columns: 250px 1fr; gap: 20px; height: 100%; overflow: hidden; }
.report-menu { background: #2b1d14; padding: 15px; border-radius: 8px; height: 100%; overflow-y: auto; border: 2px solid #5d4037; }
.report-btn { display: block; width: 100%; padding: 10px; margin-bottom: 5px; background: rgba(255,255,255,0.05); border: 1px solid #5d4037; color: #d7ccc8; text-align: left; cursor: pointer; transition: 0.2s; font-family: 'Segoe UI', serif; }
.report-btn:hover { background: #5d4037; color: #fff; border-color: #8d6e63; }
.report-btn.special { background: #8d6e63; color: #fff; font-weight: bold; border: 2px solid #d7ccc8; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.report-content { background: #fff; color: #000; padding: 30px; border-radius: 4px; overflow-y: auto; height: 100%; border: 5px double #5d4037; }

/* TABELA EXCELOWA */
.report-template-table { width: 100%; border-collapse: collapse; background: #fff; color: #000; font-family: 'Segoe UI', sans-serif; font-size: 0.85rem; border: 2px solid #000; margin-bottom: 30px; }
.report-template-table th, .report-template-table td { border: 1px solid #000; padding: 5px; vertical-align: middle; }
.rt-date { width: 90px; text-align: center; }
.rt-nr { width: 40px; text-align: center; font-weight: bold; }
.rt-label { width: 100px; text-align: center; background: #fff; border-right: none; font-style: italic; }
.rt-content { text-align: left; border-left: none; }
.rt-score { width: 80px; text-align: center; font-weight: bold; }
.rt-header-pink { background: #ead1dc; font-weight: bold; text-align: center; border-bottom: 2px solid #000; text-transform: uppercase; color:#000; font-size: 1rem; }
.rt-sub-header { background: #fff; font-weight: bold; text-align: center; border-bottom: 2px solid #000; }
.rt-green { background: #93c47d; }
.rt-yellow { background: #fff2cc; }
.rt-summary { background: #ead1dc; font-weight: bold; text-align: right; padding-right: 15px; }
.rt-sidequest { background: #ead1dc; font-weight: bold; text-align: center; }

.summary-detailed-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; text-align: center; border: 2px solid #5d4037; margin-top: 20px; background: #fff; min-width: 800px; }
.summary-detailed-table th, .summary-detailed-table td { border: 1px solid #8d6e63; padding: 4px; }
.sum-head-main { background: #2b1d14; color: #fff; text-transform: uppercase; font-family: serif; letter-spacing: 1px; }
.sum-head-sub { background: #5d4037; color: #ffecb3; font-size: 0.7rem; }
.sum-col-subject { background: #efebe9; font-weight: bold; text-align: left; padding-left: 10px; min-width: 120px; color: #3e2723; }
.sum-col-rank { background: #fff8e1; font-weight: bold; font-size: 0.9rem; color: #e67e22; }
.sum-val { color: #3e2723; }
.sum-avg { color: #795548; font-style: italic; font-size: 0.7rem; }
.sum-total-row { background: #3e2723; color: #fff; font-weight: bold; border-top: 3px double #d7ccc8; }
.sum-total-row td { border-color: #5d4037; color: #fff; }

.keys-list-report { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.key-item-report { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; padding: 10px; border: 1px solid #a1887f; border-radius: 5px; min-width: 80px; background: #fff; color: #333; }
.key-icon-report { font-size: 1.5rem; margin-bottom: 5px; }

/* ADMIN */
.admin-grid-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-bottom: 50px; }
.admin-rank-box { background: #fff; border: 2px solid #5d4037; border-radius: 5px; overflow: hidden; }
.admin-rank-header { background: #2b1d14; color: #e1b12c; padding: 10px; text-align: center; font-weight: bold; text-transform: uppercase; font-family: serif; letter-spacing: 1px; border-bottom: 2px solid #e1b12c; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; text-align: center; color: #000; }
.admin-table th { background: #5d4037; color: #fff; padding: 5px; font-size:0.75rem; }
.admin-table td { border-bottom: 1px solid #ccc; padding: 4px; }
.admin-table tr:nth-child(even) { background: #f5f5f5; }
.rank-row-1 { background: #fff9c4 !important; font-weight:bold; }

/* AUDYT TABELA */
.audit-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: center; border: 2px solid #5d4037; margin-top: 10px; background: #fff; color: #000; min-width: 600px; }
.audit-table th { background: #2b1d14; color: #e1b12c; padding: 10px; text-transform: uppercase; font-weight: bold; border: 1px solid #5d4037; font-size: 0.85rem; }
.audit-table td { border: 1px solid #8d6e63; padding: 8px; background: #fff; }
.audit-table tr:nth-child(even) { background: #f5f5f5; }
.audit-table tr:hover { background: #fff9c4; }
.audit-summary { margin-top: 20px; padding: 15px; background: rgba(255, 255, 255, 0.05); border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.2); }

/* ONBOARDING */
.onboarding-section { background: #fff; border: 2px solid #5d4037; border-radius: 5px; padding: 20px; margin-bottom: 30px; }
.onboarding-form { display: flex; flex-direction: column; gap: 15px; max-width: 500px; margin: 0 auto; }
.onboarding-form-row { display: flex; flex-direction: column; gap: 5px; }
.onboarding-form-row label { color: #5d4037; font-weight: bold; font-size: 0.9rem; }
.onboarding-input { padding: 10px; border: 2px solid #5d4037; border-radius: 4px; font-size: 1rem; background: #fff; color: #000; }
.onboarding-input:focus { outline: none; border-color: #e1b12c; box-shadow: 0 0 5px rgba(225, 177, 44, 0.3); }
.onboarding-btn { background: #e1b12c; color: #000; border: none; padding: 12px 25px; font-weight: bold; font-size: 1rem; border-radius: 4px; cursor: pointer; text-transform: uppercase; transition: background 0.3s; }
.onboarding-btn:hover { background: #f1c40f; }
.onboarding-btn:active { transform: scale(0.98); }
.onboarding-message { padding: 10px; border-radius: 4px; margin-top: 10px; text-align: center; font-weight: bold; display: none; }
.onboarding-message.success { background: #2ecc71; color: #fff; display: block; }
.onboarding-message.error { background: #e74c3c; color: #fff; display: block; }

/* STUDENT CATALOG */
.student-catalog-section { background: #fff; border: 2px solid #5d4037; border-radius: 5px; padding: 25px; margin-bottom: 30px; }
.catalog-form-section { margin-bottom: 30px; padding-bottom: 25px; border-bottom: 2px solid #5d4037; }
.catalog-list-section { margin-top: 20px; }
.students-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.students-table th { background: #5d4037; color: #fff; padding: 12px; text-align: left; font-weight: bold; border: 1px solid #8d6e63; }
.students-table td { padding: 12px; border: 1px solid #ddd; color: #000; }
.students-table tr:nth-child(even) { background: #f5f5f5; }
.students-table tr:hover { background: #fff9c4; }
.student-action-btn { padding: 6px 12px; margin: 0 3px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: all 0.2s; }
.student-action-btn:hover { transform: scale(1.05); }
.btn-edit { background: #3498db; color: white; }
.btn-edit:hover { background: #2980b9; }
.btn-delete { background: #e74c3c; color: white; }
.btn-delete:hover { background: #c0392b; }
.edit-form-row { display: flex; gap: 10px; align-items: center; }
.edit-form-row input { padding: 6px; border: 1px solid #5d4037; border-radius: 3px; font-size: 0.9rem; }
.edit-form-actions { display: flex; gap: 5px; }
.btn-save { background: #2ecc71; color: white; padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.85rem; }
.btn-save:hover { background: #27ae60; }
.btn-cancel { background: #95a5a6; color: white; padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.85rem; }
.btn-cancel:hover { background: #7f8c8d; } 
.rank-row-2 { background: #f5f5f5 !important; } 
.rank-row-3 { background: #f5f5f5 !important; }

/* UI */
input.input-text { padding: 8px; border-radius: 4px; border: 1px solid #555; }
.btn-action { background: var(--accent); color: #000; border: none; padding: 8px 15px; cursor: pointer; font-weight: bold; border-radius: 4px; }
.btn-boss { background: #ffc107; color: #333; border: none; padding: 8px 16px; cursor: pointer; font-weight: bold; border-radius: 4px; font-size: 12px; }
.btn-boss:hover { background: #ffb300; }
.btn-sidequest { background: #ffc107; color: #333; border: none; padding: 8px 16px; cursor: pointer; font-weight: bold; border-radius: 4px; font-size: 12px; }
.btn-sidequest:hover { background: #ffb300; }
.btn-del { background: transparent; color: #757575; border: 1px solid #e0e0e0; padding: 4px 8px; cursor: pointer; border-radius: 3px; font-size: 11px; font-weight:bold; }
.btn-del:hover { background: #f5f5f5; color: #f44336; border-color: #f44336; }

/* GRAFIKA */
.shelf-zone { position: absolute; display: flex; flex-wrap: wrap; align-content: flex-start; padding: 0; z-index: 5; border: none; background: transparent; }
#shelf-purple { top: 15%; left: 2%; width: 15%; height: 40%; }
#shelf-red { top: 15%; left: 21.5%; width: 15%; height: 40%; }
#shelf-blue { top: 15%; left: 49%; width: 15%; height: 40%; }
#shelf-green { top: 15%; left: 67%; width: 15%; height: 40%; }
#homework-zone { position: absolute; top: 55px; right: 0px; bottom: 180px; left: auto; width: 20cqw; height: auto; display: flex; flex-direction: column; flex-wrap: wrap; direction: rtl; align-content: flex-start; overflow: visible; padding-top: 0.7cqh; z-index: 1000; }
.scroll-item { position: relative; direction: ltr; width: 8cqw; height: 8cqw; margin-bottom: -4cqh; object-fit: contain; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.5)); cursor: pointer; z-index: 1005; transition: all 0.2s ease-out; pointer-events: auto; clip-path: inset(10px 0 10px 0); }
.scroll-item:hover { filter: drop-shadow(0 0 8px gold) brightness(1.4) contrast(1.1); transform: translateX(0.7cqw); cursor: pointer; }
@keyframes urgentPulse {
    0% { filter: drop-shadow(0 0 2px red); transform: scale(1); }
    50% { filter: drop-shadow(0 0 15px orangered); transform: scale(1.05); }
    100% { filter: drop-shadow(0 0 2px red); transform: scale(1); }
}
.urgent-scroll { animation: urgentPulse 1.5s infinite; z-index: 2000 !important; }
.scroll-withered { filter: sepia(0.8) grayscale(0.5) brightness(0.7) drop-shadow(2px 4px 6px rgba(0,0,0,0.5)); }
.scroll-parent-done { position: relative; }
.scroll-parent-done::after { content: '✔'; position: absolute; top: 5px; right: 5px; color: #2ecc71; font-size: 24px; font-weight: bold; text-shadow: 0 0 10px #2ecc71, 0 0 20px #2ecc71; pointer-events: none; z-index: 10006; }

#table-zone { position: absolute; bottom: -38%; left: 11%; transform: translateX(-50%); z-index: 55; }
#table-graphic { width: 87%; filter: drop-shadow(0 50px 15px rgba(0,0,0,0.8)); transition: all 0.1s; }
#compass-wrapper { position: absolute; left: 53.6%; top: 19%; transform: translate(-50%, -50%); z-index: 60; width: 40%; aspect-ratio: 1 / 1; pointer-events: none; container-type: size; }
#compass-backdrop { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 57%; height: 57%; border-radius: 50%; background-color: rgba(0, 0, 0, 1); backdrop-filter: blur(2px); box-shadow: 0 0 20px rgba(0,0,0,0.5); pointer-events: none; }
#power-compass { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* Style dla slotów run wokół kompasu */
.rune-slots-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    margin: 0;
    pointer-events: none;
}
.rune-slot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10%;
    height: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
/* Pozycjonowanie slotów w grupie north (góra) - kolisty układ */
#slots-north .rune-slot:nth-child(1) {
    --angle: 15deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-north .rune-slot:nth-child(2) {
    --angle: 35deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-north .rune-slot:nth-child(3) {
    --angle: 55deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-north .rune-slot:nth-child(4) {
    --angle: 75deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
/* Pozycjonowanie slotów w grupie east (prawo) - kolisty układ */
#slots-east .rune-slot:nth-child(1) {
    --angle: 105deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-east .rune-slot:nth-child(2) {
    --angle: 125deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-east .rune-slot:nth-child(3) {
    --angle: 145deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-east .rune-slot:nth-child(4) {
    --angle: 165deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
/* Pozycjonowanie slotów w grupie south (dół) - kolisty układ */
#slots-south .rune-slot:nth-child(1) {
    --angle: 195deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-south .rune-slot:nth-child(2) {
    --angle: 215deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-south .rune-slot:nth-child(3) {
    --angle: 235deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-south .rune-slot:nth-child(4) {
    --angle: 255deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
/* Pozycjonowanie slotów w grupie west (lewo) - kolisty układ */
#slots-west .rune-slot:nth-child(1) {
    --angle: 285deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-west .rune-slot:nth-child(2) {
    --angle: 305deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-west .rune-slot:nth-child(3) {
    --angle: 325deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}
#slots-west .rune-slot:nth-child(4) {
    --angle: 345deg;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(-1 * var(--slot-radius))) rotate(calc(-1 * var(--angle)));
}

/* Inicjalizacja zmiennych CSS dla slotów */
:root {
    --slot-size: 12%;
    --slot-gap: 2%;
    --slot-radius: 32.5cqw;
}
.rune-slot .slot-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}
.rune-slot .slot-gem {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    transform-origin: center;
    pointer-events: none; /* Kamienie nie blokują kliknięć - kliknięcia przechodzą do .rune-slot */
}

/* Animacja pulsu dla kamieni oczekujących na odebranie */
.slot-gem.gem-pending {
    animation: gemPulse 1.5s ease-in-out infinite;
}

@keyframes gemPulse {
    0%, 100% {
        transform: scale(1.0);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Animacja lotu kamieni do środka radaru */
.slot-gem.gem-collecting {
    position: absolute;
    animation: arcFlight 1.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
    z-index: 999999;
    filter: blur(0px);
    transition: filter 0.1s;
}

@keyframes arcFlight {
    0% {
        transform: translate(-50%, -50%) scale(1.0) translate(0, 0);
        opacity: 1;
        filter: blur(0px);
        box-shadow: 0 0 0px currentColor;
    }
    40% {
        transform: translate(-50%, -50%) scale(1.2) translate(var(--arc-x, 0), -400%);
        opacity: 1;
        filter: blur(2px);
        box-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
    }
    100% {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0) translate(0, 0);
        opacity: 0;
        filter: blur(4px);
        box-shadow: 0 0 30px currentColor, 0 0 50px currentColor;
    }
}

/* Efekt wstrząsu radaru */
#compass-wrapper.radar-shake {
    animation: radarShake 0.3s ease-in-out;
}

@keyframes radarShake {
    0%, 100% {
        transform: translate(-50%, -50%) translateX(0) translateY(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-50%, -50%) translateX(-2px) translateY(-1px);
    }
    20%, 40%, 60%, 80% {
        transform: translate(-50%, -50%) translateX(2px) translateY(1px);
    }
}

/* Style dla cząsteczek wybuchu */
.particle-burst {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100001;
    animation: particleExplode 0.6s ease-out forwards;
    --end-x: 0px;
    --end-y: 0px;
}

@keyframes particleExplode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(calc(-50% + var(--end-x)), calc(-50% + var(--end-y))) scale(0);
        opacity: 0;
    }
}

/* Przycisk odbierania run - now integrated in HUD */

/* Panel kalibratora slotów */
#slots-tuner {
    position: fixed;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #e1b12c;
    border-radius: 8px;
    padding: 15px;
    z-index: 1000;
    color: #fff;
    font-size: 0.85rem;
    min-width: 250px;
    display: none; /* Domyślnie ukryty - można pokazać dla kalibracji */
}
#slots-tuner.visible {
    display: block;
}
#slots-tuner h3 {
    margin: 0 0 15px 0;
    color: #e1b12c;
    text-align: center;
    font-size: 1rem;
}
#slots-tuner .tuner-control {
    margin-bottom: 15px;
}
#slots-tuner .tuner-control label {
    display: block;
    margin-bottom: 5px;
    color: #ddd;
}
#slots-tuner .tuner-control input[type="range"] {
    width: 100%;
}
#slots-tuner .tuner-control .value-display {
    display: inline-block;
    margin-left: 10px;
    color: #e1b12c;
    font-weight: bold;
    min-width: 50px;
}

.trophy-item { width: 36%; margin-right: -23%; margin-bottom: 4%; filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.5)); }

.character-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity 0.3s; opacity: 0; will-change: transform, opacity; }
#layer-baza { z-index: 20; opacity: 1; }
#layer-helm { z-index: 21; }
#layer-tarcza { z-index: 22; }
#layer-bron { z-index: 23; }
#layer-zwierzak { z-index: 65; width: 101%; height: auto; left: 25%; top: 0%; }


/* HUD KLUCZE (Z-Index 9999) */
.keys-panel { position: absolute; bottom: 20px; right: 20px; background: rgba(0,0,0,0.9); border: 2px solid #7f8c8d; border-radius: 0.7cqw; padding: 0.7cqw; width: 22cqw; z-index: 9999; display: grid; grid-template-columns: 1fr 1fr; gap: 0.4cqw; font-size: 1cqw; color: #ddd; min-height: 3.5cqh; }
.key-row { display: flex; flex-direction: column; padding: 0.3cqw 0.4cqw; border-radius: 0.28cqw; background: rgba(255,255,255,0.05); position: relative; cursor: help; }
.key-header { display: flex; justify-content: space-between; width: 100%; align-items: center; margin-bottom: 0.14cqh; }
.key-icon { font-size: 1.1cqw; margin-left: 0.35cqw; text-shadow: 0 0 3px white; }
.reward-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* Styl dla "1" - Srebrna odznaka */
.reward-badge.badge-1 {
    background: linear-gradient(135deg, #e8e8e8 0%, #bdc3c7 100%);
    border: 2px solid #95a5a6;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 2px rgba(255,255,255,0.3);
}
/* Styl dla "2" - Złota odznaka */
.reward-badge.badge-2 {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    border: 2px solid #e67e22;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
    box-shadow: 0 2px 12px rgba(241, 196, 15, 0.6), 0 0 20px rgba(241, 196, 15, 0.4);
}
/* Styl dla "3" - Diamentowa/Neonowa odznaka */
.reward-badge.badge-3 {
    background: linear-gradient(135deg, #00d2d3 0%, #0066cc 100%);
    border: 2px solid #00ffff;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    box-shadow: 0 2px 15px rgba(0, 210, 211, 0.8), 0 0 25px rgba(0, 255, 255, 0.6);
}
.multi-bar-container { display: flex; gap: 2px; width: 100%; height: 6px; margin-top: 2px; }
.sub-bar { flex-grow: 1; background: #444; border-radius: 1px; overflow: hidden; position: relative; }
.sub-fill { height: 100%; width: 0%; transition: width 0.5s ease; }
.fill-steel { background: var(--key-steel); } .fill-gold { background: var(--key-gold); } .fill-diamond { background: var(--key-diamond); }
.key-row:hover::after { content: attr(data-tooltip); position: absolute; bottom: 100%; right: 0; background: #222; color: #fff; padding: 0.55cqw; border-radius: 0.35cqw; width: 15cqw; z-index: 200; border: 1px solid #999; pointer-events: none; white-space: pre-wrap; }

.star-wallet-container {
    position: absolute;
    bottom: 30%;
    left: 43%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: row;
    gap: 0px;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px 15px;
    border-radius: 20px;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.star-group {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.group-school {
    color: #2ecc71;
    text-shadow: 0 0 8px #2ecc71, 0 0 12px #2ecc71;
}

.group-parent {
    color: #f1c40f;
    text-shadow: 0 0 8px #f1c40f, 0 0 12px #f1c40f;
}

.group-student {
    color: #3498db;
    text-shadow: 0 0 8px #3498db, 0 0 12px #3498db;
}

.star-icon {
    height: 33px;
    width: auto;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.8));
    object-fit: contain;
}
.star-icon-large {
    height: 33px;
    width: auto;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.8));
    object-fit: contain;
}
.star-icon-super {
    height: 33px;
    width: auto;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.8));
    object-fit: contain;
}

.calibration-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #f1c40f;
    border-radius: 8px;
    padding: 15px;
    min-width: 280px;
    backdrop-filter: blur(4px);
}

.calibration-title {
    color: #f1c40f;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
}

.calibration-control {
    margin-bottom: 15px;
}

.calibration-control:last-child {
    margin-bottom: 0;
}

.calibration-control label {
    display: block;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-wrapper input[type="range"] {
    flex: 1;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #f1c40f;
    border-radius: 50%;
    cursor: pointer;
}

.slider-wrapper input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #f1c40f;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-value {
    color: #f1c40f;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 35px;
    text-align: right;
}

.name-plate-container { 
    position: fixed; 
    top: 15px; /* Taka sama wysokość jak przycisk wioski */
    left: 90px; /* Obok przycisku wioski (15px + 56px + gap) */
    z-index: 9999; /* Wyższy z-index żeby był na wierzchu */
    text-align: left;
    display: none; /* Ukryty domyślnie, pokazywany tylko na stronie game */
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px; /* Zmniejszony odstęp między elementami */
}

/* Pokaż HUD tylko na stronie game */
#page-game .name-plate-container {
    display: flex;
}
.name-plate { 
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0 20px;
    color: white;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}
.hero-name { font-size: 1rem; font-weight: bold; text-transform: uppercase; color: #ecf0f1; }
.hero-level { font-size: 0.8rem; color: #f1c40f; margin-top: 0px; font-weight: 800; }
.hero-goals-wrapper { 
    display: flex; 
    gap: 10px; 
    align-items: center;
    flex-shrink: 0;
}

.debug-box { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.8); color: #0f0; font-family: monospace; font-size: 0.7rem; padding: 5px; border: 1px solid #0f0; z-index: 1000; pointer-events: none; display:none;}

/* ZASŁONA "OBRÓĆ URZĄDZENIE" */
#rotate-device-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.rotate-msg {
    text-align: center;
    color: #fff;
    padding: 30px;
}

.rotate-msg h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--accent);
    text-transform: uppercase;
}

.rotate-msg p {
    font-size: 1.2rem;
    margin: 15px 0;
    color: #fff;
}

.rotate-icon {
    font-size: 4rem;
    margin: 30px 0;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

@keyframes goalPulse {
    0%, 100% {
        box-shadow: 0 0 10px gold, 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px #2ecc71, 0 0 40px rgba(46, 204, 113, 0.8);
    }
}

/* Kontener stosu pasków - pozycjonowany przy radarze (lewa strona stołu) */
.goal-bar-stack {
    position: absolute;
    top: 71%;
    left: 34%;
    z-index: 201;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    min-width: 250px;
    max-width: 250px;
    min-height: 120px; /* Stała wysokość dla 3 rzędów celów */
}

/* Kontener pojedynczego paska */
.goal-bar-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

/* Wiersz celu - zawiera slot przycisku i zawartość */
.goal-bar-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Slot na przycisk zakończenia - stała szerokość 40px */
.goal-bar-button-slot {
    width: 40px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wrapper dla zawartości paska (etykieta i segmenty) */
.goal-bar-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

/* Etykieta typu celu (tytuł) - mały, biały, z cieniem, wyrównany do lewej */
.goal-bar-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: left;
    margin-bottom: 2px;
}

/* Kontener dla przycisku "ODBIERZ MOC" - na środku ekranu (kolana postaci) */
.claim-runes-container {
    position: fixed;
    bottom: 42%;
    left: 35%;
    z-index: 300;
    display: none;
}

#page-game .claim-runes-container {
    display: block;
}

.btn-claim-runes-center {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: 3px solid #f1c40f;
    border-radius: 12px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 15px 30px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6), 0 0 30px rgba(241, 196, 15, 0.4);
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.btn-claim-runes-center:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.8), 0 0 40px rgba(241, 196, 15, 0.6);
    border-color: #f39c12;
}

.btn-claim-runes-center:active {
    transform: scale(1.05);
}

/* Przycisk tarczy prywatności - LEWY DOLNY RÓG */
.privacy-shield-btn {
    position: absolute;
    bottom: 15px;
    left: 15px;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    opacity: 0.5;
}

.privacy-shield-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.privacy-shield-btn.active {
    background: rgba(241, 196, 15, 0.3);
    border-color: rgba(241, 196, 15, 0.6);
    color: #f1c40f;
    opacity: 1;
}

/* Etykieta archetypu przy celach */
.goal-archetype-label {
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6); /* Stonowany kolor */
    margin-right: 8px;
}

/* Tryb prywatności - ukryj etykiety, paski pozostają widoczne */
.goal-bar-stack.privacy-on .goal-bar-label,
.goal-bar-stack.privacy-on .goal-bar-label .goal-archetype-label {
    opacity: 0;
}

/* Kontener segmentów */
.goal-bar-segments {
    display: flex;
    gap: 2px;
    width: 100%;
    height: 18px;
    align-items: center;
}

/* Pojedynczy segment */
.goal-segment {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
    min-width: 4px;
}

/* Wypełnione segmenty - neonowe kolory z efektem poświaty */
.goal-bar-container[data-goal-type="school"] .goal-segment.filled {
    background: #2ecc71;
    box-shadow: 0 0 10px #2ecc71, 0 0 20px rgba(46, 204, 113, 0.6);
}

.goal-bar-container[data-goal-type="parent"] .goal-segment.filled {
    background: #f1c40f;
    box-shadow: 0 0 10px #f1c40f, 0 0 20px rgba(241, 196, 15, 0.6);
}

.goal-bar-container[data-goal-type="student"] .goal-segment.filled {
    background: #00d2ff;
    box-shadow: 0 0 10px #00d2ff, 0 0 20px rgba(0, 210, 255, 0.6);
}

/* Licznik nadmiaru */
.goal-overflow-counter {
    margin-left: 5px;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.goal-bar-container[data-goal-type="school"] .goal-overflow-counter {
    color: #2ecc71;
}

.goal-bar-container[data-goal-type="parent"] .goal-overflow-counter {
    color: #f1c40f;
}

.goal-bar-container[data-goal-type="student"] .goal-overflow-counter {
    color: #00d2ff;
}

/* Przycisk zakończenia celu */
.btn-finish-goal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
    margin: 0 auto;
}

.btn-finish-goal:hover {
    background: rgba(241, 196, 15, 0.2);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.6);
    transform: scale(1.1);
}

.btn-finish-goal:active {
    transform: scale(0.95);
}


/* Responsywność */
@media (max-width: 768px) {
    .goal-bar-stack {
        min-width: 250px;
        max-width: 250px;
    }
    
    .goal-bar-segments {
        height: 15px;
    }
    
    .goal-bar-label {
        font-size: 0.7rem;
    }
}

/* RESPONSYWNOŚĆ DLA URZĄDZEŃ MOBILNYCH */
@media (max-width: 768px) {
    /* Kontenery ze sztywną szerokością */
    .login-box {
        width: 95% !important;
        margin: 10px auto;
        padding: 20px;
    }
    
    .journal-container {
        width: 95% !important;
        margin: 10px auto;
        max-width: none;
    }
    
    /* Zmniejszenie paddingów w oknach modalnych */
    .modal-box {
        padding: 15px !important;
    }
    
    /* Menu nawigacyjne - poziome przewijanie */
    .top-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .top-nav::-webkit-scrollbar {
        height: 4px;
    }
    
    .top-nav::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 2px;
    }
    
    /* WIDOK GRY - WYMUŚ ASPECT RATIO 16:9 */
    #page-game .game-screen {
        width: 177.78vh !important; /* Szerokość = wysokość * 16/9 */
        max-width: 100vw !important; /* Nie wychodź poza ekran */
        height: 100vh !important;
        aspect-ratio: 16 / 9 !important;
    }
    
    /* Panel kluczy - powiększenie i przesunięcie na dół */
    .keys-panel {
        font-size: 0.9rem !important;
        padding: 15px !important;
        bottom: 10px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 150 !important;
    }
    
    
    /* DZIENNIK I RAPORT - Przewijanie tabel */
    .summary-detailed-table,
    .report-template-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    .summary-detailed-table {
        min-width: 800px;
    }
    
    .report-template-table {
        min-width: 600px;
    }
    
    /* Wrapper dla tabel w kontenerach */
    .report-content,
    .journal-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Przyciski ocen - większy rozmiar na telefonie */
    .grade-btn-long {
        padding: 12px 15px !important;
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
        min-height: 44px !important;
    }
}

/* ============================================================================
   PANEL PRZEDMIOTÓW - Przyciski przedmiotowe (NEONOWE KOLORY)
   ============================================================================ */
.subjects-panel {
    position: absolute;
    left: 50%;
    bottom: 15px;
    max-width: 90%;
    gap: 6px;
    transform: translateX(-50%) scale(0.8);
    transform-origin: bottom center;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #f39c12;
    border-radius: 10px;
    padding: 15px;
    z-index: 9998;
    display: none; /* Domyślnie ukryty - pokazywany przez JS */
    /* Grid z 4 kolumnami (1 kolumna = 1 grupa kolorystyczna) */
    grid-template-columns: repeat(4, auto);
    justify-content: center;
    align-items: start;
}

.subject-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid;
    border-radius: 8px;
    padding: 12px 20px;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
}

/* KOLORY NEONOWE - zgodne z półkami z grafiki */
.subject-btn.color-purple { 
    border-color: #9b59b6; 
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5), 0 4px 8px rgba(0,0,0,0.3);
}
.subject-btn.color-red { 
    border-color: #e74c3c; 
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5), 0 4px 8px rgba(0,0,0,0.3);
}
.subject-btn.color-blue { 
    border-color: #3498db; 
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5), 0 4px 8px rgba(0,0,0,0.3);
}
.subject-btn.color-green { 
    border-color: #2ecc71; 
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 4px 8px rgba(0,0,0,0.3);
}

/* Efekt świecenia przy hover (wzmocniony neon) */
.subject-btn.color-purple:hover { 
    background: rgba(155, 89, 182, 0.2); 
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.8), 0 6px 12px rgba(0,0,0,0.5);
    text-shadow: 0 0 8px rgba(155, 89, 182, 0.8);
    transform: translateY(-3px);
}
.subject-btn.color-red:hover { 
    background: rgba(231, 76, 60, 0.2); 
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.8), 0 6px 12px rgba(0,0,0,0.5);
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
    transform: translateY(-3px);
}
.subject-btn.color-blue:hover { 
    background: rgba(52, 152, 219, 0.2); 
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.8), 0 6px 12px rgba(0,0,0,0.5);
    text-shadow: 0 0 8px rgba(52, 152, 219, 0.8);
    transform: translateY(-3px);
}
.subject-btn.color-green:hover { 
    background: rgba(46, 204, 113, 0.2); 
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.8), 0 6px 12px rgba(0,0,0,0.5);
    text-shadow: 0 0 8px rgba(46, 204, 113, 0.8);
    transform: translateY(-3px);
}

/* Kolumny dla grup kolorystycznych */
.subjects-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* OPTYMALIZACJA DLA WIDOKU POZIOMEGO NA TELEFONACH */
@media only screen and (orientation: landscape) and (max-width: 900px) {
    :root {
        --nav-height: 35px; /* Zmniejszona wysokość paska nawigacyjnego w landscape */
    }
    
    .top-nav {
        height: var(--nav-height) !important;
    }
    
    /* Komnata - WYMUŚ ASPECT RATIO 16:9 dla landscape */
    #page-game .game-screen {
        width: 177.78vh !important; /* Szerokość = wysokość * 16/9 */
        max-width: 100vw !important; /* Nie wychodź poza ekran */
        height: 100vh !important;
        aspect-ratio: 16 / 9 !important; /* CSS aspect ratio */
    }
    
    /* Skalowanie tabeli kluczy - wzór jak radar */
    .keys-panel {
        transform: scale(0.5);
        transform-origin: bottom right;
        padding: 5px !important;
        gap: 3px !important;
    }
    
    .keys-panel .key-row {
        padding: 2px 3px !important;
        gap: 2px !important;
    }
    
    /* Elementy na dole - domyślne pozycje (nie nadpisuj!) */
}

/* STARY SYSTEM - WYŁĄCZONY, ZASTĄPIONY PRZEZ JAVASCRIPT
   Komentarz: Ta stara media query blokowała logowanie PRZED pokazaniem ekranu orientacji.
   Nowy system w JavaScript pokazuje komunikat PO zalogowaniu.
   
@media (orientation: portrait) and (max-width: 900px) {
    #rotate-device-overlay {
        display: flex !important;
    }
    
    #app-container,
    .top-nav,
    #login-screen,
    #start-overlay,
    #custom-modal,
    #confirm-modal {
        display: none !important;
    }
}
*/

/* RESPONSIVE - Mobile adjustments for sidebar and HUD */
@media (max-width: 768px) {
    .sidebar-btn {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .game-sidebar {
        gap: 10px;
        top: 10px;
        left: 10px;
    }
    
    .name-plate-container {
        top: 10px;
        left: 75px; /* Obok mniejszego przycisku wioski (10px + 48px + gap) */
        gap: 6px; /* Zmniejszony odstęp dla mobilnych */
    }
    
    .hud-controls {
        flex-wrap: wrap;
        gap: 6px; /* Zmniejszony odstęp dla mobilnych */
    }
    
    .hud-btn,
    .hud-select,
    .name-plate {
        height: 38px;
        font-size: 0.85rem;
        padding: 0 15px;
    }
    
    .hud-select {
        padding-right: 35px;
    }
    
    .btn-claim-runes-center {
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .start-title {
        font-size: 2rem;
    }
    
    .start-subtitle {
        font-size: 1rem;
    }
    
    .btn-enter-throne {
        font-size: 1rem;
        padding: 15px 30px;
    }
}

/* ============================================================================
   PRZYCISK WYJŚCIE Z FULLSCREEN W WIOSCE
   ============================================================================ */

.btn-exit-village {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    padding: 12px 24px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 3px solid #fff;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-exit-village:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.btn-exit-village:active {
    transform: translateY(0px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   LESSON MODALS - Style dla modali dodawania elementów do zajęć
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}