/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0b0f1a;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}
/* Color tokens */
:root {
    --btn-grad-start: #0083FD;
    --btn-grad-end: #5300FD;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* SwiftUI-like Background Layers */
.bg-blobs,
.bg-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-blobs::before,
.bg-blobs::after {
    content: '';
    position: absolute;
    width: 438px;
    height: 438px;
    border-radius: 50%;
    filter: blur(100px);
}

.bg-blobs::before {
    top: -120px;
    left: -120px;
    background: rgba(88, 101, 242, 0.30); /* circle1 30% */
}

.bg-blobs::after {
    top: -60px;
    right: -160px;
    background: rgba(147, 51, 234, 0.20); /* circle2 20% */
}

.bg-overlay {
    z-index: -1;
    background: radial-gradient(
        circle at 10% 10%,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.06) 10%,
        rgba(255,255,255,0.00) 40%
    );
    mix-blend-mode: overlay;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

.header .branding {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.7;
    font-style: italic;
    margin-top: 4px;
}

/* Game Status */
.game-status {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #667eea;
}

.loading-spinner i {
    font-size: 1.5rem;
}

/* Game Interface */
.game-interface {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.game-info {
    margin-bottom: 25px;
}

.info-card {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 12px;
    flex: 1;
    min-width: 200px;
}

.info-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.info-item strong {
    color: #667eea;
    font-weight: 600;
}

/* Chat Container */
.chat-container {
    margin-bottom: 25px;
}

.chat-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.chat-header h3 {
    color: #495057;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header i {
    color: #667eea;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
}

/* Guess Input Container */
.guess-input-container {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.guess-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guess-input-wrapper input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.guess-input-wrapper input:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.guess-input-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.guess-input-actions .action-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.secondary-btn {
    background: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background: #5a6268;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.ai {
    background: #e9ecef;
    color: #495057;
    margin-right: auto;
}

/* AI answer correctness states */
.message.ai.ai-yes {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.message.ai.ai-no {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.35);
}

.message .message-content {
    margin-bottom: 8px;
}

.message .message-meta {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Input Section */
.input-section {
    margin-bottom: 25px;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-container input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(90deg, var(--btn-grad-start), var(--btn-grad-end));
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.send-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

.send-btn:active {
    transform: translateY(0);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.input-hint i {
    color: #ffc107;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.quick-guess-btn {
    background: linear-gradient(90deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #ffffff;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.quick-guess-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.action-hint {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

/* Game Actions */
.game-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.primary-btn {
    background: linear-gradient(90deg, var(--btn-grad-start), var(--btn-grad-end));
    color: white;
}

.primary-btn:hover {
    filter: brightness(1.05);
}

.guess-btn {
    background: linear-gradient(90deg, var(--btn-grad-start), var(--btn-grad-end));
    color: #ffffff;
}

.guess-btn:hover {
    filter: brightness(1.05);
}

.new-game-btn {
    background: #6c757d;
    color: white;
}

.new-game-btn:hover {
    background: #5a6268;
}

/* Countdown Container */
.countdown-container {
    background: transparent;
    border-radius: 0;
    padding: 60px 20px;
    text-align: center;
    box-shadow: none;
}

.countdown-content i {
    display: none;
}

.countdown-content h3 {
    color: #E5E7EB;
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 700;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.time-unit {
    text-align: center;
    min-width: 90px;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    padding: 14px 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 16px rgba(0,0,0,0.25);
}

.time-unit span {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.time-unit label {
    color: #cbd5e1;
    font-size: 0.9rem;
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.countdown-message {
    color: #cbd5e1;
    font-size: 1rem;
}

/* Welcome Screen */
.welcome-screen {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.welcome-icon {
    margin-bottom: 25px;
}

.welcome-icon i {
    font-size: 4rem;
    color: #667eea;
}

.welcome-screen h2 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 2rem;
}

.welcome-screen p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 35px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.feature i {
    color: #667eea;
    font-size: 1.2rem;
    width: 20px;
}

.start-btn {
    font-size: 1.2rem;
    padding: 18px 35px;
    margin: 24px auto 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #495057;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px 30px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* Result Content Styles */
.result-success {
    text-align: center;
    padding: 20px 0;
}

.result-success i {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 20px;
}

.result-success h4 {
    color: #28a745;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.result-fail {
    text-align: center;
    padding: 20px 0;
}

.result-fail i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.result-fail h4 {
    color: #dc3545;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.daily-mystery {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.daily-mystery h5 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.daily-mystery .mystery-word {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.daily-mystery .mystery-url {
    color: #6c757d;
    text-decoration: none;
}

.daily-mystery .mystery-url:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .game-interface,
    .game-status,
    .countdown-container,
    .welcome-screen {
        padding: 20px;
    }
    
    .info-card {
        flex-direction: column;
    }
    
    .info-item {
        min-width: auto;
    }
    
    .countdown-timer {
        gap: 12px;
    }
    
    .time-unit span {
        font-size: 2.4rem;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-actions {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .quick-guess-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .countdown-timer {
        gap: 15px;
    }
    
    .time-unit {
        min-width: 60px;
    }
    
    .time-unit span {
        font-size: 1.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Footer Styles */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand p {
    color: #ffffff;
    font-size: 14px;
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-link {
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    color: #ffffff !important;
    opacity: 0.8;
    text-decoration: underline;
}

.footer-link:visited {
    color: #ffffff !important;
}

.footer-separator {
    color: #ffffff;
    font-size: 14px;
}

/* Modal Close Button */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Privacy Policy and Terms Content */
.privacy-content,
.terms-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.privacy-content h4,
.terms-content h4 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.privacy-content h4:first-child,
.terms-content h4:first-child {
    margin-top: 0;
}

.privacy-content p,
.terms-content p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.privacy-content ul,
.terms-content ul {
    color: #555;
    margin: 10px 0 15px 20px;
}

.privacy-content li,
.terms-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.privacy-content strong,
.terms-content strong {
    color: #333;
    font-weight: 600;
}

.privacy-content em,
.terms-content em {
    color: #888;
    font-size: 14px;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .footer-brand p {
        font-size: 13px;
    }
    
    .footer-link {
        font-size: 13px;
    }
}
