/* ONE NIGHT GAME - Telegram Mini App Styles v5.07 */

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0000 100%);
    color: #e0e0e0;
}

#app-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

#app-content {
    min-height: calc(100% + 1px);
    width: 100%;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none !important;
    width: 100%;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.screen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Logo */
.logo {
    margin-bottom: 60px;
    animation: fadeIn 0.8s ease-out;
}

.logo h1 {
    font-size: 32px;
    font-weight: bold;
    color: #dc143c;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.subtitle {
    font-size: 14px;
    color: #999;
    letter-spacing: 1px;
}

/* Buttons Container */
.buttons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* Button Styles */
.btn {
    width: 100%;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:active::before {
    opacity: 1;
}

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

.btn-icon {
    font-size: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #dc143c, #8b0000);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.3);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3), rgba(74, 0, 0, 0.3));
    color: #dc143c;
    border: 2px solid #8b0000;
}

.btn-secondary:active {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.5), rgba(74, 0, 0, 0.5));
    border-color: #dc143c;
    transform: translateY(2px);
}

/* Info Text */
.info-text {
    padding: 20px;
    background: rgba(26, 0, 0, 0.4);
    border: 1px solid #4a0000;
    border-radius: 10px;
    animation: fadeIn 1s ease-out 0.3s both;
}

.info-text p {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
}

/* Test Container */
.test-container {
    width: 100%;
    max-width: 400px;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.question-header {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.question-number {
    font-size: 14px;
    color: #dc143c;
    margin-bottom: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 10px;
}

.question-text {
    font-size: 19px;
    line-height: 1.7;
    color: #e0e0e0;
    text-align: center;
    padding: 0 10px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.slider-section {
    margin-bottom: 20px;
    margin-top: 20px;
    flex-shrink: 0;
}

.slider-labels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 5px;
}

.slider-labels span {
    font-size: 11px;
    color: #999;
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
}

.slider-wrapper {
    padding: 0 10px;
    margin-bottom: 25px;
}

#answerSlider {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, #dc143c 0%, #8b0000 25%, #4a0000 50%, #2a0000 75%, #1a0000 100%);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
}

#answerSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    background: #dc143c;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.6);
    transition: transform 0.2s;
}

#answerSlider::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

#answerSlider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    background: #dc143c;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.6);
    transition: transform 0.2s;
}

#answerSlider::-moz-range-thumb:active {
    transform: scale(1.2);
}

.selected-value {
    font-size: 17px;
    color: #dc143c;
    font-weight: bold;
    text-align: center;
    padding: 18px;
    background: rgba(220, 20, 60, 0.1);
    border: 1px solid #8b0000;
    border-radius: 10px;
}

.navigation-buttons {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
    padding-bottom: 10px;
}

.btn-nav {
    flex: 1;
    padding: 16px 20px;
    font-size: 14px;
}

/* Code Input Container */
.code-input-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.code-input-header {
    margin-bottom: 50px;
}

.code-input-header h2 {
    font-size: 28px;
    color: #dc143c;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.code-input-subtitle {
    font-size: 14px;
    color: #999;
    letter-spacing: 1px;
}

.code-inputs-wrapper {
    margin-bottom: 30px;
}

.code-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.code-cell {
    width: 50px;
    height: 50px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #dc143c;
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid #8b0000;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.code-cell:focus {
    border-color: #dc143c;
    background: rgba(220, 20, 60, 0.2);
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.4);
}

.code-cell:not(:placeholder-shown) {
    background: rgba(220, 20, 60, 0.15);
}

/* Validation Message */
.code-validation-message {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(220, 20, 60, 0.15);
    border: 2px solid #dc143c;
    border-radius: 10px;
    animation: shakeError 0.5s ease-in-out;
}

.code-validation-message p {
    font-size: 15px;
    color: #dc143c;
    font-weight: bold;
    line-height: 1.6;
    margin: 0;
}

/* Continue Button Wrapper */
.code-continue-wrapper {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-out;
}

/* Result Container */
.result-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    text-align: center;
}

.result-header {
    margin-bottom: 40px;
}

.result-header h2 {
    font-size: 28px;
    color: #dc143c;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.code-display {
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid #8b0000;
    border-radius: 15px;
    animation: pulse 2s ease-in-out infinite;
}

.code-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-value {
    font-size: 36px;
    font-weight: bold;
    color: #dc143c;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
}

.result-description {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(26, 0, 0, 0.4);
    border: 1px solid #4a0000;
    border-radius: 10px;
}

