@font-face {
  font-family: "PressStart";
  src: url("assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111;
  --bg2: #181818;
  --panel: #222;
  --panel2: #2d2d2d;
  --line: #555;
  --muted: #a8a8a8;
  --text: #f6f2df;
  --gold: #f7c84b;
  --gold2: #ffe17a;
  --green: #78db84;
  --red: #f06868;
  --blue: #65a7ff;
  --purple: #c18bff;
  --black: #090909;
  --shadow: #050505;
  --radius: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(247, 200, 75, 0.08), transparent 28rem),
    radial-gradient(circle at 70% 30%, rgba(101, 167, 255, 0.07), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: PressStart, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
  background-image: url("assets/carrots/dark-carrot-pattern.svg");
  background-size: 178px;
}

.sidebar {
  min-height: 100vh;
  border-right: 4px solid var(--line);
  background: rgba(16, 16, 16, 0.96);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 4px solid var(--line);
  background: var(--black);
  color: var(--text);
  text-align: left;
  text-transform: uppercase;
}

.brand img {
  width: 54px;
  height: 54px;
  image-rendering: pixelated;
}

.brand span {
  color: var(--gold2);
  line-height: 1.25;
}

.nav {
  padding: 12px;
  display: grid;
  gap: 7px;
  overflow: auto;
}

.nav button,
.pixel-btn,
.tab-btn,
.square,
.chip {
  border: 3px solid var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--shadow);
  text-transform: uppercase;
  transition: transform 0.08s ease, background 0.08s ease, border-color 0.08s ease;
}

.nav button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  min-height: 40px;
}

.nav button:hover,
.pixel-btn:hover,
.tab-btn:hover,
.square:hover,
.chip:hover {
  transform: translate(-1px, -1px);
  border-color: var(--gold);
}

.nav button.active,
.tab-btn.active,
.chip.active,
.square.active {
  background: #3d331b;
  border-color: var(--gold);
  color: var(--gold2);
}

.pixel-btn {
  padding: 11px 14px;
  min-height: 42px;
}

.pixel-btn.primary {
  color: #1b1300;
  background: var(--gold);
  border-color: var(--gold2);
}

.pixel-btn.danger,
.square.danger {
  border-color: #7e3333;
  background: #341616;
  color: #ffd7d7;
}

.pixel-btn.good {
  border-color: #397642;
  background: #173d20;
  color: #d9ffdd;
}

.pixel-btn:disabled,
.tab-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.audio-box {
  margin: auto 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.square {
  min-height: 40px;
  padding: 8px;
  text-align: center;
}

.player-card-mini {
  border-top: 4px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 4px;
  background: var(--black);
}

.player-card-mini small {
  color: var(--muted);
}

.mobile-top {
  display: none;
}

.main {
  min-width: 0;
  padding: 28px;
}

.view {
  max-width: 1460px;
  margin: 0 auto;
}

.crumb {
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 54px);
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 5px 5px 0 var(--shadow);
}

.page-copy {
  max-width: 860px;
  color: var(--muted);
  margin: 0 0 24px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: rgba(31, 31, 31, 0.94);
  border: 4px solid var(--line);
  box-shadow: 7px 7px 0 var(--shadow);
  padding: 18px;
}

.panel.tight {
  padding: 12px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  text-transform: uppercase;
  color: var(--text);
}

.panel-title small {
  color: var(--gold);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  border: 3px solid #444;
  background: var(--panel2);
  padding: 12px;
  min-height: 78px;
}

.stat label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat strong {
  display: block;
  color: var(--gold2);
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 390px;
  gap: 22px;
}

