:root {
    --bg-color: #160d33;
    --bs-yellow: #ffc800;
    --bs-blue: #00aaff;
    --bs-red: #d82e2e;
    --bs-purple: #b02ed8;
    --bs-green: #2ed853;
    --text-stroke: #000;
    --font-main: 'Russo One', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* Убирает синий блик на телефонах */
}

body {
    background-color: var(--bg-color);
    /* Анимированный паттерн */
    background-image: 
        radial-gradient(rgba(255, 200, 0, 0.15) 15%, transparent 16%),
        radial-gradient(rgba(0, 170, 255, 0.15) 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    animation: moveBackground 140s linear infinite;
    
    font-family: var(--font-main);
    color: white;
    
    display: flex;
    justify-content: center;
    align-items: center;
    
}

/* Затемнение фона для читаемости */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(22, 13, 51, 0.4) 0%, rgba(22, 13, 51, 0.9) 100%);
    z-index: -1;
}

@keyframes moveBackground {
    0% { background-position: 0 0, 30px 30px; }
    100% { background-position: 1000px 1000px, 1030px 1030px; }
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
}

/* --- Экраны --- */
.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    width: 100%;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

/* --- Текст --- */
h1 {
    font-size: 3.5rem;
    text-transform: uppercase;
    /* Тень для эффекта обводки */
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    line-height: 0.9;
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 15px;
}

.highlight {
    color: var(--bs-yellow);
    -webkit-text-stroke: 1.5px black; /* Работает в Webkit браузерах */
    text-shadow: 3px 3px 0 #000;
}
.hidden {
    display: none !important;
}
.subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 50px;
}

/* --- Кнопки --- */
.brawl-btn {
    font-family: var(--font-main);
    font-size: 1.8rem;
    padding: 15px 50px;
    border: 3px solid black;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    text-shadow: 2px 2px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative;
    top: 0;
    width: 100%;
    max-width: 3000px;
}

.brawl-btn:active {
    top: 6px;
    box-shadow: 0 0 0 black !important;
}

.brawl-btn.mt3{
    margin-top: 30px;
}
.brawl-input.mb0 {
    margin-bottom: 0px;
}

.yellow {
    background-color: var(--bs-yellow);
    box-shadow: 0 8px 0 #b38b00, 0 8px 0 2px black;
}

.blue {
    background-color: var(--bs-blue);
    box-shadow: 0 8px 0 #0077b3, 0 8px 0 2px black;
}

.small-btn {
    font-size: 1rem;
    padding: 10px 15px;
    width: auto;
}

