@font-face { font-family: "Power Green"; src: url("assets/essentials/fonts/power-green.ttf"); }
@font-face { font-family: "Power Clear"; src: url("assets/essentials/fonts/power-clear.ttf"); }
@font-face { font-family: "Power Clear Bold"; src: url("assets/essentials/fonts/power-clear-bold.ttf"); }

:root {
  --bg: #1d2333;
  --panel: #f8f8f0;
  --ink: #484850;
  --ink-soft: #8a8a96;
  --accent: #e8b830;
  --accent-dark: #a87818;
  --sel: #3a8ee8;
  --border: #303040;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg) radial-gradient(ellipse at top, #2c3858 0%, var(--bg) 70%);
  color: var(--panel);
  font-family: "Power Green", "Courier New", monospace;
  font-size: 22px;
  -webkit-font-smoothing: none;
}

#app { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 16px; }
.screen { display: none; width: 100%; max-width: 1280px; flex: 1; flex-direction: column; align-items: center; }
.screen.active { display: flex; }

h1 { font-size: 56px; margin: 8px 0 0; color: var(--accent); text-shadow: 3px 3px 0 var(--accent-dark), 6px 6px 0 #00000055; letter-spacing: 2px; }
.sub { margin: 4px 0 20px; color: #c8d0e8; }
h2 { font-size: 28px; margin: 0 0 10px; text-align: center; }

.sides { display: flex; gap: 20px; align-items: flex-start; justify-content: center; flex-wrap: wrap; width: 100%; }
.side { background: #00000033; border: 3px solid var(--border); border-radius: 10px; padding: 14px; width: min(420px, 100%); }
.cards { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, 56px); gap: 6px; width: 100%; max-width: 380px; justify-content: center; }
.pick { width: 56px; height: 56px; padding: 0; background: #f8f8f0; border: 3px solid #c8c8c0; border-radius: 8px; cursor: pointer; font-family: inherit; }
.pick canvas { width: 50px; height: 50px; image-rendering: pixelated; display: block; }
.pick:hover { border-color: #e8b830; }
.pick.selected { border-color: var(--sel); background: #e0ecff; }
.actions { display: flex; gap: 14px; align-items: flex-end; }
.actions .btn.big { margin-top: 0; }
.vs { align-self: center; font-size: 48px; color: var(--accent); text-shadow: 3px 3px 0 var(--accent-dark); }

.card {
  width: 196px; background: var(--panel); color: var(--ink); border: 4px solid #c8c8c0;
  border-radius: 8px; padding: 8px 10px 10px; cursor: pointer; text-align: center;
  transition: transform .08s, border-color .08s;
}
.card:hover { transform: translateY(-3px); }
.card.selected { border-color: var(--sel); box-shadow: 0 0 0 3px #3a8ee855; }
.card img.front { width: 160px; height: 160px; image-rendering: pixelated; display: block; margin: 0 auto; }
.card .name { font-size: 28px; line-height: 1; }
.card .types { display: flex; gap: 4px; justify-content: center; margin: 6px 0; }
.card .types canvas { image-rendering: pixelated; width: 64px; height: 28px; }
.stats { font-size: 18px; text-align: left; }
.stat { display: grid; grid-template-columns: 34px 30px 1fr; align-items: center; gap: 4px; line-height: 1.1; }
.stat .bar { height: 6px; background: #ddd; border-radius: 3px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: #58c858; }
.moves { font-size: 17px; color: var(--ink-soft); margin-top: 4px; line-height: 1.1; }

.btn {
  font-family: inherit; font-size: 26px; color: var(--ink); background: var(--panel);
  border: 3px solid var(--border); border-bottom-width: 6px; border-radius: 8px;
  padding: 6px 18px; cursor: pointer;
}
.btn:hover { background: #fff; }
.btn:active { border-bottom-width: 3px; transform: translateY(3px); }
.actions { margin-top: 22px; }
.btn.big { font-size: 34px; padding: 8px 40px; background: var(--accent); }
.btn.small { font-size: 20px; padding: 4px 12px; }
.btn.ghost { background: #c8ccd8; }

.stage { position: relative; width: 100%; max-width: min(1280px, calc((100vh - 120px) * 16 / 9)); aspect-ratio: 16 / 9; }
#cv { width: 100%; height: 100%; image-rendering: pixelated; display: block; border: 3px solid var(--border); border-radius: 6px; background: #000; }
.end { position: absolute; left: 0; right: 0; top: 64%; display: flex; gap: 16px; justify-content: center; }
.hidden { display: none; }
.toolbar { display: flex; gap: 10px; margin-top: 10px; }

footer { font-family: system-ui, sans-serif; font-size: 12px; color: #8890a8; text-align: center; margin-top: 18px; max-width: 900px; }
footer a { color: #a8b8e8; }

@media (max-width: 640px) {
  h1 { font-size: 40px; }
  .card { width: 150px; }
  .card img.front { width: 120px; height: 120px; }
  .vs { width: 100%; text-align: center; }
}
