/* ============================================
   FREGATA MIECZNIK: OBRONA BAŁTYKU
   Style CSS - Motyw militarno-morski
   ============================================ */

/* Reset i podstawy */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Kolory morskie i militarne */
    --ocean-deep: #0a1628;
    --ocean-medium: #1a3a5c;
    --ocean-light: #2d5a87;
    --sky-horizon: #4a7ba7;
    --steel-dark: #2c3e50;
    --steel-light: #5d7d99;
    --gold-accent: #d4af37;
    --gold-light: #f4d03f;
    --danger-red: #c0392b;
    --danger-light: #e74c3c;
    --success-green: #27ae60;
    --success-light: #2ecc71;
    --white: #ecf0f1;
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    
    /* Czcionki */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    
    /* Rozmiary */
    --border-radius: 8px;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: var(--ocean-deep);
    color: var(--text-primary);
}

/* Ekrany */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--ocean-deep) 0%, var(--ocean-medium) 50%, var(--ocean-light) 100%);
}

/* Tło z fregatą dla ekranów menu */
#login-screen,
#main-menu,
#level-select,
#codes-screen,
#leaderboard-screen,
#settings-screen,
#ending-screen {
    background: 
        linear-gradient(
            135deg,
            rgba(10, 22, 40, 0.85) 0%,
            rgba(26, 58, 92, 0.7) 50%,
            rgba(10, 22, 40, 0.9) 100%
        ),
        url('../../assets/fragata_miecznik_tło.png') center center / cover no-repeat;
}

.screen.hidden {
    display: none;
}

.screen.overlay {
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(5px);
    z-index: 100;
}

/* Logo gry */
.game-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.game-logo h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold-accent);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5), 0 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.game-logo h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Przyciski */
.btn {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--gold-accent), var(--gold-light));
    color: var(--ocean-deep);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
    background: var(--steel-dark);
    color: var(--text-primary);
    border: 2px solid var(--steel-light);
}

.btn-secondary:hover {
    background: var(--steel-light);
    border-color: var(--gold-accent);
}

.btn-menu {
    width: 100%;
    background: linear-gradient(135deg, var(--ocean-medium), var(--ocean-light));
    color: var(--text-primary);
    border: 2px solid var(--steel-light);
    margin-bottom: 0.8rem;
}

.btn-menu:hover {
    border-color: var(--gold-accent);
    background: linear-gradient(135deg, var(--ocean-light), var(--sky-horizon));
}

/* ============================================
   EKRAN WYBORU NAZWY GRACZA
   ============================================ */
.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-box {
    background: rgba(26, 58, 92, 0.8);
    border: 2px solid var(--steel-light);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.player-name-form h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--gold-accent);
    text-align: center;
    margin-bottom: 0.5rem;
}

.form-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.saved-player {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--steel-dark);
}

.saved-player-info {
    text-align: center;
}

.saved-player-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.saved-player-info strong {
    color: var(--gold-accent);
}

.btn-continue-saved {
    margin-top: 0.5rem;
    width: 100%;
}

/* Link powrotu na stronę główną */
.back-to-site {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(26, 58, 92, 0.8);
    border: 1px solid var(--steel-light);
    border-radius: 20px;
    transition: all var(--transition-fast);
}

.back-to-site:hover {
    color: var(--gold-accent);
    border-color: var(--gold-accent);
    background: rgba(26, 58, 92, 0.95);
}

/* Ukryj link powrotu podczas gry */
#game-screen:not(.hidden) ~ .back-to-site,
.screen:not(.hidden):not(#login-screen):not(#main-menu) ~ .back-to-site {
    /* Widoczny tylko na ekranach logowania i menu */
}

#game-screen.hidden ~ #back-btn {
    display: block;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background: var(--ocean-deep);
    border: 2px solid var(--steel-dark);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.error-message {
    color: var(--danger-light);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

#play-guest {
    width: 100%;
    margin-top: 1rem;
}

/* ============================================
   MENU GŁÓWNE
   ============================================ */
.menu-container {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.welcome-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.welcome-message span {
    color: var(--gold-accent);
    font-weight: 700;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
}

.active-codes {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(39, 174, 96, 0.2);
    border: 1px solid var(--success-green);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
}

.active-codes:empty {
    display: none;
}

/* ============================================
   WYBÓR POZIOMU
   ============================================ */
.level-select-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    text-align: center;
}

