/**
 * Stili Frontend - Admin e Giocatore (No Login)
 */

/* ========== LAYOUT BASE ========== */
.quiz-frontend-admin,
.quiz-frontend-player {
    min-height: 100vh;
    background: #1a237e; /* Blu scuro solido */
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

/* ========== FORM CREAZIONE/JOIN SESSIONE ========== */
.quiz-create-session,
.quiz-join-session {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

.create-session-container,
.join-session-container {
    background: transparent;
    padding: 40px 20px;
    border-radius: 0;
    box-shadow: none;
    max-width: 600px;
    width: 100%;
    color: white;
}

@media (min-width: 768px) {
    .create-session-container,
    .join-session-container {
        padding: 40px;
    }
}

.create-session-container h1,
.join-session-container h1 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
    color: #2c3e50;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-primary {
    background: #3949ab; /* Blu medio scuro */
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary:hover {
    background: #303f9f; /* Blu più scuro al hover */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.btn-large {
    padding: 18px 30px;
    font-size: 18px;
}

/* ========== SCHERMATA LINK CONDIVISIONE ========== */
.quiz-share-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

.share-link-container {
    background: transparent;
    padding: 40px 20px;
    border-radius: 0;
    box-shadow: none;
    max-width: 700px;
    width: 100%;
    text-align: center;
    color: white;
}

@media (min-width: 768px) {
    .share-link-container {
        padding: 40px;
    }
}

.share-link-container h2 {
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.share-url-box {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-url-box input {
    flex: 1;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    font-size: 14px;
    color: #2c3e50;
}

.share-url-box input:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}

.btn-copy {
    background: #27ae60;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.session-code-large {
    font-size: 48px;
    font-weight: bold;
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    letter-spacing: 5px;
    border: 2px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

/* ========== DASHBOARD ADMIN ========== */
.quiz-admin-dashboard {
    background: transparent;
    border-radius: 0;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: none;
    color: white;
}

@media (min-width: 768px) {
    .quiz-admin-dashboard {
        padding: 30px;
        padding-top: 30px;
    }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid rgba(255,255,255,0.3);
}

.admin-header h2 {
    color: white;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.admin-badge {
    background: #e74c3c; /* Rosso solido */
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

.game-controls {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.btn-control {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start {
    background: #27ae60;
    color: white;
}

.btn-pause {
    background: #f39c12;
    color: white;
}

.btn-next {
    background: #3498db;
    color: white;
}

.btn-end {
    background: #e74c3c;
    color: white;
}

.btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.current-question-section {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-category {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
}

.answers-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.answer-option-admin {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 3px solid #ecf0f1;
    position: relative;
}

.answer-option-admin.correct {
    border-color: #27ae60;
    background: #d5f4e6;
}

.answer-label {
    display: inline-block;
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-weight: bold;
    margin-right: 10px;
}

.answer-text {
    font-weight: bold;
    margin: 10px 0;
}

.answer-count {
    font-size: 12px;
    color: #7f8c8d;
}

/* ========== INTERFACCIA GIOCATORE ========== */
.quiz-game-screen {
    background: transparent;
    border-radius: 0;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    max-width: 100%;
    margin: 0;
    box-shadow: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .quiz-game-screen {
        max-width: 900px;
        margin: 0 auto;
        padding: 30px;
        padding-top: 30px;
    }
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid rgba(255,255,255,0.2);
}

.player-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.player-label {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    margin-top: 5px;
}

.player-score {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.timer-display {
    background: #f39c12; /* Arancione solido */
    color: white;
    padding: 15px 25px;
    border-radius: 50%;
    font-size: 32px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
}

.timer-display.warning {
    background: #e74c3c; /* Rosso solido */
    animation: pulse 1s infinite;
}

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

.question-section {
    margin: 25px 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
}

.question-badge {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.3);
}

.question-text {
    font-size: 22px;
    font-weight: bold;
    color: white;
    line-height: 1.6;
    margin: 15px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.answers-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.answer-btn {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255,255,255,0.95);
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 16px;
    min-height: 60px;
    color: #2c3e50;
}

.answer-btn:hover:not(:disabled) {
    border-color: white;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-btn.selected {
    background: #667eea;
    color: white;
    border-color: #5568d3;
    opacity: 1;
}

.answer-btn.correct {
    background: #27ae60;
    color: white;
    border-color: #229954;
    opacity: 1;
}

.answer-btn.incorrect {
    background: #ff9800;
    color: white;
    border-color: #f57c00;
    opacity: 1;
}

.leaderboard-section,
.prizes-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    margin: 8px 0;
    color: #2c3e50;
}

.leaderboard-item.self {
    background: rgba(255,255,255,0.95);
    color: #2c3e50;
    font-weight: bold;
    border: 2px solid white;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.prize-card {
    padding: 15px;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    text-align: center;
    border: 3px solid rgba(255,255,255,0.3);
    color: #2c3e50;
}

.prize-card.qualified {
    border-color: #f1c40f;
    border-width: 4px;
    background: rgba(241, 196, 15, 0.2);
    backdrop-filter: blur(5px);
}

/* ========== RISULTATI FINALI ========== */
.quiz-final-results {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

.final-results-container {
    background: transparent;
    padding: 40px 20px;
    border-radius: 0;
    box-shadow: none;
    max-width: 800px;
    width: 100%;
    text-align: center;
    color: white;
}

@media (min-width: 768px) {
    .final-results-container {
        padding: 40px;
    }
}

.final-score-value {
    font-size: 56px;
    font-weight: bold;
    color: #764ba2;
    margin: 20px 0;
}

.final-leaderboard-box,
.final-prizes-box {
    margin: 30px 0;
    text-align: left;
}

/* ========== SChermata ATTESA ========== */
.quiz-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
}

.waiting-container {
    background: transparent;
    padding: 40px 20px;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    max-width: 500px;
    color: white;
}

@media (min-width: 768px) {
    .waiting-container {
        padding: 50px;
    }
}

.waiting-container h2 {
    color: white;
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.waiting-container p {
    color: white;
    font-size: 18px;
    margin: 15px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.waiting-container strong {
    color: white;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.waiting-message {
    color: rgba(255,255,255,0.95);
    font-style: italic;
    font-size: 16px;
}

.waiting-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.players-waiting {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(255,255,255,0.3);
}

.players-waiting p {
    color: white;
    font-weight: 500;
}

.players-waiting span {
    color: white;
    font-weight: bold;
    font-size: 20px;
}

/* Giocatori Admin */
.players-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
}

.player-card-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    margin: 10px 0;
    border-left: 5px solid rgba(255,255,255,0.3);
    color: #2c3e50;
}

.player-card-admin.correct {
    border-left-color: #27ae60;
    background: #d5f4e6;
}

.player-card-admin.incorrect {
    border-left-color: #e74c3c;
    background: #ffe0e0;
}

.player-card-admin.waiting {
    border-left-color: #95a5a6;
    background: #ecf0f1;
}

/* Premi Admin */
.prizes-section-admin {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
}

#prizes-grid-admin {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.prize-card-admin {
    padding: 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    border: 3px solid rgba(255,255,255,0.3);
    text-align: center;
    color: #2c3e50;
}

.prize-card-admin h4 {
    margin: 10px 0;
    color: #2c3e50;
}

.prize-card-admin .prize-threshold {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.prize-card-admin .assign-prize-btn {
    margin-top: 15px;
    width: 100%;
}

.prize-card-admin {
    position: relative;
}

.prize-card-admin .prize-threshold {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Statistiche timer */
.timer-value {
    font-size: 28px;
    color: #667eea;
}

/* Admin dashboard miglioramenti */
.quiz-admin-dashboard h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* Player cards admin */
.player-card-admin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    transition: all 0.3s;
}

.player-card-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Risultati Finali Admin */
.quiz-final-results-admin {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top, 20px));
    background: #1a237e; /* Blu scuro solido */
}

.final-results-container {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 100%;
    text-align: center;
    color: #2c3e50;
}

.final-results-container h1 {
    color: #1a237e; /* Blu scuro per titolo */
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: none;
}

.final-results-container .subtitle {
    color: #7f8c8d;
    font-size: 18px;
    margin-bottom: 40px;
}

.final-leaderboard-admin {
    margin: 40px 0;
    text-align: left;
    background: #f8f9ff;
    padding: 30px;
    border-radius: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.leaderboard-item-admin {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    margin: 12px 0;
    border-left: 5px solid rgba(255,255,255,0.3);
    transition: all 0.3s;
    color: #2c3e50;
}

.leaderboard-item-admin:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.leaderboard-item-admin.podium {
    border-left-color: #f39c12;
    background: #fff9e6;
}

.leaderboard-item-admin.podium:first-child {
    border-left-color: #f1c40f;
    background: #fff9e6;
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.3);
}

.leaderboard-position {
    font-size: 24px;
    font-weight: bold;
    margin-right: 20px;
    min-width: 50px;
}

.leaderboard-name {
    flex: 1;
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

.leaderboard-score {
    font-size: 22px;
    font-weight: bold;
    color: #3949ab;
    min-width: 100px;
    text-align: right;
}

.assigned-prizes-section {
    margin: 40px 0;
    padding: 30px;
    background: #f8f9ff;
    border-radius: 15px;
    border: 2px solid #e0e7ff;
}

.assigned-prizes-section h3 {
    color: #1a237e;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

#admin-assigned-prizes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.assigned-prize-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e7ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.assigned-prize-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e7ff;
}

.prize-emoji {
    font-size: 48px;
}

.prize-info h4 {
    margin: 0 0 5px 0;
    color: #1a237e;
    font-size: 20px;
    font-weight: bold;
}

.prize-threshold {
    margin: 0;
    color: #3949ab;
    font-weight: bold;
    font-size: 14px;
}

.prize-description {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 14px;
}

.assigned-players-list {
    margin-top: 15px;
}

.players-count {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.assigned-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    margin: 8px 0;
    border: 1px solid #e0e7ff;
}

.assigned-player-item .player-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 16px;
}

.assigned-player-item .player-score {
    font-weight: bold;
    color: #3949ab;
    margin-right: 10px;
    font-size: 16px;
}

.btn-small,
.btn-reactivate,
.reactivate-prize-btn {
    background: #3949ab;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-small:hover,
.btn-reactivate:hover,
.reactivate-prize-btn:hover {
    background: #303f9f;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Assicura che il contenitore dei risultati finali abbia testo leggibile su sfondo bianco */
.final-results-container {
    color: #2c3e50;
}

.final-results-container p,
.final-results-container span,
.final-results-container div,
.final-results-container strong {
    color: #2c3e50;
}

.final-results-container .assigned-prizes-section,
.final-results-container .final-leaderboard-admin {
    color: #2c3e50;
}

.final-results-container .assigned-prize-card,
.final-results-container .leaderboard-item-admin {
    color: #2c3e50;
}

.final-actions {
    margin-top: 40px;
}

/* Video */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    margin: 20px 0;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal Pausa */
.quiz-pause-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pause-modal-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 400px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.pause-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pause-modal-content h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.pause-message {
    color: #7f8c8d;
    font-style: italic;
    margin-top: 20px;
}

/* Responsive - Mobile Fullscreen */
@media (max-width: 768px) {
    /* Rimuovi padding e margini extra su mobile */
    .quiz-frontend-admin,
    .quiz-frontend-player {
        padding: 0;
        min-height: 100vh;
        height: 100vh;
        overflow-x: hidden;
    }
    
    /* Schermate fullscreen su mobile con padding top per evitare taglio */
    .quiz-create-session,
    .quiz-join-session,
    .quiz-share-link,
    .quiz-waiting,
    .quiz-final-results,
    .quiz-final-results-admin {
        padding: 0;
        padding-top: max(60px, env(safe-area-inset-top, 60px)); /* Spazio per barra browser */
        min-height: 100vh;
        height: 100vh;
        box-sizing: border-box;
    }
    
    /* Container senza padding extra */
    .create-session-container,
    .join-session-container,
    .share-link-container,
    .waiting-container,
    .final-results-container {
        padding: 20px;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow-y: auto;
        box-sizing: border-box;
    }
    
    /* Dashboard admin su mobile */
    .quiz-admin-dashboard {
        padding: 15px;
        padding-top: max(60px, env(safe-area-inset-top, 60px));
        min-height: 100vh;
        box-sizing: border-box;
    }
    
    /* Game screen su mobile */
    .quiz-game-screen {
        padding: 15px;
        padding-top: max(60px, env(safe-area-inset-top, 60px));
        min-height: 100vh;
        box-sizing: border-box;
    }
    
    /* Form responsive */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .answers-admin-grid {
        grid-template-columns: 1fr;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-control {
        width: 100%;
    }
    
    /* Titoli più piccoli su mobile */
    .create-session-container h1,
    .join-session-container h1 {
        font-size: 24px;
    }
    
    .question-text {
        font-size: 18px;
    }
    
    /* Timer più piccolo su mobile */
    .timer-display {
        font-size: 24px;
        padding: 12px 20px;
        min-width: 60px;
    }
    
    /* Header più compatto */
    .player-header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }
    
    .player-score {
        font-size: 24px;
    }
    
    /* Sezioni più compatte */
    .question-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .answers-section {
        gap: 12px;
        margin: 20px 0;
    }
    
    .answer-btn {
        padding: 15px 18px;
        min-height: 55px;
        font-size: 15px;
    }
    
    /* Leaderboard e premi più compatti */
    .leaderboard-section,
    .prizes-section {
        margin: 20px 0;
        padding: 15px;
    }
}

/* Supporto per safe-area su iOS */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .quiz-create-session,
        .quiz-join-session,
        .quiz-share-link,
        .quiz-waiting,
        .quiz-game-screen {
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
            padding-top: max(15px, env(safe-area-inset-top));
            padding-bottom: max(15px, env(safe-area-inset-bottom));
        }
    }
}

