* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan: #4ff0e0;
  --yellow: #ffd24a;
  --red: #ff4d33;
  --panel: rgba(12, 16, 32, 0.92);
  --border: #3a4a72;
}

html, body {
  height: 100%;
  background: #05070f;
  color: #e8ecff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  width: min(100vw, calc(100vh * 1.5625));
  height: min(100vh, calc(100vw / 1.5625));
  background: #0b0e1a;
  box-shadow: 0 0 60px rgba(79, 240, 224, 0.12), 0 0 0 2px #1a2140;
  image-rendering: auto;
  cursor: crosshair;
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(8,10,22,0.55), rgba(3,4,10,0.9));
  z-index: 10;
  padding: 4vh 3vw;
}
.overlay.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 26px 30px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(79,240,224,0.18), inset 0 0 30px rgba(0,0,0,0.4);
}
.panel.wide { max-width: 640px; }

.title {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 18px rgba(79,240,224,0.5);
}
.title.small { font-size: clamp(24px, 4vw, 34px); color: var(--red); text-shadow: 0 0 18px rgba(255,77,51,0.6); }
.title .bolt { color: var(--yellow); text-shadow: 0 0 20px var(--yellow); }

.sub { margin: 12px 0; color: #b6c0e6; font-size: 15px; }

.rules {
  list-style: none;
  text-align: left;
  margin: 16px auto;
  max-width: 420px;
  font-size: 14px;
  color: #c8d0f0;
}
.rules li { padding: 4px 0 4px 22px; position: relative; }
.rules li::before { content: "▹"; position: absolute; left: 0; color: var(--cyan); }
.rules b { color: var(--yellow); }

.stat-row { display: flex; gap: 24px; justify-content: center; margin: 14px 0; color: #a8b2d8; font-size: 15px; }
.stat-row b { color: var(--cyan); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 18px 0; max-width: 360px; margin-left: auto; margin-right: auto;
}
.stat-grid > div { background: rgba(255,255,255,0.04); border: 1px solid #2a3358; border-radius: 8px; padding: 10px; }
.stat-grid span { display: block; font-size: 12px; color: #90a0d0; text-transform: uppercase; letter-spacing: 1px; }
.stat-grid b { font-size: 24px; color: #fff; }

.btn-row { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.btn {
  font-family: inherit; font-weight: 700; letter-spacing: 1px;
  font-size: 15px; color: #dfe6ff;
  background: #1b2340;
  border: 2px solid var(--border); border-radius: 10px;
  padding: 12px 22px; cursor: pointer; transition: all 0.12s;
  text-transform: uppercase;
}
.btn:hover { border-color: var(--cyan); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(79,240,224,0.25); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #1e6f66, #124a44); border-color: var(--cyan); color: #eafffb; }
.btn.primary:hover { background: linear-gradient(180deg, #268b80, #166057); }
.btn.small { padding: 12px 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Shop */
.shop-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; text-align: left; }
.shop-item {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid #2a3358; border-radius: 10px; padding: 12px 14px;
}
.shop-item .ic { font-size: 26px; width: 34px; text-align: center; }
.shop-item .info { flex: 1; }
.shop-item .info .nm { font-weight: 700; color: #fff; font-size: 15px; }
.shop-item .info .ds { font-size: 12px; color: #9aa6d0; margin-top: 2px; }
.shop-item .lvl { display: flex; gap: 3px; margin-top: 6px; }
.shop-item .pip { width: 16px; height: 6px; border-radius: 3px; background: #2c3663; }
.shop-item .pip.on { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.shop-item .buy {
  font-family: inherit; font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
  background: #1b2340; border: 2px solid var(--border); color: #dfe6ff;
  border-radius: 8px; padding: 8px 12px; cursor: pointer; white-space: nowrap; min-width: 92px;
}
.shop-item .buy:hover:not(:disabled) { border-color: var(--yellow); color: #fff; }
.shop-item .buy:disabled { opacity: 0.4; cursor: not-allowed; }
.shop-item .buy.max { color: var(--yellow); border-color: var(--yellow); }
