/* style.css */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e;
    color: #fff;
    
    /* ИСПРАВЛЕНИЕ: Выстраиваем элементы строго сверху вниз, а не сбоку! */
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    
    /* Заменяем жесткую высоту на минимальную, чтобы страницы прокручивались */
    min-height: 100vh; 
    margin: 0;
    padding: 20px 0;
    box-sizing: border-box;
}

.game-card {
    background-color: #162447;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    color: #e43f5a;
    font-size: 24px;
    margin-bottom: 20px;
}

#winner-name {
    color: #00fff0;
}

.step {
    font-size: 14px;
    color: #00fff0;
    margin-bottom: 10px;
}

.question-text {
    font-size: 20px;
    min-height: 60px;
    margin-bottom: 30px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    background-color: #1f4068;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background-color: #e43f5a;
}

.restart-btn {
    background-color: #28a745;
    margin-top: 15px;
}

.result-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 15px;
}

.hidden {
    display: none;
}

.lang-switch {
    text-align: right;
    margin-bottom: 10px;
}

.lang-switch select {
    background: #1a1a2e;
    color: #fff;
    border: 1px solid #1f4068;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
}

.actions-row {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.actions-row button {
    margin: 0;
    flex: 1 1 auto;
}

.portal-link {
    display: inline-block;
    margin-top: 12px;
    color: #00fff0;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #00fff0;
    border-radius: 6px;
    padding: 6px 14px;
}

.portal-link:hover {
    background: #00fff0;
    color: #121214;
}

#alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    text-align: left;
}

.alt-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a2e;
    border: 1px solid #1f4068;
    border-radius: 10px;
    padding: 10px;
}

.alt-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.alt-info {
    flex: 1;
    min-width: 0;
}

.alt-name {
    font-weight: bold;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alt-author {
    font-size: 13px;
    color: #a8a8b3;
    margin-top: 2px;
}

.alt-vrchat-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #00fff0;
    text-decoration: none;
}

.alt-card button {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 14px;
    background-color: #28a745;
}

.learn-prompt {
    font-size: 14px;
    color: #a8a8b3;
}

.learn-input-row {
    display: flex;
    gap: 10px;
}

.learn-input-row input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #1f4068;
    background: #1a1a2e;
    color: #fff;
}
/* НЕОНОВОЕ МЕНЮ ИГРОВОГО ХАБА А К И Н А Т О Р А */
.game-nav-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 20px auto 15px auto;
    padding: 0 10px;
    box-sizing: border-box;
}
.nav-tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: #121214;
    border: 1px solid #29292e;
    color: #7c7c8a;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}
.nav-tab-btn:hover {
    color: #fff;
    border-color: #00fff0;
    box-shadow: 0 0 8px rgba(0, 255, 240, 0.2);
}
.nav-tab-btn.active-tab {
    background: #00fff0 !important;
    color: #121214 !important;
    border-color: #00fff0 !important;
    box-shadow: 0 0 12px rgba(0, 255, 240, 0.4);
}

/* === Флаговый выпадающий список языков (см. lang_flag_widget.js + flags.css) ===
   Сам <select> визуально прячется (не display:none — стандартный приём
   "visually-hidden", чтобы не терять доступность/фоллбэк без JS), а рядом
   виджет строит кнопку "флаг + код" и свой список с флагами из спрайта. */
.lang-select-native-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

.lang-flag-wrap {
    display: inline-block;
    width: 20px;
    height: 20px;
    overflow: hidden;
    border-radius: 3px;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
}

.lang-flag-wrap .lang-flag-inner {
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(0.3125); /* 20/64 — масштабируем родной 64×64 тайл спрайта до 20×20 */
    transform-origin: top left;
}

.flag-select-wrap {
    position: relative;
    display: inline-block;
}

.flag-select-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a1a2e;
    color: #fff;
    border: 1px solid #1f4068;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
}

.flag-select-btn:hover {
    border-color: #00fff0;
}

.flag-select-current-label {
    font-weight: bold;
}

.flag-select-arrow {
    color: #7c7c8a;
    font-size: 11px;
    margin-left: 2px;
}

.flag-select-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1a1a2e;
    border: 1px solid #1f4068;
    border-radius: 6px;
    padding: 4px;
    margin: 0;
    list-style: none;
    min-width: 150px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.flag-select-list.hidden {
    display: none;
}

.flag-select-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #e1e1e6;
}

.flag-select-list li:hover {
    background: rgba(0, 255, 240, 0.08);
}
.confidence-bar-wrap {
    width: 100%;
    height: 8px;
    background: #1a1a2e;
    border: 1px solid #1f4068;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.confidence-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e43f5a, #ffc107, #28a745);
    /* Заливка растёт по width — цвет по факту "плывёт" по градиенту вместе с
       ростом полосы, так что на низкой уверенности видна красная часть,
       на высокой — зелёная, без JS-переключения классов */
    transition: width 0.4s ease;
}

.confidence-bar-label {
    font-size: 11px;
    color: #7c7c8a;
    text-align: right;
    margin-bottom: 12px;
}