* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: 'Segoe UI', Tahoma, sans-serif; overflow-x: hidden; }
body { background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 100%); }

/* ===== LOGIN ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-container { width: 100%; max-width: 400px; }
.login-card { background: #fff; padding: 40px 30px; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center; }
.login-icon { font-size: 80px; animation: float 3s ease-in-out infinite; }
.login-card h1 { color: #2c3e50; margin: 10px 0; font-size: 28px; }
.subtitle { color: #7f8c8d; margin-bottom: 25px; }
.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; color: #34495e; font-weight: 600; font-size: 14px; }
.form-group input { width: 100%; padding: 12px 15px; border: 2px solid #ecf0f1; border-radius: 10px; font-size: 15px; transition: all 0.3s; }
.form-group input:focus { outline: none; border-color: #3498db; }
.btn { padding: 12px 25px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-block; }
.btn-primary { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(52,152,219,0.4); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.btn-success { background: linear-gradient(135deg, #27ae60, #229954); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #f39c12, #d68910); color: #fff; }
.btn-block { width: 100%; display: block; }
.alert { padding: 10px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.alert-error { background: #fadbd8; color: #c0392b; border-left: 4px solid #c0392b; }
.alert-success { background: #d4efdf; color: #229954; border-left: 4px solid #229954; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* ===== DASHBOARD ===== */
.app-header { background: linear-gradient(135deg, #34495e, #2c3e50); color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); position: sticky; top: 0; z-index: 100; }
.app-header h2 { font-size: 18px; }
.user-info { font-size: 13px; text-align: right; }
.user-info small { opacity: 0.8; }

.sidebar { background: #fff; padding: 15px; box-shadow: 2px 0 10px rgba(0,0,0,0.05); }
.sidebar a { display: block; padding: 12px 15px; color: #34495e; text-decoration: none; border-radius: 8px; margin-bottom: 5px; transition: all 0.2s; font-size: 14px; }
.sidebar a:hover, .sidebar a.active { background: #3498db; color: #fff; }

.container { padding: 20px; max-width: 1200px; margin: 0 auto; }
.card { background: #fff; border-radius: 15px; padding: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); margin-bottom: 20px; }
.card h3 { color: #2c3e50; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #ecf0f1; }

/* ===== GRID ===== */
.grid { display: grid; gap: 15px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat-card { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; padding: 20px; border-radius: 15px; text-align: center; }
.stat-card.green { background: linear-gradient(135deg, #27ae60, #229954); }
.stat-card.orange { background: linear-gradient(135deg, #f39c12, #d68910); }
.stat-card.red { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.stat-card .stat-number { font-size: 36px; font-weight: bold; }
.stat-card .stat-label { font-size: 13px; opacity: 0.9; margin-top: 5px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #ecf0f1; font-size: 14px; }
th { background: #34495e; color: #fff; font-weight: 600; }
tr:hover { background: #f8f9fa; }

/* ===== FORM ===== */
.form-control { width: 100%; padding: 10px 12px; border: 2px solid #ecf0f1; border-radius: 8px; font-size: 14px; margin-bottom: 10px; }
.form-control:focus { outline: none; border-color: #3498db; }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { background: #fff; }

/* ===== GAME ===== */
.game-container { position: relative; width: 100%; height: calc(100vh - 60px); overflow: hidden; background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 70%, #90EE90 100%); }
.game-header { position: absolute; top: 0; left: 0; right: 0; padding: 10px 15px; background: rgba(255,255,255,0.9); display: flex; justify-content: space-between; align-items: center; z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.game-header .timer { font-size: 20px; font-weight: bold; color: #e74c3c; }
.game-header .score { font-size: 16px; font-weight: bold; color: #27ae60; }
.game-header .progress { font-size: 14px; color: #34495e; }

#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ===== CLOUDS ===== */
.cloud { position: absolute; background: #fff; border-radius: 50%; opacity: 0.8; pointer-events: none; }

/* ===== POPUP ===== */
.popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.popup-content { background: #fff; padding: 30px; border-radius: 20px; text-align: center; max-width: 400px; width: 100%; }
.popup-content h2 { margin-bottom: 15px; color: #2c3e50; }
.popup-content p { margin-bottom: 20px; color: #555; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-header h2 { font-size: 16px; }
    .container { padding: 15px; }
    .card { padding: 15px; }
    .stat-card .stat-number { font-size: 28px; }
    th, td { padding: 8px; font-size: 13px; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .game-container { height: 100vh; }
}

/* ===== BADGE ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; color: #fff; }
.badge-success { background: #27ae60; }
.badge-danger { background: #e74c3c; }
.badge-info { background: #3498db; }

/* ===== ACTION BUTTONS ===== */
.btn-sm { padding: 6px 12px; font-size: 12px; }
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }