/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tile: #111111;
    --bg-tile-hover: #1a1a1a;
    
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    
    /* Цвета обводок плиток */
    --gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    --blue: #00D4FF;
    --blue-glow: rgba(0, 212, 255, 0.4);
    --purple: #A855F7;
    --purple-glow: rgba(168, 85, 247, 0.4);
    --green: #10B981;
    --green-glow: rgba(16, 185, 129, 0.4);
    --red: #EF4444;
    --red-glow: rgba(239, 68, 68, 0.4);
    --cyan: #06B6D4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    
    --radius: 16px;
    --radius-sm: 12px;
    --gap: 16px;
    --padding: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== ШАПКА ===== */
.header {
    padding: 20px 0 30px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Кнопка настроек */
.settings-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: translateY(-50%) rotate(45deg);
}

.settings-btn .material-symbols-rounded {
    font-size: 22px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ===== СЕТКА ПЛИТОК ===== */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
    flex: 1;
}

/* ===== ПЛИТКА (БАЗОВЫЙ СТИЛЬ) ===== */
.tile {
    position: relative;
    background: var(--bg-tile);
    border-radius: var(--radius);
    padding: 24px 16px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-medium);
    border: 2px solid transparent;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 2px;
    background: linear-gradient(135deg, var(--border-color) 0%, transparent 50%, var(--border-color) 100%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.8;
    transition: opacity var(--transition-medium);
}

.tile:hover::before {
    opacity: 1;
}

.tile:hover {
    transform: translateY(-4px) scale(1.02);
    background: var(--bg-tile-hover);
}

.tile:active {
    transform: translateY(-2px) scale(1.01);
}

/* Свечение плитки */
.tile-glow {
    position: absolute;
    inset: -30%;
    background: radial-gradient(
        ellipse 60% 60% at center,
        var(--glow-color) 0%,
        color-mix(in srgb, var(--glow-color) 60%, transparent) 25%,
        color-mix(in srgb, var(--glow-color) 30%, transparent) 50%,
        transparent 80%
    );
    opacity: 0;
    filter: blur(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    pointer-events: none;
    z-index: 0;
    will-change: opacity, transform;
}

.tile:hover .tile-glow {
    opacity: 0.4;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        opacity: 0.35; 
        transform: scale(1); 
        filter: blur(20px);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(1.05); 
        filter: blur(25px);
    }
}

/* Блик на плитке */
.tile-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%
    );
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 2;
}

.tile:hover .tile-shine {
    left: 100%;
}

/* Контент плитки */
.tile-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.tile-icon {
    font-size: 36px;
    margin-bottom: 12px;
    transition: transform var(--transition-medium);
}

.tile-icon .material-symbols-rounded {
    font-size: 36px;
}

/* Material Symbols base styling */
.material-symbols-rounded {
    font-size: inherit;
    vertical-align: middle;
    line-height: 1;
}

.logo-icon.material-symbols-rounded {
    font-size: 32px;
}

.tile:hover .tile-icon {
    transform: scale(1.15);
    animation: icon-bounce 0.5s ease;
}

@keyframes icon-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1.15); }
}

.tile-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.tile-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Бейдж "Soon" */
.tile-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-soon {
    opacity: 0.6;
    cursor: default;
}

.tile-soon:hover {
    transform: none;
}

.tile-soon:hover .tile-glow {
    opacity: 0;
}

.tile-soon:hover .tile-shine {
    left: -100%;
}

/* ===== ЦВЕТА ПЛИТОК ===== */

/* Циановая (Поиск подарков) */
.tile-cyan {
    --border-color: var(--cyan);
    --glow-color: var(--cyan);
}

