/* Flat styling only: no glow, no gradients, no animation */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0b0b10;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  color: #dde1ee;
}

canvas {
  display: block;
  cursor: none;
}

#ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  pointer-events: none;
}

#hud {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.label {
  font-size: 11px;
  letter-spacing: 2px;
  color: #9aa0b8;
  margin-bottom: 4px;
}

.bar {
  width: 200px;
  height: 12px;
  background: #15161f;
  border: 1px solid #4a4f6a;
}

#health-bar { height: 100%; width: 100%; background: #d94040; }
#card-bar   { height: 100%; width: 0;    background: #4a7bd0; }

.small {
  font-size: 12px;
  letter-spacing: 1px;
  margin: 4px 0 12px;
  color: #c4c8d8;
}

.ability-row { margin-top: 4px; }
.ability-bar { overflow: hidden; }
#time-stop-bar { height: 100%; width: 0; background: #7ed6ff; }
#time-stop-text { margin-top: 4px; color: #9ad9ff; }

#center-hud { position: absolute; left: 50%; top: 0; transform: translateX(-50%); text-align: center; white-space: nowrap; }
#wave-text  { font-size: 22px; letter-spacing: 6px; padding-left: 6px; }
#enemy-text { font-size: 13px; letter-spacing: 2px; padding-left: 2px; color: #e0a040; margin-top: 4px; }
#score-text { font-size: 12px; letter-spacing: 2px; padding-left: 2px; color: #9aa0b8; margin-top: 4px; }

#banner {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #4a4f6a;
  padding: 10px 24px;
  font-size: 15px;
  letter-spacing: 2px;
  display: none;
  pointer-events: none;
  text-align: center;
}

#pick-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #5acb8a;
  color: #5acb8a;
  padding: 8px 20px;
  font-size: 13px;
  letter-spacing: 2px;
  display: none;
  pointer-events: none;
}

