* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E30611;
    --secondary-color: #B8050D;
    --primary-light: #FF1A2E;
    --primary-dark: #9A0409;
    --success-color: #4CAF50;
    --danger-color: #D32F2F;
    --warning-color: #ff9800;
    --info-color: #2196F3;
    --dark: #333;
    --light: #fff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFF5F5 20%, #FFE5E5 40%, #FFD5D5 60%, #FFC5C5 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
    position: relative;
}

/* Фоновое изображение для страниц ведущего и участника */
body.host-body,
body.player-body {
    background: url('bg1920x1080.jpg') center center / cover no-repeat fixed;
    background-color: #000;
}

body.host-body::before,
body.player-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 0;
}

body.host-body .container,
body.player-body .container {
    border-radius: 16px;
    margin: 20px auto;
}

/* Белый простой текст для заголовков на страницах с фоновым изображением */
body.host-body h2,
body.player-body h2 {
    color: #fff;
    font-weight: 400;
    text-shadow: none;
    font-size: 2em;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(227, 6, 17, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(184, 5, 13, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(227, 6, 17, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.4s ease-in;
}

.page.active {
    display: block;
}

h1, h2, h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    text-shadow: none;
}

h1 {
    font-size: 3.5em;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: -1px;
}

h2 {
    font-size: 2.5em;
    font-weight: 600;
}

h3 {
    font-size: 1.8em;
    font-weight: 600;
}

/* Кнопки */
.btn {
    padding: 14px 28px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    margin: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #666 0%, #555 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-large {
    padding: 24px 48px;
    font-size: 22px;
    border-radius: 16px;
    font-weight: 700;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    font-size: 1.2em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Главная страница */
.home-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 60px;
}

/* Формы */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #000000;
    font-weight: 600;
    font-size: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(211, 47, 47, 0.2);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255,255,255,0.98);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1);
    transform: translateY(-2px);
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Вопросы */
.question-item {
    background: rgba(255,255,255,0.98);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(211, 47, 47, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: slideIn 0.4s ease-out;
}

.question-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.15);
    border-color: rgba(211, 47, 47, 0.2);
}

.question-item h4 {
    color: var(--dark);
    margin-bottom: 18px;
    font-size: 1.3em;
    border-bottom: 2px solid rgba(211, 47, 47, 0.3);
    padding-bottom: 10px;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.question-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
}

.question-option:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(227, 6, 17, 0.1);
}

.question-option input {
    width: 100%;
    border: none;
    padding: 8px;
    font-size: 15px;
    background: transparent;
}

.question-option-multiple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: all 0.3s;
}

.question-option-multiple:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(227, 6, 17, 0.1);
}

.question-option-multiple input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.question-option-multiple input[type="text"] {
    flex: 1;
    border: none;
    padding: 8px;
    font-size: 15px;
    background: transparent;
}

.checkbox-indicator {
    font-size: 1.5em;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
}

.multiple-choice-btn {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

.multiple-choice-btn.selected {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.3) 100%);
    border: 2px solid var(--success-color);
}

#question-image-container {
    margin: 20px 0;
    text-align: center;
}

#question-image-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    object-fit: contain;
}

.correct-answer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
}

.correct-answer label {
    color: var(--dark);
    font-weight: 600;
    white-space: nowrap;
}

.correct-answer select {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

/* Игровой экран ведущего */
.game-info {
    background: rgba(255,255,255,0.98);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(211, 47, 47, 0.1);
    animation: slideIn 0.4s ease-out;
}

.game-info h3 {
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 2em;
}

#game-title-display {
    color: var(--primary-color) !important;
    font-size: 4em !important;
    font-weight: 700 !important;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.game-code-section {
    display: flex;
    gap: 30px;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    margin: 40px 0;
    padding: 50px;
    background: linear-gradient(135deg, rgba(227, 6, 17, 0.1) 0%, rgba(184, 5, 13, 0.1) 100%);
    border-radius: 16px;
}

.code-display {
    text-align: center;
    margin-bottom: -55px;
    margin-top: auto;
}

.website-label {
    font-size: 40px;
    color: #000000;
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
}

.code-label {
    font-size: 63px;
    color: #000000;
    font-weight: 700;

}

.code-value {
    font-size: 8em;
    font-weight: 700;
    color: #6444a1;
    letter-spacing: 12px;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
    line-height: 1.2;
}

.qr-section {
    text-align: center;
}

#qr-code-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    display: inline-block;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

#qr-code-container img {
    display: block;
    max-width: 600px;
    width: 100%;
    height: auto;
    min-width: 400px;
}

