/* Shared look: panels, buttons, outlined display text. Used by every screen. */
:root {
  --ink: #2b1d1a;          /* dark outline tone */
  --paper: #fff6e6;
  --peach: #ff9fb0;
  --jade: #4fb59a;
  --gold: #ffd36b;
  --seal: #d8452e;         /* vermilion seal accent */
  --text: #fffaf0;
  --font-title: "Kai", serif;
  --font-ui: "Rounded", sans-serif;
  --c-cute: #ff8fae;
  --c-ancient: #c98b4a;
  --c-fantasy: #a685e2;
  --c-robot: #5aa9e6;
  --c-monster: #8fcf4f;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #1c1412; touch-action: none; }
#app { position: fixed; inset: 0; overflow: hidden; font-family: var(--font-ui); color: var(--text); }
#stage3d { position: absolute; inset: 0; }
#stage3d canvas { display: block; width: 100%; height: 100%; }
#screens { position: absolute; inset: 0; pointer-events: none; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: none; }
.screen.on { display: block; }
.screen.passthrough { pointer-events: none; }
.screen.passthrough .hit { pointer-events: auto; }
#toast-layer { position: absolute; inset: 0; pointer-events: none; z-index: 50; }

/* Outlined display text */
.outline { text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink), -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 4px 0 rgba(43,29,26,.55); }
.title-font { font-family: var(--font-title); font-weight: 700; }

/* 9-slice panel and button from the generated art */
.panel {
  border-style: solid; border-width: 22px;
  border-image: url("../assets/ui-panel.webp") 64 fill / 22px stretch;
  color: var(--ink); padding: 6px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border-style: solid; border-width: 12px 18px;
  border-image: url("../assets/ui-button.webp") 40 56 fill / 12px 18px stretch;
  background: none; color: var(--text); font-family: var(--font-ui); font-size: 17px; font-weight: 700;
  cursor: pointer; transition: transform .12s ease, filter .12s ease;
  text-shadow: -1.5px -1.5px 0 #7a2a1c, 1.5px -1.5px 0 #7a2a1c, -1.5px 1.5px 0 #7a2a1c, 1.5px 1.5px 0 #7a2a1c, 0 2px 0 #7a2a1c;
}
.btn:active, .btn.pressed { transform: scale(.92); }
.btn:hover, .btn.focus { filter: brightness(1.12) drop-shadow(0 0 8px rgba(255,230,160,.9)); transform: scale(1.04); }
.btn.jade { filter: hue-rotate(120deg) saturate(.8); }
.btn.jade:hover, .btn.jade.focus { filter: hue-rotate(120deg) saturate(.8) brightness(1.12) drop-shadow(0 0 8px rgba(255,230,160,.9)); }
.btn.disabled { filter: grayscale(.85) brightness(.85); }
.btn img { width: 24px; height: 24px; object-fit: contain; }
.icon-btn {
  width: 48px; height: 48px; border: none; padding: 0; cursor: pointer;
  background: url("../assets/ui-pause.webp") center / 100% 100% no-repeat;
  display: flex; align-items: center; justify-content: center; transition: transform .12s;
}
.icon-btn > * { display: none; }
.icon-btn.plate { background-image: url("../assets/ui-button.webp"); border-radius: 12px; }
.icon-btn.plate > * { display: block; }
.icon-btn:active { transform: scale(.9); }
.icon-btn.focus { filter: brightness(1.15) drop-shadow(0 0 8px rgba(255,230,160,.9)); }
[data-nav].focus { outline: none; }
.focus-ring { box-shadow: 0 0 0 3px #fff3b0, 0 0 14px 4px rgba(255,220,120,.85); }

/* family seal colours */
.fam-cute { --fam: var(--c-cute); }
.fam-ancient { --fam: var(--c-ancient); }
.fam-fantasy { --fam: var(--c-fantasy); }
.fam-robot { --fam: var(--c-robot); }
.fam-monster { --fam: var(--c-monster); }

@keyframes pop-in { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slide-up { 0% { transform: translateY(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.pop { animation: pop-in .28s cubic-bezier(.3,1.6,.5,1) both; }

.toast {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 14px; background: rgba(43,29,26,.82); color: #fff6e6;
  font-size: 16px; font-weight: 700; white-space: nowrap; animation: pop-in .25s both;
}