.button-stage {
  min-height: 620px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.button-stage:before {
  content: "+5k users";
  position: absolute;
  left: 34px;
  top: 72px;
  color: var(--red);
  font-size: 28px;
  transform: rotate(-8deg);
  text-shadow: 4px 4px 0 #310909;
}

.bunny-button {
  width: min(54vw, 430px);
  max-width: 430px;
  aspect-ratio: 1;
  border: 18px solid var(--gold);
  background: #050505;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 8px rgba(247, 200, 75, 0.18),
    0 0 80px rgba(247, 200, 75, 0.18),
    10px 10px 0 var(--shadow);
  transition: transform 0.08s ease, filter 0.08s ease;
  position: relative;
}

.bunny-button img {
  width: 46%;
  image-rendering: pixelated;
}

.bunny-button.pressed {
  transform: scale(0.96);
  filter: brightness(1.18);
}

.stage-meta {
  width: min(100%, 760px);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}

.stage-meta span,
.pill {
  border: 3px solid var(--line);
  background: #2b2b2b;
  padding: 8px 10px;
  color: var(--text);
  text-transform: uppercase;
}

.stash-card {
  position: sticky;
  top: 28px;
}

.progress-bar {
  height: 18px;
  border: 3px solid #383838;
  background: #101010;
  overflow: hidden;
  display: block;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0%;
}

.progress-bar.green span {
  background: var(--green);
}

.progress-bar.red span {
  background: var(--red);
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.tab-btn,
.chip {
  padding: 8px 10px;
}

.card-list {
  display: grid;
  gap: 12px;
}

.item-card,
.breed-card,
.quest-card,
.leader-row {
  border: 3px solid #4b4b4b;
  background: rgba(42, 42, 42, 0.94);
  padding: 12px;
}

.item-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
}

.item-card img,
.breed-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  border: 3px solid #444;
  background: #171717;
  padding: 6px;
}

.item-card.equipped {
  border-color: var(--gold);
}

.rarity-common { color: #dadada; }
.rarity-special { color: var(--green); }
.rarity-rare { color: var(--blue); }
.rarity-epic { color: var(--purple); }
.rarity-mythic { color: #ff9f54; }
.rarity-legendary { color: var(--gold2); }
.rarity-ancient { color: #fff; text-shadow: 0 0 10px #fff; }

.breed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.breed-card {
  display: grid;
  gap: 8px;
}

.breed-card.selected {
  border-color: var(--gold);
  background: #332b18;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 2px solid #444;
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

.table th {
  color: var(--gold);
  text-transform: uppercase;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  background: #211a0b;
  border: 3px solid var(--gold);
  color: var(--text);
  padding: 12px;
  box-shadow: 5px 5px 0 var(--shadow);
}

.modal-root {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-root.hidden {
  display: none;
}

.modal {
  width: min(960px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border: 4px solid var(--gold);
  box-shadow: 10px 10px 0 var(--shadow);
  padding: 18px;
}

.crate-reveal {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.crate-reveal img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  image-rendering: pixelated;
}

.chat-box {
  height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-line {
  border: 2px solid #3d3d3d;
  background: #1b1b1b;
  padding: 8px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.input {
  min-height: 42px;
  width: 100%;
  border: 3px solid var(--line);
  background: #111;
  color: var(--text);
  padding: 10px;
  box-shadow: inset 3px 3px 0 #000;
}

.footer-note {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: fixed;
    inset: 72px auto 0 0;
    width: min(320px, calc(100vw - 30px));
    min-height: auto;
    height: calc(100vh - 72px);
    box-shadow: 10px 0 0 var(--shadow);
  }

  .sidebar.open {
    display: flex;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 72px;
    padding: 8px 12px;
    border-bottom: 4px solid var(--line);
    background: #070707;
  }

  .mobile-brand {
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .mobile-brand img {
    width: 42px;
    height: 42px;
  }

  .main {
    padding: 18px 12px 32px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .play-layout {
    grid-template-columns: 1fr;
  }

  .button-stage {
    min-height: 500px;
  }

  .button-stage:before {
    font-size: 18px;
    left: 18px;
    top: 58px;
  }

  .bunny-button {
    width: min(86vw, 390px);
  }

  .stash-card {
    position: static;
  }

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

@media (max-width: 560px) {
  body {
    font-size: 10px;
  }

  .page-title {
    font-size: 28px;
  }

  .panel {
    padding: 12px;
  }

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

  .item-card img,
  .breed-card img {
    width: 54px;
    height: 54px;
  }

  .table {
    font-size: 9px;
  }

  .form-row {
    flex-direction: column;
  }
}

