* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0d0a08;
  color: #e8d5b5;
  font-family: "Courier New", ui-monospace, monospace;
}

#wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

#wrap.view-full {
  padding: 0;
  gap: 0;
}

#wrap.view-full header,
#wrap.view-full .hint,
#wrap.cine header,
#wrap.cine .hint {
  display: none;
}

header { text-align: center; }

h1 {
  font-size: 26px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #f0c27a;
}

.sub {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8a7460;
}

#stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

#game {
  background: #1a1410;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 6px solid #4a2e1c;
  display: block;
}

.overlay {
  position: absolute;
  inset: 6px;
  background: rgba(8, 5, 4, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.overlay.hidden { display: none; }

.panel {
  width: min(420px, 90%);
  text-align: center;
}

.panel-wide {
  width: min(520px, 94%);
}

.inv-block {
  margin: 14px 0 4px;
  text-align: left;
}

.inv-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8a7460;
  margin-bottom: 8px;
}

.inv-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 54px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #3a2818;
}

.inv-slot {
  width: 52px;
  height: 52px;
  padding: 0;
  background: #1a1210;
  border: 2px solid #5a4030;
  cursor: help;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-slot:hover,
.inv-slot:focus {
  border-color: #f0c27a;
  outline: none;
}

.inv-slot.inv-active {
  border-color: #c9a227;
  box-shadow: inset 0 0 0 1px #c9a227;
}

.inv-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.inv-tip {
  min-height: 34px;
  margin-top: 8px;
  font-size: 12px;
  color: #c4b090;
  line-height: 1.45;
}

.inv-empty {
  font-size: 12px;
  color: #6e5a48;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #8a7460;
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #f0c27a;
  margin-bottom: 10px;
}

.blurb {
  font-size: 13px;
  color: #c4b090;
  margin-bottom: 18px;
}

.btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px 14px;
  background: #2a1c14;
  border: 2px solid #6a4a28;
  color: #e8d5b5;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.btn:hover, .btn:focus {
  border-color: #f0c27a;
  color: #f0c27a;
}

.btn.primary {
  background: #3a2418;
  border-color: #c9a227;
  color: #f0c27a;
}

.vols {
  margin-top: 12px;
  text-align: left;
}

.vols label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 12px;
  color: #c4b090;
}

.vols label.toggle {
  cursor: pointer;
}

.vols input[type="range"] {
  flex: 1;
  accent-color: #c9a227;
  cursor: pointer;
}

.vols select {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  background: #1a1210;
  border: 1px solid #6a4a28;
  color: #e8d5b5;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.vols select:focus {
  border-color: #f0c27a;
  outline: none;
}

.how, .hint-mini {
  margin-top: 14px;
  font-size: 12px;
  color: #8a7460;
  line-height: 1.45;
}

.ach-meta {
  font-size: 12px;
  color: #8a7460;
  margin-bottom: 10px;
}

.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: min(280px, 42vh);
  overflow: auto;
  margin-bottom: 10px;
  text-align: left;
}

.ach-slot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: #1a1210;
  border: 1px solid #3a2818;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: default;
}

.ach-slot strong {
  font-size: 12px;
  color: #6e5a48;
}

.ach-slot span {
  font-size: 11px;
  color: #5a4a3a;
  line-height: 1.3;
}

.ach-slot.on {
  border-color: #6a4a28;
}

.ach-slot.on strong {
  color: #f0c27a;
}

.ach-slot.on span {
  color: #c4b090;
}

.ach-slot.plat {
  grid-column: 1 / -1;
}

.ach-slot.plat.on {
  border-color: #ffe08a;
  background: #241808;
}

.ach-slot.plat.on strong {
  color: #fff4c8;
}

.hidden { display: none; }

.hint {
  font-size: 12px;
  color: #6e5a48;
  text-align: center;
  max-width: min(100%, 1920px);
}

@media (max-height: 700px) {
  h1 { font-size: 18px; }
  .sub { display: none; }
  .hint { display: none; }
  #wrap { padding: 8px; gap: 8px; }
}

@media (max-width: 900px) {
  h1 { font-size: 18px; }
  .panel h2 { font-size: 18px; }
}
