/**
 * Hanzi Master Game - Complete Styles
 * Includes animations, characters, landscapes, and all UI components
 */

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
    /* Colors */
    --primary: #6c5ce7;
    --primary-dark: #5b4cdb;
    --secondary: #00cec9;
    --accent: #fd79a8;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --dark: #2d3436;
    --light: #dfe6e9;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-dark: linear-gradient(135deg, #232526 0%, #414345 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.4);
    
    /* Typography */
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-chinese: 'Noto Sans SC', 'Microsoft YaHei', 'SimHei', sans-serif;
    
    /* Sizing */
    --header-height: 60px;
    --card-radius: 16px;
    --btn-radius: 12px;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: var(--gradient-dark);
    color: var(--white);
    line-height: 1.5;
}

/* =====================================================
   LOADING SCREEN
   ===================================================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    margin-bottom: 20px;
}

.loading-logo .hanzi-char {
    font-size: 64px;
    font-family: var(--font-chinese);
    color: var(--primary);
    text-shadow: 0 0 30px rgba(108, 92, 231, 0.5);
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-logo .hanzi-char:nth-child(2) {
    animation-delay: 0.3s;
}

.loading-title {
    font-size: 28px;
    margin-bottom: 30px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 15px;
}

.loading-progress {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    animation: loadingProgress 2s ease-in-out forwards;
}

.loading-text {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--btn-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-submit {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    background: var(--success);
}

.btn-submit:hover {
    background: #00a884;
    transform: scale(1.1);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* =====================================================
   HOME SCREEN
   ===================================================== */
.home-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    overflow: hidden;
}

.home-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-chars {
    position: absolute;
    inset: 0;
}

.float-char {
    position: absolute;
    font-family: var(--font-chinese);
    font-size: 80px;
    color: rgba(108, 92, 231, 0.1);
    animation: floatChar 20s linear infinite;
}

.float-char:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.float-char:nth-child(2) { top: 20%; right: 15%; animation-delay: -4s; }
.float-char:nth-child(3) { top: 60%; left: 5%; animation-delay: -8s; }
.float-char:nth-child(4) { top: 70%; right: 10%; animation-delay: -12s; }
.float-char:nth-child(5) { top: 40%; left: 20%; animation-delay: -16s; }
.float-char:nth-child(6) { bottom: 10%; right: 20%; animation-delay: -2s; }

@keyframes floatChar {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
    50% { transform: translateY(-30px) rotate(10deg); opacity: 0.15; }
    100% { transform: translateY(0) rotate(0deg); opacity: 0.1; }
}

.home-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
}

.home-logo {
    margin-bottom: 40px;
}

.logo-chars {
    margin-bottom: 10px;
}

.logo-char {
    font-size: 80px;
    font-family: var(--font-chinese);
    display: inline-block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoFloat 3s ease-in-out infinite;
    text-shadow: none;
}

.logo-char:nth-child(2) {
    animation-delay: 0.5s;
}

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

.home-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--white), var(--light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.6);
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-bottom: 40px;
}

.home-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-card i {
    color: var(--warning);
}

.home-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* =====================================================
   LEVEL SELECT SCREEN
   ===================================================== */
.level-select-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--gradient-dark);
}

.level-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
}

.level-header h1 {
    font-size: 20px;
}

.player-stats-mini {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.player-stats-mini i {
    color: var(--warning);
}

.level-map-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.level-map {
    position: relative;
    min-height: 800px;
    max-width: 400px;
    margin: 0 auto;
}

.level-node {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
}

.level-node:hover {
    transform: translateX(-50%) scale(1.1);
}

.level-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-node.locked:hover {
    transform: translateX(-50%);
}

.node-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--white);
}

.level-node.locked .node-circle {
    background: var(--gradient-dark);
    border-color: rgba(255,255,255,0.3);
}

.level-node.completed .node-circle {
    background: var(--gradient-secondary);
}

.node-number {
    font-size: 24px;
    font-weight: 700;
}

.node-stars {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 3px;
}

.node-stars .far {
    color: rgba(255,255,255,0.3);
}

.node-title {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-details-panel {
    background: rgba(0,0,0,0.5);
    padding: 20px;
    text-align: center;
}

.level-detail-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    color: rgba(255,255,255,0.7);
}

.level-detail-stars {
    font-size: 24px;
    color: var(--warning);
    margin-bottom: 15px;
}

