* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: #1a1a2e; color: #e0e0e0; min-height: 100vh; display: flex; flex-direction: column; }
#app { display: flex; flex-direction: column; height: 100vh; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Header */
.header { background: #16213e; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #0f3460; flex-wrap: wrap; gap: 8px; }
.header h1 { font-size: 1.4em; color: #e94560; text-shadow: 0 0 10px rgba(233,69,96,0.5); }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.euro-display { font-size: 1.2em; color: #ffd700; font-weight: bold; }
.char-name { color: #7ec8e3; }
.save-btn { background: #0f3460; border: 1px solid #7ec8e3; color: #7ec8e3; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8em; }
.save-btn:hover { background: #7ec8e3; color: #16213e; }
.cheater-flag { color: #ff4444; font-weight: bold; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* Skill Tabs */
.skill-tabs { background: #16213e; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid #0f3460; }
.skill-tab { background: #0f3460; border: 1px solid #233e6e; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.85em; transition: all 0.2s; display: flex; align-items: center; gap: 4px; }
.skill-tab:hover { background: #233e6e; transform: translateY(-1px); }
.skill-tab.active { background: #e94560; border-color: #e94560; color: white; }
.skill-tab .tab-level { font-size: 0.7em; opacity: 0.8; }
.skill-tab.special { background: #1a3a2e; border-color: #4ecdc4; }
.skill-tab.special.active { background: #4ecdc4; color: #1a1a2e; }

/* Main Area */
.main-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 20px; position: relative; overflow-y: auto; }
.skill-view { display: none; flex-direction: column; align-items: center; gap: 15px; width: 100%; max-width: 700px; }
.skill-view.active { display: flex; }

/* Click Target */
.click-target { width: 150px; height: 150px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 3em; cursor: pointer; transition: transform 0.1s; user-select: none; background: radial-gradient(circle, #233e6e, #0f3460); border: 3px solid #7ec8e3; box-shadow: 0 0 20px rgba(126,200,227,0.3); }
.click-target:active { transform: scale(0.9); }
.click-target:hover { box-shadow: 0 0 30px rgba(126,200,227,0.6); }

/* XP Bar */
.xp-section { width: 100%; max-width: 400px; text-align: center; }
.xp-bar-container { background: #0a0a1a; border-radius: 10px; height: 24px; overflow: hidden; border: 1px solid #233e6e; position: relative; }
.xp-bar { height: 100%; background: linear-gradient(90deg, #e94560, #ff6b6b); border-radius: 10px; transition: width 0.3s; }
.xp-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 0.75em; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.level-display { font-size: 1.3em; margin-bottom: 5px; }
.xp-numbers { font-size: 0.8em; color: #aaa; margin-top: 4px; }

/* Skill Info */
.skill-info { text-align: center; padding: 10px; background: rgba(15,52,96,0.5); border-radius: 8px; width: 100%; }
.skill-info h3 { color: #7ec8e3; margin-bottom: 5px; }
.skill-info p { font-size: 0.85em; color: #bbb; }

/* Action buttons */
.action-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.action-btn { background: #0f3460; border: 1px solid #233e6e; padding: 8px 16px; border-radius: 6px; cursor: pointer; color: #e0e0e0; font-size: 0.85em; transition: all 0.2s; }
.action-btn:hover { background: #233e6e; }
.action-btn.active { background: #e94560; border-color: #e94560; }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn .req { font-size: 0.7em; color: #ffd700; display: block; }

/* Inventory */
.inventory { background: #16213e; border-top: 2px solid #0f3460; padding: 10px 15px; min-height: 80px; max-height: 130px; overflow-y: auto; }
.inventory h3 { font-size: 0.9em; color: #7ec8e3; margin-bottom: 8px; }
.inv-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-item { background: #0f3460; border: 1px solid #233e6e; border-radius: 4px; padding: 4px 8px; font-size: 0.8em; display: flex; align-items: center; gap: 4px; cursor: pointer; transition: all 0.2s; position: relative; }
.inv-item:hover { border-color: #7ec8e3; background: #233e6e; }
.inv-item .item-qty { color: #ffd700; font-weight: bold; }
.inv-item.rare { border-color: #9b59b6; }
.inv-item.legendary { border-color: #f39c12; animation: legendaryGlow 2s infinite; }
@keyframes legendaryGlow { 0%,100%{box-shadow:0 0 5px #f39c12;} 50%{box-shadow:0 0 15px #f39c12;} }

/* XP Popup */
.xp-popup { position: absolute; pointer-events: none; font-weight: bold; color: #ffd700; font-size: 1.2em; animation: floatUp 1s forwards; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); z-index: 50; }
@keyframes floatUp { 0% { opacity:1; transform:translateY(0); } 100% { opacity:0; transform:translateY(-60px); } }

/* Character Creation */
#char-creation { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 20px; padding: 20px; }
#char-creation h1 { color: #e94560; font-size: 2em; text-shadow: 0 0 15px rgba(233,69,96,0.5); }
#char-creation input { background: #0f3460; border: 2px solid #7ec8e3; color: white; padding: 12px 20px; font-size: 1.1em; border-radius: 8px; text-align: center; width: 250px; }
#char-creation input:focus { outline: none; border-color: #e94560; box-shadow: 0 0 10px rgba(233,69,96,0.3); }
.start-btn { background: #e94560; color: white; border: none; padding: 12px 30px; font-size: 1.1em; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.start-btn:hover { background: #ff6b6b; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(233,69,96,0.4); }

/* Combat */
.combat-area { width: 100%; }
.enemy-display { text-align: center; padding: 15px; background: rgba(15,52,96,0.5); border-radius: 8px; margin-bottom: 10px; }
.hp-bar-container { background: #0a0a1a; border-radius: 6px; height: 18px; overflow: hidden; border: 1px solid #233e6e; margin: 5px 0; position: relative; }
.hp-bar { height: 100%; background: linear-gradient(90deg, #ff4444, #ff6b6b); border-radius: 6px; transition: width 0.2s; }
.hp-bar.player { background: linear-gradient(90deg, #44ff44, #6bff6b); }
.hp-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 0.7em; font-weight: bold; }

/* Farm */
.farm-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.farm-slot { width: 60px; height: 60px; background: #0f3460; border: 1px solid #233e6e; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.5em; }
.farm-slot.occupied { border-color: #ffd700; background: #1a3a5e; }
.farm-income { color: #ffd700; font-size: 0.9em; }

/* Toast */
.toast { position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%); background: #233e6e; border: 1px solid #7ec8e3; padding: 8px 16px; border-radius: 6px; font-size: 0.85em; animation: fadeInOut 2.5s forwards; z-index: 999; }
@keyframes fadeInOut { 0%{opacity:0;transform:translate(-50%,10px);}15%{opacity:1;transform:translate(-50%,0);}85%{opacity:1;}100%{opacity:0;} }

/* Alchemy */
.alchemy-items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; max-height: 120px; overflow-y: auto; }
.alch-item { background: #0f3460; border: 1px solid #233e6e; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8em; }
.alch-item:hover { border-color: #ffd700; }
.alch-item.selected { border-color: #e94560; background: #2a1a3e; }

/* Equipment / Character Tab */
.equip-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; width: 100%; max-width: 400px; margin: 10px auto; }
.equip-slot { background: #0f3460; border: 2px dashed #233e6e; border-radius: 8px; padding: 10px; text-align: center; min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.8em; }
.equip-slot.filled { border-style: solid; border-color: #7ec8e3; }
.equip-slot.filled.rare { border-color: #9b59b6; }
.equip-slot.filled.legendary { border-color: #f39c12; }
.equip-slot-label { font-size: 0.7em; color: #666; margin-top: 4px; }
.equip-slot-item { font-size: 1.5em; }
.stat-summary { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.stat-box { background: #0f3460; border: 1px solid #233e6e; padding: 8px 12px; border-radius: 6px; text-align: center; }
.stat-box .stat-val { color: #ffd700; font-size: 1.2em; font-weight: bold; }
.stat-box .stat-label { font-size: 0.7em; color: #aaa; }

/* Shop */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; width: 100%; }
.shop-item { background: #0f3460; border: 1px solid #233e6e; border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; transition: all 0.2s; }
.shop-item:hover { border-color: #ffd700; transform: translateY(-2px); }
.shop-item.owned { opacity: 0.5; border-color: #44ff44; }
.shop-item .shop-emoji { font-size: 2em; }
.shop-item .shop-name { font-weight: bold; margin: 5px 0; }
.shop-item .shop-desc { font-size: 0.75em; color: #aaa; }
.shop-item .shop-price { color: #ffd700; font-weight: bold; margin-top: 5px; }
.shop-section-title { width: 100%; color: #7ec8e3; font-size: 1.1em; margin: 15px 0 5px; border-bottom: 1px solid #233e6e; padding-bottom: 5px; }

/* Wiki */
.wiki-container { width: 100%; max-width: 700px; text-align: left; }
.wiki-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; }
.wiki-nav-btn { background: #0f3460; border: 1px solid #233e6e; padding: 6px 12px; border-radius: 4px; cursor: pointer; color: #e0e0e0; font-size: 0.8em; }
.wiki-nav-btn:hover { background: #233e6e; }
.wiki-nav-btn.active { background: #4ecdc4; color: #1a1a2e; border-color: #4ecdc4; }
.wiki-content { background: rgba(15,52,96,0.3); border: 1px solid #233e6e; border-radius: 8px; padding: 20px; max-height: 500px; overflow-y: auto; line-height: 1.6; }
.wiki-content h2 { color: #e94560; margin-bottom: 10px; }
.wiki-content h3 { color: #7ec8e3; margin: 15px 0 8px; }
.wiki-content p { margin-bottom: 10px; color: #ccc; }
.wiki-content ul { margin: 5px 0 10px 20px; }
.wiki-content li { margin-bottom: 4px; color: #bbb; }
.wiki-content table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.8em; }
.wiki-content th { background: #0f3460; padding: 6px 8px; text-align: left; color: #7ec8e3; }
.wiki-content td { padding: 5px 8px; border-bottom: 1px solid #233e6e; }
.wiki-content .highlight { color: #ffd700; }
.wiki-content code { background: #0a0a1a; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }

/* CAPTCHA overlay */
.captcha-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.captcha-box { background: #16213e; border: 2px solid #e94560; border-radius: 12px; padding: 30px; text-align: center; max-width: 350px; }
.captcha-box h3 { color: #e94560; margin-bottom: 15px; }
.captcha-box p { margin-bottom: 15px; color: #ccc; }
.captcha-options { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.captcha-option { width: 60px; height: 60px; border-radius: 50%; cursor: pointer; border: 3px solid #233e6e; transition: all 0.2s; display: flex; align-items: center; justify-content: center; font-size: 1.5em; }
.captcha-option:hover { transform: scale(1.1); border-color: #7ec8e3; }

/* Diminishing returns warning */
.fatigue-warning { background: rgba(233,69,96,0.2); border: 1px solid #e94560; border-radius: 6px; padding: 8px; text-align: center; font-size: 0.8em; color: #ff6b6b; }

/* PVP Placeholder */
.pvp-placeholder { text-align: center; padding: 40px; }
.pvp-placeholder h2 { color: #e94560; margin-bottom: 15px; }
.pvp-placeholder p { color: #aaa; margin-bottom: 10px; }

/* Auth Screen */
#auth-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 12px; padding: 20px; }
#auth-screen h1 { color: #e94560; font-size: 2em; text-shadow: 0 0 15px rgba(233,69,96,0.5); }
.auth-form { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 280px; }
.auth-form input { background: #0f3460; border: 2px solid #7ec8e3; color: white; padding: 10px 16px; font-size: 1em; border-radius: 8px; text-align: center; width: 100%; }
.auth-form input:focus { outline: none; border-color: #e94560; box-shadow: 0 0 10px rgba(233,69,96,0.3); }

/* Leaderboard */
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.leaderboard-table th { background: #0f3460; padding: 8px; text-align: left; color: #7ec8e3; }
.leaderboard-table td { padding: 6px 8px; border-bottom: 1px solid #233e6e; }
.leaderboard-table tr:nth-child(-n+3) td:first-child { color: #ffd700; font-weight: bold; }

/* Tournament Bracket */
.bracket-container { width: 100%; overflow-x: auto; }
.bracket-round { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.bracket-match { background: #0f3460; border: 1px solid #233e6e; border-radius: 6px; padding: 8px; font-size: 0.8em; }
.bracket-match .winner { color: #4ecdc4; font-weight: bold; }
.bracket-match .loser { color: #666; text-decoration: line-through; }
.bracket-match .pending { color: #aaa; font-style: italic; }
.tournament-info { background: rgba(15,52,96,0.5); border-radius: 8px; padding: 12px; margin-bottom: 10px; text-align: center; }
.tournament-info .tier-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.tier-rookie { background: #4a4a4a; color: #ccc; }
.tier-fighter { background: #2a4a2a; color: #4ecdc4; }
.tier-champion { background: #4a2a4a; color: #9b59b6; }
.tier-legend { background: #4a3a1a; color: #f39c12; }
.pvp-queue-info { text-align: center; padding: 15px; background: rgba(15,52,96,0.3); border-radius: 8px; margin: 10px 0; }

/* Responsive */
@media (max-width: 600px) {
  .skill-tabs { justify-content: center; }
  .skill-tab { font-size: 0.75em; padding: 5px 8px; }
  .click-target { width: 120px; height: 120px; font-size: 2.5em; }
  .shop-grid { grid-template-columns: 1fr; }
  .equip-grid { grid-template-columns: 1fr 1fr; }
  .header { padding: 8px 10px; }
  .header h1 { font-size: 1.1em; }
  #auth-screen h1 { font-size: 1.5em; }
  .auth-form input { font-size: 0.9em; padding: 8px 12px; }
}