.level-select-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold-accent);
    margin-bottom: 2rem;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.level-card {
    background: rgba(26, 58, 92, 0.8);
    border: 2px solid var(--steel-dark);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.level-card:hover:not(.locked) {
    border-color: var(--gold-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

.level-card .level-num {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--gold-accent);
}

.level-card .level-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0.3rem 0;
    line-height: 1.2;
}

.level-card .level-stars {
    color: var(--gold-light);
    font-size: 0.9rem;
}

.level-card .level-difficulty {
    font-size: 0.7rem;
    margin-top: 0.3rem;
}

/* ============================================
   EKRAN KODÓW
   ============================================ */
.codes-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
}

.codes-container h2 {
    font-family: var(--font-display);
    color: var(--gold-accent);
    margin-bottom: 2rem;
}

.code-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.code-input-group input {
    flex: 1;
    padding: 0.8rem;
    background: var(--ocean-deep);
    border: 2px solid var(--steel-dark);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.code-input-group input:focus {
    outline: none;
    border-color: var(--gold-accent);
}

.code-message {
    min-height: 1.5rem;
    margin-bottom: 1rem;
}

.code-message.success {
    color: var(--success-light);
}

.code-message.error {
    color: var(--danger-light);
}

.active-codes-list {
    background: rgba(26, 58, 92, 0.6);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.active-codes-list h3 {
    font-size: 1rem;
    color: var(--gold-accent);
    margin-bottom: 0.5rem;
}

.active-codes-list ul {
    list-style: none;
}

.active-codes-list li {
    padding: 0.3rem 0;
    color: var(--success-light);
}

.active-codes-list li::before {
    content: '✓ ';
}

/* ============================================
   EKRAN USTAWIEŃ
   ============================================ */
.settings-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

.settings-container h2 {
    font-family: var(--font-display);
    color: var(--gold-accent);
    margin-bottom: 2rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(26, 58, 92, 0.6);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.toggle {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--steel-dark);
    border-radius: 30px;
    transition: all var(--transition-fast);
}

.toggle .slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle input:checked + .slider {
    background: var(--success-green);
}

.toggle input:checked + .slider::before {
    transform: translateX(30px);
}

/* ============================================
   LEADERBOARD (Tabela najlepszych wyników)
   ============================================ */
.leaderboard-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    text-align: center;
}

.leaderboard-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold-accent);
    margin-bottom: 1.5rem;
}

.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.leaderboard-tab {
    padding: 0.5rem 1rem;
    background: var(--steel-dark);
    border: 2px solid var(--steel-medium);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.leaderboard-tab:hover {
    background: var(--steel-medium);
    color: var(--text-primary);
}

.leaderboard-tab.active {
    background: var(--gold-accent);
    border-color: var(--gold-accent);
    color: var(--navy-dark);
    font-weight: 700;
}

.leaderboard-table-wrapper {
    background: rgba(26, 58, 92, 0.8);
    border: 2px solid var(--steel-medium);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.8rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--steel-dark);
}

.leaderboard-table th {
    background: var(--steel-dark);
    color: var(--gold-accent);
    font-family: var(--font-display);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.leaderboard-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

.leaderboard-table tbody tr:nth-child(1) td:first-child {
    color: #ffd700;
    font-weight: 700;
    font-size: 1.2rem;
}

.leaderboard-table tbody tr:nth-child(2) td:first-child {
    color: #c0c0c0;
    font-weight: 700;
    font-size: 1.1rem;
}

.leaderboard-table tbody tr:nth-child(3) td:first-child {
    color: #cd7f32;
    font-weight: 700;
    font-size: 1.05rem;
}

.leaderboard-table .player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-table .score {
    color: var(--gold-accent);
    font-family: var(--font-display);
    font-weight: 700;
}

.leaderboard-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.no-scores {
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   TUTORIAL
   ============================================ */
.tutorial-container {
    width: 100%;
    max-width: 700px;
    padding: 2rem;
    text-align: center;
}

.tutorial-content {
    background: rgba(26, 58, 92, 0.9);
    border: 2px solid var(--gold-accent);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
}

.tutorial-content h3 {
    font-family: var(--font-display);
    color: var(--gold-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tutorial-content p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-content .keys {
    display: inline-flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.tutorial-content .key {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--steel-dark);
    border: 2px solid var(--steel-light);
    border-radius: 6px;
    font-family: var(--font-display);
    font-weight: 700;
}

.tutorial-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tutorial-progress {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.tutorial-progress .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--steel-dark);
}

.tutorial-progress .dot.active {
    background: var(--gold-accent);
}

/* ============================================
   EKRAN GRY
   ============================================ */
#game-screen {
    background: none;
    cursor: none;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Celownik */
#crosshair {
    position: fixed;
    font-size: 24px;
    color: var(--danger-light);
    text-shadow: 0 0 10px var(--danger-red);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 50;
    font-family: var(--font-display);
    font-weight: 700;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    pointer-events: none;
    z-index: 40;
}

#hud > * {
    pointer-events: auto;
}

.hud-left {
    position: absolute;
    top: 15px;
    left: 20px;
}

.hp-bar {
    width: 200px;
    height: 24px;
    background: var(--steel-dark);
    border: 2px solid var(--steel-light);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger-red), var(--success-green));
    width: 100%;
    transition: width 0.3s ease;
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.ammo-display {
    display: flex;
    gap: 1rem;
    margin-top: 10px;
}

