/* ========== CHIRI AI - CYBERPUNK STYLE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: 'Courier New', 'Microsoft YaHei', monospace;
    background: radial-gradient(ellipse at center, #0a0a2a 0%, #000000 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #00d4ff;
}

/* Animated Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(125deg, #0a0a2a 0%, #1a1a3a 50%, #0a0a2a 100%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========== LOGIN SCREEN ========== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.login-container {
    background: linear-gradient(135deg, rgba(0, 20, 40, 0.95), rgba(0, 0, 0, 0.95));
    border: 2px solid #00d4ff;
    border-radius: 30px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 60px rgba(0, 212, 255, 0.6); }
}

.login-robot-glow {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

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

.gaming-title {
    font-size: 36px;
    letter-spacing: 4px;
    text-shadow: 0 0 10px #00d4ff;
    margin-bottom: 10px;
}

.gaming-title .highlight {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

.gaming-subtitle {
    font-size: 14px;
    letter-spacing: 3px;
    color: #ffaa00;
    margin-bottom: 10px;
}

.version-tag {
    font-size: 10px;
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    width: 280px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00d4ff;
    border-radius: 30px;
    color: #00d4ff;
    font-family: monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.input-group input:focus {
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.gaming-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, #00d4ff, #0088aa);
    border: none;
    border-radius: 30px;
    color: #000;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.gaming-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.login-error {
    color: #ff4444;
    font-size: 12px;
    margin-top: 15px;
}

/* ========== MODE SCREEN ========== */
.mode-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow-y: auto;
    padding: 20px;
}

.mode-container {
    max-width: 1200px;
    margin: 0 auto;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid #00d4ff;
}

.user-name {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px #00d4ff;
}

.logout-gaming {
    background: rgba(255, 0, 0, 0.3);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-gaming:hover {
    background: rgba(255, 0, 0, 0.6);
    color: white;
}

/* Robot Status */
.robot-status {
    text-align: center;
    margin-bottom: 40px;
}

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

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

.status-badge {
    width: 15px;
    height: 15px;
    background: #666;
    border-radius: 50%;
    display: inline-block;
    margin: 10px auto;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.status-text {
    font-size: 14px;
    letter-spacing: 2px;
}

/* Mode Grid */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.8), rgba(0, 0, 0, 0.8));
    border: 1px solid #00d4ff;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
    border-color: #ff00ff;
}

.mode-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.mode-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.mode-desc {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 10px;
}

.mode-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 10px;
    color: #00d4ff;
}

.mode-footer {
    text-align: center;
    padding: 20px;
}

.tip-gaming {
    font-size: 12px;
    color: #ffaa00;
    letter-spacing: 2px;
}

/* ========== MODE PANELS (Chung) ========== */
.mode-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    z-index: 100;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid #00d4ff;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00d4ff;
    color: #00d4ff;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #00d4ff;
    color: #000;
}

.panel-title {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 5px #00d4ff;
}

.panel-status {
    font-size: 12px;
    color: #ffaa00;
}

/* Chat Panel */
.chat-container {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid #00d4ff;
    word-wrap: break-word;
}

.message.user .bubble {
    background: linear-gradient(135deg, #00d4ff, #0088aa);
    color: #000;
}

.chat-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.control-btn {
    padding: 10px 25px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 30px;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: #00d4ff;
    color: #000;
}

/* Robot SVG Animation */
.robot-svg {
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
    transition: all 0.3s;
}

.robot-eye {
    transition: all 0.1s;
}

.pupil {
    transition: all 0.1s;
}

.robot-mouth {
    transition: all 0.1s;
}

/* Drive Mode */
.drive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 300px;
    margin: 30px auto;
}

.drive-btn-gaming {
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid #00d4ff;
    border-radius: 20px;
    padding: 20px;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.1s;
    text-align: center;
}

.drive-btn-gaming:active {
    transform: scale(0.95);
    background: #00d4ff;
}

.drive-btn-gaming span {
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.drive-btn-gaming.stop {
    background: rgba(255, 0, 0, 0.3);
    border-color: #ff4444;
}

.drive-voice-hint {
    text-align: center;
    font-size: 12px;
    color: #aaa;
    margin-top: 20px;
}

/* Translate Mode */
.lang-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    align-items: center;
}

.lang-select-gaming {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00d4ff;
    border-radius: 20px;
    padding: 8px 15px;
    color: #00d4ff;
    font-family: monospace;
}

.swap-gaming {
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 30px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 18px;
}

.translation-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.original-box, .translated-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00d4ff;
    border-radius: 15px;
    padding: 15px;
    min-height: 200px;
}

.box-header-gaming {
    color: #ffaa00;
    margin-bottom: 15px;
    font-size: 14px;
}

.original-text, .translated-text {
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.translate-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.control-gaming {
    padding: 8px 20px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 20px;
    color: #00d4ff;
    cursor: pointer;
}

/* Camera Mode */
.camera-container-gaming {
    padding: 20px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

#video, #canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    border-radius: 15px;
}

#video {
    position: relative;
}

.face-info {
    text-align: center;
    margin-top: 250px;
    padding: 20px;
}

.face-emoji {
    font-size: 50px;
}

.face-text {
    margin: 10px 0;
    font-size: 14px;
}

.face-details-gaming {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
}

.camera-buttons-gaming {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.cam-gaming {
    padding: 10px 20px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 20px;
    color: #00d4ff;
    cursor: pointer;
}

/* Game Mode */
.game-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    overflow: hidden;
    background: #000;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#webcam {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 160px;
    height: 120px;
    border-radius: 10px;
    border: 2px solid #00d4ff;
    z-index: 10;
}

#gameHud {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    border-left: 3px solid #00d4ff;
    z-index: 10;
}

#gameHud div {
    font-size: 14px;
    margin: 5px 0;
}

.game-instruction {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* Sleep Timer */
.sleep-timer {
    text-align: center;
    font-size: 12px;
    color: #ffaa00;
    margin-top: 10px;
}

/* Modal */
.modal-gaming {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content-gaming {
    background: linear-gradient(135deg, #0a0a2a, #000);
    border: 2px solid #00d4ff;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
}

.modal-header-gaming {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #00d4ff;
}

.close-modal-gaming {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 28px;
    cursor: pointer;
}

.modal-body-gaming {
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }
    
    .translation-box {
        grid-template-columns: 1fr;
    }
    
    .game-instruction {
        font-size: 8px;
        white-space: normal;
        text-align: center;
        width: 90%;
    }
    
    .drive-grid {
        gap: 10px;
    }
    
    .drive-btn-gaming {
        padding: 15px;
        font-size: 24px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a2a;
}

::-webkit-scrollbar-thumb {
    background: #00d4ff;
    border-radius: 4px;
}

/* Utility */
.robot-display {
    text-align: center;
    padding: 20px;
}
