/* Локальные правила не выходят за DOM-границы модуля. */
@scope (.amber-module-scope) {
/* Amber Forge — проектные стили. Префикс: .amber-*
   Корневые переменные/тема — в /styles.css. Здесь только специфика. */

/* --- Экран --- */
.amber-screen {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    height: 100dvh;
    max-height: 100dvh;
    background:
        radial-gradient(circle at 50% 40%, rgba(10, 103, 131, 0.46) 0%, rgba(3, 34, 55, 0.92) 48%, #010a12 100%),
        #031826;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    border-radius: var(--radius, 8px);
}

.amber-screen::before,
.amber-screen::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(42px);
    opacity: 0.34;
    z-index: 0;
}

.amber-screen::before {
    top: 15%;
    left: -46%;
    background: #007b9b;
    animation: amberDeepCurrentOne 16s ease-in-out infinite alternate;
}

.amber-screen::after {
    right: -52%;
    bottom: 8%;
    background: #005d82;
    animation: amberDeepCurrentTwo 20s ease-in-out infinite alternate;
}

@keyframes amberDeepCurrentOne {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -20px) scale(1.15); }
}

@keyframes amberDeepCurrentTwo {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, 20px) scale(1.1); }
}

/* --- Фоновые сферы --- */
.amber-bg-spheres {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.amber-bg-sphere {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.4), rgba(0, 100, 200, 0.1));
    border: 1px solid rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    animation: amberBgSphereFloat 12s ease-in-out infinite;
    opacity: 0;
}

.amber-bg-sphere:nth-child(1)  { width: 30px; height: 30px; top: 15%; left: 5%;  animation-duration: 14s; animation-delay: 0s; }
.amber-bg-sphere:nth-child(2)  { width: 20px; height: 20px; top: 25%; right: 8%; animation-duration: 10s; animation-delay: 2s; }
.amber-bg-sphere:nth-child(3)  { width: 40px; height: 40px; top: 55%; left: 3%;  animation-duration: 16s; animation-delay: 4s; }
.amber-bg-sphere:nth-child(4)  { width: 15px; height: 15px; top: 70%; right: 5%; animation-duration: 11s; animation-delay: 1s; }
.amber-bg-sphere:nth-child(5)  { width: 25px; height: 25px; top: 40%; left: 2%;  animation-duration: 13s; animation-delay: 3s; }
.amber-bg-sphere:nth-child(6)  { width: 35px; height: 35px; top: 80%; left: 10%; animation-duration: 15s; animation-delay: 5s; }
.amber-bg-sphere:nth-child(7)  { width: 18px; height: 18px; top: 10%; left: 85%; animation-duration: 9s;  animation-delay: 2.5s; }
.amber-bg-sphere:nth-child(8)  { width: 28px; height: 28px; top: 45%; right: 2%; animation-duration: 12s; animation-delay: 4.5s; }
.amber-bg-sphere:nth-child(9)  { width: 12px; height: 12px; top: 88%; right: 15%; animation-duration: 8s;  animation-delay: 1.5s; }
.amber-bg-sphere:nth-child(10) { width: 22px; height: 22px; top: 60%; left: 8%;  animation-duration: 14s; animation-delay: 3.5s; }
.amber-bg-sphere:nth-child(11) { width: 16px; height: 16px; top: 5%;  left: 20%; animation-duration: 11s; animation-delay: 6s; }
.amber-bg-sphere:nth-child(12) { width: 32px; height: 32px; top: 35%; right: 15%; animation-duration: 13s; animation-delay: 7s; }
.amber-bg-sphere:nth-child(13) { width: 10px; height: 10px; top: 92%; left: 30%; animation-duration: 9s;  animation-delay: 5.5s; }
.amber-bg-sphere:nth-child(14) { width: 24px; height: 24px; top: 50%; left: 20%; animation-duration: 15s; animation-delay: 8s; }
.amber-bg-sphere:nth-child(15) { width: 14px; height: 14px; top: 75%; right: 25%; animation-duration: 10s; animation-delay: 4s; }

@keyframes amberBgSphereFloat {
    0%   { transform: translate(0, 0) scale(0.5); opacity: 0; }
    10%  { opacity: 0.7; }
    30%  { transform: translate(60px, -40px) scale(1.1); opacity: 0.9; }
    55%  { transform: translate(120px, 20px) scale(0.9); opacity: 0.6; }
    80%  { opacity: 0.4; }
    100% { transform: translate(180px, -10px) scale(0.4); opacity: 0; }
}

/* --- Пузырьки --- */
.amber-bubbles-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.amber-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(0, 240, 255, 0.4) 60%, rgba(0, 100, 200, 0.1));
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.6);
    animation: amberFloatUp 8s infinite ease-in-out;
}

