/* Abyss Stitch Altar — shared pixel UI kit. Modules build their screens from these classes. */
:root {
  --ink: #06121a;          /* darkest outline */
  --deep: #0c1f2a;         /* panel fill */
  --deep2: #143241;        /* panel inner */
  --sand: #c4a46e;         /* sandstone frame */
  --sand-hi: #e8cf96;
  --bone: #e2d6bc;         /* text */
  --cyan: #6ef0e6;         /* jellyfish glow accent */
  --magenta: #e66edc;      /* mutation / karma accent */
  --gold: #fad678;         /* holy / legend */
  --red: #e0584e;
  --g-common: #e2d6bc; --g-rare: #6ef0e6; --g-epic: #b98cff; --g-legend: #fad678; --g-mythic: #ff8a9a;
  --font: "Trebuchet MS", sans-serif; /* replaced at boot by the pixel font stack */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050d12; color: var(--bone); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; }
#stage { position: fixed; inset: 0; background: #0c1a24; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--font); }
#ui * { pointer-events: auto; }
#ui .pass, #ui .pass * { pointer-events: none; }
.hidden { display: none !important; }

/* text */
.px-text { color: var(--bone); text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 2px 2px var(--ink), 0 3px 0 var(--ink); }
.px-title { font-size: 24px; color: var(--sand-hi); text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 3px 3px 0 var(--ink); letter-spacing: 1px; }
.px-small { font-size: 12px; }

/* panels: stepped pixel frame in sandstone with a cyan inner glow line */
.px-panel {
  background: linear-gradient(180deg, rgba(20,50,65,0.96), rgba(10,28,38,0.96));
  border: 3px solid var(--sand);
  box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px rgba(110,240,230,0.25), 0 6px 0 3px rgba(0,0,0,0.5);
  border-radius: 2px;
  padding: 12px;
  animation: px-pop 0.22s cubic-bezier(.2,1.6,.4,1);
}
.px-panel.dark { background: rgba(6,18,26,0.92); }
@keyframes px-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes px-slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes px-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.97); } }

/* buttons: chunky stepped plates; min 44x44 */
.px-btn {
  font-family: var(--font); font-size: 15px; color: var(--bone);
  min-width: 44px; min-height: 44px; padding: 6px 12px;
  background: linear-gradient(180deg, #2a5566 0%, #1b3d4b 55%, #142f3a 100%);
  border: 3px solid var(--sand); border-radius: 3px;
  box-shadow: 0 0 0 2px var(--ink), 0 4px 0 2px var(--ink);
  text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.08s, filter 0.1s; outline: none; line-height: 1.1; text-align: center;
}
.px-btn:hover, .px-btn.focus { filter: brightness(1.25); transform: translateY(-1px) scale(1.03); }
.px-btn.focus { box-shadow: 0 0 0 2px var(--ink), 0 4px 0 2px var(--ink), 0 0 0 5px var(--cyan); }
.px-btn:active, .px-btn.pressed { transform: translateY(3px) scale(0.97); box-shadow: 0 0 0 2px var(--ink), 0 1px 0 2px var(--ink); }
.px-btn.primary { background: linear-gradient(180deg, #3fb6a8 0%, #22867c 55%, #186960 100%); border-color: var(--sand-hi); }
.px-btn.danger { background: linear-gradient(180deg, #a8463e 0%, #7c2c27 100%); }
.px-btn.holy { background: linear-gradient(180deg, #e8c35c 0%, #b48a2c 100%); color: #2a1a06; text-shadow: none; }
.px-btn[disabled], .px-btn.disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; transform: none; }
.px-icon-btn { width: 48px; height: 48px; padding: 0; font-size: 22px; }

/* grade tints */
.g-common { --g: var(--g-common); } .g-rare { --g: var(--g-rare); } .g-epic { --g: var(--g-epic); }
.g-legend { --g: var(--g-legend); } .g-mythic { --g: var(--g-mythic); }
.gcol { color: var(--g, var(--bone)); }
.gborder { border-color: var(--g, var(--sand)) !important; }

/* shared overlays from core */
.subtitle { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); max-width: 86%; padding: 8px 14px; font-size: 15px; text-align: center; background: rgba(6,18,26,0.85); border: 2px solid var(--cyan); box-shadow: 0 0 0 2px var(--ink); z-index: 60; pointer-events: none !important; }
#toasts { position: absolute; left: 0; right: 0; top: 18%; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 55; pointer-events: none !important; }
.toast { pointer-events: none !important; padding: 6px 12px; font-size: 14px; background: rgba(6,18,26,0.9); border: 2px solid var(--sand); box-shadow: 0 0 0 2px var(--ink); animation: px-slide-up 0.25s ease-out; }
.banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-size: 30px; z-index: 56; pointer-events: none !important; color: var(--gold); animation: px-banner 1.6s ease-out forwards; text-shadow: 3px 0 var(--ink), -3px 0 var(--ink), 0 3px var(--ink), 0 -3px var(--ink), 4px 4px 0 var(--ink); }
@keyframes px-banner { 0% { transform: scale(2.2); opacity: 0; } 15% { transform: scale(0.95); opacity: 1; } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