.qr-label {
    font-size: 20px;
    color: #666;
    margin-top: 15px;
    font-weight: 600;
}

.players-info {
    margin-top: 20px;
}

.players-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--info-color) 0%, #0b7dda 100%);
    color: white;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.players-icon {
    font-size: 1.5em;
}

#game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

#game-display {
    background: rgba(255,255,255,0.98);
    padding: 50px;
    border-radius: 20px;
    margin-top: 24px;
    min-height: 500px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(211, 47, 47, 0.1);
    animation: slideIn 0.4s ease-out;
}

.question-display {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--dark);
    font-weight: 700;
    line-height: 1.3;
}

.options-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 40px;
}

.option-display {
    padding: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 16px;
    font-size: 1.5em;
    font-weight: 600;
    cursor: default;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.option-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.option-display.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    animation: correctPulse 0.6s ease-out;
}

.option-display.incorrect {
    background: linear-gradient(135deg, var(--danger-color) 0%, #d32f2f 100%);
}

.results-display {
    margin-top: 40px;
}

.leaderboard {
    margin-top: 40px;
}

.leaderboard h3, .leaderboard h4 {
    color: var(--dark);
    margin-bottom: 20px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin: 12px 0;
    background: rgba(227, 6, 17, 0.1);
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: 600;
    transition: all 0.3s;
    animation: slideInLeft 0.5s ease-out;
    animation-fill-mode: both;
}

.leaderboard-item:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.3s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.4s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.5s; }

.leaderboard-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

.leaderboard-item.top {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    font-weight: 700;
    font-size: 1.5em;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.leaderboard-item.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: white;
    font-weight: 700;
    font-size: 1.4em;
    box-shadow: 0 8px 20px rgba(192, 192, 192, 0.4);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    color: white;
    font-weight: 700;
    font-size: 1.3em;
    box-shadow: 0 8px 20px rgba(205, 127, 50, 0.4);
}

/* Игровой экран участника */
#player-join {
    background: rgba(255,255,255,0.98);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(211, 47, 47, 0.1);
    animation: slideIn 0.4s ease-out;
}

#player-question {
    background: rgba(255,255,255,0.98);
    padding: 40px;
    border-radius: 20px;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(211, 47, 47, 0.1);
    animation: slideIn 0.4s ease-out;
}

.question-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(211, 47, 47, 0.2);
}

.question-header span {
    font-size: 18px;
    font-weight: 600;
    color: #666;
}

#question-number {
    color: var(--primary-color);
}

.question-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
}

#player-score {
    color: var(--success-color);
    font-size: 1.2em;
    font-weight: 600;
}

#question-text {
    font-size: 1.8em;
    color: var(--dark);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
    min-height: 60px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Стили для длинных текстов */
#question-text.long-text {
    font-size: 1.4em;
    line-height: 1.5;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0 30px 0;
    text-align: left;
    max-width: 100%;
    font-weight: 500;
}

/* Стили для очень длинных текстов */
#question-text.very-long-text {
    font-size: 1.1em;
    line-height: 1.6;
    padding: 20px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0 30px 0;
    text-align: left;
    max-width: 100%;
    font-weight: 500;
    border-left: 4px solid var(--primary-color);
}

#question-timer {
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    color: var(--warning-color);
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 12px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color) 0%, var(--info-color) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

#question-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
    width: 100%;
}

.option-btn {
    padding: 24px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    width: 100%;
}

.option-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;
}

