/* ==========================================================
   WESTWARD cartridge styles. The screen is split: a pixel
   scene up top, a parchment status readout below, and event
   boxes that float over the scene like the old game. Mono
   skin flips everything to lime on black. Brand tokens only.
   ========================================================== */

.wsww-root {
  --wsww-lime: #C3DD22;
  --wsww-slate: #496D89;
  --wsww-grey: #A2AAAD;
  --wsww-red: #FF6B6B;
  --wsww-ink: #1C1C1E;
  --wsww-parch: #ECE3CB;
  --wsww-parch-2: #E1D5B4;
  --wsww-orange: #E0842B;

  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
  color: var(--wsww-ink);
}

/* --- the pixel scene --- */
.wsww-scenery {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

/* --- event / landmark box, floats over the lower scene --- */
.wsww-caption {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  justify-self: center;
  z-index: 3;
  margin-bottom: 5%;
  max-width: 84%;
  padding: 7px 14px;
  text-align: center;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  line-height: 1.28;
}
.wsww-caption.is-hidden { display: none; }
.wsww-caption__name { font-weight: 900; font-size: 0.98rem; letter-spacing: 0.01em; }
.wsww-caption__sub { font-size: 0.82rem; opacity: 0.85; margin-top: 2px; }
.wsww-caption__line { font-size: 0.86rem; margin-top: 3px; }
.wsww-caption__hint {
  margin-top: 7px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wsww-lime);
}

/* --- skin toggle on the bezel --- */
.wsww-skinbtn {
  grid-row: 1;
  grid-column: 1;
  align-self: start;
  justify-self: end;
  z-index: 4;
  margin: 6px;
  padding: 3px 8px;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--wsww-lime);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(195, 221, 34, 0.5);
  border-radius: 999px;
  cursor: pointer;
}
.wsww-skinbtn:hover { background: rgba(0, 0, 0, 0.75); }

/* --- readout panel below the scene --- */
.wsww-panel {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px 12px;
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--wsww-parch);
  background-image: linear-gradient(180deg, var(--wsww-parch) 0%, var(--wsww-parch-2) 100%);
  color: var(--wsww-ink);
}

/* classic centered Label: value block */
.wsww-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 1px;
  align-content: center;
}
.wsww-ro { display: contents; }
.wsww-ro__label { text-align: right; font-weight: 700; opacity: 0.72; white-space: nowrap; }
.wsww-ro__value { text-align: left; font-weight: 800; white-space: nowrap; }
.wsww-ro.is-low .wsww-ro__value { color: #B23B3B; }

/* supply chips */
.wsww-supply {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
  margin-top: 2px;
}
.wsww-chip {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(73, 109, 137, 0.16);
  border: 1px solid rgba(73, 109, 137, 0.3);
  white-space: nowrap;
}
.wsww-chip__label { opacity: 0.6; margin-right: 4px; font-weight: 700; }
.wsww-chip__value { font-weight: 800; }

/* single line of latest flavor */
.wsww-ticker {
  font-size: 0.76rem;
  font-style: italic;
  opacity: 0.66;
  text-align: center;
  max-width: 46ch;
  min-height: 1.1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- menu / store / names lines --- */
.wsww-line {
  width: 100%;
  max-width: 46ch;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.4;
}
.wsww-line--menuhead { font-weight: 900; color: var(--wsww-slate); margin-bottom: 3px; }
.wsww-line--dim { opacity: 0.6; font-size: 0.78rem; margin-top: 4px; }
.wsww-line--warn { color: #B23B3B; font-weight: 700; }
.wsww-line--total { font-weight: 900; margin-top: 4px; }
.wsww-line.is-picked {
  background: rgba(195, 221, 34, 0.28);
  box-shadow: inset 3px 0 0 var(--wsww-lime);
  border-radius: 3px;
  padding-left: 5px;
  font-weight: 800;
}

.wsww-nameinput {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 1px 5px;
  width: 11ch;
  border: 1px solid var(--wsww-slate);
  border-radius: 3px;
  background: #fff;
  color: var(--wsww-ink);
}
.wsww-nameinput:focus { outline: 2px solid var(--wsww-lime); outline-offset: 0; }

.wsww-share {
  margin-top: 8px;
  padding: 5px 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--wsww-ink);
  background: var(--wsww-lime);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

/* --- toast --- */
.wsww-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(8px);
  z-index: 6;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(28, 28, 30, 0.94);
  border: 1px solid rgba(195, 221, 34, 0.5);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.wsww-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- keypad in the deck --- */
.wsww-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
}
.wsww-key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  font-family: inherit;
  cursor: pointer;
  color: var(--wsww-lime);
  background: linear-gradient(180deg, #2A3D4C 0%, #1B2833 100%);
  border: 1px solid rgba(195, 221, 34, 0.35);
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.05s ease, background 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.wsww-key:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.45); }
.wsww-key__num {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.5;
  color: var(--wsww-grey);
}
.wsww-key__label { font-size: 0.92rem; font-weight: 800; text-align: center; line-height: 1.05; }
.wsww-key.is-blank { visibility: hidden; }
.wsww-key:disabled { cursor: default; }

/* ==========================================================
   MONO SKIN. lime on black, everywhere.
   ========================================================== */
.wsww-root.is-mono { background: #000; color: var(--wsww-lime); }
.wsww-root.is-mono .wsww-panel {
  background: #000;
  background-image: none;
  color: var(--wsww-lime);
  border-top: 1px solid rgba(195, 221, 34, 0.3);
}
.wsww-root.is-mono .wsww-ro__label { color: var(--wsww-lime); opacity: 0.7; }
.wsww-root.is-mono .wsww-ro__value { color: var(--wsww-lime); }
.wsww-root.is-mono .wsww-ro.is-low .wsww-ro__value { color: #fff; }
.wsww-root.is-mono .wsww-chip {
  background: rgba(195, 221, 34, 0.12);
  border-color: rgba(195, 221, 34, 0.35);
  color: var(--wsww-lime);
}
.wsww-root.is-mono .wsww-ticker { color: var(--wsww-lime); opacity: 0.7; }
.wsww-root.is-mono .wsww-line--menuhead { color: var(--wsww-lime); }
.wsww-root.is-mono .wsww-line--warn { color: #fff; }
.wsww-root.is-mono .wsww-line.is-picked {
  background: rgba(195, 221, 34, 0.2);
  box-shadow: inset 3px 0 0 var(--wsww-lime);
}
.wsww-root.is-mono .wsww-nameinput {
  background: #000;
  color: var(--wsww-lime);
  border-color: var(--wsww-lime);
}
.wsww-root.is-mono .wsww-caption {
  background: #000;
  color: var(--wsww-lime);
  border-color: var(--wsww-lime);
}
.wsww-root.is-mono .wsww-caption__hint { color: var(--wsww-lime); opacity: 0.8; }
.wsww-root.is-mono .wsww-share {
  background: #000;
  color: var(--wsww-lime);
  border: 1px solid var(--wsww-lime);
}

/* ==========================================================
   REDUCED MOTION
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .wsww-key, .wsww-toast { transition: none; }
}
