:root {
    /* Оранжево-зеленая палитра - улучшенная */
    --orange-primary: #FF6B35;
    --orange-light: #FF8C42;
    --orange-lighter: #FFB88C;
    --orange-dark: #E55A2B;
    --green-primary: #4ECDC4;
    --green-light: #6EDDD6;
    --green-lighter: #8EEDE6;
    --green-dark: #2EBCB3;
    --green-accent: #44A08D;
    
    /* Базовые цвета - светлые и читаемые */
    --bg-color: #FFFFFF;
    --text-color: #1A1A1A;
    --text-color-light: #2C3E50;
    --hint-color: #6B7280;
    --button-color: var(--orange-primary);
    --button-text-color: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-bg-solid: #FFFFFF;
    --border-color: rgba(255, 107, 53, 0.2);
    --gradient-start: #FF6B35;
    --gradient-end: #4ECDC4;
    --gradient-mid: #FFB88C;
}

[data-theme="dark"] {
    --bg-color: #0F0F0F;
    --text-color: #F5F5F5;
    --text-color-light: #E5E5E5;
    --hint-color: #A0A0A0;
    --button-color: var(--orange-primary);
    --button-text-color: #FFFFFF;
    --card-bg: rgba(30, 30, 30, 0.95);
    --card-bg-solid: #1E1E1E;
    --border-color: rgba(255, 107, 53, 0.3);
    --gradient-start: #FF8C42;
    --gradient-end: #6EDDD6;
    --gradient-mid: #FFB88C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: background 0.3s, color 0.3s;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px 16px;
    position: relative;
    z-index: 1;
}

.access-denied {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 500;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 28px;
    padding: 28px;
    border: 2px solid var(--border-color);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .card {
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--orange-primary), var(--green-primary));
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 107, 53, 0.4);
}

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

.card-label {
    display: block;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.4px;
}

.order-card .card-label {
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bonk-card .card-label {
    background: linear-gradient(135deg, var(--green-primary), var(--green-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

textarea {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 18px;
    background: var(--card-bg-solid);
    color: #FFD4B8;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

textarea:focus {
    outline: none;
    border-color: var(--orange-primary);
    box-shadow: 
        0 0 0 4px rgba(255, 107, 53, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.04);
    background: var(--card-bg-solid);
}

textarea::placeholder {
    color: #FFD4B8;
    opacity: 0.9;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.chip {
    padding: 12px 22px;
    border: 2px solid var(--border-color);
    border-radius: 26px;
    background: var(--card-bg-solid);
    color: #FFB88C;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--orange-primary), var(--green-primary));
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.chip:hover::before {
    left: 0;
}

.chip:hover {
    border-color: var(--orange-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

.chip:active {
    transform: translateY(-1px) scale(0.97);
}

.chip span {
    position: relative;
    z-index: 1;
}

.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 400px;
    height: 400px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-light));
    color: var(--button-text-color);
    box-shadow: 
        0 6px 20px rgba(255, 107, 53, 0.4),
        0 2px 8px rgba(255, 107, 53, 0.2);
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 28px rgba(255, 107, 53, 0.5),
        0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:not(:disabled):active {
    transform: translateY(-1px) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(135deg, #CCCCCC, #BBBBBB);
}

.btn-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* Bonk Image Button */
.bonk-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px 0;
    min-height: 220px;
}

.bonk-image-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.bonk-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
}

.bonk-image-btn:hover .bonk-image {
    transform: scale(1.08) rotate(8deg);
    filter: drop-shadow(0 16px 32px rgba(78, 205, 196, 0.5));
}

.bonk-image-btn:active .bonk-image {
    transform: scale(0.92) rotate(-8deg);
}

.bonk-image-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Bonk Text Popup Animation */
.bonk-text-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: 900;
    color: var(--orange-primary);
    text-shadow: 
        0 0 30px rgba(255, 107, 53, 0.9),
        0 6px 12px rgba(0, 0, 0, 0.4),
        3px 3px 0 var(--green-primary),
        -3px -3px 0 var(--green-primary),
        0 0 20px rgba(78, 205, 196, 0.6);
    pointer-events: none;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 6px;
    opacity: 0;
    user-select: none;
}

.bonk-text-popup.animate {
    animation: bonkPop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bonkPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2) rotate(-25deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3) rotate(8deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.6) rotate(15deg) translateY(-120px);
    }
}

.status-text {
    margin-top: 18px;
    text-align: center;
    font-size: 15px;
    min-height: 22px;
    color: var(--text-color);
    font-weight: 600;
}

.status-text.success {
    color: var(--green-primary);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(78, 205, 196, 0.3);
}

.status-text.error {
    color: var(--orange-dark);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(229, 90, 43, 0.3);
}

.cooldown-text {
    text-align: center;
    font-size: 14px;
    color: var(--orange-primary);
    margin-top: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 107, 53, 0.3);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bonk-card {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

.order-card {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

/* Адаптивность */
@media (max-width: 320px) {
    .container {
        padding: 20px 12px;
    }
    
    h1 {
        font-size: 26px;
    }
    
    .card {
        padding: 22px;
        border-radius: 24px;
    }
    
    .bonk-image {
        width: 160px;
        height: 160px;
    }
    
    .bonk-text-popup {
        font-size: 56px;
    }
}

/* Улучшения для темной темы */
[data-theme="dark"] .card {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #0F0F0F 100%);
}

[data-theme="dark"] body::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
}

[data-theme="dark"] textarea {
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(255, 107, 53, 0.25);
}

[data-theme="dark"] .chip {
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(255, 107, 53, 0.25);
    color: #FFB88C;
}