.option-btn:hover:not(:disabled)::before {
    left: 100%;
}

.option-btn:hover:not(:disabled) {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.option-btn:active:not(:disabled) {
    transform: translateY(-2px) scale(0.98);
}

.option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    animation: selectPulse 0.4s ease-out;
}

.option-btn.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    animation: correctAnswer 0.6s ease-out;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, var(--danger-color) 0%, #d32f2f 100%);
    animation: incorrectAnswer 0.6s ease-out;
}

#answer-feedback {
    margin-top: 30px;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    font-size: 1.4em;
    font-weight: 700;
    animation: slideInUp 0.5s ease-out;
}

#answer-feedback.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

#answer-feedback.incorrect {
    background: linear-gradient(135deg, var(--danger-color) 0%, #d32f2f 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(244, 67, 54, 0.3);
}

#player-waiting,
#player-results,
#player-final {
    background: rgba(255,255,255,0.98);
    padding: 40px;
    border-radius: 20px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.4s ease-out;
    box-sizing: border-box;
    width: 100%;
}

/* Стили для результатов - черный текст */
#player-results h3,
#player-results h4 {
    color: #000 !important;
    font-weight: 600;
}

#player-results #results-content {
    color: #000;
    text-align: left;
}

#player-results #results-content h3 {
    color: #000 !important;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0 10px;
}

#player-results #results-content h3.very-long-text {
    font-size: 1.1em !important;
    line-height: 1.6 !important;
    padding: 20px 15px !important;
    text-align: left !important;
    margin: 20px 0 30px 0 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%) !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
    border-left: 4px solid var(--primary-color) !important;
    font-weight: 500 !important;
}

#player-results #results-content h3.long-text {
    font-size: 1.3em !important;
    line-height: 1.5 !important;
    padding: 16px 18px !important;
}

#player-results #results-content h4 {
    color: #000 !important;
    font-size: 1.2em;
    margin: 20px 0 15px 0;
    font-weight: 600;
}

#player-results #results-content .option-display {
    color: #000 !important;
}

#player-results #results-content .option-display strong {
    color: #000 !important;
}

#player-results #results-content .option-display span {
    color: #000 !important;
}

#player-results #results-content .leaderboard-item {
    color: #000 !important;
}

#player-results #results-content .leaderboard-item.top,
#player-results #results-content .leaderboard-item.top-2,
#player-results #results-content .leaderboard-item.top-3 {
    color: #000000 !important;
}

#player-results #results-content .answer-feedback {
    color: #000000 !important;
}

#player-results #results-content p {
    color: #000 !important;
}

#player-waiting h3 {
    color: var(--dark);
    margin-bottom: 30px;
    font-size: 2em;
}

.waiting-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(227, 6, 17, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    
    h1 {
        font-size: 2.2em;
        margin-bottom: 30px;
    }
    
    h2 {
        font-size: 1.8em;
    }
    
    h3 {
        font-size: 1.5em;
    }
    
    .home-buttons {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .btn-large {
        width: 100%;
        max-width: 350px;
        padding: 22px;
        font-size: 20px;
    }
    
    .btn {
        font-size: 18px;
        padding: 16px 24px;
    }
    
    .question-options {
        grid-template-columns: 1fr;
    }
    
    .options-display {
        grid-template-columns: 1fr;
    }
    
    .game-code-section {
        flex-direction: column;
        padding: 20px;
    }
    
    .code-value {
        font-size: 2.2em;
    }
    
    #player-question {
        padding: 25px 20px;
        margin: 10px;
    }
    
    #question-text {
        font-size: 1.5em;
        padding: 18px 15px;
        margin-bottom: 25px;
    }
    
    #question-text.long-text {
        font-size: 1.3em;
        padding: 16px 18px;
        line-height: 1.5;
    }
    
    #question-text.very-long-text {
        font-size: 1.1em;
        padding: 18px 20px;
        line-height: 1.6;
    }
    
    #question-options {
        gap: 16px;
        margin: 20px 0;
    }
    
    .option-btn {
        font-size: 1.2em;
        padding: 22px 20px;
        min-height: 60px;
        display: flex;
        align-items: center;
        margin-bottom: 10px;
    }
    
    .question-display {
        font-size: 1.6em;
    }
    
    #question-number {
        font-size: 16px;
    }
    
    #player-score {
        font-size: 1.1em;
    }
    
    #question-timer {
        font-size: 1.8em;
        padding: 12px;
    }
    
    #player-results,
    #player-final {
        padding: 20px 15px;
        margin: 10px 5px;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #player-results h3,
    #player-final h3 {
        font-size: 1.4em !important;
        padding: 0 5px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    #player-results h3,
    #player-results h4 {
        font-size: 1.4em !important;
        margin-bottom: 15px;
    }
    
    #player-results #results-content {
        font-size: 16px;
        padding: 0 5px;
    }
    
    #player-results #results-content h3 {
        font-size: 1.3em !important;
        padding: 15px 10px !important;
        margin-bottom: 15px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4 !important;
    }
    
    #player-results #results-content h3.very-long-text {
        font-size: 0.95em !important;
        line-height: 1.5 !important;
        padding: 15px 12px !important;
        margin: 15px 0 20px 0 !important;
    }
    
    #player-results #results-content h3.long-text {
        font-size: 1.1em !important;
        line-height: 1.4 !important;
        padding: 12px 10px !important;
    }
    
    #player-results #results-content h4 {
        font-size: 1.1em !important;
        margin: 20px 0 12px 0 !important;
        padding: 0 5px;
    }
    
    #player-results #results-content .option-display {
        padding: 12px 10px;
        margin: 10px 0;
        font-size: 16px;
        border-radius: 10px;
    }
    
    #player-results #results-content .option-display > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    
    #player-results #results-content .option-display > div:first-child > div {
        width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    #player-results #results-content .option-display > div:first-child > span {
        margin-left: 0 !important;
        margin-top: 4px;
        font-size: 14px;
    }
    
    #player-results #results-content .option-display > div:last-child {
        flex-direction: column;
        gap: 8px;
        margin-top: 8px;
    }
    
    #player-results #results-content .option-display > div:last-child > div {
        width: 100%;
        height: 20px;
    }
    
    #player-results #results-content .option-display > div:last-child > span {
        min-width: auto;
        width: 100%;
        text-align: left;
        font-size: 14px;
    }
    
    #player-results,
    #player-final {
        padding: 20px 15px;
        margin: 10px 5px;
        border-radius: 15px;
    }
    
    #player-results #results-content .leaderboard-item {
        padding: 18px 20px;
        font-size: 18px;
        margin: 10px 0;
    }
    
    #player-results #results-content .answer-feedback {
        padding: 18px;
        font-size: 18px;
        margin: 15px 0;
    }
    
    .question-header {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .question-stats {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .container {
        padding: 15px;
    }
    
    .page {
        padding: 15px;
    }
    
    .game-info {
        padding: 20px;
    }
    
    #game-display {
        padding: 30px 20px;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes selectPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes correctAnswer {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.6);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes incorrectAnswer {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Дополнительные улучшения */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideInRight 0.4s ease-out;
    max-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Улучшенные анимации для визуализации */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 30px rgba(76, 175, 80, 0.6); }
}

@keyframes scoreIncrease {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: var(--success-color); }
    100% { transform: scale(1); }
}

@keyframes scaleIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Улучшенные стили для результатов */
.option-display {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-display.correct {
    animation: glow 1s ease-in-out infinite;
}

.option-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.option-display.correct::before {
    left: 100%;
}

/* Анимация для счетчика очков */
.score-animation {
    animation: scoreIncrease 0.5s ease-out;
}

/* Эффект появления с масштабированием */
.scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* Эффект для правильного ответа */
.correct-answer-effect {
    animation: correctPulse 0.6s ease-out, glow 1s ease-in-out infinite;
}

/* Эффект для неправильного ответа */
.incorrect-answer-effect {
    animation: shake 0.5s ease-out;
}