.amber-b1 { width: 14px; height: 14px; left: 10%; bottom: -20px; animation-duration: 7s; }
.amber-b2 { width: 22px; height: 22px; left: 85%; bottom: -20px; animation-duration: 9s; animation-delay: 1s; }
.amber-b3 { width: 10px; height: 10px; left: 25%; bottom: -20px; animation-duration: 6s; animation-delay: 2s; }
.amber-b4 { width: 18px; height: 18px; left: 70%; bottom: -20px; animation-duration: 10s; animation-delay: 3s; }
.amber-b5 { width: 12px; height: 12px; left: 50%; bottom: -20px; animation-duration: 8s; animation-delay: 1.5s; }
.amber-b6 { width: 16px; height: 16px; left: 38%; bottom: -20px; animation-duration: 7.5s; animation-delay: 0.5s; }

@keyframes amberFloatUp {
    0%   { transform: translateY(0) scale(0.8); opacity: 0; }
    20%  { opacity: 0.8; }
    80%  { opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(1.2); opacity: 0; }
}

/* --- Субстанция --- */
.amber-substance-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.amber-substance {
    position: absolute;
    display: block;
    width: 50px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 35%, rgba(121, 245, 255, 0.92), rgba(0, 187, 226, 0.4) 42%, rgba(0, 93, 149, 0) 74%);
    box-shadow: 0 0 22px rgba(0, 224, 255, 0.52);
    filter: blur(1px);
    opacity: 0;
    animation: amberSubstanceDrift 13s linear infinite;
}

.amber-s1 { top: 18%; left: -16%; animation-delay: -2s; }
.amber-s2 { top: 44%; left: -18%; width: 30px; height: 14px; animation-duration: 10s; animation-delay: -6s; }
.amber-s3 { top: 67%; left: -14%; width: 66px; height: 28px; animation-duration: 17s; animation-delay: -11s; }
.amber-s4 { top: 30%; left: -12%; width: 20px; height: 10px; animation-duration: 9s;  animation-delay: -4s; }
.amber-s5 { top: 84%; left: -18%; width: 44px; height: 18px; animation-duration: 15s; animation-delay: -8s; }

@keyframes amberSubstanceDrift {
    0%   { transform: translateX(0) translateY(0) scale(0.8); opacity: 0; }
    20%  { opacity: 0.7; }
    50%  { transform: translateX(60vw) translateY(-10px) scale(1.1); opacity: 0.9; }
    80%  { opacity: 0.5; }
    100% { transform: translateX(120vw) translateY(0) scale(0.7); opacity: 0; }
}

/* --- Верхние табы --- */
.amber-top-nav {
    position: relative;
    z-index: 10;
    display: flex;
    height: 48px;
    background: rgba(12, 18, 24, 0.85);
    border-bottom: 2px solid #2a2115;
    flex-shrink: 0;
}

.amber-nav-tab {
    flex: 1;
    border: none;
    background: #141b22;
    color: #616e7d;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px #000;
}

.amber-nav-tab.active {
    background: linear-gradient(180deg, #996e33 0%, #4a3315 100%);
    color: #fff;
    border-bottom: 2px solid #fcd34d;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* --- Главная область --- */
.amber-main-stage {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    overflow-y: auto;
    gap: 6px;
    min-height: 0;
}

/* --- Карточка результата --- */
.amber-result-card {
    width: 100%;
    background: rgba(5, 15, 25, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 10px;
    padding: 6px 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.amber-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.amber-result-row-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
}

.amber-legacy-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #2f3f4a;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.amber-legacy-badge.amber-badge-exclusive { background: #4f3b5e; color: #e9d8f5; }
.amber-legacy-badge.amber-badge-soldier   { background: #2f3f4a; color: #cbd5e1; }

.amber-detail-chance {
    color: #f1f5f9;
    font-weight: 700;
    font-size: 1.7rem;
    text-align: center;
    flex: 1;
}

.amber-legacy-quality {
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1.2;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    flex-shrink: 0;
    text-align: right;
}

.amber-legacy-target {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: #e2e8f0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    padding: 1px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: 0.2px;
    transition: all 0.4s ease;
    display: inline-block;
}

.amber-legacy-target.soldier {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
}

/* --- Настройки эксклюзивного режима --- */
.amber-exclusive-select-container {
    width: 100%;
    margin: 4px 0;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.amber-exclusive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.amber-exclusive-title {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amber-settings-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    padding: 0;
}

.amber-settings-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
}

.amber-settings-toggle-btn:active {
    transform: scale(0.9);
}

.amber-settings-toggle-btn.active {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.08);
}

.amber-exclusive-settings-body {
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
}

.amber-exclusive-settings-body.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.amber-select-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.amber-select-group label {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amber-exclusive-ant-select,
.amber-exclusive-amber-select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23616e7d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.amber-exclusive-ant-select:hover,
.amber-exclusive-amber-select:hover {
    border-color: rgba(0, 240, 255, 0.4);
}

.amber-exclusive-ant-select:focus-visible,
.amber-exclusive-amber-select:focus-visible {
    outline: none;
    border-color: rgba(0, 240, 255, 0.6);
}

.amber-exclusive-ant-select option,
.amber-exclusive-amber-select option {
    background: #1a2a35;
    color: #f1f5f9;
}

.amber-ant-probabilities {
    margin-top: 2px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 0.6rem;
    color: #94a3b8;
    text-align: center;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: none;
    word-break: break-all;
}

/* --- Мифический прогресс --- */
.amber-mythic-progress-container {
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(246, 43, 44, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amber-mythic-progress-container label {
    color: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amber-mythic-progress-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.amber-mythic-progress-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.amber-mythic-progress-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.amber-mythic-progress-btn:active {
    transform: scale(0.9);
}

.amber-mythic-progress-value {
    color: #F62B2C;
    font-size: 1.3rem;
    font-weight: 900;
    min-width: 40px;
    text-align: center;
}

.amber-mythic-progress-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #F62B2C 0%, #F62B2C var(--progress, 0%), #2a2a2a var(--progress, 0%), #2a2a2a 100%);
    border-radius: 2px;
    outline: none;
    transition: background 0.3s ease;
}

.amber-mythic-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #F62B2C;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(246, 43, 44, 0.5);
}

.amber-mythic-progress-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #F62B2C;
    cursor: pointer;
    border: 2px solid #fff;
}

.amber-mythic-progress-label {
    color: #94a3b8;
    font-size: 0.7rem;
    text-align: center;
}

.amber-mythic-progress-label span {
    color: #F62B2C;
    font-weight: 700;
}

/* --- Сфера --- */
.amber-sphere-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
    width: 100%;
    flex: 1;
    min-height: 100px;
    animation: amberOrbDrift 5.5s ease-in-out infinite;
}

@keyframes amberOrbDrift {
    0%, 100% { transform: translateY(5px); }
    50%      { transform: translateY(-9px); }
}

.amber-glowing-orb {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: amberPulseGlow 4s infinite ease-in-out;
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.amber-ant-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.2));
    transition: filter 0.5s ease;
}

.amber-orb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    transition: box-shadow 0.5s ease;
    box-shadow: inset 0 0 80px rgba(0, 240, 255, 0.15), inset 0 0 40px rgba(0, 240, 255, 0.1);
}