.tile-cyan .tile-title {
    background: linear-gradient(135deg, var(--cyan) 0%, #00D4FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tile-cyan::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--cyan) 30%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--cyan) 20%, transparent) 100%
    );
    box-shadow: 
        0 0 30px color-mix(in srgb, var(--cyan) 40%, transparent),
        0 0 60px color-mix(in srgb, var(--cyan) 20%, transparent),
        inset 0 0 30px rgba(6, 182, 212, 0.03);
    opacity: 0;
    filter: blur(1px);
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.tile-cyan:hover::after {
    opacity: 1;
}

/* Синяя (Trade Ban) */
.tile-blue {
    --border-color: var(--blue);
    --glow-color: var(--blue);
}

.tile-blue .tile-title {
    background: linear-gradient(135deg, var(--blue) 0%, #0099FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tile-blue::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--blue) 30%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--blue) 20%, transparent) 100%
    );
    box-shadow: 
        0 0 30px color-mix(in srgb, var(--blue) 40%, transparent),
        0 0 60px color-mix(in srgb, var(--blue) 20%, transparent),
        inset 0 0 30px rgba(0, 212, 255, 0.03);
    opacity: 0;
    filter: blur(1px);
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.tile-blue:hover::after {
    opacity: 1;
}

/* Фиолетовая */
.tile-purple {
    --border-color: var(--purple);
    --glow-color: var(--purple);
}

.tile-purple .tile-title {
    background: linear-gradient(135deg, var(--purple) 0%, #9333EA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tile-purple::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--purple) 30%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--purple) 20%, transparent) 100%
    );
    box-shadow: 
        0 0 30px color-mix(in srgb, var(--purple) 40%, transparent),
        0 0 60px color-mix(in srgb, var(--purple) 20%, transparent),
        inset 0 0 30px rgba(168, 85, 247, 0.03);
    opacity: 0;
    filter: blur(1px);
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.tile-purple:hover::after {
    opacity: 1;
}

/* Зелёная */
.tile-green {
    --border-color: var(--green);
    --glow-color: var(--green);
}

.tile-green .tile-title {
    background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tile-green::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--green) 30%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--green) 20%, transparent) 100%
    );
    box-shadow: 
        0 0 30px color-mix(in srgb, var(--green) 40%, transparent),
        0 0 60px color-mix(in srgb, var(--green) 20%, transparent),
        inset 0 0 30px rgba(16, 185, 129, 0.03);
    opacity: 0;
    filter: blur(1px);
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.tile-green:hover::after {
    opacity: 1;
}

/* Красная */
.tile-red {
    --border-color: var(--red);
    --glow-color: var(--red);
}

.tile-red::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius) + 2px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--red) 30%, transparent) 0%,
        transparent 40%,
        transparent 60%,
        color-mix(in srgb, var(--red) 20%, transparent) 100%
    );
    box-shadow: 
        0 0 30px color-mix(in srgb, var(--red) 40%, transparent),
        0 0 60px color-mix(in srgb, var(--red) 20%, transparent),
        inset 0 0 30px rgba(239, 68, 68, 0.03);
    opacity: 0;
    filter: blur(1px);
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.tile-red:hover::after {
    opacity: 1;
}

/* Голубая */
.tile-cyan {
    --border-color: var(--cyan);
    --glow-color: var(--cyan);
}

/* ===== ФУТЕР ===== */
.footer {
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.rally-link {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--transition-fast);
}

.rally-link:hover {
    filter: brightness(1.2);
    text-shadow: 0 0 20px var(--cyan-glow);
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
    transition: transform var(--transition-medium);
    z-index: 101;
    overflow: hidden;
}

