:root {
  --ink: #1d1712;
  --paper: #f3e6c8;
  --leather: #3a2616;
  --leather-deep: #26180e;
  --brass: #c9a35a;
  --moss: #6f8f4e;
  --warn: #c45b2d;
  --full: #b4332a;
  --muted: #b7a48a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #120e0a;
  color: var(--paper);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.app,
.stage {
  width: 100%;
  height: 100%;
}

.stage {
  position: relative;
  background: #1c2a18;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#world.is-blocked {
  cursor: not-allowed;
}

.hint {
  position: absolute;
  left: 24px;
  bottom: 20px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18, 14, 10, 0.55);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.pack-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 168px;
  padding: 10px 14px;
  border: 1px solid #6a4528;
  border-radius: 12px;
  background: var(--leather);
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pack-toggle:hover,
.pack-toggle:focus-visible {
  border-color: var(--brass);
  outline: none;
}

.pack-toggle-title {
  color: var(--brass);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pack-toggle-meta {
  font-size: 14px;
}

.pack-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
}

.pack-layer[hidden] {
  display: none;
}

.pack-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(12, 8, 5, 0.45);
  cursor: pointer;
}

.pack {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(360px, 100%);
  height: 100%;
  padding: 28px 24px 24px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 220, 150, 0.06), transparent 28%), var(--leather);
  border-left: 1px solid #5a3b22;
  box-shadow: -16px 0 32px rgba(0, 0, 0, 0.28);
}

.pack-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.pack-close {
  padding: 8px 12px;
  border: 1px solid #6a4528;
  border-radius: 999px;
  background: transparent;
  color: var(--brass);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.pack-close:hover,
.pack-close:focus-visible {
  border-color: var(--brass);
  outline: none;
}

.pack-kicker {
  margin: 0 0 4px;
  color: var(--brass);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pack-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.gauges {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gauge-row,
.slot-meta,
.slot-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.gauge-row {
  font-size: 14px;
  color: var(--muted);
}

.gauge-track {
  height: 10px;
  margin: 8px 0 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--leather-deep);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.gauge-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--moss), #d2b56a);
  transition:
    width 180ms ease,
    background 180ms ease;
}

.gauge-fill.is-volume {
  background: linear-gradient(90deg, #6a8f7a, #c9a35a);
}

.gauge-fill.is-heavy {
  background: linear-gradient(90deg, #d2b56a, var(--warn));
}

.gauge-fill.is-full {
  background: linear-gradient(90deg, var(--warn), var(--full));
}

.gauge-note {
  margin: 0;
  color: var(--paper);
  font-size: 14px;
}

.slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.slot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #6a4528;
  border-radius: 10px;
  background: rgba(20, 12, 7, 0.45);
}

.slot-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.slot:hover,
.slot:focus-within {
  border-color: var(--brass);
}

.slot-item:focus-visible,
.slot-drop:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.slot-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #2b1c11;
  font-size: 22px;
}

.slot-head {
  font-size: 16px;
}

.slot-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.slot-drop {
  padding: 8px 10px;
  border: 1px solid #6a4528;
  border-radius: 8px;
  background: transparent;
  color: var(--brass);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.slot-drop:hover {
  border-color: var(--brass);
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.empty.is-hidden,
.slots:empty + .empty {
  display: none;
}

.slots:empty + .empty {
  display: block;
}

@media (max-width: 860px) {
  .pack-toggle {
    min-width: 0;
  }

  .pack {
    width: min(100%, 360px);
  }
}