.amber-glowing-orb::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    z-index: 0;
    background: radial-gradient(circle at 28% 22%, rgba(220, 255, 255, 0.3) 0%, transparent 70%);
    animation: amberOrbSurface 7s ease-in-out infinite alternate;
    pointer-events: none;
}

.amber-glowing-orb::after {
    content: '';
    position: absolute;
    width: 115%;
    height: 42%;
    left: -10%;
    bottom: 7%;
    z-index: 0;
    background: radial-gradient(ellipse, rgba(0, 229, 255, 0.15), rgba(0, 120, 180, 0.05) 52%, transparent 72%);
    filter: blur(5px);
    animation: amberOrbCurrent 6.5s ease-in-out infinite;
    pointer-events: none;
}

.amber-glowing-orb.pulse-anim {
    animation: amberPulseGlow 4s infinite ease-in-out, amberPopEffect 0.3s ease-out;
}

@keyframes amberPulseGlow {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.03); }
}

@keyframes amberPopEffect {
    0%   { transform: scale(0.95); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes amberOrbSurface {
    from { transform: translate3d(-8px, -5px, 0) scale(0.96); opacity: 0.7; }
    to   { transform: translate3d(10px, 8px, 0) scale(1.05); opacity: 1; }
}

@keyframes amberOrbCurrent {
    0%, 100% { transform: translateX(-16px) rotate(-5deg); opacity: 0.45; }
    50%      { transform: translateX(20px) rotate(6deg); opacity: 0.82; }
}

/* --- Нижний блок --- */
.amber-bottom-bar {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 12px 16px;
    background: linear-gradient(180deg, rgba(2, 11, 20, 0) 0%, rgba(2, 11, 20, 0.95) 40%);
    gap: 6px;
    flex-shrink: 0;
    min-height: 80px;
}

.amber-goal-btn {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amber-goal-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.amber-goal-btn:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.amber-goal-btn.has-goal {
    border-color: #FFD700;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.08);
}

.amber-goal-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.amber-goal-text .amber-goal-highlight {
    color: #FFD700;
    font-weight: 700;
}

.amber-goal-text .amber-goal-quality {
    font-weight: 700;
}

.amber-goal-text .amber-goal-type {
    color: #49ACF9;
    font-weight: 600;
}

.amber-goal-text .amber-no-goal {
    color: #616e7d;
}

/* --- Счётчик --- */
.amber-counter-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.amber-counter-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
}

.amber-counter-value {
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 900;
    min-width: 24px;
    text-align: center;
}

.amber-counter-value.has-goal {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.amber-reset-btn,
.amber-stats-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    padding: 0;
}

.amber-reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
}

.amber-reset-btn:active {
    transform: scale(0.9);
}

.amber-stats-btn {
    display: none;
}

.amber-stats-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #FFD700;
}

.amber-stats-btn:active {
    transform: scale(0.9);
}

/* --- Авто-тумблер --- */
.amber-auto-toggle-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.amber-auto-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    user-select: none;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s ease;
}

