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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #fff;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* 🔒 STICKY HEADER - zawsze widoczny na górze */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1a1a;
    border-bottom: 2px solid #333;
}

/* 📱 SCROLLABLE CONTENT - przewijana część */
.scrollable-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Sekcje w scrollable content */
.scrollable-content > div {
    border-bottom: 1px solid #333;
}

.scrollable-content > div:last-child {
    border-bottom: none;
}

/* 1. Timer Section - Countdown Timer/zegary odliczania czasu */
.timer-section {
    padding: 20px;
}

.timer-section.hidden {
    display: none;
}

/* 2. Message Section - Messaging/wiadomości */
.message-section {
    padding: 20px;
    min-height: 100px;
}

.message-section.hidden {
    display: none;
}

/* 3. Slide Preview Section */
.slide-preview-section {
    padding: 20px;
}

.slide-preview-section.hidden {
    display: none;
}

/* 4. Presenter Notes Section */
.presenter-notes-section {
    padding: 20px;
}

.presenter-notes-section.hidden {
    display: none;
}

/* 5. Laser Section */
.laser-section {
    padding: 20px;
    text-align: center;
}

.laser-section.hidden {
    display: none;
}

/* 6. Blank Section */
.blank-section {
    padding: 20px;
    text-align: center;
}

.blank-section.hidden {
    display: none;
}

/* Connect Screen */
#connect-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

.logo h1 {
    font-size: 48px;
    font-weight: 700;
    color: #00a8ff;
    margin-bottom: 10px;
}

.logo p {
    font-size: 18px;
    color: #888;
}

.connect-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

#session-code {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 5px;
}

#session-code:focus {
    outline: none;
    border-color: #00a8ff;
}

.primary-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 20px;
    font-weight: 600;
    background: #00a8ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn:hover {
    background: #0090e0;
}

.primary-btn:active {
    transform: scale(0.98);
}

.error-message {
    color: #ff4444;
    margin-top: 20px;
    text-align: center;
}

/* Control Screen */
#control-screen {
    background: #000;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #1a1a1a;
    position: relative;
    z-index: 10;
}

/* Kompaktowy header - wszystko w jednej linii */
.header.compact-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 10px 12px;
}

.compact-header .slide-info {
    background: transparent;
    padding: 0;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    padding: 10px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    color: #888;
    display: flex !important;
    align-items: center;
    justify-content: center;
    /* Optymalizacja dla GPU na urządzeniach mobilnych */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.icon-btn:hover {
    color: #fff;
    border-color: #666;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.label {
    color: #888;
    font-size: 14px;
}

.code {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 2px;
}

.secondary-btn {
    padding: 8px 20px;
    font-size: 14px;
    background: transparent;
    color: #888;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    color: #fff;
    border-color: #666;
}

.main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5vw;
    padding: 10px 20px;
    margin-top: 5px;
}

.control-btn {
    width: min(45vw, 300px);
    height: min(45vw, 300px);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    font-size: clamp(20px, 5vw, 28px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.control-btn.prev {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.control-btn.next {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
}

.control-btn:active {
    transform: scale(0.95);
}

/* Ikony strzałek z CSS trójkątami */
.control-btn .arrow-icon {
    width: 0;
    height: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Trójkąt wskazujący w lewo (dla przycisku "Wstecz") */
.control-btn.prev .arrow-icon {
    border-right: clamp(35px, 8vw, 60px) solid white;
    border-top: clamp(20px, 5vw, 35px) solid transparent;
    border-bottom: clamp(20px, 5vw, 35px) solid transparent;
}

/* Trójkąt wskazujący w prawo (dla przycisku "Dalej") */
.control-btn.next .arrow-icon {
    border-left: clamp(35px, 8vw, 60px) solid white;
    border-top: clamp(20px, 5vw, 35px) solid transparent;
    border-bottom: clamp(20px, 5vw, 35px) solid transparent;
}

/* Gdy przyciski funkcji są ukryte, zwiększ przyciski nawigacji */
.controls.expanded .control-btn {
    width: min(48vw, 320px);
    height: min(48vw, 320px);
}

/* Większe trójkąty w trybie rozszerzonym */
.controls.expanded .control-btn.prev .arrow-icon {
    border-right: clamp(45px, 10vw, 75px) solid white;
    border-top: clamp(25px, 6vw, 45px) solid transparent;
    border-bottom: clamp(25px, 6vw, 45px) solid transparent;
}

.controls.expanded .control-btn.next .arrow-icon {
    border-left: clamp(45px, 10vw, 75px) solid white;
    border-top: clamp(25px, 6vw, 45px) solid transparent;
    border-bottom: clamp(25px, 6vw, 45px) solid transparent;
}

/* DUŻE PRZYCISKI NAWIGACJI gdy brak funkcji - KOMPATYBILNE Z FIREFOX */
.main-controls.fullscreen-navigation {
    position: fixed;
    top: 120px;                
    left: 0;
    width: 100vw;
    height: calc(100vh - 120px);
    min-height: 400px;         /* Fallback dla Firefox */
    z-index: 1000;
    background: transparent;
    display: flex;
    flex-direction: row;       
    padding: 0;
    margin: 0;
    gap: 0;
    
    /* Subtelna optymalizacja Safari - bez radykalnych zmian */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* CAŁKOWICIE UKRYJ PRZYCISKI gdy aktywny jest connect-screen */
#app:has(#connect-screen.active) .main-controls {
    display: none !important;
}

/* Backup selector - gdy connect-screen jest aktywny */
.screen#connect-screen.active ~ .screen#control-screen .main-controls {
    display: none !important;
}

/* UKRYJ SCROLLABLE CONTENT gdy duże przyciski są aktywne */
body:has(.main-controls.fullscreen-navigation) .scrollable-content {
    display: none !important;
}

.main-controls.fullscreen-navigation .control-btn {
    width: 50%;             /* POŁOWA SZEROKOŚCI */
    height: 100%;           /* CAŁA WYSOKOŚĆ */
    border-radius: 0;       
    margin: 0;
    font-size: clamp(28px, 8vw, 48px);  
    box-shadow: none;       
    border: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* LEWA POŁOWA - WSTECZ */
.main-controls.fullscreen-navigation .control-btn.prev {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-right: 2px solid rgba(255, 255, 255, 0.3);
}

/* PRAWA POŁOWA - DALEJ */
.main-controls.fullscreen-navigation .control-btn.next {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

/* DUŻE STRZAŁKI */
.main-controls.fullscreen-navigation .control-btn.prev .arrow-icon {
    border-right: clamp(60px, 15vw, 100px) solid white;
    border-top: clamp(40px, 10vw, 70px) solid transparent;
    border-bottom: clamp(40px, 10vw, 70px) solid transparent;
}

.main-controls.fullscreen-navigation .control-btn.next .arrow-icon {
    border-left: clamp(60px, 15vw, 100px) solid white;
    border-top: clamp(40px, 10vw, 70px) solid transparent;
    border-bottom: clamp(40px, 10vw, 70px) solid transparent;
}

/* Efekt naciśnięcia */
.main-controls.fullscreen-navigation .control-btn:active {
    opacity: 0.8;
}

/* OPTYMALIZACJE DLA iOS - ograniczenie animacji powodujących trzęsienie */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Podstawowe optymalizacje bez radykalnych zmian */
* {
    -webkit-tap-highlight-color: transparent;
}

.control-btn span {
    font-size: inherit;
    font-weight: 600;
}

.slide-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 5px 20px;
    background: #1a1a1a;
    border-bottom: 2px solid #333;
    margin-top: 5px;
}

.slide-info .label {
    font-size: clamp(14px, 3vw, 18px);
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slide-info .number {
    font-size: clamp(42px, 10vw, 64px);
    font-weight: 700;
    color: #00a8ff;
    text-shadow: 0 2px 10px rgba(0, 168, 255, 0.3);
}

/* Function Controls */
.function-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #1a1a1a;
}

/* Presentation Info Section */
.presentation-info {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    background: #1a1a1a;
    border-top: 2px solid #333;
}

.presentation-info.show-notes {
    display: grid;
    grid-template-columns: 1fr;
}

.presentation-info.show-preview {
    display: grid;
    grid-template-columns: 1fr;
}

.presentation-info.show-both {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .presentation-info.show-both {
        grid-template-columns: 1fr;
    }
}

.presenter-notes {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    display: block; /* ZMIANA - zawsze pokazuj notatki */
}

.slide-preview {
    background: #222;
    border-radius: 12px;
    padding: 20px;
    display: block; /* ZMIANA - zawsze pokazuj */
}

.presentation-info.show-notes .presenter-notes {
    display: block;
}

.presentation-info.show-preview .slide-preview {
    display: block;
}

.presentation-info.show-both .presenter-notes,
.presentation-info.show-both .slide-preview {
    display: block;
}

.presenter-notes h4,
.slide-preview h4 {
    margin: 0 0 15px 0;
    color: #00a8ff;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notes-content {
    color: #ccc;
    font-size: 16px;
    line-height: 1.6;
}

.notes-placeholder {
    color: #666;
    font-style: italic;
}

.preview-three {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 15px;
    align-items: center;
}

.slide-thumbnail {
    aspect-ratio: 16/9;
    background: #333;
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    cursor: default;
}

.slide-thumbnail.prev,
.slide-thumbnail.next {
    opacity: 0.6;
    transform: scale(0.9);
}

.slide-thumbnail.current {
    border-color: #00a8ff;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.4);
    transform: scale(1);
}

.slide-thumbnail .slide-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.slide-thumbnail.current .slide-label {
    color: #00a8ff;
}

.slide-thumbnail .slide-number {
    font-size: 24px;
    font-weight: bold;
    color: #888;
}

.slide-thumbnail.current .slide-number {
    color: #00a8ff;
    font-size: 32px;
}

@media (max-width: 768px) {
    .preview-three {
        grid-template-columns: 1fr 2fr 1fr;
    }
    
    .slide-thumbnail .slide-label {
        font-size: 10px;
    }
    
    .slide-thumbnail .slide-number {
        font-size: 20px;
    }
    
    .slide-thumbnail.current .slide-number {
        font-size: 28px;
    }
}

.function-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 12px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.function-btn:hover {
    background: #333;
    color: #fff;
    border-color: #666;
}

.function-btn.active {
    background: #00a8ff;
    color: #fff;
    border-color: #00a8ff;
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.4);
}

.function-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.function-btn span {
    font-size: 14px;
    font-weight: 500;
}

.extra-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #1a1a1a;
}

.extra-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    background: transparent;
    border: 1px solid #333;
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
}

.extra-btn:hover {
    color: #fff;
    border-color: #555;
}

.extra-btn.active {
    color: #00a8ff;
    border-color: #00a8ff;
}

.extra-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.extra-btn span {
    font-size: 12px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}


/* Safari/iOS specjalny fix */
@supports (-webkit-touch-callout: none) {
    .header-actions {
        position: relative !important;
        z-index: 999 !important;
        background: #1a1a1a !important;
        padding: 5px !important;
        border-radius: 8px !important;
    }
    
    .icon-btn {
        min-width: 40px !important;
        min-height: 40px !important;
        background: #333 !important;
        border: 2px solid #555 !important;
    }
    
}


.status-dot.timer-warning {
    background: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.status-dot.timer-danger {
    background: #ff0000;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.status-dot.timer-overtime {
    background: #ff0000;
    animation: blink 0.5s infinite alternate;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
}

@keyframes blink {
    0% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Kropka przy timerze */
.timer-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    display: inline-block;
    margin: 0 8px;
    transition: all 0.3s;
}

.timer-status-dot.timer-ok {
    background: #00ff00;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.timer-status-dot.timer-warning {
    background: #ffaa00;
    box-shadow: 0 0 6px rgba(255, 170, 0, 0.6);
}

.timer-status-dot.timer-danger {
    background: #ff0000;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.6);
}

.timer-status-dot.timer-overtime {
    background: #ff0000;
    animation: blink 0.5s infinite alternate;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.9);
}

.timer {
    font-size: 18px;
    font-weight: 600;
    color: #888;
}

/* Timer Bar */
.timer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-wrap: wrap;
    gap: 10px;
}

.timer-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-family: monospace;
    font-size: clamp(12px, 3vw, 16px);
    min-width: 80px;
}

.timer-btn:hover {
    background: #333;
    border-color: #00a8ff;
}

.timer-btn.active {
    background: #00a8ff;
    border-color: #00a8ff;
}

.timer-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.settings-panel.active {
    display: flex;
}

.settings-content {
    background: #1a1a1a;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
}

.settings-header h3 {
    margin: 0;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #333;
    color: #fff;
}

.settings-section {
    padding: 20px;
    border-bottom: 1px solid #333;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    color: #00a8ff;
    font-size: 16px;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.slider {
    width: 50px;
    height: 24px;
    background: #333;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #666;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

.toggle input:checked + .slider {
    background: #00a8ff;
}

.toggle input:checked + .slider::before {
    background: #fff;
    transform: translateX(26px);
}

.toggle .label {
    color: #fff;
    font-size: 14px;
}

.timer-setup {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.timer-setup input {
    width: 80px;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    text-align: center;
}

.timer-setup input:focus {
    outline: none;
    border-color: #00a8ff;
}

.set-btn, .reset-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.set-btn {
    background: #00a8ff;
    color: #fff;
}

.set-btn:hover {
    background: #0090e0;
}

.reset-btn {
    background: #444;
    color: #fff;
}

.reset-btn:hover {
    background: #555;
}

/* Responsywność mobilna */
@media (max-width: 768px) {
    .header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Kompaktowy header na mobile */
    .header.compact-header {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 8px;
    }
    
    .compact-header .session-info .label,
    .compact-header .slide-info .label {
        display: none; /* Ukryj etykiety na małych ekranach */
    }
    
    .compact-header .secondary-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .timer-controls {
        gap: 8px;
    }
    
    .timer-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .settings-content {
        width: 95%;
        margin: 10px;
    }
    
    .settings-section {
        padding: 15px;
    }
    
    .timer-setup {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .timer-setup input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .timer-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .timer-controls {
        justify-content: center;
    }
    
}
/* Dashboard lasera - zreorganizowany */
.laser-dashboard {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(25, 25, 35, 0.95) 100%);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

.laser-dashboard.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Kontener dla touchpada z zachowaniem proporcji */
.laser-container {
    position: relative;
    width: 95vw;
    max-width: 800px;
    height: 90vh;
    max-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Touchpad lasera - responsywny z proporcjami prezentacji */
.laser-touchpad {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 450px;
    /* Proporcje 16:9 dla prezentacji */
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-image:
        radial-gradient(circle at center, rgba(0, 200, 255, 0.05) 0%, transparent 50%),
        linear-gradient(rgba(0, 168, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 168, 255, 0.05) 1px, transparent 1px);
    background-size: 100% 100%, 5% 5%, 5% 5%;
    border: 3px solid transparent;
    background-clip: padding-box;
    border-image: linear-gradient(45deg, #00a8ff, #00ff88, #00a8ff) 1;
    border-radius: 25px;
    box-shadow:
        0 0 40px rgba(0, 168, 255, 0.3),
        inset 0 0 20px rgba(0, 168, 255, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efekt hover i active dla touchpada */
.laser-touchpad:hover {
    box-shadow:
        0 0 50px rgba(0, 168, 255, 0.4),
        inset 0 0 30px rgba(0, 168, 255, 0.15),
        0 15px 50px rgba(0, 0, 0, 0.6);
}

.laser-touchpad.active {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f172a 100%);
    box-shadow:
        0 0 60px rgba(0, 255, 136, 0.4),
        inset 0 0 40px rgba(0, 255, 136, 0.2),
        0 15px 50px rgba(0, 0, 0, 0.7);
}

/* Wsparcie dla aspect-ratio */
@supports (aspect-ratio: 16 / 9) {
    .laser-touchpad {
        height: auto;
    }
}

/* Dla urządzeń bez wsparcia aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .laser-touchpad {
        height: 56.25vw;
        max-height: 450px;
    }
}

/* Krzyżyk lasera - ulepszona widoczność */
.laser-crosshair {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
}

.laser-crosshair::before,
.laser-crosshair::after {
    content: "";
    position: absolute;
    background: linear-gradient(90deg, transparent 0%, #ff0000 45%, #ff0000 55%, transparent 100%);
    box-shadow:
        0 0 15px #ff0000,
        0 0 30px rgba(255, 0, 0, 0.5);
}

.laser-crosshair::before {
    width: 3px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.laser-crosshair::after {
    width: 100%;
    height: 3px;
    top: 50%;
    transform: translateY(-50%);
}

/* Centralny punkt lasera */
.laser-crosshair::after {
    box-shadow:
        0 0 20px #ff0000,
        0 0 40px rgba(255, 0, 0, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.laser-touchpad.active .laser-crosshair {
    opacity: 1;
    animation: laserPulse 2s infinite;
}

@keyframes laserPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 0, 0, 1));
    }
}

/* Przycisk wyjścia z lasera - elegancki design */
.laser-exit-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.laser-exit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.laser-exit-btn:active {
    transform: scale(0.95);
}

.laser-exit-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Wskazówka dla użytkownika */
.laser-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.laser-dashboard.active .laser-hint {
    opacity: 1;
    animation: fadeInOut 4s ease;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Media queries dla różnych rozmiarów ekranów - touchpad lasera */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Tablety */
    .laser-container {
        max-width: 700px;
        max-height: 500px;
    }

    .laser-touchpad {
        max-width: 700px;
        max-height: 394px;
    }

    .laser-exit-btn {
        width: 55px;
        height: 55px;
    }
}

@media (min-width: 1025px) {
    /* Desktopy */
    .laser-container {
        max-width: 900px;
        max-height: 600px;
    }

    .laser-touchpad {
        max-width: 900px;
        max-height: 506px;
    }

    .laser-exit-btn {
        width: 60px;
        height: 60px;
        top: 30px;
        right: 30px;
    }
}

/* Obsługa orientacji poziomej na mobilnych */
@media (max-width: 767px) and (orientation: landscape) {
    .laser-container {
        max-height: 85vh;
    }

    .laser-touchpad {
        max-height: 80vh;
    }

    .laser-exit-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
}





/* Custom Messaging Section - teraz część scrollable content */

.message-display {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px 20px;
    display: none;
}

.message-display:not(:empty) {
    display: block;
}

.message-item {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease;
}

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

.message-item.moderator {
    background: #00a8ff;
    color: #fff;
    font-weight: 500;
}

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.message-item .message-from {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
}

.message-item.moderator .message-from {
    color: #fff;
    opacity: 0.8;
}

.message-item .message-time {
    font-size: 11px;
    color: #666;
}

.message-item.moderator .message-time {
    color: #fff;
    opacity: 0.6;
}

.message-item .message-text {
    font-size: 14px;
    line-height: 1.4;
}

.message-input-area {
    display: flex;
    padding: 10px 20px;
    gap: 10px;
    background: #222;
}

.message-input-area.hidden {
    display: none;
}

.message-input {
    flex: 1;
    padding: 10px 15px;
    background: #333;
    border: 1px solid #444;
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
}

.message-input:focus {
    outline: none;
    border-color: #00a8ff;
}

.send-message-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00a8ff;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.send-message-btn:hover {
    background: #0090e0;
    transform: scale(1.1);
}

.send-message-btn:active {
    transform: scale(0.95);
}

.send-message-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Powiadomienie o nowej wiadomości */
.new-message-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #00a8ff;
    color: #fff;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.4);
    animation: bounce 0.5s ease;
    z-index: 1000;
}

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

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border-top: 1px solid #333;
    padding: 8px 20px;
    z-index: 100;
}

.company-info {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.company-info strong {
    color: #888;
    font-weight: 600;
}

.company-info .separator {
    margin: 0 10px;
    color: #444;
}

/* Adjust control screen for footer */
#control-screen {
    padding-bottom: 50px;
}

/* Responsywność dla control-screen - nowa struktura */
#control-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* Language selector styles */
.language-selector {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector label {
    color: #888;
    font-size: 14px;
}

.language-select {
    flex: 1;
    padding: 8px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.language-select:focus {
    outline: none;
    border-color: #00a8ff;
}

.language-select option {
    background: #333;
    color: #fff;
}

/* ========== RESPONSYWNOŚĆ ========== */

/* Duże ekrany (Desktop) */
@media screen and (min-width: 1200px) {
    .logo h1 {
        font-size: 64px;
    }
    
    .logo p {
        font-size: 24px;
    }
    
    .connect-form {
        max-width: 400px;
    }
    
    .main-controls {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .control-btn {
        font-size: 24px;
        padding: 20px 40px;
    }
    
    .function-controls {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .presentation-info {
        max-width: 1000px;
        margin: 0 auto;
        padding: 0 20px;
    }
}

/* Średnie ekrany (Tablety poziomo) */
@media screen and (max-width: 1199px) and (min-width: 768px) {
    .logo h1 {
        font-size: 42px;
    }
    
    .presentation-info {
        padding: 0 15px;
    }
    
    .preview-three {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .slide-thumbnail {
        width: 30%;
        min-width: 120px;
    }
}

/* Tablety pionowo i duże telefony */
@media screen and (max-width: 767px) and (min-width: 481px) {
    .logo h1 {
        font-size: 36px;
    }
    
    .logo p {
        font-size: 16px;
    }
    
    .header {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .session-info {
        font-size: 14px;
    }
    
    .main-controls {
        padding: 0 10px;
    }
    
    .control-btn {
        font-size: 16px;
        padding: 15px 25px;
        min-height: 60px;
    }
    
    .function-controls {
        padding: 0 15px;
        gap: 10px;
    }
    
    .function-btn {
        font-size: 14px;
        padding: 12px 20px;
        min-height: 50px;
    }
    
    /* PEŁNOEKRANOWE PRZYCISKI na tabletach */
    .main-controls.fullscreen-navigation .control-btn {
        font-size: clamp(24px, 7vw, 40px);
    }
    
    .presentation-info {
        padding: 15px;
    }
    
    .preview-three {
        flex-direction: column;
        gap: 10px;
    }
    
    .slide-thumbnail {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
    
    .slide-thumbnail .slide-label {
        display: none;
    }
    
    .timer-controls {
        gap: 10px;
    }
    
    .timer-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Małe telefony */
@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 28px;
    }
    
    .logo p {
        font-size: 14px;
    }
    
    .connect-form {
        max-width: 280px;
        padding: 0 20px;
    }
    
    #session-code {
        font-size: 20px;
        letter-spacing: 3px;
        padding: 12px;
    }
    
    .primary-btn {
        font-size: 16px;
        padding: 12px 24px;
    }
    
    .header {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .session-info {
        text-align: center;
        font-size: 12px;
    }
    
    .header-actions {
        justify-content: center;
        gap: 8px;
    }
    
    .slide-info {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .main-controls {
        padding: 0 8px;
        gap: 8px;
    }
    
    .control-btn {
        font-size: 14px;
        padding: 12px 20px;
        min-height: 50px;
        flex: 1;
    }
    
    /* PEŁNOEKRANOWE PRZYCISKI na telefonach */  
    .main-controls.fullscreen-navigation .control-btn {
        font-size: clamp(20px, 6vw, 32px);
    }
    
    /* Mniejsze strzałki na telefonach */
    .main-controls.fullscreen-navigation .control-btn.prev .arrow-icon {
        border-right: clamp(40px, 12vw, 80px) solid white;
        border-top: clamp(25px, 8vw, 50px) solid transparent;
        border-bottom: clamp(25px, 8vw, 50px) solid transparent;
    }
    
    .main-controls.fullscreen-navigation .control-btn.next .arrow-icon {
        border-left: clamp(40px, 12vw, 80px) solid white;
        border-top: clamp(25px, 8vw, 50px) solid transparent;
        border-bottom: clamp(25px, 8vw, 50px) solid transparent;
    }
    
    /* Małe trójkąty dla małych ekranów */
    .control-btn.prev .arrow-icon {
        border-right: 18px solid white;
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
    }
    
    .control-btn.next .arrow-icon {
        border-left: 18px solid white;
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
    }
    
    .function-controls {
        padding: 0 12px;
        gap: 8px;
        flex-direction: column;
    }
    
    .function-btn {
        font-size: 12px;
        padding: 10px 16px;
        min-height: 45px;
        width: 100%;
    }
    
    .function-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .presentation-info {
        padding: 10px;
        margin: 10px 0;
    }
    
    .presenter-notes, 
    .slide-preview {
        margin-bottom: 15px;
    }
    
    .presenter-notes h4,
    .slide-preview h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .notes-content {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .preview-three {
        flex-direction: column;
        gap: 8px;
    }
    
    .slide-thumbnail {
        width: 100%;
        height: 50px;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 0 12px;
        font-size: 11px;
    }
    
    .slide-thumbnail .slide-label {
        display: none;
    }
    
    .timer-bar {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .timer-controls {
        gap: 8px;
        justify-content: center;
    }
    
    .timer-btn {
        font-size: 10px;
        padding: 6px 10px;
        min-height: 35px;
    }
    
    
    /* Responsywny laser dashboard dla mobilnych */
    .laser-dashboard {
        padding: 10px;
    }

    .laser-container {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
    }

    .laser-touchpad {
        width: 100%;
        max-width: none;
        max-height: 70vh;
        border-radius: 20px;
    }

    .laser-exit-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }

    .laser-hint {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .message-section {
        padding: 10px;
    }
    
    .message-input-area {
        gap: 8px;
    }
    
    .message-input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .send-message-btn {
        padding: 8px 12px;
        min-width: 40px;
    }
    
    .settings-panel {
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        border-radius: 0;
    }
    
    .settings-content {
        padding: 15px;
        height: 100%;
        overflow-y: auto;
    }
    
    .settings-header h3 {
        font-size: 18px;
    }
    
    .toggle {
        font-size: 14px;
    }
    
    .language-select {
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* Bardzo małe ekrany */
@media screen and (max-width: 320px) {
    .logo h1 {
        font-size: 24px;
    }
    
    .connect-form {
        max-width: 260px;
    }
    
    #session-code {
        font-size: 18px;
        letter-spacing: 2px;
    }
    
    .control-btn {
        font-size: 12px;
        padding: 10px 15px;
        min-height: 45px;
    }
    
    .function-btn {
        font-size: 11px;
        padding: 8px 12px;
        min-height: 40px;
    }
    
    .timer-btn {
        font-size: 9px;
        padding: 5px 8px;
        min-height: 30px;
    }
}

/* Orientacja pozioma na telefonach */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .presentation-info {
        display: none;
    }
    
    
    #control-screen {
        padding-bottom: 50px;
    }
    
    .main-controls {
        margin: 10px auto;
    }
    
    .function-controls {
        margin: 10px auto;
        flex-direction: row;
        max-width: 400px;
    }
}

/* 📱 RESPONSYWNE STYLE DLA NOWEJ STRUKTURY */

/* Telefony - wszystko pionowo */
@media (max-width: 768px) {
    .sticky-header {
        padding: 10px;
    }
    
    .scrollable-content > div {
        padding: 15px;
    }
    
    /* Przyciski laser i blank w osobnych liniach */
    .laser-section .function-btn,
    .blank-section .function-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Slide preview - kolumna na telefonach */
    .preview-three {
        flex-direction: column !important;
        gap: 10px;
    }
    
    /* Laser i Blank pod sobą na telefonach */
    .function-buttons-container {
        display: block;
    }
    
    .laser-section,
    .blank-section {
        display: block;
        width: 100%;
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid #333;
    }
    
    .laser-section .function-btn,
    .blank-section .function-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ========== TABLETY I WIĘKSZE EKRANY ========== */
@media (min-width: 768px) {
    .scrollable-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Miniaturki slajdów w rzędzie */
    .preview-three {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        align-items: center;
        gap: 20px;
    }
    
    .slide-thumbnail {
        width: auto;
        flex: 0 1 200px;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .slide-thumbnail.current {
        flex: 0 1 280px;
        transform: scale(1.1);
    }
    
    .slide-thumbnail.prev,
    .slide-thumbnail.next {
        flex: 0 1 180px;
        opacity: 0.7;
    }
    
    /* Laser i Blank obok siebie */
    .function-buttons-container {
        display: flex;
        justify-content: center;
        gap: 20px;
        padding: 20px;
    }
    
    .laser-section,
    .blank-section {
        flex: 0 1 auto;
        border-bottom: none !important;
        padding: 0 !important;
    }
    
    .laser-section .function-btn,
    .blank-section .function-btn {
        width: 150px;
        max-width: none;
    }
    
    /* Szersze notatki */
    .presenter-notes-section {
        max-width: 800px;
        margin: 0 auto;
    }
    
    #notes-content {
        font-size: 18px;
        line-height: 1.6;
    }
}

/* ========== DUŻE KOMPUTERY ========== */
@media (min-width: 1024px) {
    /* Większe miniaturki */
    .slide-thumbnail {
        flex: 0 1 250px;
    }
    
    .slide-thumbnail.current {
        flex: 0 1 350px;
        transform: scale(1.15);
    }
    
    .slide-thumbnail.prev,
    .slide-thumbnail.next {
        flex: 0 1 220px;
    }
    
    /* Większe przyciski funkcji */
    .laser-section .function-btn,
    .blank-section .function-btn {
        width: 180px;
        padding: 20px 30px;
    }
    
    .function-btn svg {
        width: 40px;
        height: 40px;
    }
    
    .function-btn span {
        font-size: 16px;
    }
}

/* ========== BARDZO DUŻE EKRANY (4K) ========== */
@media (min-width: 1440px) {
    .scrollable-content {
        max-width: 1400px;
    }
    
    .slide-thumbnail {
        flex: 0 1 300px;
    }
    
    .slide-thumbnail.current {
        flex: 0 1 400px;
    }
    
    .slide-thumbnail.prev,
    .slide-thumbnail.next {
        flex: 0 1 260px;
    }
    
    #notes-content {
        font-size: 20px;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .laser-section .function-btn,
    .blank-section .function-btn {
        width: 200px;
    }
}

/* Style dla zablokowanych toggles USUNIĘTE - nie ma już toggles funkcji do blokowania */
