/* Filler chrome. Every colour here is a placeholder for real art direction. */

:root {
  --ink: #21242e;
  --ink-soft: #4a5061;
  --paper: #fdf6e8;
  --panel: rgba(253, 246, 232, 0.94);
  --gold: #f2b134;
  --gold-deep: #c98b1a;
  --edge: rgba(33, 36, 46, 0.14);
  --shadow: 0 6px 0 rgba(33, 36, 46, 0.16), 0 12px 28px rgba(33, 36, 46, 0.18);
  --radius: 16px;
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
  background: #10131b;
  font-family: var(--font);
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

/* ------------------------------------------------------------------ stage */

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 0%, #232838, #10131b 70%);
}

#game-container { line-height: 0; }
#game-container canvas {
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

/* -------------------------------------------------------------------- hud */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.hud-row { display: flex; gap: 12px; align-items: flex-start; pointer-events: none; }
.hud-row > * { pointer-events: auto; }
.hud-row.bottom { align-items: flex-end; justify-content: space-between; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.pill .coin {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(160deg, #ffd873, var(--gold-deep));
  border: 2px solid #a97613;
  flex: none;
}

.pill.room { font-weight: 700; color: var(--ink-soft); }
/* The corner map (LV.mapbtn): pushed right, in the same corner in every room, beside How Owl's perch (owl.css, fixed at the top right), which would cover it. */
.chat-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.map-pill { font-size: 34px; padding: 8px 18px; cursor: pointer; }
.map-pill:hover { transform: translateY(-1px); }

/* ------------------------------------------------------------------ chat */

/* Safe chat (LV.chat.safe): the Say button, its wheel above it, and the `/` command line. */
.chatbar { position: relative; display: flex; gap: 8px; align-items: center; }

.say-toggle, .btn {
  border: 2px solid var(--gold-deep); background: var(--gold);
  color: #3a2a05; font-weight: 900; font-size: 14px;
  border-radius: 11px; padding: 8px 16px;
  box-shadow: 0 3px 0 var(--gold-deep);
  transition: transform 0.06s ease;
}
.say-toggle:active, .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.say-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; padding: 10px 20px; border-radius: var(--radius); cursor: pointer;
}
.say-toggle-icon { font-size: 26px; line-height: 1; }

.command-line {
  width: min(360px, 50vw); border: 2px solid var(--edge); outline: none;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  font: inherit; font-size: 15px; padding: 10px 12px; color: var(--ink);
}

.say-wheel {
  position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 30; pointer-events: auto;
  width: min(560px, 92vw); display: grid; gap: 10px; padding: 12px;
  background: var(--panel); border: 2px solid var(--edge);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.say-emoji { display: flex; flex-wrap: wrap; gap: 6px; }
.say-emoji-btn {
  width: 48px; height: 48px; font-size: 28px; line-height: 1; cursor: pointer;
  border: 2px solid var(--edge); border-radius: 12px; background: #fff;
  transition: transform 0.06s ease;
}
.say-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.say-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 76px; padding: 6px 8px; cursor: pointer;
  border: 2px solid var(--edge); border-radius: 12px; background: var(--panel);
  font: inherit; font-size: 12px; font-weight: 800; color: var(--ink-soft);
}
.say-tab.on { border-color: var(--gold-deep); background: var(--gold); color: #3a2a05; }
.say-tab-icon { font-size: 26px; line-height: 1; }
.say-phrases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.say-phrase {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px;
  cursor: pointer; text-align: left;
  border: 2px solid var(--edge); border-radius: 14px; background: #fff;
  font: inherit; font-size: 16px; font-weight: 800; color: var(--ink);
  transition: transform 0.06s ease;
}
.say-phrase-emoji { font-size: 28px; line-height: 1; }
.say-emoji-btn:hover, .say-phrase:hover { transform: translateY(-2px); }
.btn.ghost {
  background: var(--panel); border-color: var(--edge);
  color: var(--ink-soft); box-shadow: 0 3px 0 var(--edge);
}

.hint {
  background: rgba(16, 19, 27, 0.82); color: #fdf6e8;
  border-radius: 10px; padding: 7px 13px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
}

/* -------------------------------------------------------------- minigame */

.frame-backdrop {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(10, 12, 18, 0.82);
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
}

.frame-shell {
  width: min(980px, 94vw);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  border: 3px solid #1c1f28;
}

.frame-top {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: #1c1f28; color: var(--paper);
}
.frame-top .title { font-weight: 900; font-size: 16px; }
.frame-top .pitch { font-size: 13px; opacity: 0.72; flex: 1; }
.frame-top button {
  border: none; background: rgba(253, 246, 232, 0.14); color: var(--paper);
  border-radius: 9px; padding: 7px 13px; font-weight: 800; font-size: 13px;
}

.frame-shell iframe {
  display: block; width: 100%; height: min(560px, 62vh);
  border: none; background: #0d1017;
}

.frame-result { padding: 22px; text-align: center; }
.frame-result h2 { margin: 0 0 6px; font-size: 26px; }
.frame-result .rewards { display: flex; gap: 10px; justify-content: center; margin: 16px 0 20px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ misc */

.toast-stack {
  position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--panel); border: 2px solid var(--edge);
  border-radius: 12px; padding: 10px 18px;
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow);
  animation: pop 0.28s cubic-bezier(0.2, 1.4, 0.4, 1);
  max-width: 460px; text-align: center;
}
.toast.warn { background: #ffe9d6; border-color: #e4a06a; }
.toast.gold { background: linear-gradient(160deg, #fff3d0, #ffe1a0); border-color: var(--gold-deep); }

@keyframes pop { from { transform: scale(0.86) translateY(-8px); opacity: 0; } }

.gate {
  position: absolute; inset: 0; z-index: 60;
  display: grid; place-items: center; background: #10131b;
}
.gate-card {
  background: var(--paper); border-radius: 20px; padding: 30px 34px;
  width: min(420px, 90vw); box-shadow: var(--shadow); text-align: center;
}
.gate-card h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -0.5px; }
.gate-card p { margin: 0 0 20px; color: var(--ink-soft); font-size: 14px; }
.gate-card input {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px;
  border: 2px solid var(--edge); border-radius: 12px; margin-bottom: 12px;
  outline: none; text-align: center; font-weight: 700;
}
.gate-card input:focus { border-color: var(--gold); }
.gate-card .btn { width: 100%; }
.gate-error { color: #c0392b; font-size: 13px; margin: 0 0 12px; }

.swatches { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--edge); cursor: pointer; padding: 0;
}
.swatch[aria-pressed='true'] { border-color: var(--ink); transform: scale(1.12); }

.debug {
  position: absolute; right: 18px; bottom: 18px; z-index: 30;
  background: rgba(16, 19, 27, 0.86); color: #b9f5d0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; line-height: 1.6; padding: 10px 13px;
  border-radius: 10px; pointer-events: none; min-width: 172px; display: none;
}
body.show-debug .debug { display: block; }
.debug b { color: #fdf6e8; }

/* --------------------------------------------------------------- player card */

.player-card {
  background: var(--paper);
  border: 3px solid #1c1f28;
  border-radius: 18px;
  padding: 22px 24px 20px;
  width: min(280px, 88vw);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.player-card-avatar {
  display: flex; justify-content: center; align-items: flex-end;
  margin: 0 auto 10px; min-height: 64px;
}

.player-card-name {
  font-size: 20px; font-weight: 900;
  color: var(--ink); margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.player-card-actions {
  display: flex; flex-direction: column; gap: 8px;
}

.player-card-actions .btn {
  width: 100%; font-size: 15px; padding: 10px 16px;
}

.player-card-actions .btn:disabled {
  opacity: 0.38; cursor: not-allowed;
  box-shadow: none; transform: none;
}

/* ---------------------------------------------------------------- report */

.report-card {
  width: min(460px, 92vw);
  background: var(--paper);
  border: 3px solid #1c1f28;
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.report-card h2 { margin: 0 0 6px; font-size: 22px; }
.report-card p { margin: 0 0 14px; font-size: 14px; }
.report-card p.quiet { color: var(--ink-soft); }

.reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.reason {
  text-align: left;
  background: #fff;
  border: 2px solid var(--edge);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  transition: border-color .08s ease, transform .06s ease;
}
.reason:hover { border-color: var(--gold); }
.reason.chosen {
  border-color: var(--gold-deep);
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
}

.report-card textarea {
  width: 100%; min-height: 68px; resize: vertical;
  font: inherit; font-size: 14px; padding: 10px 12px;
  border: 2px solid var(--edge); border-radius: 12px;
  outline: none; margin-bottom: 16px;
}
.report-card textarea:focus { border-color: var(--gold); }

.report-actions { display: flex; gap: 10px; justify-content: center; }
.report-actions .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* --------------------------------------------------------------- wizard panel */

.wizard-panel {
  position: relative;
  width: min(560px, 96vw);
  max-height: min(600px, 90vh);
  background: var(--paper);
  border: 3px solid #1c1f28;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* vertically centre inside frame-backdrop */
  margin: auto;
  transform: translateY(-20px);
}

.wizard-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #2d1b6b, #4a2d9e);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}

.wizard-turns {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 2px 8px;
}

.close-btn {
  background: none; border: none; color: #fff; font-size: 18px;
  line-height: 1; padding: 0; margin-left: auto; opacity: 0.7;
  cursor: pointer;
}
.close-btn:hover { opacity: 1; }
.wizard-turns + .close-btn { margin-left: 8px; }

.wizard-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.pause-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 12, 18, 0.88);
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}

.pause-menu-container {
  width: min(920px, 96vw);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 20px;
  border: 3px solid #1c1f28;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------- Tabs Navigation */

.pause-menu-tabs {
  display: flex;
  gap: 4px;
  background: #1c1f28;
  padding: 12px;
  border-bottom: 3px solid var(--edge);
  overflow-x: auto;
}

.pause-tab-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex: none;
}

.pause-tab-button:hover {
  background: rgba(33, 36, 46, 0.2);
  color: var(--ink);
}

.pause-tab-button.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(242, 177, 52, 0.2);
}

.tab-icon {
  font-size: 16px;
}

.tab-label {
  display: none;
}

@media (min-width: 640px) {
  .tab-label {
    display: inline;
  }
}

/* ------------------------------------------------- Tab Content */

.pause-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--paper);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-content h3 {
  margin: 0 0 8px 0;
  font-size: 22px;
  color: var(--ink);
}

.tab-content h4 {
  margin: 16px 0 8px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-soft);
  font-weight: 900;
}

.tab-content p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ------------------------------------------------- Character Tab */

.character-tab {
  max-width: 600px;
}

.character-preview {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
  border-radius: 14px;
  border: 2px solid var(--gold);
}

.character-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  flex: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.character-info {
  flex: 1;
}

.character-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
}

.character-id {
  font-size: 12px;
  color: var(--ink-soft);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.stats-section {
  padding: 16px;
  background: #f9f7f2;
  border-radius: 12px;
  border: 2px solid var(--edge);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 800;
}

.stat-label {
  color: var(--ink-soft);
}

.stat-value {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.stat-value .coin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffd873, var(--gold-deep));
  border: 2px solid #a97613;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
}

.membership-badge {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
  border-radius: 8px;
  color: #8b6914;
  font-weight: 900;
  font-size: 12px;
}

/* ------------------------------------------------- Inventory Tab */

.inventory-tab {
  max-width: 700px;
}

.inventory-note {
  padding: 12px;
  background: #e8f4f8;
  border-radius: 10px;
  border-left: 4px solid #4fa3dd;
  font-size: 14px;
  margin: 0;
}

.cosmetic-category {
  margin-top: 16px;
}

.cosmetic-category h4 {
  margin-bottom: 12px;
}

.cosmetics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.cosmetic-item {
  padding: 12px;
  background: #f9f7f2;
  border: 2px solid var(--edge);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.cosmetic-item:hover:not(.locked) {
  border-color: var(--gold);
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
}

.cosmetic-item.locked {
  opacity: 0.6;
}

.cosmetic-preview {
  font-size: 32px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cosmetic-info {
  text-align: center;
  flex: 1;
  width: 100%;
}

.cosmetic-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.cosmetic-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cosmetic-price .coin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(160deg, #ffd873, var(--gold-deep));
  border: 1px solid #a97613;
}

.owned-badge {
  color: var(--gold);
  font-weight: 900;
}

.cosmetic-action {
  padding: 6px 10px;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: #3a2a05;
  font-weight: 900;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.06s ease;
}

.cosmetic-action:active {
  transform: translateY(1px);
}

.cosmetic-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inventory-empty-state {
  text-align: center;
  padding: 24px;
  color: var(--ink-soft);
  margin-top: 16px;
}

/* ------------------------------------------------- Badges Tab */

.badges-tab {
  max-width: 700px;
}

.badges-header {
  padding: 12px;
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
  border-radius: 12px;
  border: 2px solid var(--gold);
}

.badges-header h3 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-count {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gold);
  color: #3a2a05;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
}

.badges-section {
  margin-top: 16px;
}

.wizard-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.wizard-msg.user {
  flex-direction: row-reverse;
}

.wizard-avatar {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.wizard-bubble {
  background: #fff;
  border: 2px solid var(--edge);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 80%;
  white-space: pre-wrap;
}

.wizard-msg.user .wizard-bubble {
  background: linear-gradient(135deg, #4a2d9e, #2d1b6b);
  color: #fff;
  border-color: transparent;
}

.wizard-thinking {
  color: var(--ink-soft);
  font-style: italic;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.wizard-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 2px solid var(--edge);
  background: #fdf6e8;
}

.wizard-input {
  flex: 1;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  border: 2px solid var(--edge);
  border-radius: 12px;
  outline: none;
  background: #fff;
}

.wizard-input:focus { border-color: #4a2d9e; }
.wizard-input:disabled { opacity: 0.6; }

/* --------------------------------------------------------- wizard portal overlay */

.wizard-portal-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 60px;
  pointer-events: none;
}

.wizard-portal-card {
  pointer-events: all;
  background: linear-gradient(135deg, #2d1b6b, #4a2d9e);
  border: 3px solid #f2b134;
  border-radius: 18px;
  padding: 20px 28px;
  box-shadow: 0 8px 32px rgba(74, 45, 158, 0.6), 0 0 0 4px rgba(242, 177, 52, 0.2);
  text-align: center;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: portal-appear 0.4s ease-out;
}

@keyframes portal-appear {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.wizard-portal-title {
  font-size: 18px;
  font-weight: 800;
  color: #f2b134;
}

.wizard-portal-pitch {
  font-size: 13.5px;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}

.btn-secondary {
  background: none;
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: 12px;
  color: rgba(255,255,255,0.7);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color .1s, color .1s;
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

.progress-bar {
  height: 6px;
  background: rgba(33, 36, 46, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7aa2f7, #4fa3dd);
  transition: width 0.3s ease;
}

/* ------------------------------------------------- Map Tab */

.map-tab {
  max-width: 800px;
}

.map-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.map-burrow {
  flex: none;
  padding: 12px 20px;
  border: 3px solid #6b4a3a;
  border-radius: 16px;
  background: #f0c987;
  color: #3b2b3f;
  font: 900 17px Nunito, 'Segoe UI', sans-serif;
  cursor: pointer;
}

.map-burrow:hover { background: #ffd99c; }

.map-header h3 {
  margin: 0 0 4px 0;
}

.map-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.street-map {
  display: block;
  width: 100%;
  height: auto;
  /* The whole map fits above the window's footer: 90vh is the window, 265px its tab bar, the map's own header and the
     footer. Taller than this and the bottom row (Stone Gate) sat under the Resume bar, out of a child's sight. */
  max-height: max(300px, calc(90vh - 265px));
  margin: 0 0 4px;
}

.street-road {
  stroke: #e8b84b;
  stroke-width: 14;
  stroke-linecap: round;
}

.street-cell {
  stroke: var(--ink);
  stroke-width: 3;
}

.street-cell.plaza {
  fill: #7fc96a;
}

.street-far {
  opacity: 0.45;
}

/* Past the launch slice (launch.ts): grey, dashed roads, nothing to tap. */
.street-soon .street-name { fill: #3d382e; stroke: none; }
.street-soon .street-tier { fill: #5a5346; }
.street-soon .street-cell { fill: #c9c4b8; stroke-dasharray: 8 6; }
.street-road.soon { stroke: #c9c4b8; stroke-dasharray: 4 22; }
.zone-card.soon { opacity: 0.55; }

.street-name {
  font-size: 19px;
  font-weight: 900;
  text-anchor: middle;
  fill: #fff;
  paint-order: stroke;
  stroke: #21242e;
  stroke-width: 3px;
}

.street-tier {
  font-size: 15px;
  font-weight: 800;
  text-anchor: middle;
  fill: #21242e;
}

.zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.zone-card {
  padding: 16px;
  background: #f9f7f2;
  border: 2px solid var(--edge);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.zone-card.unlocked {
  border-color: var(--gold);
}

.zone-card.unlocked:hover {
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
  border-color: var(--gold-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(242, 177, 52, 0.15);
}

.zone-card.locked {
  opacity: 0.7;
}

.map-tier {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: #f0ece2;
}


.zone-info {
  flex: 1;
}

.zone-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 4px;
}

.zone-description {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 8px;
}

.zone-requirements {
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 6px;
  background: rgba(33, 36, 46, 0.1);
  border-radius: 6px;
}









/* ------------------------------------------------- Settings Tab */

.settings-tab {
  max-width: 600px;
}

.settings-section {
  padding: 16px;
  background: #f9f7f2;
  border: 2px solid var(--edge);
  border-radius: 12px;
}

.settings-section h4 {
  margin: 0 0 12px 0;
}

.settings-section.delete-account { margin-top: 12px; }
.delete-account input { display: block; width: 100%; margin: 8px 0; }
.delete-account-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

/* The grown-ups' links under sign-up: small, there, and not in the child's way. */
.gate-legal { margin: 14px 0 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.gate-legal a { color: inherit; margin: 0 6px; }
.gate-card p a, .beta-note a, .delete-account a { color: var(--gold-deep); }
/* Small grey text here went unseen in Mark's playtest (p119); the one line meant for the parent has to stand out. */
.gate-grownup-note {
  background: #fff3d6; border: 2px solid var(--gold); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; margin: 8px 0 12px;
}

.volume-control {
  margin-bottom: 14px;
}

.volume-control:last-child {
  margin-bottom: 0;
}

.volume-control label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.volume-slider {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-slider input {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  border: none;
  outline: none;
  background: linear-gradient(90deg, rgba(33, 36, 46, 0.1), rgba(33, 36, 46, 0.2));
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.volume-slider input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--gold-deep);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(242, 177, 52, 0.3);
}

.volume-slider input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--gold-deep);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(242, 177, 52, 0.3);
}

.volume-value {
  min-width: 36px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.keybind-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.keybind-header h4 {
  margin: 0;
}

.keybindings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keybind-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(33, 36, 46, 0.05);
  border-radius: 8px;
}

.keybind-action {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.keybind-button {
  padding: 6px 14px;
  border: 2px solid var(--edge);
  background: white;
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
  transition: all 0.15s ease;
}

.keybind-button:hover {
  border-color: var(--gold);
}

.keybind-button.rebinding {
  border-color: var(--gold);
  background: linear-gradient(160deg, #fff3d0, #ffe1a0);
  color: #8b6914;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 177, 52, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(242, 177, 52, 0); }
}

.checkbox-setting {
  margin-bottom: 12px;
}

.checkbox-setting label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.checkbox-setting input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--gold);
}

.checkbox-setting small {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: 28px;
  margin-top: 4px;
}

.settings-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--edge);
}

.settings-footer .btn {
  width: 100%;
}

.settings-footer small {
  display: block;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 8px;
}

/* ------------------------------------------------- Footer */

.pause-menu-footer {
  padding: 16px;
  border-top: 3px solid var(--edge);
  background: #f9f7f2;
}

.pause-menu-footer .btn {
  width: 100%;
  font-size: 15px;
  padding: 12px 16px;
}

/* ------------------------------------------------- Responsive */

@media (max-width: 768px) {
  .pause-menu-container {
    border-radius: 16px;
  }

  .pause-menu-content {
    padding: 16px;
  }

  .character-preview {
    flex-direction: column;
    gap: 12px;
  }

  .cosmetics-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

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

  .pause-tab-button {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* ---------------------------------------------------------- shared bits */

.quiet { color: var(--ink-soft); }
.small { font-size: 12px; }
.form-error { color: #c0392b; font-size: 13px; margin: 0 0 12px; }
.push-right { margin-left: auto; }

.btn.small { font-size: 12px; padding: 4px 12px; }
.btn.neutral { background: #78909c; color: #fff; }
.btn.warn { background: #f2b134; color: #000; }
.btn.mute { background: #ff7043; color: #fff; }
.btn.danger { background: #c62828; color: #fff; }
.btn.ok { background: #2e7d32; color: #fff; }
.btn.gold { background: #f2b134; color: #000; }
.btn.danger-text { color: #c62828; border: 1px solid #c62828; }

.confirm-bar { display: inline-flex; align-items: center; gap: 6px; }
.confirm-question { font-size: 12px; color: var(--ink-soft); }

/* ---------------------------------------------------------- mod dashboard */

/* Its own shell rather than the pause menu's: eleven tabs wrap onto rows so
   the close button never scrolls out of reach, and the body is a sans face
   because a wall of monospace made every table read as an error log. */
.mod-dashboard {
  width: min(1180px, 96vw);
  height: min(860px, 92vh);
  max-height: none;
  background: #f6f2e9;
  border-color: #2d1b6b;
}
.mod-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  background: linear-gradient(135deg, #2d1b6b, #4a2d9e);
}
.mod-title { color: #fff; font-weight: 900; font-size: 20px; letter-spacing: 0.3px; }
.mod-close {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 16px; line-height: 1;
  transition: background 0.15s ease;
}
.mod-close:hover { background: rgba(255,255,255,0.3); }
.mod-tabs {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 16px 12px;
  background: linear-gradient(135deg, #2d1b6b, #4a2d9e);
  border-bottom: 3px solid var(--gold);
}
.mod-tab {
  padding: 7px 12px; border-radius: 999px; border: 2px solid transparent;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85);
  font-weight: 800; font-size: 13px; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.mod-tab:hover { background: rgba(255,255,255,0.22); color: #fff; }
.mod-tab.active { background: var(--gold); border-color: var(--gold-deep); color: #3a2a05; }
.mod-content { flex: 1; overflow-y: auto; padding: 22px 26px 28px; font-size: 14px; }
.mod-content h3 { margin: 0 0 14px; font-size: 18px; font-weight: 900; color: #2d1b6b; }
.mod-content h4 { margin: 0 0 8px; color: #2d1b6b; }

.mod-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden;
}
.mod-table th {
  padding: 10px 14px; border-bottom: 2px solid var(--edge); background: #efe9f8; color: #2d1b6b;
  font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; text-align: left;
}
.mod-table td { padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid var(--edge); }
.mod-table tr:last-child td { border-bottom: none; }
.mod-table tbody tr:hover { background: #faf7ff; }
.mod-table td:last-child { min-width: 260px; }
.mod-who { display: flex; align-items: flex-end; gap: 10px; }
.mod-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mod-gold-input { width: 84px; font-size: 12px; padding: 4px 8px; border: 1px solid var(--edge); border-radius: 8px; background: #fff; }
.mod-search { display: flex; gap: 8px; margin-bottom: 14px; }
.mod-search input { flex: 1; max-width: 380px; font-size: 14px; padding: 7px 12px; border: 2px solid var(--edge); border-radius: 10px; background: #fff; }
.mod-search input:focus { outline: none; border-color: #4a2d9e; }
.mod-content .btn.small { box-shadow: 0 2px 0 rgba(0,0,0,0.18); }
.mod-content .btn.ghost { background: #fff; color: var(--ink-soft); }
.mod-content .btn:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 720px) {
  .mod-dashboard { height: 96vh; }
  .mod-content { padding: 14px; }
  .mod-table td:last-child { min-width: 0; }
}

/* H9-01: an account's medals, set for testing. */
.medal-editor { border: 2px solid var(--edge); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; background: #fdfbf5; }
.medal-editor-head { display: flex; align-items: center; justify-content: space-between; }
.medal-editor-head h3 { margin: 0; }
.medal-world h4, .medal-changes h4 { margin: 12px 0 4px; }
.medal-row, .medal-station { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; }
.medal-station { padding-left: 22px; }
.medal-pick { display: inline-flex; gap: 3px; }
.medal-pick .btn.active { outline: 2px solid #2b2f3a; font-weight: 900; }
.metal-pill.metal-none { background: #e9e5dc; }
.medal-changes ul { list-style: none; margin: 0; padding: 0; }
.medal-changes li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }

.status-banned { color: #c62828; font-weight: 700; }
.status-flagged { color: #e2574c; }
.status-muted { color: #ff7043; }

.mod-list { display: flex; flex-direction: column; gap: 4px; }
.mod-line { padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--edge); }
.mod-line.flagged { background: #fff3cd; }

.mod-card { margin-bottom: 12px; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--edge); background: #fff; box-shadow: 0 2px 0 var(--edge); }
.mod-card.flagged { background: #fff3cd; border-color: #f2b134; }
.mod-card.report { background: #ffeef0; border-color: #e2574c; }
.mod-card.game { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.mod-card-text { margin: 6px 0; font-size: 15px; }
.mod-context { margin: 8px 0 4px; border-left: 2px solid var(--edge); padding-left: 10px; font-size: 12px; color: var(--ink-soft); }
.mod-context .subject { color: var(--ink); font-weight: 800; }
.mod-context .who { color: #4a2d9e; }

.mod-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #2d1b6b; color: #fff; }

/* ------------------------------------------------ wizard games & notes */

.frame-shell.wide { width: min(1180px, 96vw); }

.my-games { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; }

.game-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--panel); border: 2px solid var(--edge); border-radius: 12px;
  font: inherit; color: inherit;
}
.game-card:hover { border-color: var(--accent, #f2b134); }
.game-card-title { font-weight: 800; flex: 1; }

.note-badge {
  background: #e2574c; color: #fff; border-radius: 999px;
  padding: 2px 9px; font-size: 12px; font-weight: 800;
}

.status-draft     { background: #e9e4d8; color: #4a4437; }
.status-submitted { background: #f2b134; color: #3a2d0b; }
.status-approved  { background: #7fc96a; color: #17330f; }
.status-rejected  { background: #e2574c; color: #fff; }

/* The game and its thread, side by side. Stacks on a narrow screen. */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; }
.studio-game { display: flex; flex-direction: column; min-width: 0; }
.studio-game iframe {
  display: block; width: 100%; height: min(520px, 58vh);
  border: none; background: #0d1017;
}
.studio-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 2px solid var(--edge);
}
.studio-notes {
  display: flex; flex-direction: column; min-width: 0;
  border-left: 2px solid var(--edge); background: var(--panel);
}
.studio-notes h4 { margin: 0; padding: 10px 14px; border-bottom: 2px solid var(--edge); font-size: 14px; }

.note-thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.note-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.note { max-width: 100%; }
.note-who { font-size: 12px; font-weight: 800; opacity: 0.75; margin-bottom: 3px; }
.note-text {
  background: var(--paper); border: 2px solid var(--edge);
  border-radius: 12px; padding: 8px 11px; font-size: 14px; line-height: 1.35;
  overflow-wrap: anywhere;
}
.note.mine .note-text { background: #e8f3ff; border-color: #a9cdf0; }
.note-compose { display: flex; gap: 8px; padding: 10px 14px; border-top: 2px solid var(--edge); }
.note-compose .wizard-input { flex: 1; min-width: 0; }

.mod-review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

@media (max-width: 860px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-notes { border-left: none; border-top: 2px solid var(--edge); }
  .note-list { max-height: 220px; }
}

/* ------------------------------------------------------ burrow furniture */

.catalog-notice { margin: 12px 16px 0; padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.catalog-notice.ok { background: #e8f5e9; border: 1px solid #81c784; color: #2e7d32; }
.catalog-notice.warn { background: #fff4e0; border: 1px solid var(--gold-deep); color: #7a4d00; }

.catalog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 16px; max-height: 64vh; overflow-y: auto;
}
.catalog-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px; border-radius: 12px; background: var(--panel); border: 2px solid var(--edge);
}
.catalog-card.dim { opacity: 0.55; }
.catalog-card img { width: 100px; height: 90px; object-fit: contain; }
.catalog-name { font-weight: 800; font-size: 14px; text-align: center; }
.catalog-price { font-size: 13px; color: var(--ink-soft); }
.catalog-owned { font-size: 12px; color: #2e7d32; font-weight: 700; }
.catalog-card .btn { width: 100%; }

/* Beside the burrow, under any overlay: the catalog covers it while open. */
.home-inventory {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%); z-index: 30;
  width: 150px; max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px;
  user-select: none;
}
.home-inventory h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.home-inventory.drop-here { border: 3px dashed #2e7d32; background: #eef8ec; }
.home-inventory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.home-inventory-tile {
  position: relative; aspect-ratio: 1; padding: 4px; cursor: grab; touch-action: none;
  background: #fff; border: 2px solid var(--edge); border-radius: 10px;
}
.home-inventory-tile:hover { border-color: var(--gold); }
.home-inventory-tile img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.home-inventory-tile .count {
  position: absolute; right: 2px; bottom: 2px; font-size: 11px; font-weight: 900;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 0 6px;
}
.home-drag-ghost {
  position: fixed; z-index: 200; pointer-events: none;
  transform: translate(-50%, -100%); opacity: 0.85; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.3));
}

/* ------------------------------------------------------ friends & visits */

.friend-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--edge); border-radius: 8px; font-size: 13px;
}
.friend-name { flex: 1; font-weight: 700; }

.invite-card {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 3px solid var(--gold-deep); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 14px;
}
.invite-text { font-size: 15px; }

/* ---------------------------------------------------------------- economy */

.economy h4 { margin: 16px 0 6px; }
.economy-verdict {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px; border: 2px solid var(--edge); background: var(--panel);
}
.economy-verdict .btn { margin-left: auto; }
.economy-verdict.inflating { border-color: #c62828; background: #fff1ef; }
.economy-verdict.watch { border-color: var(--gold-deep); background: #fff8e6; }
.economy-verdict.healthy { border-color: #2e7d32; background: #eef8ec; }
.economy-chart { display: flex; gap: 4px; align-items: flex-end; height: 140px; }
.economy-day { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; font-size: 10px; }
.economy-day .bars { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; }
.economy-day .bars i { flex: 1; display: block; min-height: 1px; border-radius: 3px 3px 0 0; }
.minted { background: #f2b134; }
.spent { background: #4a6fa5; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.economy-table td:last-child { min-width: 0; }
.minted-text { color: #9a6700; font-weight: 800; }
.spent-text { color: #4a6fa5; font-weight: 800; }

/* ---------------------------------------------------------------- payouts */

.payout-card { display: flex; flex-direction: column; gap: 8px; }
.payout-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.payout-line input { padding: 4px 6px; border: 1px solid var(--edge); border-radius: 6px; font: inherit; }
.payout-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- hidden people */

.hidden-book { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 64vh; overflow-y: auto; }
.hidden-person { display: flex; align-items: center; gap: 12px; }
.hidden-person .mail-title { flex: 1; }

/* ---------------------------------------------------------------- mailbox */

.mailbox { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 64vh; overflow-y: auto; }
.mailbox h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.mail-card {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 12px;
  background: var(--panel); border: 2px solid var(--edge);
}
.mail-card.letter { flex-direction: column; align-items: stretch; }
.mail-card.letter p { margin: 0; }
.mail-card.letter .btn { align-self: flex-start; }
.mail-card.unread { border-color: var(--gold); }
.mail-head { display: flex; justify-content: space-between; gap: 8px; }
.mail-title { flex: 1; font-weight: 800; }
.mail-pill { background: #fff4d6; border-color: var(--gold-deep); font-weight: 800; }

/* ---------------------------------------------------------------- game lab
   Every Game Lab style lives beside its component in
   apps/client/src/ui/lab/styles/*.css, one file per station, imported by
   the component; five sessions rewriting one 900-line block here collided. */

/* ------------------------------------------------------------ drawing board */

.doodle-screen {
  position: fixed; inset: 0; z-index: 80; overflow: auto;
  background: radial-gradient(circle at 50% 0%, #232838, #10131b 70%);
  display: flex; justify-content: center; padding: 18px 14px 40px;
}
.doodle-layout { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; justify-content: center; max-width: 1100px; }
.doodle-left { display: flex; flex-direction: column; gap: 10px; width: min(620px, 100%); }
.doodle-right { display: flex; flex-direction: column; gap: 12px; width: min(372px, 100%); }
.doodle-title { margin: 0; font-size: 30px; letter-spacing: -0.5px; color: var(--paper); }
.doodle-sub { margin: 0; font-size: 14px; color: #cfd3e0; }
.doodle-panel { background: var(--paper); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.doodle-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doodle-label { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-soft); display: inline-flex; gap: 8px; align-items: center; }
.doodle-hint { color: var(--ink-soft); line-height: 1.5; font-size: 12.5px; }
.doodle-tool { width: 46px; height: 46px; padding: 0; font-size: 22px; line-height: 1; background: #fff; box-shadow: 0 3px 0 var(--edge); border-color: var(--edge); }
.doodle-tool[aria-pressed='true'] { background: var(--gold); border-color: var(--gold-deep); transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-deep); }
.doodle-swatch { width: 26px; height: 26px; }
.doodle-small { padding: 6px 10px; font-size: 13px; }
.doodle-small:disabled, .doodle-save:disabled { opacity: .4; cursor: default; }
.doodle-save { font-size: 17px; padding: 12px 20px; }
.doodle-board {
  width: 100%; height: auto; aspect-ratio: 620 / 650; border-radius: 12px; background: #fff;
  touch-action: none; cursor: crosshair; display: block; box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.doodle-preview { width: 100%; max-width: 348px; aspect-ratio: 348 / 340; border-radius: 12px; display: block; }
.doodle-view { position: relative; flex: none; }

/* ------------------------------------------------------- mod: AI models
   Maker colours (--maker) come from the card itself, so a game's cost bar and
   the model it was made with are the same colour. */

.models { font-family: 'Fredoka Variable', 'Nunito', 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 14px; }
.models h4 { margin: 6px 0 0; font-size: 17px; font-weight: 700; }
.models h4 small { font-weight: 500; font-size: 13px; color: var(--ink-soft); margin-left: 6px; }
.models-top { display: flex; align-items: flex-start; gap: 12px; }
.images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.image-card { display: flex; gap: 10px; padding: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.image-card.flagged { opacity: 0.6; border-style: dashed; }
.image-card-pic { flex: 0 0 96px; height: 96px; display: grid; place-items: center; background: #f3efe6; border-radius: 8px; }
.image-card-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.image-card-body b { overflow-wrap: anywhere; }
.models-budget {
  flex: 1; padding: 14px 16px; border-radius: 16px; border: 3px solid var(--ink);
  background: linear-gradient(135deg, #fff7e0, #fffdf6); box-shadow: 0 4px 0 var(--ink);
}
.models-budget h4 { margin: 0 0 8px; }
.models-budget p { margin: 8px 0 0; }
.models-gauge { height: 22px; border-radius: 999px; background: #fff; border: 3px solid var(--ink); overflow: hidden; }
.models-gauge i { display: block; height: 100%; background: linear-gradient(90deg, #57d88f, #2bb673); transition: width 0.5s cubic-bezier(0.2, 1.2, 0.4, 1); }
.models-gauge i.warm { background: linear-gradient(90deg, #ffd25a, #f2a81a); }
.models-gauge i.hot { background: linear-gradient(90deg, #ff8a6b, #e0443a); }
.models-gauge-text { display: flex; justify-content: space-between; margin-top: 6px; font-size: 15px; }
.models-spent { font-size: 15px; }

.models-role { display: flex; flex-direction: column; gap: 8px; }
.models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.models-card {
  --maker: #7a8194;
  position: relative; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left;
  padding: 10px 12px 10px 14px; border-radius: 14px; border: 3px solid rgba(33, 36, 46, 0.18);
  background: #fff; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: inset 6px 0 0 var(--maker); transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.models-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--maker); }
.models-card:disabled { cursor: progress; opacity: 0.7; }
.models-card.on {
  border-color: var(--ink); background: linear-gradient(180deg, #fff, #fffbea);
  box-shadow: inset 6px 0 0 var(--maker), 0 4px 0 var(--ink);
}
.models-card b { font-size: 16px; font-weight: 700; }
.models-maker { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--maker); }
.models-note { font-size: 13px; line-height: 1.3; color: var(--ink-soft); }
.models-price { margin-top: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f1eee6; }
.models-tick {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: #2bb673; color: #fff; border: 3px solid var(--ink); font: 700 13px/1 inherit; font-style: normal;
}

.models-table { width: 100%; border-collapse: collapse; }
.models-table th { padding: 6px 10px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); border-bottom: 3px solid var(--ink); }
.models-table td { padding: 10px; vertical-align: top; border-bottom: 2px solid var(--edge); }
.models-money { font-size: 18px; font-weight: 700; white-space: nowrap; }
.models-bar { display: flex; height: 14px; min-width: 40px; border-radius: 999px; overflow: hidden; border: 2px solid var(--ink); background: #fff; }
.models-bar i { display: block; min-width: 3px; }
.models-chips { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; }
.models-chips span { display: inline-flex; align-items: center; gap: 5px; }
.models-chips i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.models .small { font-size: 12px; }
.models-totals { display: flex; flex-wrap: wrap; gap: 10px; }
.models-totals > div {
  display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; border-radius: 12px; background: #fff;
  border: 3px solid; min-width: 150px;
}
.models-totals span { font-size: 20px; font-weight: 700; }
.models-totals small { color: var(--ink-soft); }

/* ------------------------------------------------------------ My looks */

.looks { margin: 0 0 22px; padding-bottom: 16px; border-bottom: 2px solid var(--edge); }
.looks h3 { margin: 0 0 4px; }
.looks h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.swatch:disabled { opacity: 0.45; cursor: default; }
.looks-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.look-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 104px; padding: 8px 6px; background: #fff; border: 2px solid var(--edge); border-radius: 12px;
}
.look-tile.worn { border-color: #2e7d32; background: #eef8ec; }
.look-tile .look-picture { height: 70px; display: grid; place-items: center; overflow: hidden; }
.look-tile .btn { padding: 4px 10px; font-size: 13px; }
.look-tile .look-tag { font-size: 12px; font-weight: 800; color: #2e7d32; }
.looks-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.looks-message { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.looks-message.warn { color: #b3261e; }
.character-shop-hint { margin: 8px 0 0; }

/* ------------------------------------------------- The front door (Login) */

/* Room under the card for the beta note pinned to the bottom, and a scroll
   when both do not fit: on an 800 px screen the note sat over the picker's Back. */
.gate:has(+ .beta-note) { padding: 12px 16px 112px; overflow-y: auto; align-items: safe center; }
.gate-card-wide { width: min(520px, 94vw); }
.gate-card .gate-back { margin-top: 8px; }
/* The two doors are the biggest things on the card: most children choosing between them read the picture. */
.gate-card .gate-door { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 72px; font-size: 24px; }
.gate-card .gate-door-back { margin-top: 12px; }
.gate-door-pic { font-size: 36px; line-height: 1; }
.gate-guest {
  display: block; margin: 14px auto 2px; padding: 4px 8px; background: none; border: 0;
  color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; cursor: pointer;
}
.gate-mini { display: grid; place-items: center; margin: 0 0 12px; min-height: 70px; }
.gate-parade { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 14px 0 20px; min-height: 90px; }
.gate-steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.gate-steps span { width: 34px; height: 6px; border-radius: 3px; background: var(--edge); }
.gate-steps span.on { background: var(--gold); }
.gate-rules { text-align: left; margin: 4px 0 12px; padding-left: 22px; font-size: 14px; line-height: 1.45; }
.gate-rules li { margin-bottom: 4px; }
.gate-promise { display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 14px; cursor: pointer; }
.gate-card .gate-promise input { width: 20px; height: 20px; margin: 0; }

.starter-picker { margin-bottom: 14px; }
.starter-stage { display: grid; place-items: center; min-height: 130px; margin-bottom: 4px; }
.starter-shapes { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.starter-shape {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; padding: 6px 4px;
  background: #fff; border: 3px solid var(--edge); border-radius: 14px; cursor: pointer; font: inherit; font-weight: 800; font-size: 13px;
}
.starter-shape[aria-checked='true'] { border-color: var(--gold); background: #fff7e0; }
.starter-colours { flex-wrap: wrap; max-width: 320px; margin: 0 auto 4px; }

/* ------------------------------------------------------------ /test panel */

.test-panel {
  background: var(--paper); border-radius: 20px; padding: 20px 24px; width: min(460px, 94vw);
  box-shadow: var(--shadow); max-height: 86vh; overflow-y: auto;
}
.test-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.test-panel-head h2 { margin: 0; }
.test-jumps { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.test-leave { margin-top: 14px; width: 100%; }
.test-sure { margin-top: 14px; padding: 10px 12px; background: #fff3d0; border: 2px solid var(--gold); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.world-switches { padding: 8px 4px; }
/* One card per switch, its state in the colour, so a world change left on
   is seen at a glance rather than read out of a sentence. */
.world-switch + .world-switch { margin-top: 10px; }
.world-switch {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px; border: 2px solid var(--edge); background: #fff; font-size: 15px;
}
label.world-switch { cursor: pointer; }
.world-switch.on { border-color: #2e7d32; background: #eef8ec; }
.world-switch-text { display: flex; flex-direction: column; gap: 2px; }
.world-switch input[type='checkbox'] { width: 22px; height: 22px; accent-color: #2e7d32; cursor: pointer; }
.world-switch-controls { display: flex; align-items: center; gap: 6px; }
.world-switch-controls input { width: 90px; font-size: 14px; padding: 5px 8px; border: 2px solid var(--edge); border-radius: 8px; background: #fff; }
.world-switch-controls input:focus { outline: none; border-color: #4a2d9e; }
.realm-tab h4 { margin-top: 20px; }
.mod-pick { display: flex; align-items: center; gap: 8px; }
.mod-pick select { font: inherit; font-size: 14px; padding: 6px 10px; border: 2px solid var(--edge); border-radius: 10px; background: #fff; min-width: 200px; }
.mod-pick select:focus { outline: none; border-color: #4a2d9e; }
.mod-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mod-switch-pill {
  padding: 6px 14px; border-radius: 999px; border: 2px solid var(--edge); background: #fff;
  font: inherit; font-size: 13px; font-weight: 800; color: #2d1b6b; cursor: pointer;
}
.mod-switch-pill:hover { border-color: #4a2d9e; }
.mod-switch-pill.active { background: #2d1b6b; border-color: #2d1b6b; color: #fff; }
.street-map .street-go { cursor: pointer; }
.street-map .street-go:hover .street-cell { stroke: #fff; stroke-width: 4; }

/* ------------------------------------------------- Badges: one per building */

.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.medal-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: rgba(33, 36, 46, 0.04);
}

.medal-card.held { background: #fffaf0; }

/* The shield (Badge.tsx) on a tile, with the spider's web or crack laid over it when the badge was won on the track. */
.medal { flex: none; position: relative; width: 78px; height: 70px; display: grid; place-items: center; }
.medal .badge-shape { display: block; }
.badge-shape .badge-shine { transform: translateX(0); }

.medal-body { flex: 1; min-width: 0; }
.medal-name { font-weight: 900; font-size: 14px; }
.medal-domain { font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; }
.medal-line { font-size: 12px; margin-top: 4px; }
.medal-gate { font-size: 11px; margin-top: 3px; color: #8a5a00; }
/* Side stacks only: dashed so it never reads as part of the real game. */
.medal-dev { margin-top: 6px; font-size: 11px; padding: 2px 8px; border-style: dashed; }

/* The badge bar sweeps by script (BadgesTab.tsx useSweep) so the number and the bar move as one; a CSS transition on top would trail the number. */
.medal-fill { transition: none; }
.medal-xp { font-variant-numeric: tabular-nums; font-weight: 800; }
.medal-card { transition: box-shadow 0.4s ease; }
.medal-card.gaining { box-shadow: 0 0 0 2px rgba(242, 177, 52, 0.55), 0 0 14px rgba(242, 177, 52, 0.35); }
.medal-pop { animation: medal-rise 0.7s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes medal-rise {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-8deg); box-shadow: 0 0 22px rgba(255, 240, 160, 0.9); }
  70% { transform: scale(0.94) rotate(4deg); }
  100% { transform: scale(1); }
}

.metal-count { display: flex; flex-wrap: wrap; gap: 6px; }
.metal-pill { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #2a2a2a; }

/* An in-world game's intro: its NPC's story, then each action with its key (GameIntro.tsx). */
.intro-card {
  width: min(520px, 88vw); padding: 26px 28px 22px; border-radius: 22px; background: #fdf6e8;
  border: 4px solid #2b2f3a; box-shadow: 0 6px 0 #2b2f3a; text-align: center;
  font: 800 22px/1.4 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a;
  animation: keeper-pop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.intro-who { font-size: 15px; color: #6b7a90; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.intro-story { margin: 0 0 18px; font-size: 24px; }
.intro-step { display: flex; align-items: center; gap: 18px; text-align: left; margin-bottom: 18px; }
.intro-key {
  flex: none; min-width: 64px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 3px solid #2b2f3a;
  box-shadow: 0 4px 0 #2b2f3a; font-size: 20px; text-align: center;
}
.intro-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.intro-dots span { width: 10px; height: 10px; border-radius: 50%; background: #c8bfae; }
.intro-dots span.on { background: #e8a33a; }
.intro-next, .intro-again {
  font: 900 20px 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; background: #f2c14e; cursor: pointer;
  border: 4px solid #2b2f3a; border-radius: 16px; box-shadow: 0 4px 0 #2b2f3a; padding: 8px 26px;
}
.intro-again { position: fixed; left: 20px; top: 64px; z-index: 61; font-size: 16px; padding: 6px 16px; }

/* A world's storybook (Storybook.tsx): the whole screen, over every window a child could have open, and lifted off the
   world in one fade. Its colour is the book's own, so its first page fades up out of the same dark. */
.storybook { position: fixed; inset: 0; z-index: 150; background: #05070f; transition: opacity 1.1s ease; animation: storybook-in 0.5s ease-out; }
.storybook.lifting { opacity: 0; pointer-events: none; }
.storybook-frame { display: block; width: 100%; height: 100%; border: 0; }
@keyframes storybook-in { from { opacity: 0; } }

/* The badge ceremony (BadgeRise.tsx): the screen goes dark, the building's meter grows, the badge is forged metal by metal. */
.rise-backdrop {
  position: fixed; inset: 0; z-index: 58;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 32, 20, 0.86), rgba(8, 9, 14, 0.94) 70%);
  animation: rise-in 0.5s ease-out;
}
@keyframes rise-in { from { opacity: 0; } }
.rise-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: min(560px, 92vw); padding: 24px 20px 20px; text-align: center;
  font: 800 18px/1.3 'Nunito', 'Segoe UI', sans-serif; color: #fdf6e8;
  animation: rise-card-in 0.7s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes rise-card-in { from { transform: translateY(40px) scale(0.9); opacity: 0; } }
.rise-domain { font-size: 36px; font-weight: 900; letter-spacing: 0.02em; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }

.rise-badge-slot { position: relative; width: 340px; height: 310px; display: grid; place-items: center; margin: 4px 0 0; }
.rise-badge { position: relative; display: grid; place-items: center; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); animation: rise-badge-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes rise-badge-in { from { transform: scale(0.6); opacity: 0; } }
/* The forge: a white-hot flash that settles into the new metal, the light sweeping across the face as it cools. */
.rise-badge.forging { animation: rise-forge 1.4s cubic-bezier(0.2, 1.1, 0.3, 1); }
.rise-badge.forging .badge-shine { animation: rise-shine 1.1s 0.3s ease-in-out forwards; }
@keyframes rise-forge {
  0% { transform: scale(0.7); filter: brightness(3) saturate(0.2) drop-shadow(0 0 40px #fff); }
  30% { transform: scale(1.22); filter: brightness(1.6) drop-shadow(0 0 30px #fff3b0); }
  60% { transform: scale(0.94); filter: brightness(1) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); }
}
@keyframes rise-shine { from { transform: translateX(0); } to { transform: translateX(190px); } }
/* The ring thrown off and the sparks: one burst on each forge, keyed on the new metal so they play once. */
.rise-ring { position: absolute; width: 210px; height: 210px; border-radius: 50%; border: 6px solid #fff3b0; animation: rise-ring 1s ease-out forwards; pointer-events: none; }
@keyframes rise-ring { from { transform: scale(0.8); opacity: 1; } to { transform: scale(2.1); opacity: 0; } }
.rise-sparks { position: absolute; inset: 0; pointer-events: none; }
.rise-sparks i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 10px #ffd966; transform-origin: center; animation: rise-spark 1s 0.2s ease-out forwards; opacity: 0; }
.rise-sparks i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; }
@keyframes rise-spark { 0% { opacity: 1; } 100% { opacity: 0; translate: 0 -150px; } }
/* A Diamond's glints twinkle; a Platinum's dark steel keeps a cold white edge. */
.badge-spark { animation: badge-twinkle 1.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.badge-spark-2 { animation-delay: 0.7s; }
@keyframes badge-twinkle { 0%, 100% { opacity: 0.4; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.15); } }

.rise-headline { font-size: 40px; font-weight: 900; min-height: 48px; line-height: 48px; color: #fff3b0; text-shadow: 0 0 18px rgba(255, 220, 120, 0.8); }
.rise-headline.forged { animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
/* The meter and its figure are one thing: a bar in the next metal's colour with the number on it, both driven by one value per frame. */
.rise-meter {
  --m1: #8a4a1c; --m2: #f6c89a;
  position: relative; width: min(440px, 84vw); height: 34px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.12); border: 3px solid rgba(255, 255, 255, 0.35); overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.rise-meter.metal-silver { --m1: #8f98a6; --m2: #ffffff; }
.rise-meter.metal-gold { --m1: #c5891a; --m2: #fff6c4; }
.rise-meter.metal-platinum { --m1: #3a4852; --m2: #d5dee5; }
.rise-meter.metal-diamond { --m1: #2a7fc4; --m2: #ffffff; }
.rise-meter-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--m1), var(--m2)); box-shadow: 0 0 14px rgba(255, 255, 255, 0.45); }
.rise-meter-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.8); font-variant-numeric: tabular-nums; }
.rise-gain { font-size: 30px; font-weight: 900; color: #8fd27a; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); animation: pop 0.4s 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.rise-continue {
  margin-top: 10px; width: 64px; height: 50px; font: 900 22px 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; background: #f2c14e; cursor: pointer;
  border: 4px solid #2b2f3a; border-radius: 16px; box-shadow: 0 4px 0 #2b2f3a; padding: 0;
}

/* The hint and digit tiles of a game in the room, across the top where the camera never hides them. */
.tile-bar { position: fixed; top: 64px; right: 14px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: min(470px, 90vw); pointer-events: none; }
.tile-bar > * { pointer-events: auto; }
/* The badge ceremony covers the screen; the tiles stood over it, stuck (Mark, 11-12: "the digit tiles are stuck during this badge sequence"). */
body:has(.rise-backdrop) .tile-bar { display: none; }
.tile-hint { padding: 6px 16px; border-radius: 14px; background: #fdf6e8; border: 3px solid #2b2f3a; font: 800 16px/1.3 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; text-align: center; pointer-events: none; }
/* The tiles stand on their own in the corner, no window behind them (Mark, 2026-10-14): each digit its own sweet, pressed down like a real button. */
.tile-tray { display: flex; gap: 10px; flex-direction: column; align-items: flex-end; }
.tile-slates { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tile-keys { display: grid; grid-template-columns: repeat(5, 52px); gap: 8px; justify-content: end; }
.tile-slate { min-width: 84px; padding: 4px 12px; border-radius: 16px; background: #fdf6e8; border: 4px solid #2b2f3a; box-shadow: 0 4px 0 #2b2f3a; cursor: pointer; display: flex; flex-direction: column; align-items: center; font-family: 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; }
.tile-slate b { font-size: 28px; line-height: 1.1; min-height: 31px; }
.tile-slate i { font-size: 12px; font-style: normal; color: #4a5061; }
.tile-slate.on { background: #fff3c4; outline: 4px solid #f2c14e; outline-offset: 2px; }
.tile-slate.ok { background: #d9f5d0; }
.tile-slate.bad { background: #ffe0d6; }
.tile-key {
  --c: #f2c14e; --d: #b8862a;
  width: 52px; height: 52px; padding: 0; border-radius: 18px; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55) 0 18%, transparent 19%), var(--c);
  border: 4px solid #2b2f3a; box-shadow: 0 5px 0 var(--d), 0 5px 0 4px #2b2f3a;
  font: 900 26px 'Nunito', 'Segoe UI', sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(43, 47, 58, 0.55);
  transition: transform 0.12s cubic-bezier(0.3, 1.8, 0.5, 1), box-shadow 0.08s;
}
.tile-key:hover:not(:disabled) { transform: translateY(-3px) scale(1.08) rotate(-4deg); }
.tile-key:active:not(:disabled) { transform: translateY(5px) scale(0.94); box-shadow: 0 0 0 var(--d), 0 0 0 4px #2b2f3a; transition-duration: 0.04s; }
.tile-key:disabled { filter: grayscale(0.7); opacity: 0.6; cursor: default; }
.tile-go { grid-column: span 2; width: auto; --c: #6fae5a; --d: #3f7a35; }
/* A question asked in the world (the Harbour's sums): two short rows of smaller keys, so the planks and the dock being worked on stay in sight. */
.tile-bar.slim { max-width: min(380px, 90vw); gap: 6px; }
.tile-bar.slim .tile-keys { grid-template-columns: repeat(7, 44px); gap: 6px; }
.tile-bar.slim .tile-key { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
.tile-bar.slim .tile-go { width: auto; }
.tile-bar.slim .tile-slate { padding: 2px 10px; }
/* While tiles are up the tray stands in the middle of the screen under the question, big (Mark, 2026-10-29): the sum first, what is written on its slate under it, the keys last. */
.tile-bar.centre { top: 46%; right: auto; left: 50%; transform: translate(-50%, -50%); align-items: center; max-width: min(440px, 94vw); gap: 8px; padding: 12px 16px 16px; border-radius: 26px; background: rgba(253, 246, 232, 0.94); border: 4px solid #2b2f3a; box-shadow: 0 8px 0 rgba(43, 47, 58, 0.35); }
.forest-cut .tile-bar.centre { top: auto; bottom: 16px; transform: translateX(-50%); }
/* In a game played without reading the tray stands at the bottom: in the middle it covered Old Wick's posts, the very thing being counted (Mark, 11-11: "put it lower"). */
.tile-bar.centre.low { top: auto; bottom: 16px; transform: translateX(-50%); }
.tile-bar.centre .tile-hint { order: -2; border: 0; background: none; padding: 0; font-size: 20px; }
.tile-bar.centre .tile-hint.big { font: 900 72px/1 'Nunito', 'Segoe UI', sans-serif; letter-spacing: 2px; }
.tile-bar.centre .tile-left { order: -3; }
.tile-bar.centre .tile-tray { flex-direction: column-reverse; align-items: center; }
.tile-bar.centre .tile-slates { justify-content: center; }
.tile-bar.centre .tile-keys { justify-content: center; }
.tile-bar.centre.slim { max-width: min(440px, 94vw); }
.tile-bar.centre.slim .tile-keys { grid-template-columns: repeat(7, 48px); }
.tile-bar.centre.slim .tile-key { width: 48px; height: 48px; }
.tile-bar.centre .tile-op { color: #2b2f3a; text-shadow: none; }
@media (max-height: 640px) { .tile-bar.centre { top: 50%; } .tile-bar.centre .tile-hint.big { font-size: 52px; } }
/* The Crate Count: the keys sit low, above the chat, so the pen they ask about stays in view above them (Mark, 2026-10-30). */
body.audit-open .tile-bar.centre { top: auto; bottom: 76px; transform: translateX(-50%); }

/* The digit ops wear these same colours (OP_KINDS in shared ops/kinds.ts): change one, change both. */
.tile-key[data-k='1'] { --c: #ff6b6b; --d: #b53e3e; }
.tile-key[data-k='2'] { --c: #ff9f43; --d: #b8661f; }
.tile-key[data-k='3'] { --c: #f7c531; --d: #a8820f; }
.tile-key[data-k='4'] { --c: #7ccf5b; --d: #4a8c30; }
.tile-key[data-k='5'] { --c: #2ec4b6; --d: #1b8077; }
.tile-key[data-k='6'] { --c: #4d9de0; --d: #2c6599; }
.tile-key[data-k='7'] { --c: #8c7ae6; --d: #5a4aa8; }
.tile-key[data-k='8'] { --c: #f368e0; --d: #a8399a; }
.tile-key[data-k='9'] { --c: #ff8fab; --d: #b85670; }
.tile-key[data-k='0'] { --c: #a0d8ef; --d: #5c97ad; color: #2b2f3a; text-shadow: none; }
.tile-key[data-k='⌫'] { --c: #fdf6e8; --d: #a89f8c; color: #2b2f3a; text-shadow: none; font-size: 22px; grid-column: 5; }
/* An equation's slates: smaller, so a row of five and its total fit across the corner. */
.tile-slates.sum { align-items: center; gap: 4px; }
.tile-slates.sum .tile-slate { min-width: 46px; padding: 2px 6px; }
.tile-slates.sum .tile-slate b { font-size: 24px; }
.tile-slates.sum .tile-slate i { font-size: 10px; }
.tile-op { font: 900 26px 'Nunito', 'Segoe UI', sans-serif; color: #fdf6e8; text-shadow: 0 2px 0 #2b2f3a, 0 0 6px #2b2f3a; }
.tile-left { display: flex; align-items: center; gap: 5px; padding: 4px 14px; border-radius: 14px; background: #fdf6e8; border: 3px solid #2b2f3a; font: 900 15px 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; pointer-events: none; }
.tile-left span { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #2b2f3a; background: #fdf6e8; }
.tile-left span.on { background: #f2c14e; }
.tile-left b { margin-left: 6px; }

/* Mother Honeycomb's house (kit/kinds/bee-house.ts, play/houseLine.ts): the build button and the equation line, over the world. */
.house-hud { position: fixed; inset: 0; pointer-events: none; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 68px; }
.house-build {
  pointer-events: auto; position: absolute; bottom: 120px; padding: 18px 34px; border-radius: 20px; background: #f2c14e;
  border: 4px solid #2b2f3a; box-shadow: 0 6px 0 #2b2f3a; font: 900 28px 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; cursor: pointer;
  animation: pop 0.25s ease-out;
}
.house-build:hover { background: #ffd36b; }
.house-build:active { transform: translateY(4px); box-shadow: 0 2px 0 #2b2f3a; }
.house-line {
  pointer-events: none; padding: 8px 18px; border-radius: 20px; background: #fdf6e8; border: 4px solid #2b2f3a;
  box-shadow: 0 6px 0 #2b2f3a; text-align: center; animation: pop 0.25s ease-out;
}
.house-line-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: min(760px, 86vw); }
.house-line-box {
  min-width: 52px; padding: 2px 8px; border-radius: 12px; border: 3px solid #2b2f3a; background: #fff;
  font: 900 38px 'Nunito', 'Segoe UI', sans-serif; color: #2b2f3a; line-height: 1.1;
}
.house-line-op { font: 900 36px 'Nunito', 'Segoe UI', sans-serif; color: #8a5a1c; }
.house-line-wrong { background: #ffd9d4; border-color: #c0392b; }
.house-line-right .house-line-box { background: #d9f5d0; border-color: #3f8f4a; }
.house-line-shake { animation: house-shake 0.45s ease-in-out; }
@keyframes house-shake { 20% { transform: translateX(-14px); } 40% { transform: translateX(12px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(5px); } }

/* A badge won on the spider's track keeps its metal and carries a trim over it (BadgesTab.tsx, badgeLook). */
.medal-web, .medal-crack { position: relative; }
.medal-trim-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.medal-web-lines path { fill: none; stroke: rgba(43, 47, 58, 0.55); stroke-width: 0.6; stroke-linejoin: round; }
.medal-crack-line { fill: none; stroke: #2b2f3a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: miter; }

/* The ruin (Harbour MVP): the speech line and the order line (a question to answer is the kit's digit tiles). */
.yard-top { position: fixed; left: calc(50% - 170px); top: 70px; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 440px); pointer-events: none; }
.yard-hint { max-width: 640px; padding: 10px 16px; background: #fff8e1; border: 3px solid #3a2a12; border-radius: 12px; font-size: 18px; color: #1c1408; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.yard-hint.on { opacity: 1; }
.yard-order { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 18px; font-weight: bold; color: #1c1408; background: #ffe9a8; border-radius: 8px; padding: 0 8px; text-align: center; }
.yard-order:empty { display: none; }
/* The Forest's shop (realm/forest/forest.ts drawShop): Bracken's axes, beside him at the centre of the forest. */
/* Fern's co-quest card (realm/quest/yard.ts showCo): the one part of the strip a child clicks. */
.yard-co { display: none; flex-direction: column; gap: 8px; max-width: 520px; padding: 10px 16px; background: #fff8e1; border: 3px solid #3a2a12; border-radius: 12px; font-size: 18px; color: #1c1408; pointer-events: auto; }
.yard-co.on { display: flex; }
.yard-co-row { display: flex; gap: 10px; justify-content: center; }
.yard-co-yes, .yard-co-no { font: inherit; font-size: 18px; padding: 6px 14px; border: 2px solid #3a2a12; border-radius: 8px; color: #1c1408; cursor: pointer; }
.yard-co-yes { font-weight: bold; background: #f2c14e; }
.yard-co-no { background: #ffe9a8; }
/* The build board: two rafts of one material, pieces to drag, and three boxes to drag them into. */

/* Under the sign-in card on the beta (BetaNote.tsx): over the gate's backdrop, never in the way of the card. */
.beta-note { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 10px 14px; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; z-index: 61; }
.beta-note p { margin: 0; }
.beta-note .beta-note-keys { margin-bottom: 6px; font-weight: 700; color: var(--ink); }

/* The settings bar (LV.settings): four big buttons a child can read at a glance, each saying what it is now. */
.settings-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.settings-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--edge); background: var(--panel); font: inherit; font-weight: 800; font-size: 15px;
  color: var(--ink-soft); cursor: pointer;
}
.settings-toggle.on { background: #e4f6d8; border-color: #5aa83a; color: var(--ink); }
.settings-toggle.chat-mode { cursor: default; font-weight: 700; }
.settings-toggle-icon { font-size: 20px; }

/* Calm screen (motion.ts): the page's own animations stop with the world's shaking. */
.calm *, .calm *::before, .calm *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
}

/* The emote buttons (LV.emote): bottom right, above the world, out of the chat's way; the job rail sits higher. */
.emote-bar { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.emote-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 50%; border: 2px solid var(--edge); background: var(--panel); box-shadow: var(--shadow); cursor: pointer; padding: 0;
}
.emote-btn:hover { transform: translateY(-2px); }
.emote-icon { font-size: 22px; line-height: 1; }
.emote-key {
  position: absolute; right: -2px; bottom: -2px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 3px;
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 900; line-height: 16px;
}

/* `/fps` in chat (game/frameMeter.ts): read at a glance, never in the way of a click. */
.frame-meter {
  position: fixed; top: 6px; left: 50%; transform: translateX(-50%); z-index: 10000; pointer-events: none;
  padding: 3px 10px; border-radius: 8px; background: rgba(20, 24, 34, 0.78); color: #fff;
  font: 700 12px/1.4 ui-monospace, Consolas, monospace; white-space: nowrap;
}

/* Touch play (LV.tablet, ui/TouchControls.tsx): the stick bottom left, E and Space bottom right, over the game
   on an iPad and in the bars beside or under it on a phone. Big enough for a nine-year-old's thumb. */
#game-container canvas { touch-action: none; }
.touch-pad {
  position: fixed; inset: auto 0 0 0; z-index: 35; display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 18px max(18px, env(safe-area-inset-bottom)); pointer-events: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.touch-pad > * { pointer-events: auto; }
.touch-stick {
  --kx: 0; --ky: 0; position: relative; width: 140px; height: 140px; border-radius: 50%; touch-action: none;
  background: radial-gradient(circle, rgba(253, 246, 232, 0.18), rgba(253, 246, 232, 0.32));
  border: 3px solid rgba(253, 246, 232, 0.7); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.touch-knob {
  position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(33, 36, 46, 0.35);
  transform: translate(calc(var(--kx) * 50px), calc(var(--ky) * 50px)); pointer-events: none;
}
.touch-stick.held .touch-knob { background: #fff3c4; }
.touch-stick.run .touch-knob { background: var(--gold); }
/* One over the other, each named for what it does and only there while it would do it; the main one (E's) below. */
.touch-keys { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none; }
.touch-keys > * { pointer-events: auto; }
.touch-key {
  position: relative; display: inline-flex; align-items: center; justify-content: center; touch-action: none;
  min-width: 96px; max-width: 220px; padding: 8px 20px; border-radius: 30px; text-align: center; line-height: 1.1;
  border: 3px solid var(--ink); color: var(--ink); font-weight: 900; animation: touch-in 0.18s ease-out;
  box-shadow: 0 6px 0 rgba(33, 36, 46, 0.4); -webkit-tap-highlight-color: transparent;
}
.touch-key:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(33, 36, 46, 0.4); }
.touch-act { min-height: 76px; font-size: 24px; background: var(--gold); }
.touch-use { min-height: 60px; font-size: 20px; background: #bfe6ff; }
@keyframes touch-in { from { transform: scale(0.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .touch-key { animation: none; } }
/* The bottom row moves clear of the controls: up over them when the screen stands tall, in from the sides when it
   lies wide. `.stage` outranks the keeper corner's own padding (keeper.css), which left the emotes under Space. */
html.touch-play .stage .hud-row.bottom { padding: 0 230px 0 160px; }
html.touch-play .hud-row.bottom .hint { display: none; }
/* Stretched to share the row, its empty box beside the map button would eat taps meant for the ground. */
html.touch-play .chat-stack { flex: 1 1 auto; min-width: 0; pointer-events: none; }
html.touch-play .chat-stack > * { pointer-events: auto; }
/* A building's keeper stands over the keys, not on E. */
html.touch-play .keeper-corner { bottom: 176px; }
@media (orientation: portrait) {
  html.touch-play .stage .hud-row.bottom { padding: 0 0 170px; }
}
@media (max-height: 520px) {
  .touch-stick { width: 116px; height: 116px; }
  .touch-knob { width: 52px; height: 52px; margin: -26px 0 0 -26px; transform: translate(calc(var(--kx) * 40px), calc(var(--ky) * 40px)); }
  .touch-keys { gap: 8px; }
  .touch-act { min-height: 60px; font-size: 20px; }
  .touch-use { min-height: 48px; font-size: 17px; }
  html.touch-play .stage .hud-row.bottom { padding: 0 200px 0 136px; }
  html.touch-play .keeper-corner { bottom: 136px; }
}

/* The digit tiles on a small screen (Mark, 11-09, on his phone: "the number digits are waaaay blocking the screen,
   you cant see or do anything"). Lying wide, the tray folds into one strip along the top: the question, the slates,
   then one row of small keys, so the game under it stays in sight and in reach. Standing tall, it moves into the
   empty band above the game. The `html` prefix makes these outrank the centre, slim and audit rules above. */
@media (max-height: 520px) {
  html .tile-bar.centre {
    top: 6px; bottom: auto; transform: translateX(-50%); flex-direction: row; align-items: center; gap: 8px;
    max-width: 98vw; padding: 5px 10px; border-width: 3px; border-radius: 18px;
  }
  html .tile-bar.centre .tile-hint { font-size: 15px; white-space: nowrap; }
  html .tile-bar.centre .tile-hint.big { font-size: 26px; }
  html .tile-bar.centre .tile-left { padding: 2px 8px; font-size: 12px; }
  html .tile-bar.centre .tile-tray { flex-direction: row; align-items: center; gap: 8px; }
  /* Two short rows of seven: one row of eleven keys and Go ran the slates off the side of a phone. */
  html .tile-bar.centre .tile-keys, html .tile-bar.centre.slim .tile-keys { grid-template-columns: repeat(7, 32px); gap: 4px; }
  html .tile-bar.centre .tile-key, html .tile-bar.centre.slim .tile-key { width: 32px; height: 32px; font-size: 17px; border-width: 3px; border-radius: 10px; box-shadow: 0 3px 0 var(--d), 0 3px 0 3px #2b2f3a; }
  html .tile-bar.centre .tile-go { width: auto; grid-column: span 2; }
  html .tile-bar.centre .tile-slate { min-width: 50px; padding: 1px 8px; border-width: 3px; box-shadow: 0 2px 0 #2b2f3a; }
  html .tile-bar.centre .tile-slate b { font-size: 20px; min-height: 22px; }
  html .tile-bar.centre .tile-slate i { font-size: 10px; }
}
/* A tablet lying wide: the tray goes up under the top bar, so the middle, where the child stands, stays in sight. */
@media (orientation: landscape) and (min-height: 521px) {
  html.touch-play .tile-bar.centre { top: 64px; bottom: auto; transform: translateX(-50%); padding: 8px 14px 12px; gap: 6px; }
  html.touch-play .tile-bar.centre .tile-hint.big { font-size: 48px; }
}
@media (orientation: portrait) and (max-width: 600px) {
  html .tile-bar.centre { top: 62px; bottom: auto; transform: translateX(-50%); max-width: 96vw; padding: 8px 10px 10px; gap: 6px; }
  html .tile-bar.centre .tile-hint.big { font-size: 40px; }
  html .tile-bar.centre .tile-key { width: 44px; height: 44px; font-size: 22px; }
  html .tile-bar.centre .tile-keys { grid-template-columns: repeat(6, 44px); gap: 6px; }
}

/* The ✕ every window keeps in its top corner (ui/CloseX.tsx): a tablet has no Escape (Mark, 11-09). */
.close-x {
  position: absolute; top: 10px; right: 10px; z-index: 5; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 900 22px/1 var(--font);
  box-shadow: 0 3px 0 rgba(33, 36, 46, 0.35); touch-action: manipulation;
}
.close-x:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(33, 36, 46, 0.35); }
.pause-menu-container, .intro-card, .ow-panel { position: relative; }
.pause-menu-tabs { padding-right: 60px; }
/* The settings button beside the map: on a tablet there is no Escape to open them. */
.settings-pill { font-size: 22px; padding: 6px 14px; cursor: pointer; }

/* Playtime with one op in the burrow (OpPlaytime.tsx). */
.op-play-backdrop { z-index: 55; }
.op-play {
  display: flex; flex-direction: column; gap: 10px; box-sizing: border-box;
  /* The stage is 560 by 500: on a short screen the card narrows so the tray below it is never cut off. */
  width: min(584px, 94vw, calc((100vh - 220px) * 1.12)); padding: 12px; border-radius: 22px;
  background: var(--paper); border: 3px solid var(--edge); box-shadow: var(--shadow);
}
.op-play-top { display: flex; align-items: center; gap: 10px; }
.op-play-name { font-weight: 900; font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-play-found { display: flex; gap: 4px; }
.op-play-slot {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(33, 36, 46, 0.07); border: 2px dashed rgba(33, 36, 46, 0.2);
}
.op-play-slot .op-play-icon { width: 26px; height: 26px; opacity: 0.28; filter: grayscale(1); }
.op-play-slot.on { background: #fff3c4; border: 2px solid var(--gold-deep); }
.op-play-slot.on .op-play-icon { opacity: 1; filter: none; }
.op-play-slot.new { animation: op-play-found 0.7s ease-out; }
@keyframes op-play-found { 0% { transform: scale(0.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.op-play-close {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--edge); background: #fff;
  font: inherit; font-weight: 900; font-size: 16px; cursor: pointer;
}
.op-play-stage {
  width: 100%; aspect-ratio: 560 / 500; border-radius: 16px; border: 3px solid rgba(33, 36, 46, 0.5);
  touch-action: none; cursor: pointer; display: block; box-sizing: border-box;
}
.op-play-tray { display: flex; gap: 8px; justify-content: center; min-height: 86px; }
.op-play-give {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  flex: 1; max-width: 120px; padding: 6px 4px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--edge); background: #fff; box-shadow: 0 4px 0 rgba(33, 36, 46, 0.14);
  font: inherit; font-weight: 800; font-size: 14px;
}
.op-play-give:hover:not(:disabled) { transform: translateY(-2px); }
.op-play-give:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.op-play-give:disabled { opacity: 0.45; cursor: default; }
.op-play-give.back { flex: 0 0 52px; font-size: 24px; }
.op-play-give.loved::after { content: '♥'; position: absolute; top: 2px; right: 8px; color: #f0486e; font-size: 16px; }
.op-play-icon { width: 52px; height: 52px; }

/* The backpack (docs/design/INVENTORY.md): beside the map, over the world, never pausing it. */
.map-row { display: flex; gap: 10px; align-items: center; }
.backpack {
  position: fixed; left: 16px; bottom: 150px; z-index: 40; width: min(440px, calc(100vw - 32px));
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px;
}
.backpack-top { display: flex; gap: 14px; align-items: stretch; padding-right: 44px; }
.backpack-viewer {
  width: 130px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center;
  background: #f0f4f0; border: 2px solid #81c784; border-radius: 14px; padding: 8px 4px; overflow: hidden;
}
/* Four rows of three, always this shape (Mark: "4 rows of 3, lets keep it one static shape"); more scroll. */
.pack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 66px; gap: 8px; flex: 1;
  max-height: calc(66px * 4 + 8px * 3); overflow-y: auto;
}
.pack-slot {
  display: flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0;
  border: 2px solid var(--edge); background: #fff; overflow: hidden;
}
.pack-slot.empty { background: rgba(33, 36, 46, 0.05); border-style: dashed; }
.pack-slot.on { border: 3px solid var(--gold); background: #fff4d6; box-shadow: 0 0 0 3px rgba(242, 177, 52, 0.35); }
.pack-slot:disabled { cursor: wait; }
.pack-icon { width: 52px; height: 52px; }
.backpack-money { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

/* The purse: one stack per piece, bronze on the left, like a cash drawer; ten of a stack is one of the next. */
.purse { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.purse-slot { display: flex; gap: 2px; align-items: flex-end; min-width: 30px; }
.purse-tower { display: flex; flex-direction: column-reverse; }
.purse-tower > .purse-coin + .purse-coin { margin-bottom: -18px; }
.purse-empty { opacity: 0.18; }
.purse-coin { display: block; padding: 0; border: 0; background: none; line-height: 0; }
button.purse-coin:hover { transform: translateY(-3px); }
.money-piece { display: block; }
.gem-count { display: flex; align-items: center; gap: 6px; font: 900 22px/1 var(--font); color: #a61e1e; }

/* A counter's pieces shake when the count is wrong (ui/counter/counter.css draws the counters themselves). */
@keyframes counter-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