.amber-auto-toggle:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.amber-auto-toggle input {
    display: none;
}

.amber-toggle-slider {
    position: relative;
    width: 34px;
    height: 18px;
    background: #2a2a2a;
    border-radius: 9px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.amber-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #616e7d;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.amber-auto-toggle input:checked + .amber-toggle-slider {
    background: linear-gradient(135deg, #996e33, #f59e0b);
}

.amber-auto-toggle input:checked + .amber-toggle-slider::before {
    transform: translateX(16px);
    background: #fff;
}

.amber-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.amber-auto-toggle input:checked ~ .amber-toggle-label {
    color: #FFD700;
}

/* --- Кнопка «Получить» --- */
.amber-get-btn {
    width: 100%;
    height: 42px;
    border: 1px solid #ffe89c;
    border-radius: 21px;
    background: linear-gradient(180deg, #ffe066 0%, #f59e0b 40%, #b45309 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #ffffff;
    font-weight: 900;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: filter 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0 16px;
}

.amber-get-btn:active {
    filter: brightness(0.95);
}

.amber-get-btn:hover {
    filter: brightness(1.1);
}

.amber-get-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: brightness(0.7);
}

.amber-get-btn:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* --- Модалки проекта --- */
.amber-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1050;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: amberModalFadeIn 0.3s ease;
}

.amber-modal-overlay.active {
    display: flex;
}

@keyframes amberModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.amber-modal-content {
    background: linear-gradient(180deg, #1a2a35 0%, #0d1a22 100%);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    max-height: 90vh;
    overflow-y: auto;
}

.amber-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.amber-modal-header h2 {
    color: #f1f5f9;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.amber-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.amber-modal-close:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
}

.amber-modal-close:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.amber-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.amber-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amber-modal-field label {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.amber-modal-field select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23616e7d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.amber-modal-field select:hover {
    border-color: rgba(0, 240, 255, 0.4);
}

.amber-modal-field select:focus-visible {
    outline: none;
    border-color: rgba(0, 240, 255, 0.6);
}

.amber-modal-field select option {
    background: #1a2a35;
    color: #f1f5f9;
    padding: 6px;
}

.amber-modal-field small {
    color: #94a3b8;
    font-size: 0.75rem;
    display: block;
    margin-top: 2px;
}

.amber-selected-ant-display {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: #FFD700;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amber-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.amber-modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.amber-modal-btn-primary {
    background: linear-gradient(180deg, #996e33 0%, #4a3315 100%);
    color: #fff;
    border: 1px solid #fcd34d;
}

.amber-modal-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.amber-modal-btn-primary:active {
    transform: scale(0.97);
}

.amber-modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.amber-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
}

.amber-modal-btn-secondary:active {
    transform: scale(0.97);
}

/* --- Поздравление --- */
.amber-congrats-content {
    max-width: 360px;

    text-align: center;
    position: relative;
    overflow: hidden;
}

.amber-congrats-content::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 1.5rem;
    height: 1.5rem;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6), transparent 70%);
    border-radius: 50%;
    animation: amberSparkleFloat 3s ease-in-out infinite;
}

.amber-congrats-content::after {
    content: '';
    position: absolute;
    top: 15%;
    right: 10%;
    width: 1.5rem;
    height: 1.5rem;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6), transparent 70%);
    border-radius: 50%;
    animation: amberSparkleFloat 3s ease-in-out infinite 1.5s;
}

@keyframes amberSparkleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    50%      { transform: translateY(-10px) scale(1.2); opacity: 1; }
}

.amber-congrats-header {
    border-bottom: none;
    padding-bottom: 0;
}

.amber-congrats-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FFD700, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: amberCongratsGlow 2s ease-in-out infinite;
}

@keyframes amberCongratsGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3)); }
    50%      { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.6)); }
}

.amber-congrats-body {
    align-items: center;
    gap: 10px;
}

.amber-congrats-icon {
    font-size: 4rem;
    color: #FFD700;
    animation: amberCongratsBounce 1s ease infinite;
}

@keyframes amberCongratsBounce {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1) rotate(-5deg); }
}

.amber-congrats-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.amber-congrats-details {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.6;
    width: 100%;
}

.amber-congrats-details strong {
    color: #FFD700;
    font-weight: 700;
}

/* --- Поздравление: строки (тема-зависимые) --- */
.amber-congrats-line {
    margin-bottom: 10px;
}

.amber-congrats-quality {
    font-weight: 700;
    font-size: 1.1rem;
}

