:root {
  color-scheme: dark;
  --bg: #05070e;
  --panel: #101629;
  --edge: #3d4f7c;
  --text: #edf2ff;
  --muted: #aab6dc;
  --cyan: #7ef4ff;
  --pink: #ff79cd;
  --gold: #ffd979;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 14%, rgba(126, 244, 255, 0.18), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(255, 121, 205, 0.16), transparent 36%),
    linear-gradient(180deg, #070b16 0%, #03050a 100%);
}

.deck {
  width: min(1060px, 94vw);
  margin: 1.8rem auto;
  display: grid;
  gap: 1rem;
}

.topbar,
.panel {
  border: 1px solid var(--edge);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(16, 22, 41, 0.97), rgba(8, 11, 23, 0.97));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
}

.topbar {
  padding: 1.1rem 1.2rem;
}

.kicker {
  margin: 0;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  margin: 0.35rem 0;
  line-height: 1.1;
  font-size: clamp(1.64rem, 3.2vw, 2.3rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(260px, 0.82fr) minmax(350px, 1.18fr);
}

.panel {
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 1.03rem;
}

.buttons {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

button {
  border: 1px solid #56659e;
  border-radius: 9px;
  padding: 0.56rem 0.82rem;
  background: #121a35;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  border-color: #c79d40;
  background: linear-gradient(180deg, #5d4818, #3e2e0e);
  color: #ffefc3;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.stats p {
  margin: 0;
  border: 1px solid #425085;
  border-radius: 9px;
  background: #0f1428;
  padding: 0.45rem 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.84rem;
}

.stats strong {
  font-size: 1.01rem;
}

.farebox,
.keys,
.status {
  border: 1px solid #404d7b;
  border-radius: 10px;
  background: #0d1222;
  padding: 0.64rem;
}

.farebox {
  margin-bottom: 0.78rem;
}

.farebox h3 {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.89rem;
}

.farebox p {
  margin: 0;
  min-height: 2.5rem;
  line-height: 1.35;
  color: #d9e3ff;
  font-size: 0.92rem;
}

.keys {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.89rem;
}

.keys p {
  margin: 0.28rem 0;
}

kbd {
  display: inline-block;
  border: 1px solid #5866a1;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.09rem 0.34rem;
  margin-right: 0.2rem;
  background: #151d3a;
  color: var(--text);
  font-size: 0.78rem;
}

.status {
  margin: 0;
  min-height: 3.1rem;
  font-size: 0.91rem;
  color: #d8e1ff;
  background: #101730;
}

.frame {
  border: 1px solid #435080;
  border-radius: 12px;
  background: #050811;
  padding: 0.65rem;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  image-rendering: crisp-edges;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .deck {
    margin: 1.2rem auto;
  }
}