#legend, #owned-cards {
  position: fixed;
  bottom: 16px;
  font-size: 11px;
  letter-spacing: 1px;
  line-height: 1.8;
  pointer-events: none;
}
#legend      { right: 16px; text-align: right; }
#owned-cards { left: 16px; color: #9aa0b8; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.overlay h1 { font-size: 48px; letter-spacing: 10px; margin-bottom: 20px; }
.overlay p  { color: #aab; letter-spacing: 2px; font-size: 14px; line-height: 1.9; margin-top: 8px; }
#game-over h1 { color: #d94040; }

.btn {
  margin-top: 30px;
  padding: 14px 40px;
  background: transparent;
  border: 1px solid #dde1ee;
  color: #dde1ee;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 4px;
  cursor: pointer;
}
.btn:hover { background: #dde1ee; color: #0b0b10; }
.btn:focus-visible { outline: 2px solid #e8d070; outline-offset: 3px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; color: #dde1ee; }

.menu-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.menu-actions .btn { min-width: 190px; }
.meta-balance { color: #e8d070 !important; }

.run-records {
  position: absolute;
  right: 22px;
  bottom: 20px;
  width: min(290px, calc(100% - 36px));
  max-height: 32vh;
  overflow-y: auto;
  padding: 12px 14px;
  border-top: 2px solid #e8d070;
  background: rgba(11, 11, 16, 0.94);
  text-align: left;
  color: #aab;
  font-size: 11px;
  letter-spacing: 1px;
}
.run-records-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.run-records-header h2 { color: #e8d070; font-size: 12px; font-weight: normal; letter-spacing: 2px; }
.run-records-header span { color: #747b93; font-size: 10px; }
.run-record-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 5px 0; border-top: 1px solid #303342; }
.run-record-rank { color: #747b93; }
.run-record-wave { color: #c4c8d8; }
.run-record-score { color: #5acb8a; text-align: right; }

#shop-screen { overflow-y: auto; }
.shop-shell { width: min(860px, 100%); margin: auto; text-align: left; }
.shop-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid #4a4f6a; }
.shop-kicker { color: #5acb8a !important; font-size: 11px !important; letter-spacing: 3px !important; }
#shop-screen h1 { margin: 8px 0 0; font-size: 34px; letter-spacing: 8px; }
.shop-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; color: #9aa0b8; font-size: 11px; letter-spacing: 2px; }
.shop-balance strong { color: #e8d070; font-size: 24px; font-weight: normal; }
.shop-items { display: flex; flex-direction: column; }
.shop-item { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 0; border-bottom: 1px solid #303342; }
.shop-item-copy { min-width: 0; }
.shop-item-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.shop-item h2 { color: #dde1ee; font-size: 15px; font-weight: normal; letter-spacing: 2px; }
.shop-level { color: #9aa0b8; font-size: 11px; letter-spacing: 1px; }
.shop-item p { margin: 7px 0 0; color: #aab; font-size: 12px; line-height: 1.5; letter-spacing: 1px; }
.shop-effect { color: #5acb8a; }
.shop-buy { flex: 0 0 190px; margin: 0; padding: 12px 10px; font-size: 11px; letter-spacing: 2px; }
.shop-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 18px; }
.shop-footer #shop-message { color: #5acb8a; font-size: 11px; letter-spacing: 1px; }
.shop-footer .btn { margin: 0; padding: 12px 28px; }

@media (max-width: 600px) {
  .overlay { padding: 18px; }
  .overlay h1 { font-size: 32px; letter-spacing: 6px; }
  .shop-header { align-items: flex-start; }
  #shop-screen h1 { font-size: 28px; letter-spacing: 5px; }
  .shop-item { align-items: flex-start; flex-direction: column; gap: 12px; }
  .shop-buy { flex-basis: auto; width: 100%; }
  .run-records { right: 12px; bottom: 12px; width: min(250px, calc(100% - 24px)); }
}

@media (max-height: 620px) {
  #start-screen { justify-content: flex-start; overflow-y: auto; }
  .run-records { position: static; align-self: flex-end; margin: 16px 0 0 auto; flex-shrink: 0; }
}

#card-screen { justify-content: center; padding-bottom: 14vh; overflow-y: auto; }
#card-choices {
  display: flex;
  gap: 40px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  width: 250px;
  height: 340px;
  padding: 0;
  border: none;
  background: none;
  color: #dde1ee;
  font-family: inherit;
  cursor: pointer;
  perspective: 900px;
}
.card-flip {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}
.card.flipped .card-flip { transform: rotateY(180deg); }
.card-face {
  display: block;
  position: absolute;
  inset: 0;
  border: 2px solid var(--rc);
  border-radius: 0;
  background: #141622;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 0 calc(var(--glow) * 1px) calc(var(--glow) * 0.12px) rgba(var(--rgb), var(--ga)),
              inset 0 0 calc(var(--glow) * 0.6px) rgba(var(--rgb), calc(var(--ga) * 0.35));
}
.card-back { display: flex; align-items: center; justify-content: center; padding: 0; }
.card-back svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--rc);
  stroke-width: 3;
  stroke-linecap: square;
  stroke-linejoin: miter;
  filter: drop-shadow(0 0 calc(var(--glow) * 0.25px) rgba(var(--rgb), var(--ga)));
}
.card-front {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  text-align: left;
  background: #171926;
}

.card-key   { font-size: 12px; color: #9aa0b8; }
.card-name  { font-size: 16px; letter-spacing: 2px; color: #e8d070; }
.card-rarity { display: inline-block; align-self: flex-start; margin-top: -4px; padding: 4px 8px; font-size: 10px; letter-spacing: 2px; border: 1px solid #4a4f6a; }
.card-rarity-common { color: #9fb0d0; border-color: #9fb0d0; }
.card-rarity-uncommon { color: #4fd08a; border-color: #4fd08a; }
.card-rarity-rare { color: #4a9dff; border-color: #4a9dff; }
.card-rarity-epic { color: #b05cff; border-color: #b05cff; }
.card-rarity-legendary { color: #ffd24a; border-color: #ffd24a; }
.card-bonus { font-size: 11px; letter-spacing: 2px; color: #9aa0b8; margin-top: -6px; }
.card-desc  { font-size: 13px; line-height: 1.6; color: #c4c8d8; flex: 1; }
.card-owned { font-size: 11px; letter-spacing: 2px; color: #5acb8a; }

#cheat-panel { z-index: 5; background: rgba(0, 0, 0, 0.9); }
.cheat-box {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #4a4f6a;
  background: #101117;
}
.cheat-box h1 { font-size: 30px; letter-spacing: 6px; margin-bottom: 20px; }
.cheat-actions { display: flex; flex-direction: column; gap: 10px; }
.cheat-actions .btn { width: 100%; margin: 0; padding: 12px; font-size: 12px; }
.cheat-wave-row { display: flex; align-items: center; gap: 8px; }
.cheat-wave-row label { flex: 0 0 auto; color: #9aa0b8; font-size: 10px; letter-spacing: 1px; }
.cheat-wave-row select { min-width: 0; flex: 1; padding: 10px; background: #171926; border: 1px solid #4a4f6a; color: #dde1ee; font: inherit; }
.cheat-wave-row .btn { width: auto; }
.cheat-scrap-row { display: flex; align-items: center; gap: 8px; }
.cheat-scrap-row label { flex: 0 0 auto; color: #9aa0b8; font-size: 10px; letter-spacing: 1px; }
.cheat-scrap-row select { min-width: 0; flex: 1; padding: 10px; background: #171926; border: 1px solid #4a4f6a; color: #dde1ee; font: inherit; }
.cheat-scrap-row .btn { width: auto; }
.cheat-card-row { display: flex; gap: 8px; }
.cheat-card-row select { min-width: 0; flex: 1; padding: 10px; background: #171926; border: 1px solid #4a4f6a; color: #dde1ee; font: inherit; }
.cheat-card-row .btn { width: auto; }