.amber-congrats-name {
    color: var(--ink, #ece5d3);
    font-weight: 500;
}

.amber-congrats-attempts {
    margin-bottom: 8px;
    color: var(--ink-dim, #a39c86);
    font-size: 0.95rem;
}

.amber-congrats-attempts strong {
    color: #FFD700;
}

.amber-congrats-phrase {
    color: var(--ink, #ece5d3);
    font-size: 0.9rem;
    font-style: italic;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.amber-congrats-mythic {
    color: #F62B2C;
    font-weight: 700;
    margin: 4px 0;
}

.amber-congrats-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    margin-top: 4px;
}

.amber-congrats-stats-title {
    color: var(--ink-dim, #a39c86);
    font-size: 0.75rem;
    margin-bottom: 6px;
    text-align: center;
}

.amber-congrats-btn {
    margin-top: 8px;
    min-width: 150px;
    font-size: 1rem;
    padding: 12px;
}

/* --- Статистика внутри поздравления --- */
.amber-congrats-details .amber-stats-summary {
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.75rem;
    text-align: center;
}

.amber-congrats-details .amber-stats-summary strong {
    color: #FFD700;
}

.amber-congrats-details .amber-stats-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 120px;
    overflow-y: auto;
}

.amber-congrats-details .amber-stats-row {
    display: grid;
    grid-template-columns: 60px repeat(5, 1fr);
    gap: 2px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.15);
    min-height: 20px;
    align-items: center;
}

.amber-congrats-details .amber-stats-header {
    background: rgba(0, 0, 0, 0.35);
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #94a3b8;
    min-height: 16px;
}

.amber-congrats-details .amber-stats-cell {
    text-align: center;
    font-size: 0.65rem;
    padding: 1px 0;
    line-height: 1.2;
}

.amber-congrats-details .amber-stats-cell.amber-stats-name {
    text-align: left;
    color: #f1f5f9;
    font-weight: 500;
    font-size: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 2px;
}

.amber-congrats-details .amber-stats-cell.amber-stats-quality {
    font-weight: 700;
    font-size: 0.6rem;
}

.amber-congrats-details .amber-stats-cell.amber-stats-count {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.65rem;
}

/* --- Модалка статистики --- */
.amber-stats-content {
    max-width: 480px;
}

.amber-stats-body {
    max-height: 350px;
    overflow-y: auto;
}

.amber-stats-summary {
    text-align: center;
    padding: 10px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.amber-stats-summary strong {
    color: #FFD700;
    font-size: 1rem;
}

.amber-stats-table {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.amber-stats-row {
    display: grid;
    grid-template-columns: 100px repeat(5, 1fr);
    gap: 3px;
    padding: 5px 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease;
}

.amber-stats-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.amber-stats-header {
    background: rgba(0, 0, 0, 0.4);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 3px;
}

.amber-stats-header:hover {
    background: rgba(0, 0, 0, 0.4);
}

.amber-stats-cell {
    text-align: center;
    font-size: 0.8rem;
    padding: 2px 0;
}

.amber-stats-cell.amber-stats-name {
    text-align: left;
    color: #f1f5f9;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amber-stats-cell.amber-stats-quality {
    font-weight: 600;
    font-size: 0.7rem;
}

.amber-stats-cell.amber-stats-count {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.8rem;
}

.amber-stats-body::-webkit-scrollbar,
.amber-congrats-details .amber-stats-table::-webkit-scrollbar {
    width: 4px;
}

.amber-stats-body::-webkit-scrollbar-track,
.amber-congrats-details .amber-stats-table::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.amber-stats-body::-webkit-scrollbar-thumb,
.amber-congrats-details .amber-stats-table::-webkit-scrollbar-thumb {
    background: #4a3315;
    border-radius: 2px;
}

.amber-stats-body::-webkit-scrollbar-thumb:hover,
.amber-congrats-details .amber-stats-table::-webkit-scrollbar-thumb:hover {
    background: #996e33;
}

/* ============================================================
   СВЕТЛАЯ ТЕМА
   ============================================================ */
:root[data-theme="light"] .amber-screen {
    background:
        radial-gradient(circle at 50% 40%, rgba(10, 103, 131, 0.10) 0%, rgba(3, 34, 55, 0.06) 48%, #eee9dc 100%),
        #eee9dc;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] .amber-screen::before { opacity: 0.12; }
:root[data-theme="light"] .amber-screen::after  { opacity: 0.12; }

:root[data-theme="light"] .amber-top-nav {
    background: rgba(243, 238, 223, 0.95);
    border-bottom-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-nav-tab {
    background: #e4dece;
    color: var(--ink-dim, #625b49);
    text-shadow: none;
}

:root[data-theme="light"] .amber-nav-tab.active {
    background: linear-gradient(180deg, #c6a259 0%, #8a641d 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* --- Карточка результата --- */
:root[data-theme="light"] .amber-result-card {
    background: rgba(250, 247, 239, 0.9);
    border-color: var(--line-brass, rgba(135, 100, 35, 0.42));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .amber-detail-chance,
:root[data-theme="light"] .amber-legacy-target {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-legacy-target {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.01));
    border-color: var(--line-soft, #e4dccb);
}

:root[data-theme="light"] .amber-legacy-target.soldier {
    color: var(--ink-dim, #625b49);
    border-color: var(--line-soft, #e4dccb);
    background: rgba(0, 0, 0, 0.02);
}

:root[data-theme="light"] .amber-legacy-badge {
    background: #e4dccb;
    color: var(--ink-dim, #625b49);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-legacy-badge.amber-badge-exclusive { background: #e6d6f2; color: #4f3b5e; }
:root[data-theme="light"] .amber-legacy-badge.amber-badge-soldier   { background: #d9e2ea; color: #2f3f4a; }

/* --- Настройки эксклюзивного режима --- */
:root[data-theme="light"] .amber-exclusive-select-container {
    background: rgba(250, 247, 239, 0.92);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-exclusive-header {
    border-bottom-color: var(--line-soft, #e4dccb);
}

:root[data-theme="light"] .amber-exclusive-title,
:root[data-theme="light"] .amber-select-group label {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-settings-toggle-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--line, #d5cab3);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-settings-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-settings-toggle-btn.active {
    color: #8a641d;
    border-color: rgba(135, 100, 35, 0.5);
    background: rgba(198, 162, 89, 0.12);
}

:root[data-theme="light"] .amber-exclusive-ant-select,
:root[data-theme="light"] .amber-exclusive-amber-select {
    background: #fffdf7;
    color: var(--ink, #292519);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-exclusive-ant-select option,
:root[data-theme="light"] .amber-exclusive-amber-select option {
    background: #faf7ef;
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-ant-probabilities {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink-dim, #625b49);
    border-color: var(--line-soft, #e4dccb);
}

/* --- Мифический прогресс --- */
:root[data-theme="light"] .amber-mythic-progress-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(153, 71, 29, 0.35);
}

:root[data-theme="light"] .amber-mythic-progress-container label {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-mythic-progress-label {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-mythic-progress-value {
    color: #99471d;
}

:root[data-theme="light"] .amber-mythic-progress-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--line, #d5cab3);
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-mythic-progress-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--brass, #8a641d);
}

:root[data-theme="light"] .amber-mythic-progress-slider {
    background: linear-gradient(to right, #99471d 0%, #99471d var(--progress, 0%), #d5cab3 var(--progress, 0%), #d5cab3 100%);
}

:root[data-theme="light"] .amber-mythic-progress-slider::-webkit-slider-thumb {
    background: #99471d;
    border-color: #fffdf7;
}

:root[data-theme="light"] .amber-mythic-progress-slider::-moz-range-thumb {
    background: #99471d;
    border-color: #fffdf7;
}

/* --- Нижний блок --- */
:root[data-theme="light"] .amber-bottom-bar {
    background: linear-gradient(180deg, rgba(238, 233, 220, 0) 0%, rgba(238, 233, 220, 0.95) 40%);
}

:root[data-theme="light"] .amber-goal-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--line, #d5cab3);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-goal-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--brass, #8a641d);
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-goal-btn.has-goal {
    border-color: #8a641d;
    color: #8a641d;
    background: rgba(198, 162, 89, 0.12);
}

:root[data-theme="light"] .amber-goal-text .amber-no-goal {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-counter-section {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-counter-label {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-counter-value {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-counter-value.has-goal {
    color: #8a641d;
    text-shadow: 0 0 10px rgba(138, 100, 29, 0.25);
}

:root[data-theme="light"] .amber-reset-btn,
:root[data-theme="light"] .amber-stats-btn {
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-reset-btn:hover,
:root[data-theme="light"] .amber-stats-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ink, #292519);
}

/* --- Авто-тумблер --- */
:root[data-theme="light"] .amber-auto-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--line, #d5cab3);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-auto-toggle:hover {
    border-color: var(--brass, #8a641d);
}

:root[data-theme="light"] .amber-toggle-slider {
    background: #d5cab3;
}

:root[data-theme="light"] .amber-toggle-slider::before {
    background: #887e6a;
}

:root[data-theme="light"] .amber-toggle-label {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-auto-toggle input:checked ~ .amber-toggle-label {
    color: #8a641d;
}

/* --- Модалки --- */
:root[data-theme="light"] .amber-modal-overlay {
    background: rgba(40, 30, 10, 0.55);
}

:root[data-theme="light"] .amber-modal-content {
    background: var(--panel, #faf7ef);
    border-color: var(--line, #d5cab3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] .amber-modal-header {
    border-bottom-color: var(--line-soft, #e4dccb);
}

:root[data-theme="light"] .amber-modal-header h2,
:root[data-theme="light"] .amber-congrats-text {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-modal-close {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-modal-close:hover {
    color: var(--ink, #292519);
    background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .amber-modal-field label,
:root[data-theme="light"] .amber-modal-field small {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-modal-field select {
    background: #fffdf7;
    color: var(--ink, #292519);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-modal-field select option {
    background: #faf7ef;
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-selected-ant-display {
    background: #fffdf7;
    color: #8a641d;
    border-color: rgba(135, 100, 35, 0.5);
}

:root[data-theme="light"] .amber-modal-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--ink-dim, #625b49);
    border-color: var(--line, #d5cab3);
}

:root[data-theme="light"] .amber-modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--ink, #292519);
}

/* --- Поздравление: строки --- */
:root[data-theme="light"] .amber-congrats-name,
:root[data-theme="light"] .amber-congrats-phrase {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-congrats-attempts,
:root[data-theme="light"] .amber-congrats-stats-title {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-congrats-attempts strong {
    color: #8a641d;
}

:root[data-theme="light"] .amber-congrats-phrase {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .amber-congrats-mythic {
    color: #99471d;
}

:root[data-theme="light"] .amber-congrats-stats {
    border-top-color: var(--line-soft, #e4dccb);
}

:root[data-theme="light"] .amber-congrats-details {
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-congrats-details strong {
    color: #8a641d;
}

/* --- Статистика --- */
:root[data-theme="light"] .amber-stats-summary,
:root[data-theme="light"] .amber-congrats-details .amber-stats-summary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-stats-summary strong {
    color: #8a641d;
}

:root[data-theme="light"] .amber-stats-row {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .amber-stats-row:hover {
    background: rgba(0, 0, 0, 0.07);
}

:root[data-theme="light"] .amber-stats-header {
    background: rgba(0, 0, 0, 0.07);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-stats-cell.amber-stats-name,
:root[data-theme="light"] .amber-stats-cell.amber-stats-count {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-congrats-details .amber-stats-row {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .amber-congrats-details .amber-stats-header {
    background: rgba(0, 0, 0, 0.07);
    color: var(--ink-dim, #625b49);
}

:root[data-theme="light"] .amber-congrats-details .amber-stats-cell.amber-stats-name,
:root[data-theme="light"] .amber-congrats-details .amber-stats-cell.amber-stats-count {
    color: var(--ink, #292519);
}

:root[data-theme="light"] .amber-congrats-details .amber-stats-summary strong {
    color: #8a641d;
}

:root[data-theme="light"] .amber-stats-body::-webkit-scrollbar-thumb,
:root[data-theme="light"] .amber-congrats-details .amber-stats-table::-webkit-scrollbar-thumb {
    background: #b79754;
}

:root[data-theme="light"] .amber-stats-body::-webkit-scrollbar-thumb:hover,
:root[data-theme="light"] .amber-congrats-details .amber-stats-table::-webkit-scrollbar-thumb:hover {
    background: #8a641d;
}

/* --- Адаптив --- */
@media (max-width: 430px) {
    .amber-screen {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .amber-top-nav { height: 44px; }
    .amber-nav-tab { font-size: 0.9rem; }

    .amber-main-stage {
        padding: 6px 12px 4px 12px;
        gap: 4px;
    }

    .amber-result-card { padding: 4px 10px; border-radius: 8px; }
    .amber-legacy-badge { font-size: 0.5rem; padding: 1px 8px; }
    .amber-detail-chance { font-size: 1.6rem; }
    .amber-legacy-quality { font-size: 0.7rem; }
    .amber-legacy-target { font-size: 0.65rem; padding: 1px 10px; border-radius: 12px; }
    .amber-result-row { gap: 4px; }
    .amber-result-row-center { margin-top: 1px; }

    .amber-glowing-orb { width: 260px; height: 260px; }

    .amber-bg-sphere:nth-child(1)  { width: 22px; height: 22px; }
    .amber-bg-sphere:nth-child(2)  { width: 16px; height: 16px; }
    .amber-bg-sphere:nth-child(3)  { width: 30px; height: 30px; }
    .amber-bg-sphere:nth-child(4)  { width: 12px; height: 12px; }
    .amber-bg-sphere:nth-child(5)  { width: 18px; height: 18px; }
    .amber-bg-sphere:nth-child(6)  { width: 26px; height: 26px; }
    .amber-bg-sphere:nth-child(7)  { width: 14px; height: 14px; }
    .amber-bg-sphere:nth-child(8)  { width: 20px; height: 20px; }
    .amber-bg-sphere:nth-child(9)  { width: 10px; height: 10px; }
    .amber-bg-sphere:nth-child(10) { width: 18px; height: 18px; }
    .amber-bg-sphere:nth-child(11) { width: 14px; height: 14px; }
    .amber-bg-sphere:nth-child(12) { width: 24px; height: 24px; }
    .amber-bg-sphere:nth-child(13) { width: 8px;  height: 8px; }
    .amber-bg-sphere:nth-child(14) { width: 20px; height: 20px; }
    .amber-bg-sphere:nth-child(15) { width: 12px; height: 12px; }

    .amber-exclusive-select-container { padding: 8px 10px; margin: 2px 0; gap: 4px; }
    .amber-exclusive-header { padding: 0 0 2px 0; }
    .amber-exclusive-title { font-size: 0.6rem; }
    .amber-settings-toggle-btn { width: 24px; height: 24px; font-size: 0.75rem; }
    .amber-select-group label { font-size: 0.7rem; }
    .amber-exclusive-ant-select,
    .amber-exclusive-amber-select { font-size: 0.8rem; padding: 7px 10px; }
    .amber-ant-probabilities { font-size: 0.6rem; padding: 4px 8px; }

    .amber-mythic-progress-container { padding: 6px 8px; }
    .amber-mythic-progress-container label { font-size: 0.7rem; }
    .amber-mythic-progress-btn { width: 28px; height: 28px; font-size: 1.1rem; }
    .amber-mythic-progress-value { font-size: 1.1rem; min-width: 34px; }
    .amber-mythic-progress-label { font-size: 0.7rem; }

    .amber-bottom-bar { padding: 6px 12px 10px 12px; gap: 4px; min-height: 70px; }
    .amber-goal-btn { font-size: 0.75rem; padding: 5px 10px; min-height: 30px; border-radius: 8px; }
    .amber-goal-text { font-size: 0.75rem; }
    .amber-counter-section { padding: 5px 10px; gap: 5px; border-radius: 8px; }
    .amber-counter-label { font-size: 0.7rem; }
    .amber-counter-value { font-size: 0.9rem; min-width: 20px; }
    .amber-reset-btn,
    .amber-stats-btn { width: 22px; height: 22px; font-size: 0.65rem; }
    .amber-auto-toggle { font-size: 0.7rem; padding: 3px 10px; gap: 6px; }
    .amber-toggle-slider { width: 30px; height: 16px; }
    .amber-toggle-slider::before { width: 12px; height: 12px; top: 2px; left: 2px; }
    .amber-auto-toggle input:checked + .amber-toggle-slider::before { transform: translateX(14px); }
    .amber-toggle-label { font-size: 0.7rem; }
    .amber-get-btn { height: 38px; font-size: 0.85rem; border-radius: 19px; }

    .amber-modal-content { padding: 16px; margin: 10px; }
    .amber-modal-header h2 { font-size: 1rem; }
    .amber-modal-body { gap: 10px; }
    .amber-modal-field label { font-size: 0.8rem; }
    .amber-modal-field select { font-size: 0.85rem; padding: 8px 10px; }
    .amber-modal-field small { font-size: 0.7rem; }
    .amber-modal-btn { font-size: 0.75rem; padding: 10px; }
    .amber-stats-row { grid-template-columns: 70px repeat(5, 1fr); font-size: 0.7rem; padding: 4px 6px; }
    .amber-stats-cell.amber-stats-name { font-size: 0.7rem; }
    .amber-stats-cell.amber-stats-quality { font-size: 0.65rem; }
    .amber-stats-cell.amber-stats-count { font-size: 0.75rem; }

    .amber-congrats-content { padding: 16px; }
    .amber-congrats-icon { font-size: 3.5rem; }
    .amber-congrats-text { font-size: 1.1rem; }
    .amber-congrats-details { font-size: 0.85rem; }
    .amber-congrats-btn { font-size: 0.85rem; padding: 10px; min-width: 120px; }
}

@media (max-width: 370px) {
    .amber-result-card { padding: 3px 8px; }
    .amber-legacy-badge { font-size: 0.45rem; padding: 1px 6px; }
    .amber-detail-chance { font-size: 1.5rem; }
    .amber-legacy-quality { font-size: 0.6rem; }
    .amber-legacy-target { font-size: 0.55rem; padding: 1px 8px; }
    .amber-glowing-orb { width: 200px; height: 200px; }

    .amber-bottom-bar { padding: 4px 8px 8px 8px; gap: 3px; min-height: 60px; }
    .amber-goal-btn { font-size: 0.65rem; padding: 4px 8px; min-height: 26px; }
    .amber-goal-text { font-size: 0.65rem; }
    .amber-counter-section { padding: 4px 8px; gap: 4px; }
    .amber-counter-label { font-size: 0.6rem; }
    .amber-counter-value { font-size: 0.75rem; min-width: 16px; }
    .amber-reset-btn,
    .amber-stats-btn { width: 18px; height: 18px; font-size: 0.55rem; }
    .amber-auto-toggle { font-size: 0.6rem; padding: 2px 8px; gap: 4px; }
    .amber-toggle-slider { width: 26px; height: 14px; }
    .amber-toggle-slider::before { width: 10px; height: 10px; top: 2px; left: 2px; }
    .amber-auto-toggle input:checked + .amber-toggle-slider::before { transform: translateX(12px); }
    .amber-toggle-label { font-size: 0.6rem; }
    .amber-get-btn { height: 32px; font-size: 0.7rem; border-radius: 16px; padding: 0 8px; }

    .amber-settings-toggle-btn { width: 20px; height: 20px; font-size: 0.65rem; }
    .amber-mythic-progress-value { font-size: 0.95rem; min-width: 28px; }
    .amber-mythic-progress-btn { width: 24px; height: 24px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    .amber-screen::before,
    .amber-screen::after,
    .amber-substance,
    .amber-bubble,
    .amber-sphere-wrapper,
    .amber-glowing-orb,
    .amber-glowing-orb::before,
    .amber-glowing-orb::after,
    .amber-congrats-content::before,
    .amber-congrats-content::after,
    .amber-congrats-icon,
    .amber-congrats-header h2 {
        animation: none !important;
    }
}
}
