:root {
  --bg: #0a1017;
  --bg-soft: #121c29;
  --panel: rgba(10, 16, 25, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f6efe0;
  --muted: #94a4b7;
  --accent: #ff8d43;
  --accent-bright: #ffd66e;
  --danger: #ff635e;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Avenir Next Condensed", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 141, 67, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(90, 183, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #0d131c 0%, #070b11 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1680px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy,
.hero-stats,
.shop-panel,
.arena-panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 24px 26px;
  border-radius: 28px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.hero h1,
.shop-panel h2 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.92;
}

.subtitle {
  max-width: 60ch;
  margin: 16px 0 0;
  color: #dce4f0;
  font-size: 1.03rem;
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
  border-radius: 28px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card span,
.selected-summary span,
.filter-wrap span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.shop-panel {
  border-radius: 28px;
  padding: 18px;
  min-height: 760px;
}

.panel-header,
.arena-toolbar,
.toolbar-actions,
.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-header,
.arena-toolbar {
  justify-content: space-between;
}

.filter-wrap {
  display: block;
  margin: 16px 0 14px;
}

.filter-wrap input {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 9, 15, 0.82);
  color: var(--text);
  outline: none;
}

.filter-wrap input:focus {
  border-color: rgba(255, 141, 67, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 141, 67, 0.12);
}

.item-grid {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
}

.item-grid::-webkit-scrollbar {
  width: 10px;
}

.item-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 999px;
}

.block-card,
.empty-state {
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(135deg, var(--card-soft, rgba(255, 255, 255, 0.06)), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.block-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.block-card:hover,
.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-2px);
}

.block-card.is-selected {
  border-color: var(--card-border, rgba(255, 255, 255, 0.28));
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.24);
}

.block-card__sprite-wrap {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(5, 9, 14, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.block-card__sprite {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}

.block-card__body {
  min-width: 0;
}

.block-card__top,
.block-card__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.block-card__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff4e4;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.block-card strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 0.98rem;
  line-height: 1.15;
}

.block-card small,
.selected-summary small,
.empty-state {
  color: var(--muted);
  line-height: 1.42;
}

.block-card__stats {
  margin-top: 8px;
  font-size: 0.83rem;
  color: #eff4fb;
  flex-wrap: wrap;
}

.empty-state {
  padding: 16px;
}

.arena-panel {
  border-radius: 30px;
  padding: 18px;
}

.selected-summary strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2.3vw, 1.7rem);
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-btn,
.primary-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  color: var(--text);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
}

.primary-btn {
  background: linear-gradient(135deg, #ff8d43, #ff6230);
  color: #fff7ef;
}

.canvas-wrap {
  position: relative;
  margin-top: 16px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 30% 10%, rgba(255, 214, 110, 0.08), transparent 22%),
    linear-gradient(180deg, #09111a, #06090e);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
}

.canvas-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  pointer-events: none;
}

.canvas-overlay p {
  margin: 0;
  width: fit-content;
  max-width: min(100%, 760px);
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(6, 10, 15, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #eef4ff;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hint-card {
  flex: 1 1 360px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8e2f0;
}

.legend-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #f8f0e6;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.legend-chip--transport {
  background: rgba(92, 208, 255, 0.12);
}

.legend-chip--hazard {
  background: rgba(255, 111, 95, 0.12);
}

.legend-chip--air {
  background: rgba(132, 255, 211, 0.12);
}

.legend-chip--cash {
  background: rgba(255, 206, 92, 0.12);
}

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

  .item-grid {
    max-height: 340px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 16px, 1680px);
    padding: 12px 0 20px;
  }

  .hero-copy,
  .hero-stats,
  .shop-panel,
  .arena-panel {
    border-radius: 22px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .arena-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions,
  .legend-row {
    justify-content: flex-start;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }

  .block-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}