.result-description p {
    font-size: 15px;
    color: #e0e0e0;
    line-height: 1.8;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.form-slide {
    width: 100%;
}

.form-header {
    margin-bottom: 40px;
    text-align: center;
}

.form-step {
    font-size: 14px;
    color: #dc143c;
    margin-bottom: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-header h2 {
    font-size: 26px;
    color: #dc143c;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.form-subtitle {
    font-size: 13px;
    color: #999;
    margin-top: 10px;
}

.form-input-wrapper {
    margin-bottom: 60px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    color: #e0e0e0;
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid #8b0000;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(220, 20, 60, 0.4);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #dc143c;
    background: rgba(220, 20, 60, 0.15);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    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='%23dc143c' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.form-select option {
    background: #1a0000;
    color: #e0e0e0;
}

/* Form Summary */
.form-summary {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(26, 0, 0, 0.4);
    border: 1px solid #4a0000;
    border-radius: 10px;
}

.summary-item {
    margin-bottom: 20px;
    text-align: left;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-label {
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 17px;
    color: #dc143c;
    font-weight: bold;
    word-wrap: break-word;
}

.form-submit-wrapper {
    margin-bottom: 20px;
}

/* ... (Existing styles remain the same) ... */

/* Legal Checkboxes */
.legal-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    color: #ccc;
    line-height: 1.4;
    text-align: left;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #8b0000;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #dc143c;
    border-color: #dc143c;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.link-text {
    color: #dc143c;
    text-decoration: underline;
    cursor: pointer;
}

/* Legal Modals */
.legal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.legal-modal-content {
    background: #1a1a1a;
    width: 90%;
    height: 80%;
    border-radius: 15px;
    border: 1px solid #4a0000;
    position: relative;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    background: rgba(0,0,0,0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-text-container {
    overflow-y: auto;
    height: 100%;
    padding-right: 5px;
    text-align: left;
}

.legal-text-container h3 {
    color: #dc143c;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    padding-right: 20px;
}

.terms-text p, .terms-text ul li {
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 10px;
}

.terms-text h4 {
    color: #fff;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- CAPTCHA STYLES --- */
.captcha-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.92);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.captcha-content {
    background: linear-gradient(135deg, #1a0000, #0a0a0a);
    padding: 30px 20px;
    border-radius: 20px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    border: 2px solid #8b0000;
    box-shadow: 0 0 50px rgba(220, 20, 60, 0.4);
}

.captcha-content h3 {
    margin: 0 0 15px 0;
    color: #dc143c;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

.captcha-content p {
    color: #999;
    margin-bottom: 25px;
    font-size: 15px;
    letter-spacing: 1px;
}

.captcha-target-text {
    font-weight: bold;
    color: #e0e0e0;
    font-size: 18px;
    text-transform: uppercase;
    border-bottom: 2px solid #dc143c;
    padding-bottom: 4px;
    margin-left: 5px;
}

.captcha-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.captcha-btn {
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid #4a0000;
    border-radius: 12px;
    font-size: 32px;
    padding: 15px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.captcha-btn:active {
    background: rgba(220, 20, 60, 0.3);
    border-color: #dc143c;
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.5);
}

.captcha-error {
    color: #dc143c;
    margin-top: 15px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: shakeError 0.4s ease-in-out;
}

/* ===== PHONE VERIFICATION ===== */
.phone-verify-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.phone-input-container {
    position: relative;
    width: 100%;
}

.phone-input-container .form-input {
    padding-right: 45px;
}

.phone-input-container .form-input[readonly] {
    background: rgba(30, 30, 30, 0.8);
    cursor: default;
    color: #888;
}

.phone-input-container .form-input.verified {
    background: rgba(0, 100, 0, 0.2) !important;
    border-color: #4CAF50 !important;
    color: #4CAF50 !important;
}

.phone-verified-badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.btn-verify {
    background: linear-gradient(135deg, #0088cc 0%, #00aaff 100%);
    color: white;
    padding: 16px 24px;
}

.btn-verify:hover {
    background: linear-gradient(135deg, #006699 0%, #0088cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 136, 204, 0.4);
}

.btn-verify:disabled {
    background: #444;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-verify.verified {
    background: linear-gradient(135deg, #2e7d32 0%, #4CAF50 100%);
}

.phone-hint {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin: 0;
}

.phone-hint.success {
    color: #4CAF50;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.5);
    }
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 480px) {
    .logo h1 {
        font-size: 28px;
    }
    
    .question-text {
        font-size: 17px;
        min-height: 80px;
    }
    
    .code-value {
        font-size: 28px;
        letter-spacing: 2px;
    }
    
    .code-cell {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .code-row {
        gap: 6px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }
}

@media (max-width: 380px) {
    .code-cell {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .code-row {
        gap: 5px;
    }
}
