* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #07100d; color: #f5f7ec; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; }
button, input, a { font: inherit; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#game.attack-cursor { cursor: crosshair; }
.eyebrow { margin: 0 0 6px; color: #9ce6ba; font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.auth-panel, .class-panel, .name-panel { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(26, 52, 38, .6), rgba(2, 8, 7, .94)); }
.auth-card, .class-card, .name-card { width: min(940px, calc(100vw - 28px)); padding: 28px; border: 1px solid rgba(202, 255, 214, .18); background: rgba(10, 20, 17, .86); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); backdrop-filter: blur(18px); }
.auth-card { max-width: 520px; }
.name-card { max-width: 560px; }
.auth-card h1, .class-card h1, .name-card h1 { margin: 0; font-size: 44px; line-height: 1; }
.auth-card p, .name-card p { color: #bec9bd; }
.auth-card .primary, .auth-card button, .name-card button, .class-list button, #shop-close { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 0; color: #06100b; background: #9ce6ba; font-weight: 900; text-decoration: none; cursor: pointer; }
.auth-card .primary { width: 100%; margin: 10px 0; }
.auth-card form, .name-card form { display: grid; gap: 8px; margin-top: 10px; }
.auth-card input, .name-card input, .chat input { width: 100%; min-height: 42px; border: 1px solid rgba(255,255,255,.14); background: rgba(5, 12, 10, .72); color: #f5f7ec; padding: 0 12px; outline: none; }
.auth-card small, .name-card small { display: block; min-height: 22px; margin-top: 10px; color: #ff9e8d; }
.class-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.class-list button { min-height: 170px; display: grid; justify-items: start; align-content: end; gap: 8px; padding: 18px; color: #f5f7ec; border: 1px solid rgba(255,255,255,.16); background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); text-align: left; }
.class-list b { font-size: 22px; }
.class-list span { color: #c6d1c8; font-size: 13px; line-height: 1.4; }
.top-left { position: fixed; left: 18px; top: 16px; z-index: 8; pointer-events: none; }
.brand { font-size: 22px; font-weight: 950; text-shadow: 0 3px 22px #000; }
.target-panel { min-width: 260px; margin-top: 12px; padding: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(6, 12, 10, .62); backdrop-filter: blur(10px); }
.target-panel h3 { margin: 0 0 8px; }
.target-panel .mini-hp { height: 8px; background: rgba(255,255,255,.12); overflow: hidden; }
.target-panel .mini-hp span { display: block; height: 100%; background: #e94d4d; }
.minimap-wrap { position: fixed; right: 18px; top: 16px; z-index: 9; padding: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(6, 12, 10, .58); backdrop-filter: blur(10px); }
.gold-hud {
  position: fixed;
  right: 230px;
  top: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px 8px 10px;
  border: 1px solid rgba(240, 212, 106, .45);
  background: rgba(12, 14, 8, .72);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.gold-hud .gold-icon { display: grid; place-items: center; filter: drop-shadow(0 0 8px rgba(240, 212, 106, .45)); }
.gold-hud b {
  color: #f0d46a;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
  font-variant-numeric: tabular-nums;
}
#minimap { display: block; width: 180px; height: 180px; cursor: crosshair; }
#coords { margin-top: 8px; font-weight: 800; text-align: center; color: #d8ead8; }
#base-guide { width: 100%; min-height: 30px; margin-top: 8px; border: 1px solid rgba(240,212,106,.35); background: rgba(240,212,106,.14); color: #f0d46a; font-weight: 900; cursor: pointer; }
#base-guide.active { background: #f0d46a; color: #08110d; }
.minimap-wrap .net { position: static; margin-top: 8px; justify-content: center; }
.world-map { position: fixed; inset: 6vh 6vw; z-index: 25; border: 1px solid rgba(255,255,255,.18); background: rgba(3, 9, 8, .88); backdrop-filter: blur(18px); display: grid; place-items: center; }
.world-map-inner { width: min(900px, 100%); height: min(680px, 100%); display: grid; grid-template-rows: 1fr auto; gap: 10px; padding: 12px; }
.world-map canvas { width: 100%; height: 100%; max-width: 900px; max-height: 620px; }
.map-coord-form { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; color: #dce6dc; font-weight: 800; }
.map-coord-form label { display: flex; gap: 6px; align-items: center; }
.map-coord-form input { width: 110px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(0,0,0,.35); color: #f2f7ef; font-weight: 800; }
.map-coord-form button { padding: 8px 16px; border: 1px solid rgba(90,167,255,.45); border-radius: 8px; background: rgba(90,167,255,.22); color: #9ed0ff; font-weight: 900; cursor: pointer; }
.map-coord-form button:hover { background: rgba(90,167,255,.38); }
.chat { position: fixed; left: 18px; bottom: 118px; z-index: 10; width: 330px; pointer-events: auto; }
.chat-log { height: 180px; padding: 8px; overflow-x: hidden; overflow-y: auto; border: 1px solid rgba(255,255,255,.14); background: rgba(3, 8, 7, .45); font-size: 13px; scrollbar-width: thin; scrollbar-color: rgba(156,230,186,.55) rgba(0,0,0,.2); }
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(156,230,186,.45); border-radius: 8px; }
.chat-log::-webkit-scrollbar-track { background: rgba(0,0,0,.15); }
.chat-log div { margin-bottom: 5px; color: #dce6dc; }
.chat-log b { color: #9ce6ba; }
.chat-log .chat-sys { font-weight: 750; text-shadow: 0 1px 6px rgba(0,0,0,.45); }
.chat-log .chat-sys-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #061018;
  background: currentColor;
  background: #dce6dc;
  mix-blend-mode: normal;
  opacity: .92;
}
.chat-log .chat-sys .chat-sys-tag {
  background: color-mix(in srgb, currentColor 75%, #fff 25%);
  color: #0a100e;
}
.self-vitals {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 12;
  width: 330px;
  display: grid;
  gap: 6px;
  pointer-events: none;
}
.self-vitals-name {
  font-size: 15px;
  font-weight: 900;
  color: #f2f7ef;
  text-shadow: 0 2px 10px #000;
  letter-spacing: .2px;
}
.self-vitals-hp { height: 22px; }
.self-vitals[hidden] { display: none !important; }
.bottom-hud { position: fixed; left: 50%; bottom: 18px; z-index: 11; width: min(720px, calc(100vw - 36px)); transform: translateX(-50%); display: grid; gap: 8px; }
.bar { position: relative; height: 20px; overflow: hidden; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); }
.bar span { position: absolute; inset: 0 auto 0 0; width: 50%; transition: width .18s linear; }
.bar b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; text-shadow: 0 1px 8px #000; }
.hp span { background: linear-gradient(90deg, #bb2736, #ff6961); }
.xp span { background: linear-gradient(90deg, #7245ff, #c75bff); }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.skill { position: relative; min-height: 62px; border: 1px solid rgba(255,255,255,.18); color: #f8fff6; background: rgba(8, 15, 13, .74); cursor: pointer; }
.skill kbd { display: block; font-weight: 950; font-size: 18px; }
.skill small { color: #b9c4b9; }
.skill .cd { position: absolute; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.58); color: #fff; font-weight: 950; font-size: 18px; }
.skill.cooling { cursor: not-allowed; filter: saturate(.65); }
.skill.cooling .cd { display: grid; }
.skill .tip { display: none; position: absolute; left: 0; bottom: 72px; width: 220px; padding: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(2, 8, 7, .94); font-size: 12px; text-align: left; }
.skill:hover .tip { display: block; }
.stats-panel { position: fixed; left: calc(50% + 380px); bottom: 20px; z-index: 11; width: 178px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; padding: 10px 12px; border: 1px solid rgba(156,230,186,.18); background: rgba(5, 15, 11, .68); color: #eaf2d0; backdrop-filter: blur(12px); }
.stats-panel div { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 20px; font-weight: 950; text-shadow: 0 2px 10px #000; position: relative; }
.stats-panel span { width: 22px; display: inline-grid; place-items: center; color: #d8a14e; font-size: 18px; }
.stats-panel div:nth-child(2n) span { color: #6aa5ff; }
.stats-panel b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-panel .stat::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 200px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(2, 8, 7, .94);
  color: #eaf2e8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: none;
  z-index: 30;
  pointer-events: none;
}
.stats-panel .stat:hover::after { display: block; }
.shop { position: fixed; right: 18px; bottom: 118px; z-index: 20; width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 160px); overflow: auto; padding: 16px; border: 1px solid rgba(255,255,255,.17); background: rgba(5, 12, 10, .86); backdrop-filter: blur(18px); }
.inventory {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: min(520px, 42vw);
  min-width: 360px;
  overflow: auto;
  padding: 18px 18px 24px;
  border-left: 1px solid rgba(255,255,255,.17);
  background: rgba(5, 12, 10, .92);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
}
.inventory header, .shop header { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.inventory h2, .shop h2 { margin: 0; }
.inventory h3 { margin: 18px 0 8px; font-size: 13px; color: #9ce6ba; letter-spacing: .6px; text-transform: uppercase; }
.inventory .inv-hint { margin: 14px 0 0; color: #9aa89c; font-size: 12px; line-height: 1.4; }
#inventory-close, #shop-close { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border: 0; color: #06100b; background: #9ce6ba; font-weight: 900; cursor: pointer; }
.bag, .equipment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 0; }
.bag { flex: 1; overflow: auto; padding: 2px; align-content: start; min-height: 220px; }
.slot, .shop-item { min-height: 88px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); padding: 8px; color: #eaf2e8; }
.slot { display: grid; place-items: center; gap: 3px; text-align: center; font-size: 11px; cursor: pointer; position: relative; overflow: visible; }
.slot.empty { cursor: default; border-style: dashed; background: rgba(255,255,255,.035); }
.slot.filled { background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.035)); }
.slot.filled:hover { border-color: rgba(156,230,186,.55); box-shadow: inset 0 0 0 1px rgba(156,230,186,.18); }
.slot.locked::after { content: "Kilitli"; position: absolute; inset: auto 4px 4px; padding: 2px 4px; background: rgba(255,82,82,.82); color: #fff; font-size: 10px; font-weight: 900; }
.slot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.slot small { color: #b9c4b9; font-size: 10px; }
.item-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--item), #fff 25%); background: radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--item), #fff 20%), color-mix(in srgb, var(--item), #000 55%)); color: #06100b; font-weight: 950; font-size: 18px; box-shadow: 0 0 18px color-mix(in srgb, var(--item), transparent 45%); }
.equipment .slot { min-height: 96px; outline: 1px dashed rgba(156,230,186,.45); }
.bag .slot { min-height: 92px; }
.item-menu {
  position: fixed;
  z-index: 40;
  min-width: 168px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(4, 10, 8, .96);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  display: grid;
  gap: 4px;
}
.item-menu button {
  min-height: 36px;
  border: 0;
  padding: 0 12px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  color: #f5f7ec;
  background: rgba(255,255,255,.06);
}
.item-menu button:hover { background: rgba(156,230,186,.22); color: #fff; }
.item-menu button.danger:hover { background: rgba(233, 77, 77, .28); }
.item-menu .item-menu-title { padding: 6px 10px 4px; color: #9ce6ba; font-size: 11px; font-weight: 800; }
.shop-items { display: grid; gap: 8px; margin-top: 14px; }
.shop-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.shop-item b { display: block; }
.shop-item small { color: #b9c4b9; }
.shop-item button { min-width: 76px; min-height: 38px; border: 0; background: #9ce6ba; color: #06100b; font-weight: 900; cursor: pointer; }
.loot-pop { position: fixed; left: 50%; top: 50%; z-index: 18; width: 210px; padding: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(4, 12, 9, .9); transform: translate(-50%, -50%); }
.loot-pop button { width: 100%; margin-top: 8px; min-height: 38px; border: 0; background: #f0b84a; color: #190f04; font-weight: 900; }
.level-modal { position: fixed; left: 50%; top: 18%; z-index: 40; min-width: 340px; padding: 20px; text-align: center; border: 1px solid rgba(156,230,186,.4); background: rgba(5, 15, 10, .94); transform: translateX(-50%); box-shadow: 0 0 60px rgba(156,230,186,.28); }
.level-modal h2 { margin: 0 0 10px; }
.level-modal strong { color: #9cffb8; }
.floating { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
.float { position: absolute; color: #fff; font-weight: 950; text-shadow: 0 2px 8px #000; animation: rise 1.1s ease-out forwards; }
.notice { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); min-width: 280px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid rgba(255,210,120,.45); background: rgba(20, 12, 4, .9); color: #ffd98a; font-weight: 900; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.35); animation: notice-pop 2.4s ease forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-38px); } }
@keyframes notice-pop { from { opacity: 0; transform: translate(-50%, -8px); } 12% { opacity: 1; transform: translate(-50%, 0); } 82% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -18px); } }
.net { display: flex; gap: 10px; color: #d8ead8; font-size: 12px; font-weight: 900; text-shadow: 0 1px 8px #000; }
@media (max-width: 760px) {
  .class-list { grid-template-columns: 1fr; }
  .chat { width: calc(100vw - 36px); bottom: 132px; }
  .chat-log { height: 94px; }
  .self-vitals { width: calc(100vw - 36px); bottom: 22px; }
  .minimap-wrap { transform: scale(.82); transform-origin: top right; }
  .skills { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .skill small { display: none; }
  .stats-panel { left: 18px; right: 18px; bottom: 8px; width: auto; grid-template-columns: repeat(4, 1fr); }
}