.modal.active {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h2 .material-symbols-rounded {
    font-size: 22px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-content {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 480px) {
    :root {
        --padding: 16px;
        --gap: 12px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .logo-icon {
        font-size: 28px;
    }
    
    .tile {
        padding: 20px 12px;
        min-height: 120px;
    }
    
    .tile-icon {
        font-size: 30px;
        margin-bottom: 8px;
    }
    
    .tile-title {
        font-size: 14px;
    }
    
    .tile-desc {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .tiles-grid {
        gap: 10px;
    }
    
    .tile {
        padding: 16px 10px;
        min-height: 110px;
    }
    
    .tile-icon {
        font-size: 26px;
    }
    
    .tile-title {
        font-size: 13px;
    }
}

/* ===== АНИМАЦИЯ ПОЯВЛЕНИЯ ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tile {
    animation: fadeInUp 0.5s ease backwards;
}

.tile:nth-child(1) { animation-delay: 0.1s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.3s; }
.tile:nth-child(4) { animation-delay: 0.4s; }
.tile:nth-child(5) { animation-delay: 0.5s; }
.tile:nth-child(6) { animation-delay: 0.6s; }

/* ===== ФОРМЫ В МОДАЛЬНОМ ОКНЕ ===== */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    background: var(--bg-tile);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.input-group input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px var(--cyan-glow);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== КНОПКИ ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
}

.btn-icon .material-symbols-rounded {
    font-size: 18px;
}

.btn-cyan {
    background: linear-gradient(135deg, var(--cyan) 0%, #00D4FF 100%);
    color: #000;
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--cyan-glow);
}

.btn-blue {
    background: linear-gradient(135deg, var(--blue) 0%, #0099FF 100%);
    color: #000;
}

.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--blue-glow);
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    color: #fff;
    margin-top: 16px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

/* ===== РЕЗУЛЬТАТЫ ===== */
#search-result,
#tradeban-result {
    margin-top: 20px;
}

.result-card {
    background: var(--bg-tile);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.3s ease;
}

.result-card.status-banned {
    border-color: var(--red);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.result-card.status-ok {
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.gift-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0 auto 16px;
    display: block;
}

/* TGS Animation Player */
.gift-animation {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    display: block;
}

/* TGS Container */
.tgs-container {
    display: inline-block;
    overflow: hidden;
}

.tgs-container svg {
    width: 100% !important;
    height: 100% !important;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.highlight {
    background: rgba(255, 255, 255, 0.05);
    margin: 0 -20px;
    padding: 12px 20px;
    border-radius: 8px;
}

.result-row .label {
    color: var(--text-secondary);
    font-size: 14px;
}

.result-row .value {
    font-weight: 600;
    font-size: 14px;
    text-align: right;
}

.result-row .value.has-link {
    color: var(--blue);
}

.result-row .rarity {
    color: var(--gold);
    font-size: 12px;
    margin-left: 8px;
}

.result-row .countdown {
    color: var(--red);
    font-size: 16px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.status-badge .material-symbols-rounded {
    font-size: 18px;
}

.status-badge.banned {
    background: rgba(239, 68, 68, 0.2);
    color: var(--red);
}

.status-badge.ok {
    background: rgba(16, 185, 129, 0.2);
    color: var(--green);
}

/* ===== LOADING & ERROR ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 16px;
    color: var(--red);
    text-align: center;
    font-size: 14px;
}

/* ===== GIFT SELECTOR MODAL ===== */
.gift-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gift-search-input {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 10px 0;
    z-index: 10;
}

.gift-search-input input {
    width: 100%;
    background: var(--bg-tile);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    padding-left: 44px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.gift-search-input input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px var(--cyan-glow);
}

.gift-search-input input::placeholder {
    color: var(--text-muted);
}

.gift-search-wrapper {
    position: relative;
}

.gift-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.5;
}

.gift-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-tile);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gift-item:hover {
    border-color: var(--gold);
    background: var(--bg-tile-hover);
    transform: translateY(-2px);
}

.gift-item:active {
    transform: scale(0.98);
}

.gift-item.selected {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

.gift-item-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: contain;
}

.gift-item-name {
    font-size: 11px;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
    font-weight: 600;
}

.gift-item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.gift-item-supply {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

.supply-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    transition: color var(--transition-fast);
}

.supply-hint.error {
    color: var(--red);
}

.supply-hint.success {
    color: var(--green);
}

.input-error {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.gift-list-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

.gift-list-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* После выбора подарка - форма ввода номера */
.gift-number-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-gift-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--bg-tile);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--cyan);
    position: relative;
}

.back-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: rgba(6, 182, 212, 0.2);
    color: var(--cyan);
}