.level-detail-stars .far {
    color: rgba(255,255,255,0.3);
}

/* =====================================================
   GAME CONTAINER
   ===================================================== */
.game-container {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
}

/* Game Header */
.game-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background: rgba(0,0,0,0.5);
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 20px;
}

.game-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-hanzi {
    font-size: 28px;
    font-family: var(--font-chinese);
    color: var(--primary);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-badge {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}

.level-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.step-info {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

.score-display, .items-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
}

.score-display i { color: var(--warning); }
.items-display i { color: var(--accent); }

.lang-selector select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* =====================================================
   GAME WORLD & LANDSCAPE
   ===================================================== */
.game-world {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.landscape {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.landscape-layer {
    position: absolute;
    left: 0;
    right: 0;
}

.landscape-layer.sky {
    top: 0;
    height: 40%;
    background: linear-gradient(180deg, var(--sky-color, #74b9ff) 0%, rgba(255,255,255,0.3) 100%);
}

.landscape-layer.mountains {
    top: 25%;
    height: 30%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath fill='%23636e72' d='M0,30 L15,10 L30,25 L45,5 L60,20 L75,8 L90,22 L100,15 L100,30 Z'/%3E%3C/svg%3E") repeat-x;
    background-size: 300px 100%;
    animation: mountainScroll 60s linear infinite;
}

.landscape-layer.hills {
    top: 30%;
    height: 30%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath fill='%2300b894' d='M0,20 Q25,5 50,15 T100,10 L100,20 Z'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 100%;
    animation: hillScroll 40s linear infinite;
    z-index: 1;
}

.landscape-layer.ground {
    bottom: 0;
    height: 25%;
    background: var(--ground-color, #2d3436);
}

@keyframes mountainScroll {
    0% { background-position-x: 0; }
    100% { background-position-x: -300px; }
}

@keyframes hillScroll {
    0% { background-position-x: 0; }
    100% { background-position-x: -200px; }
}

/* Landscape variations */
.landscape-village .landscape-layer.sky {
    background: linear-gradient(180deg, #74b9ff 0%, #ffeaa7 100%);
}

.landscape-forest .landscape-layer.mountains {
    filter: hue-rotate(90deg);
}

.landscape-desert .landscape-layer.hills {
    filter: hue-rotate(-30deg) saturate(0.5);
}

.landscape-temple .landscape-layer.sky {
    background: linear-gradient(180deg, #a29bfe 0%, #fd79a8 100%);
}

/* =====================================================
   PROGRESS ROAD
   ===================================================== */
.progress-road {
    position: absolute;
    bottom: 2%;
    left: 3%;
    right: 3%;
    height: 140px;
    z-index: 10;
}

.road-svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.road-path {
    fill: none;
    stroke: rgba(255,255,255,0.4);
    stroke-width: 10;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.road-checkpoints {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    transform: translateY(-50%);
}

.checkpoint {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    background: rgba(45, 52, 54, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.4);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.checkpoint.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.checkpoint.current {
    background: var(--primary);
    border-color: var(--white);
    box-shadow: 0 0 20px var(--primary), 0 3px 10px rgba(0,0,0,0.3);
    animation: currentPulse 2s ease-in-out infinite;
    transform: translate(-50%, -50%) scale(1.1);
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 15px var(--primary); }
    50% { box-shadow: 0 0 30px var(--primary); }
}

/* =====================================================
   PLAYER CHARACTER
   ===================================================== */
.player-marker {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    z-index: 20;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
}

.player-avatar {
    width: 45px;
    height: 65px;
}

.player-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.player-head {
    width: 20px;
    height: 20px;
    background: #ffd8a8;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: inset -3px -3px 0 rgba(0,0,0,0.1);
}

.player-head::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -2px;
    right: -2px;
    height: 12px;
    background: #2d3436;
    border-radius: 10px 10px 0 0;
}

.player-torso {
    width: 16px;
    height: 20px;
    background: var(--primary);
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
}

.player-arm {
    width: 6px;
    height: 18px;
    background: var(--primary);
    position: absolute;
    top: 20px;
    border-radius: 3px;
    animation: armSwing 0.8s ease-in-out infinite;
}

.player-arm.left {
    left: 4px;
}

.player-arm.right {
    right: 4px;
    animation-delay: 0.4s;
}

@keyframes armSwing {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.player-leg {
    width: 7px;
    height: 18px;
    background: #2d3436;
    position: absolute;
    top: 36px;
    border-radius: 3px;
    animation: legSwing 0.8s ease-in-out infinite;
}

.player-leg.left {
    left: 10px;
}

.player-leg.right {
    right: 10px;
    animation-delay: 0.4s;
}

@keyframes legSwing {
    0%, 100% { transform: rotate(20deg); }
    50% { transform: rotate(-20deg); }
}

/* =====================================================
   CHASER (ALIEN)
   ===================================================== */
.chaser-marker {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    z-index: 15;
    filter: drop-shadow(0 3px 8px rgba(0,255,136,0.5));
}

.chaser-avatar {
    width: 55px;
    height: 75px;
}

.chaser-body {
    position: relative;
    width: 100%;
    height: 100%;
}

.chaser-head {
    width: 40px;
    height: 40px;
    background: linear-gradient(180deg, #00ff88 0%, #00cc6a 100%);
    border-radius: 50% 50% 40% 40%;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(0,255,136,0.5);
}

.chaser-eye {
    width: 12px;
    height: 16px;
    background: #000;
    border-radius: 50%;
    position: absolute;
    top: 12px;
}

.chaser-eye.left {
    left: 6px;
}

.chaser-eye.right {
    right: 6px;
}

.chaser-eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    top: 4px;
    left: 3px;
    animation: eyeGlow 1s ease-in-out infinite;
}

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

.chaser-eye.blink::after {
    animation: eyeBlink 3s ease-in-out infinite;
}

@keyframes eyeBlink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.chaser-tentacles {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
}

.tentacle {
    width: 8px;
    height: 30px;
    background: linear-gradient(180deg, #00cc6a 0%, #008844 100%);
    border-radius: 0 0 4px 4px;
    position: absolute;
    animation: tentacleWave 1s ease-in-out infinite;
}

.tentacle:nth-child(1) {
    left: -15px;
    animation-delay: 0s;
}

.tentacle:nth-child(2) {
    left: -4px;
    animation-delay: 0.3s;
}

.tentacle:nth-child(3) {
    left: 7px;
    animation-delay: 0.6s;
}

@keyframes tentacleWave {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* =====================================================
   GAME CARD AREA
   ===================================================== */
.game-card-area {
    position: absolute;
    top: 70px;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 480px;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

/* Timer */
.timer-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.timer-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 1s linear;
}

.timer-progress.warning {
    background: var(--warning);
}

.timer-progress.critical {
    background: var(--danger);
    animation: timerPulse 0.5s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-text {
    font-size: 18px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Game Card */
.game-card {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    border-radius: var(--card-radius);
    padding: clamp(10px, 2vh, 20px);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: var(--shadow-lg);
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.mode-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-evenly;
}

/* Hanzi Display */
.hanzi-display {
    margin-bottom: clamp(5px, 1.5vh, 15px);
    flex-shrink: 0;
}

.hanzi-character {
    font-size: clamp(48px, 10vh, 80px);
    font-family: var(--font-chinese);
    line-height: 1;
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: charReveal 0.5s ease-out;
}

@keyframes charReveal {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.kaiti-style .hanzi-character {
    font-family: 'KaiTi', 'STKaiti', var(--font-chinese);
}

.pinyin-text {
    font-size: clamp(16px, 2.5vh, 22px);
    color: var(--secondary);
    margin-bottom: clamp(3px, 0.5vh, 8px);
    flex-shrink: 0;
}

.meaning-text {
    font-size: clamp(14px, 2vh, 18px);
    color: rgba(255,255,255,0.7);
    margin-bottom: clamp(8px, 1.5vh, 15px);
    flex-shrink: 0;
}

.question-text {
    font-size: clamp(14px, 2vh, 18px);
    margin-bottom: clamp(10px, 2vh, 20px);
    flex-shrink: 0;
}

.instruction {
    font-size: clamp(12px, 1.5vh, 14px);
    color: rgba(255,255,255,0.6);
    margin-bottom: clamp(8px, 1.5vh, 15px);
    flex-shrink: 0;
}

/* Input Area */
.input-area {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-shrink: 0;
}

.hanzi-input {
    width: min(200px, 50vw);
    padding: clamp(10px, 1.5vh, 15px) clamp(15px, 2vw, 20px);
    font-size: clamp(20px, 3vh, 28px);
    font-family: var(--font-chinese);
    text-align: center;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: var(--white);
    outline: none;
    transition: border-color 0.3s ease;
}

.hanzi-input:focus {
    border-color: var(--primary);
}

.hanzi-input::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Sentence Input */
.sentence-display {
    margin-bottom: clamp(10px, 2vh, 20px);
    flex-shrink: 0;
}

.sentence-text {
    font-size: clamp(20px, 4vh, 32px);
    font-family: var(--font-chinese);
    margin-bottom: clamp(5px, 1vh, 10px);
    line-height: 1.4;
}

.sentence-pinyin {
    font-size: clamp(14px, 2vh, 18px);
    color: var(--secondary);
}

.sentence-input {
    width: 100%;
    padding: clamp(10px, 1.5vh, 15px);
    font-size: clamp(16px, 2.5vh, 20px);
    font-family: var(--font-chinese);
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: var(--white);
    outline: none;
    resize: none;
}

.sentence-input:focus {
    border-color: var(--primary);
}

.attempts-text {
    font-size: 14px;
    color: var(--warning);
    margin-top: 10px;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(8px, 1.5vh, 15px);
    margin-top: clamp(10px, 2vh, 20px);
    flex-shrink: 0;
}

.option-btn {
    padding: clamp(12px, 2vh, 20px);
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: var(--white);
    font-size: clamp(18px, 3vh, 28px);
    font-family: var(--font-chinese);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--primary);
    transform: scale(1.02);
}

.option-btn:active {
    transform: scale(0.98);
}

.seal-options .option-btn {
    padding: clamp(10px, 1.5vh, 15px);
}

.seal-options .option-btn img {
    max-width: clamp(50px, 10vh, 80px);
    max-height: clamp(50px, 10vh, 80px);
    filter: invert(1);
}

/* =====================================================
   FEEDBACK OVERLAY
   ===================================================== */
.feedback-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.feedback-content {
    background: rgba(0,0,0,0.9);
    padding: 40px;
    border-radius: var(--card-radius);
    text-align: center;
    max-width: 300px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.feedback-content.correct {
    border: 2px solid var(--success);
    box-shadow: 0 0 30px rgba(0,184,148,0.3);
}

.feedback-content.wrong {
    border: 2px solid var(--danger);
    box-shadow: 0 0 30px rgba(214,48,49,0.3);
}

.feedback-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.feedback-content.correct .feedback-icon {
    color: var(--success);
}

.feedback-content.wrong .feedback-icon {
    color: var(--danger);
}

.feedback-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.feedback-content p {
    font-size: 20px;
    color: var(--warning);
}

.correct-answer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.correct-hanzi {
    font-size: 40px;
    font-family: var(--font-chinese);
    display: block;
    color: var(--success);
}

.correct-pinyin {
    font-size: 18px;
    color: var(--secondary);
}

/* =====================================================
   CAUGHT OVERLAY
   ===================================================== */
.caught-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.5s ease;
}

.caught-content {
    text-align: center;
    padding: 40px;
}

.caught-animation {
    margin-bottom: 30px;
}

.chaser-big {
    width: 120px;
    height: 120px;
    background: linear-gradient(180deg, #00ff88 0%, #00cc6a 100%);
    border-radius: 50% 50% 40% 40%;
    margin: 0 auto;
    position: relative;
    animation: chaserBounce 1s ease-in-out infinite;
    box-shadow: 0 0 50px rgba(0,255,136,0.5);
}

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

.chaser-big .chaser-eye {
    width: 30px;
    height: 40px;
    top: 30px;
}

.chaser-big .chaser-eye.left { left: 20px; }
.chaser-big .chaser-eye.right { right: 20px; }

.caught-content h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--danger);
}

.caught-content p {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
}

.caught-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* =====================================================
   LEVEL COMPLETE OVERLAY
   ===================================================== */
.level-complete-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.level-complete-content {
    text-align: center;
    padding: 40px;
    position: relative;
}

.level-complete-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-stars {
    font-size: 50px;
    margin-bottom: 15px;
}

.level-stars i {
    color: rgba(255,255,255,0.2);
    margin: 0 8px;
    transition: all 0.5s ease;
    animation: starAppear 0.6s ease-out forwards;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
}

.level-stars i.earned {
    color: var(--warning);
    text-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

@keyframes starAppear {
    0% { 
        transform: scale(0) rotate(-180deg); 
        opacity: 0; 
    }
    60% { 
        transform: scale(1.3) rotate(10deg); 
        opacity: 1; 
    }
    80% { 
        transform: scale(0.9) rotate(-5deg); 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

/* Performance Badges */
.performance-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.performance-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    animation: badgeSlide 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.performance-badge:nth-child(1) { animation-delay: 0.8s; }
.performance-badge:nth-child(2) { animation-delay: 1s; }

@keyframes badgeSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.performance-badge.perfect {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
}

.performance-badge.fast {
    background: linear-gradient(135deg, #fdcb6e, #f39c12);
    color: #2d3436;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.4);
}

.performance-badge i {
    font-size: 16px;
}

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.level-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
}

.item-reward {
    background: var(--gradient-accent);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    animation: itemPop 0.5s ease-out;
}

@keyframes itemPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.item-reward i {
    font-size: 24px;
    margin-right: 10px;
}

.level-complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Confetti */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* =====================================================
   SIDE MENU
   ===================================================== */
.side-menu {
    position: fixed;
    inset: 0;
    z-index: 500;
}

.side-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.side-menu-content {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--dark);
    padding: 20px;
    animation: slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

@keyframes slideIn {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    font-size: 18px;
}

.menu-profile {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: var(--white);
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.profile-avatar .avatar-letter {
    font-weight: 700;
    font-size: 36px;
    text-transform: uppercase;
}

.profile-avatar i {
    font-size: 32px;
    opacity: 0.8;
}

#menu-username {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.rank-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-secondary);
    border-radius: 20px;
    font-size: 12px;
    margin-top: 5px;
}

.menu-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.menu-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.menu-stat i {
    font-size: 18px;
    color: var(--warning);
}

.menu-stat i.fa-trophy {
    color: var(--secondary);
}

.menu-stat i.fa-layer-group {
    color: var(--primary);
}

.menu-stat span {
    font-size: 16px;
    font-weight: 600;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1; /* Take remaining space */
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.menu-item i {
    width: 24px;
    text-align: center;
}

.menu-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 600;
    padding: 20px;
}

.modal-content {
    background: var(--dark);
    border-radius: var(--card-radius);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    font-size: 16px;
}

.modal-content h2 {
    margin-bottom: 20px;
    text-align: center;
}

/* Login Modal */
.login-modal-content {
    text-align: center;
}

.modal-icon {
    font-size: 50px;
    color: var(--primary);
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

/* Settings Modal */
.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.setting-group label:first-child {
    font-size: 16px;
}

.setting-group select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 8px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Inventory Modal */
.inventory-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.inv-stat {
    text-align: center;
    padding: 15px 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.inv-stat i {
    font-size: 24px;
    color: var(--accent);
    display: block;
    margin-bottom: 5px;
}

.inv-stat span {
    font-size: 28px;
    font-weight: 700;
}

.inv-stat label {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.inventory-item {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Teammates Modal */
.teammates-desc {
    text-align: center;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
}

.teammates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.teammate-card {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.teammate-card.rescued {
    border: 2px solid var(--success);
}

.teammate-card.locked {
    opacity: 0.5;
}

.teammate-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.rescue-info {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Leaderboard Modal */
.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.leaderboard-item.top-3 {
    background: rgba(253,203,110,0.2);
}

.leaderboard-rank {
    font-size: 20px;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.leaderboard-item.top-3 .leaderboard-rank {
    color: var(--warning);
}

.leaderboard-name {
    flex: 1;
}

.leaderboard-score {
    color: var(--secondary);
    font-weight: 600;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden {
    display: none !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .home-title {
        font-size: 36px;
    }
    
    .logo-char {
        font-size: 60px;
    }
    
    .home-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .level-map {
        min-height: 600px;
    }
    
    .game-header {
        padding: 0 10px;
    }
    
    .logo-text {
        display: none;
    }
    
    .hanzi-character {
        font-size: 56px;
    }
    
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 18px;
    }
    
    .caught-buttons,
    .level-complete-buttons {
        flex-direction: column;
    }
    
    .game-card-area {
        top: 60px;
        bottom: 240px;
        max-width: 450px;
    }
    
    .progress-road {
        bottom: 5%;
        height: 160px;
    }
    
    .checkpoint {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .game-card-area {
        width: 95%;
        top: 55px;
        bottom: 200px;
        max-width: 100%;
    }
    
    .game-card {
        padding: 12px;
    }
    
    .hanzi-character {
        font-size: 48px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .progress-road {
        bottom: 3%;
        height: 130px;
    }
    
    .checkpoint {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-width: 2px;
    }
    
    .option-btn {
        padding: 10px;
        font-size: 16px;
    }
}

/* Desktop - larger screens */
@media (min-width: 1024px) {
    .game-card-area {
        top: 80px;
        bottom: 300px;
        max-width: 520px;
    }
    
    .progress-road {
        bottom: 8%;
        height: 200px;
    }
    
    .checkpoint {
        width: 46px;
        height: 46px;
        font-size: 17px;
    }
    
    .player-marker {
        transform: translateX(-50%) scale(1.4);
    }
    
    .chaser-marker {
        transform: translateX(-50%) scale(1.4);
    }
}

/* Large desktop */
@media (min-width: 1400px) {
    .game-card-area {
        top: 90px;
        bottom: 340px;
        max-width: 560px;
    }
    
    .progress-road {
        bottom: 10%;
        height: 220px;
    }
}

/* =====================================================
   MUSIC PLAYER
   ===================================================== */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.music-player.minimized {
    padding: 10px;
    border-radius: 50%;
}

.music-player.minimized .music-info,
.music-player.minimized .music-controls {
    display: none;
}

.music-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s;
}

.music-toggle-btn:hover {
    transform: scale(1.1);
}

.music-info {
    display: flex;
    flex-direction: column;
    max-width: 120px;
}

.music-info .track-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-info .artist {
    font-size: 10px;
    opacity: 0.7;
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.music-controls button:hover {
    background: rgba(255,255,255,0.2);
}

.volume-slider {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* =====================================================
   ITEM REWARD SYSTEM
   ===================================================== */
.item-reward {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.item-reward:hover {
    transform: scale(1.05);
}

.reward-item-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    border: 2px solid;
    animation: rewardPulse 1.5s ease-in-out infinite;
}

.reward-item-preview.common { border-color: #a0a0a0; }
.reward-item-preview.uncommon { border-color: #4ecdc4; }
.reward-item-preview.rare { border-color: #667eea; }
.reward-item-preview.epic { border-color: #a855f7; }
.reward-item-preview.legendary { border-color: #fbbf24; animation: legendaryGlow 1s ease-in-out infinite; }

@keyframes rewardPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,255,255,0.2); }
    50% { box-shadow: 0 0 20px rgba(255,255,255,0.4); }
}

@keyframes legendaryGlow {
    0%, 100% { box-shadow: 0 0 15px #fbbf24; }
    50% { box-shadow: 0 0 30px #fbbf24, 0 0 50px #fbbf24; }
}

.reward-icon {
    font-size: 28px;
}

.reward-name {
    font-size: 14px;
    font-weight: 600;
}

/* Item Reward Overlay */
.item-reward-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.item-reward-container {
    text-align: center;
}

.item-reward-box {
    background: rgba(30,30,40,0.95);
    padding: 40px 60px;
    border-radius: 20px;
    border: 3px solid;
    position: relative;
    overflow: hidden;
    animation: itemReveal 0.5s ease;
}

.item-reward-box.common { border-color: #a0a0a0; }
.item-reward-box.uncommon { border-color: #4ecdc4; }
.item-reward-box.rare { border-color: #667eea; }
.item-reward-box.epic { border-color: #a855f7; }
.item-reward-box.legendary { border-color: #fbbf24; }

@keyframes itemReveal {
    0% { transform: scale(0.5) rotateY(180deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0); opacity: 1; }
}

.item-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: glowRotate 3s linear infinite;
}

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

.item-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: itemBounce 0.5s ease 0.3s;
    animation-fill-mode: both;
}

@keyframes itemBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.item-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.item-rarity {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.collect-item-btn {
    padding: 12px 30px;
    font-size: 16px;
    animation: fadeIn 0.3s ease 0.5s;
    animation-fill-mode: both;
}

/* Inventory Modal */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 20px;
}

.inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.inventory-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

.inventory-item .item-icon {
    font-size: 36px;
    margin-bottom: 5px;
}

.inventory-item .item-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.inventory-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.inventory-modal h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.inventory-modal h2 i {
    color: var(--primary);
}

.empty-inventory {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.6);
}

.empty-inventory i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-inventory .hint {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.7;
}