/* Пульсация кнопки играть */
.pulse-btn {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Викторина --- */
.top-bar {
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.question-counter {
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 0.9rem;
    text-align: right;
    color: rgba(255,255,255,0.7);
}

.progress-container {
    width: 100%;
    height: 18px;
    background: rgba(0,0,0,0.6);
    border-radius: 9px;
    border: 2px solid black;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-yellow), #ffaa00);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}

.question-card {
    background: white;
    color: #222;
    padding: 25px;
    border-radius: 15px;
    border: 3px solid black;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 6px 0 rgba(0,0,0,0.4);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.question-card h2 {
    font-size: 1.5rem;
    font-family: var(--font-body);
    font-weight: 700;

    /* === ИСПРАВЛЕНИЕ: УБРАТЬ ОБВОДКУ И ТЕНЬ === */
    text-shadow: none !important;
    -webkit-text-stroke: none !important;

    /* Опционально: улучшает сглаживание шрифтов */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    font-family: var(--font-main);
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.answer-btn {
    background: #4c3b7f; /* Чуть светлее фона */
    color: white;
    border: 2px solid black;
    padding: 18px 15px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    /* Анимация появления */
    opacity: 0;
    animation: slideIn 0.5s forwards;
}

.answer-btn:hover {
    background: #5e4a99;
}

.answer-btn:active {
    background: var(--bs-yellow);
    color: black;
    transform: scale(0.98);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    text-shadow: none;
}

/* Задержки для вылета ответов */
.answer-btn:nth-child(1) { animation-delay: 0.1s; }
.answer-btn:nth-child(2) { animation-delay: 0.2s; }
.answer-btn:nth-child(3) { animation-delay: 0.3s; }
.answer-btn:nth-child(4) { animation-delay: 0.4s; }

/* Анимации */
.pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Результат --- */
.character-reveal {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 10px auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Картинка бойца */
.character-reveal img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Картинка вписывается полностью */
    z-index: 2;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

/* Свечение */
.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 230, 0, 0.6) 0%, rgba(255, 255, 0, 0) 70%);
    z-index: 1;
    animation: pulseGlow 1s infinite;
}

.legendary-drop {
    animation: spinReveal 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes spinReveal {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(720deg); opacity: 1; }
    100% { transform: scale(1) rotate(720deg); }
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
}

.result-description {
    background: rgba(0,0,0,0.4);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.4;
    border: 1px solid rgba(255,255,255,0.1);
}

.stats-box {
    width: 100%;
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-family: var(--font-body);
    font-weight: bold;
    font-size: 0.9rem;
}

.stat-row span {
    width: 75px;
    text-align: left;
}

.bar-bg {
    flex-grow: 1;
    height: 14px;
    background: #1a1a1a;
    border-radius: 7px;
    border: 2px solid #444;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 1s ease-out;
}

.bar-fill.red { background: var(--bs-red); box-shadow: inset 0 2px 0 rgba(255,255,255,0.3); }
.bar-fill.purple { background: var(--bs-purple); box-shadow: inset 0 2px 0 rgba(255,255,255,0.3); }
.bar-fill.green { background: var(--bs-green); box-shadow: inset 0 2px 0 rgba(255,255,255,0.3); }

/* --- Стили для экрана загрузки --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    /* Используйте ваш фоновый цвет */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.loader-container p {
    font-family: var(--font-body);
    font-size: 1.2rem;
    margin-top: 15px;
    color: #ccc;
    
}

.loader {
    border: 8px solid #333;
    /* Светло-серый */
    border-top: 8px solid var(--bs-yellow);
    /* Желтый Brawl Stars */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Стили для шаринга и результата --- */

.share-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    border: 3px solid var(--bs-yellow);
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.4);
    text-align: center;
}

.share-title {
    font-family: var(--font-main);
    color: var(--bs-yellow);
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px #000;
}

.brawl-input {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 10px;
    border: 2px solid var(--bs-blue);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    box-shadow: inset 0 0 5px rgba(0, 170, 255, 0.5);
}

.share-link {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

.share-link p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #ccc;
}

#share-link-input {
    cursor: text;
    margin-bottom: 10px;
}

.result-stats-output {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: var(--font-body);
    text-align: left;
    font-size: 1.1rem;
}

.result-stats-output .highlight {
    color: var(--bs-yellow);
    font-weight: 700;
}

/* Группа ввода тега и кнопки проверки */
.input-group-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.tag-input {
    flex-grow: 1;
    margin-bottom: 0;
    text-transform: uppercase;
}

/* Карточка данных игрока */
.player-data-box {
    background: rgba(40, 167, 69, 0.2);
    /* Легкий зеленый фон */
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: left;
    animation: popIn 0.3s ease-out;
}

.player-info-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-icon-small {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid white;
    background: #000;
}

.player-text h4 {
    margin: 0;
    font-size: 1.1rem;
    text-align: left;
    text-shadow: 1px 1px 0 #000;
}

.trophies {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    color: #ffc107;
    font-weight: bold;
}

.success-msg {
    margin: 5px 0 0 0;
    font-size: 0.8rem;
    color: #28a745;
    text-align: right;
    font-weight: bold;
}

/* --- Класс для выделения доминирующей шкалы --- */
.bar-fill.dominant {
    box-shadow: 0 0 10px var(--bs-yellow);
    filter: brightness(1.2);
}
.restart-btn {
    margin-top: 3rem
}