:root {
  --ink: #17231d;
  --cream: #fff7de;
  --forest: #58b65a;
  --volcano: #c24a32;
  --candy: #ff7ac8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(195, 243, 88, 0.18), transparent 28%),
    radial-gradient(circle at 78% 16%, rgba(255, 122, 200, 0.16), transparent 26%),
    linear-gradient(145deg, #081726 0%, #102235 52%, #1c2b1e 100%);
  color: var(--cream);
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.adventure-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.adventure-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(15, 27, 47, 0.92);
  border-bottom: 2px solid rgba(255, 247, 222, 0.14);
}

.adventure-brand {
  padding: 8px 12px;
  border: 2px solid rgba(255, 247, 222, 0.32);
  background: rgba(255, 183, 3, 0.18);
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adventure-topbar nav a,
.adventure-nav-locked,
.adventure-hud button,
.adventure-close,
.adventure-level-card {
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
  font: inherit;
  font-weight: 900;
}

.adventure-topbar nav a,
.adventure-nav-locked {
  padding: 8px 10px;
}

.adventure-nav-locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.adventure-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  padding: 14px;
}

.adventure-game {
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 5px solid rgba(255, 247, 222, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 22%),
    #163b45;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.adventure-game canvas {
  display: block;
  image-rendering: auto;
}

.adventure-hud {
  align-self: start;
  padding: 12px;
  border: 4px solid rgba(255, 247, 222, 0.24);
  background: rgba(15, 27, 47, 0.78);
}

.adventure-eyebrow,
.adventure-shards,
.adventure-wallet,
.adventure-prep,
.adventure-region-rewards {
  margin: 0;
  color: #c3f358;
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-wallet {
  margin-top: 4px;
  color: #8be8ff;
  font-size: 12px;
}

.adventure-prep {
  margin-top: 4px;
  color: #fff7de;
  font-size: 11px;
  text-transform: none;
}

.adventure-region-rewards {
  margin-top: 4px;
  color: #ffd66b;
  font-size: 11px;
  text-transform: none;
}

.adventure-inventory {
  margin: 10px 0;
  padding: 8px;
  border: 2px solid rgba(195, 243, 88, 0.36);
  background: rgba(10, 28, 34, 0.42);
}

.adventure-inventory-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.adventure-slot-button {
  min-height: 52px;
  border: 3px solid rgba(255, 247, 222, 0.28);
  background: #fff7de;
  color: #10251f;
  box-shadow: 4px 5px 0 #06192b;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-slot-button strong,
.adventure-slot-button span {
  display: block;
}

.adventure-inventory-list {
  margin: 8px 0 0;
  color: rgba(255, 247, 222, 0.78);
  font-size: 11px;
}

.adventure-menu-toggle {
  width: 100%;
  margin: -2px 0 10px;
  border: 3px solid #06192b;
  background: #c3f358;
  color: #10251f;
  box-shadow: 4px 5px 0 #06192b;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 12, 18, 0.76);
}

.adventure-menu-panel.hidden {
  display: none;
}

.adventure-menu-shell {
  width: min(900px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 4px solid #c3f358;
  background: #10251f;
  color: #fff7de;
  box-shadow: 8px 10px 0 #06192b;
  padding: 14px;
}

.adventure-menu-content {
  display: grid;
  gap: 12px;
}

.adventure-menu-section {
  border: 2px solid rgba(255, 247, 222, 0.2);
  padding: 10px;
  background: rgba(255, 247, 222, 0.06);
}

.adventure-menu-section h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.1;
}

.adventure-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.adventure-menu-button,
.adventure-menu-chip {
  min-height: 48px;
  border: 2px solid rgba(255, 247, 222, 0.28);
  background: rgba(255, 247, 222, 0.12);
  color: #fff7de;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
}

.adventure-menu-button {
  cursor: pointer;
}

.adventure-menu-button.is-selected {
  border-color: rgba(195, 243, 88, 0.9);
  background: rgba(195, 243, 88, 0.16);
}

.adventure-menu-button strong,
.adventure-menu-chip strong,
.adventure-menu-button span,
.adventure-menu-chip span {
  display: block;
}

.adventure-menu-chip[data-state="complete"] {
  border-color: rgba(195, 243, 88, 0.8);
  color: #c3f358;
}

.adventure-hud h1 {
  margin: 6px 0;
  font-size: 28px;
  line-height: 0.95;
}

.adventure-hud p {
  font-weight: 800;
  line-height: 1.28;
}

.adventure-help {
  color: rgba(255, 247, 222, 0.72);
  font-size: 12px;
}

.adventure-controller-status {
  margin: -4px 0 10px;
  padding: 7px 8px;
  border: 2px solid rgba(139, 232, 255, 0.32);
  background: rgba(139, 232, 255, 0.08);
  color: #8be8ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.24;
  word-break: break-word;
}

.adventure-controller-status[data-state="missing"] {
  border-color: rgba(255, 247, 222, 0.28);
  background: rgba(255, 247, 222, 0.07);
  color: rgba(255, 247, 222, 0.78);
}

.adventure-controller-status[data-state="ready"] {
  border-color: rgba(195, 243, 88, 0.54);
  background: rgba(195, 243, 88, 0.12);
  color: #c3f358;
}

.adventure-objective {
  margin: 10px 0;
  padding: 8px;
  border: 2px solid rgba(195, 243, 88, 0.48);
  background: rgba(195, 243, 88, 0.12);
  color: var(--cream);
  font-weight: 900;
  line-height: 1.24;
}

.adventure-objective strong {
  color: #c3f358;
  text-transform: uppercase;
}

.adventure-mode-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 10px 0;
}

.adventure-mode-picker button {
  min-height: 30px;
  margin: 0;
  padding: 5px 4px;
  font-size: 11px;
}

.adventure-mode-picker button.is-active {
  background: #c3f358;
}

.adventure-world-progress {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.adventure-world-progress-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 2px solid rgba(255, 247, 222, 0.2);
  background: rgba(255, 247, 222, 0.08);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-world-progress-row.is-locked {
  opacity: 0.48;
}

.adventure-world-progress-row.is-cleared {
  border-color: rgba(195, 243, 88, 0.72);
  background: rgba(195, 243, 88, 0.16);
}

.adventure-world-progress-row small {
  color: #c3f358;
  font-weight: 900;
}

.adventure-hud button,
.adventure-close {
  min-height: 38px;
  padding: 8px 12px;
  margin: 0 6px 8px 0;
}

.adventure-hud button.is-active {
  background: #c3f358;
}

.adventure-hud button:disabled {
  opacity: 0.45;
  transform: translateY(2px);
  box-shadow: none;
}

.adventure-level-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 10, 18, 0.72);
}

.hidden {
  display: none !important;
}

.adventure-level-card-shell {
  width: min(820px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border: 4px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
}

.adventure-level-card-shell h2 {
  margin: 10px 0 4px;
  font-size: 36px;
}

.adventure-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.adventure-level-card {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 12px;
  text-align: left;
  position: relative;
}

.adventure-level-card:disabled {
  opacity: 0.42;
}

.adventure-level-card.is-ready {
  background: #fff7de;
}

.adventure-level-card.is-done {
  background: #dfffa8;
}

.adventure-level-status {
  justify-self: start;
  padding: 2px 7px;
  background: var(--ink);
  color: var(--cream);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.adventure-level-card span {
  color: rgba(23, 35, 29, 0.68);
  font-size: 12px;
  text-transform: uppercase;
}

.adventure-level-card .adventure-level-rewards {
  color: #92530f;
}

.adventure-error {
  padding: 20px;
  font-weight: 900;
}

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

  .adventure-game {
    min-height: 360px;
  }
}