.back-btn .material-symbols-rounded {
    font-size: 20px;
}

.selected-gift-preview img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
}

.selected-gift-info {
    text-align: center;
}

.selected-gift-info .name {
    font-weight: 700;
    font-size: 18px;
}

.selected-gift-info .supply {
    font-size: 13px;
    color: var(--cyan);
    margin-top: 4px;
    font-weight: 500;
}

.change-gift-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.change-gift-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .gift-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .gift-item {
        padding: 12px 6px;
    }
    
    .gift-item-icon {
        width: 48px;
        height: 48px;
    }
    
    .gift-item-name {
        font-size: 10px;
    }
}

/* ===== RALLY SNOW EFFECT ===== */
.rally-snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.rally-snow.disabled {
    display: none;
}

.rally-particle {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
    pointer-events: none;
    text-shadow: 0 0 8px currentColor;
    animation: rallyFall linear forwards;
    will-change: transform;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Разные варианты частиц - 15 цветов */
.rally-particle.variant-1 {
    color: rgba(6, 182, 212, 0.25);
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.rally-particle.variant-2 {
    color: rgba(168, 85, 247, 0.2);
    text-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.rally-particle.variant-3 {
    color: rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.rally-particle.variant-4 {
    color: rgba(16, 185, 129, 0.2);
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.rally-particle.variant-5 {
    color: rgba(0, 212, 255, 0.25);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

.rally-particle.variant-6 {
    color: rgba(239, 68, 68, 0.2);
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.rally-particle.variant-7 {
    color: rgba(251, 191, 36, 0.22);
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.rally-particle.variant-8 {
    color: rgba(236, 72, 153, 0.2);
    text-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.rally-particle.variant-9 {
    color: rgba(132, 204, 22, 0.2);
    text-shadow: 0 0 12px rgba(132, 204, 22, 0.4);
}

.rally-particle.variant-10 {
    color: rgba(249, 115, 22, 0.22);
    text-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

.rally-particle.variant-11 {
    color: rgba(99, 102, 241, 0.22);
    text-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}

.rally-particle.variant-12 {
    color: rgba(20, 184, 166, 0.2);
    text-shadow: 0 0 12px rgba(20, 184, 166, 0.4);
}

.rally-particle.variant-13 {
    color: rgba(244, 63, 94, 0.2);
    text-shadow: 0 0 12px rgba(244, 63, 94, 0.4);
}

.rally-particle.variant-14 {
    color: rgba(139, 92, 246, 0.22);
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

.rally-particle.variant-15 {
    color: rgba(34, 211, 238, 0.22);
    text-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

/* Разные слои глубины */
.rally-particle.depth-far {
    font-size: 10px;
    opacity: 0.3;
    filter: blur(0.5px);
}

.rally-particle.depth-mid {
    font-size: 14px;
    opacity: 0.5;
}

.rally-particle.depth-close {
    font-size: 18px;
    opacity: 0.7;
    text-shadow: 0 0 10px currentColor;
}

.rally-particle.depth-front {
    font-size: 22px;
    opacity: 0.85;
    text-shadow: 0 0 14px currentColor;
}

@keyframes rallyFall {
    0% {
        transform: translateY(-50px) translateX(0) rotate(var(--start-rotate)) scale(var(--start-scale));
        opacity: 0;
    }
    10% {
        opacity: var(--max-opacity);
    }
    25% {
        transform: translateY(calc(25vh)) translateX(calc(var(--drift) * 0.5)) rotate(calc(var(--start-rotate) + 10deg)) scale(calc(var(--start-scale) + 0.05));
    }
    50% {
        transform: translateY(calc(50vh)) translateX(var(--drift)) rotate(calc(var(--end-rotate) * 0.5)) scale(calc((var(--start-scale) + var(--end-scale)) / 2));
    }
    75% {
        transform: translateY(calc(75vh)) translateX(calc(var(--drift) * 0.5)) rotate(calc(var(--end-rotate) * 0.8)) scale(calc(var(--end-scale) - 0.05));
    }
    90% {
        opacity: var(--max-opacity);
    }
    100% {
        transform: translateY(calc(100vh + 50px)) translateX(0) rotate(var(--end-rotate)) scale(var(--end-scale));
        opacity: 0;
    }
}

/* Переключатель Rally */
.rally-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px;
    background: var(--bg-tile);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all var(--transition-medium);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition-medium);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}


.toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== МОДАЛКА НАСТРОЕК ===== */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.settings-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
    border-radius: 10px;
    color: #000;
}

.settings-item-icon .material-symbols-rounded {
    font-size: 22px;
}

.settings-item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== ATTRIBUTE FILTERS ===== */
.attribute-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filters-loading,
.filters-empty {
    width: 100%;
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.filter-group {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-group label .material-symbols-rounded {
    font-size: 14px;
}

.filter-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-dropdown:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-value {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-value.active {
    color: var(--cyan);
    font-weight: 600;
}

.filter-dropdown .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-muted);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 12px;
    align-self: flex-end;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-small {
    padding: 8px 14px;
    font-size: 12px;
}

/* Filter items dropdown */
.filter-items-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-item.selected {
    background: rgba(6, 182, 212, 0.15);
}

.filter-item-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: transparent;
    flex-shrink: 0;
}

/* Для символов (узоров) - инвертируем чтобы было видно на тёмном фоне */
.filter-item-img.symbol-img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.filter-item-name {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.filter-item-rarity {
    font-size: 12px;
    color: var(--cyan);
    font-weight: 600;
    flex-shrink: 0;
}

.filter-item-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== SEARCH MODE TABS ===== */
.search-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mode-tab.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
    color: var(--cyan);
}

.mode-tab .material-symbols-rounded {
    font-size: 18px;
}

/* ===== MASS SEARCH ===== */
.mass-search-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.mass-search-info .material-symbols-rounded {
    font-size: 18px;
    color: var(--cyan);
}

.mass-search-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== MASS SEARCH SECTION ===== */
.mass-search-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.btn-search-main {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
}

.input-group.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group.inline label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.input-group.inline input {
    width: 100px;
    padding: 10px 12px;
}

.input-group.inline span {
    color: var(--text-muted);
}

#mass-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ===== MASS RESULTS GRID ===== */
.mass-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.mass-results-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.mass-result-tile {
    background: var(--bg-tile);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.mass-result-tile:hover {
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.15);
}

.tile-media {
    position: relative;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: block;
}

.tile-media:hover {
    opacity: 0.9;
}

.tile-media video,
.tile-media img,
.tile-media tgs-player,
.tile-media .tgs-container {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tile-media .tgs-container svg {
    width: 100% !important;
    height: 100% !important;
    transform: scale(1.5);
}

.tile-number {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--cyan);
}

.tile-info {
    padding: 10px;
}

.tile-owner {
    font-size: 12px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-owner a {
    color: var(--cyan);
    text-decoration: none;
}

.tile-owner a:hover {
    text-decoration: underline;
}

.tile-owner .no-username {
    color: var(--text-secondary);
}

.tile-attrs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tile-attrs .attr {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-attrs .attr-type {
    color: var(--text-muted);
    font-weight: 600;
}

.tile-attrs .attr em {
    color: var(--cyan);
    font-style: normal;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 500px) {
    .mass-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .attribute-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

/* ===== FILTER DROPDOWN OVERLAY ===== */
.filter-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.filter-dropdown-panel {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

.filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    font-size: 15px;
}

.filter-dropdown-header span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-dropdown-header .material-symbols-rounded {
    font-size: 20px;
    color: var(--cyan);
}

.filter-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.filter-search-box .material-symbols-rounded {
    font-size: 20px;
    color: var(--text-secondary);
}

.filter-search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
}

.filter-search-box input::placeholder {
    color: var(--text-muted);
}

.filter-dropdown-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.filter-dropdown-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-dropdown-panel .filter-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.filter-dropdown-panel .filter-item {
    margin-bottom: 4px;
}
