:root {
  color-scheme: dark;
  --bg: #05070f;
  --panel: #11162a;
  --edge: #384470;
  --text: #edf2ff;
  --muted: #aab4d8;
  --cyan: #64f2ff;
  --magenta: #ff70cc;
  --gold: #ffd767;
}

* {
  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 12% 15%, rgba(100, 242, 255, 0.18), transparent 38%),
    radial-gradient(circle at 87% 12%, rgba(255, 112, 204, 0.14), transparent 36%),
    linear-gradient(180deg, #070a14 0%, #030409 100%);
}

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

.topbar,
.panel {
  border: 1px solid var(--edge);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(17, 22, 42, 0.97), rgba(9, 12, 26, 0.97));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.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.62rem, 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 #566398;
  border-radius: 9px;
  padding: 0.56rem 0.82rem;
  background: #121a36;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

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

button.primary {
  border-color: #caa03f;
  background: linear-gradient(180deg, #5f4918, #3f2f0f);
  color: #fff0cb;
}

.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 #424f81;
  border-radius: 9px;
  background: #0f1429;
  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.02rem;
}

.orders {
  border: 1px solid #404b78;
  border-radius: 10px;
  background: #0d1223;
  padding: 0.65rem;
  margin-bottom: 0.8rem;
}

.orders h3 {
  margin: 0 0 0.42rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.orders ol {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.34rem;
  font-size: 0.92rem;
}

.keys {
  border: 1px solid #404a73;
  border-radius: 10px;
  background: #0b1120;
  padding: 0.64rem;
  font-size: 0.89rem;
  color: var(--muted);
}

.keys p {
  margin: 0.28rem 0;
}

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

.status {
  margin: 0.8rem 0 0;
  border: 1px solid #4a5589;
  border-radius: 10px;
  background: #101731;
  padding: 0.65rem;
  min-height: 3.1rem;
  font-size: 0.91rem;
  color: #d8e1ff;
}

.frame {
  border: 1px solid #434e81;
  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;
  }
}
