/* Shared reset + tokens. Each concept layers its own look on top. */
:root {
  --bg: #0b0a10;
  --fg: #e8e4f0;
  --dim: #8a8499;
  --rift: #b24dff;
  --rift-hot: #ff4dd2;
  --ember: #ff8a3d;
  --toxic: #7dff6a;
  --ice: #6ad8ff;
  --blood: #ff3b4e;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body.game {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  inset: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Back-to-hub link shared by all concepts */
.hub-link {
  position: fixed;
  top: calc(8px + var(--safe-top));
  left: 8px;
  z-index: 1000;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(0 0 0 / .45);
  backdrop-filter: blur(6px);
  color: var(--dim);
  text-decoration: none;
  font: 18px/1 var(--mono);
  border: 1px solid rgb(255 255 255 / .08);
}
.hub-link:active { transform: scale(.9); }

/* Generic floating toast */
.toast {
  position: fixed;
  left: 50%;
  top: calc(56px + var(--safe-top));
  translate: -50% 0;
  z-index: 999;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgb(20 16 30 / .9);
  border: 1px solid rgb(178 77 255 / .4);
  font: 13px/1.3 var(--mono);
  pointer-events: none;
  animation: toast-in .25s ease-out, toast-out .4s ease-in 2s forwards;
  white-space: nowrap;
}
@keyframes toast-in { from { opacity: 0; translate: -50% -10px; } }
@keyframes toast-out { to { opacity: 0; translate: -50% -10px; } }

/* Screen shake helper */
.shake { animation: shake .3s linear; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(2px, 1px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