.ammo-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(26, 58, 92, 0.8);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--steel-light);
}

.ammo-icon {
    font-size: 1.2rem;
}

.ammo-count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-accent);
}

.hud-right {
    position: absolute;
    top: 15px;
    right: 20px;
    text-align: right;
}

.level-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.level-number {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--gold-accent);
}

.level-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.score-display {
    margin-top: 10px;
    background: rgba(26, 58, 92, 0.8);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--steel-light);
    font-family: var(--font-display);
}

#score-value {
    color: var(--gold-accent);
    font-weight: 700;
    margin-left: 5px;
}

.hud-controls {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.hud-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 58, 92, 0.8);
    border: 2px solid var(--steel-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hud-btn:hover {
    border-color: var(--gold-accent);
    transform: scale(1.1);
}

.hud-btn.muted {
    opacity: 0.5;
}

/* Mini-mapa */
.minimap {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 22, 40, 0.9);
    border: 2px solid var(--steel-light);
    border-radius: 8px;
    overflow: hidden;
}

#minimap-canvas {
    display: block;
}

/* ============================================
   EKRANY KOŃCOWE (WYGRANA/PRZEGRANA)
   ============================================ */
.victory-container,
.defeat-container,
.pause-container {
    text-align: center;
    background: rgba(26, 58, 92, 0.95);
    border: 3px solid var(--gold-accent);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.victory-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--gold-accent);
    margin-bottom: 1.5rem;
}

.defeat-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--danger-light);
    margin-bottom: 1rem;
}

.pause-container h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.victory-stats,
.defeat-stats {
    margin-bottom: 1.5rem;
}

.stars {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.stat-item span:last-child {
    font-family: var(--font-display);
    color: var(--gold-accent);
    font-weight: 700;
}

.ranking-position {
    margin-top: 1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border: 2px solid var(--gold-accent);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold-accent);
    text-align: center;
}

.defeat-reason {
    font-size: 1.1rem;
    color: var(--danger-light);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(192, 57, 43, 0.2);
    border-radius: 8px;
}

.victory-buttons,
.defeat-buttons,
.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* ============================================
   EKRAN KOŃCOWY
   ============================================ */
.ending-container {
    text-align: center;
    padding: 3rem;
    max-width: 600px;
}

.ending-container h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--gold-accent);
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.ending-container h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.ending-message {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.credits {
    background: rgba(26, 58, 92, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.credits h3 {
    color: var(--gold-accent);
    margin-bottom: 0.5rem;
}

.final-stats {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.final-stats span {
    color: var(--gold-accent);
    font-weight: 700;
}

/* ============================================
   EKRAN ŁADOWANIA
   ============================================ */
#loading-screen {
    z-index: 1000;
}

.loading-container {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--steel-dark);
    border-top-color: var(--gold-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSYWNOŚĆ
   ============================================ */
@media (max-width: 1024px) {
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-logo h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-logo h1 {
        font-size: 1.5rem;
    }
    
    .game-logo h2 {
        font-size: 0.9rem;
    }
    
    .hp-bar {
        width: 150px;
    }
    
    .minimap {
        width: 120px;
        height: 80px;
    }
    
    #minimap-canvas {
        width: 120px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .level-card {
        padding: 0.7rem;
    }
    
    .level-card .level-num {
        font-size: 1.4rem;
    }
    
    .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   ANIMACJE DODATKOWE
   ============================================ */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.shake {
    animation: shake 0.3s ease;
}

.pulse {
    animation: pulse 1s ease infinite;
}

/* Efekt trafienia */
.hit-flash {
    animation: hitFlash 0.2s ease;
}

@keyframes hitFlash {
    0%, 100% {
        filter: none;
    }
    50% {
        filter: brightness(2) sepia(1) saturate(5) hue-rotate(-30deg);
    }
}
