/* Bodils matteäventyr */

:root {
  --f-title: "Cinzel", "Trajan Pro", Georgia, serif;
  --f-ui: "Alegreya", Georgia, "Times New Roman", serif;
  --ink: #f4eedc;
  --ink-soft: #bdb5a1;
  --ink-dim: #8a8475;
  --gold: #ecc978;
  --gold-deep: #b98f45;
  --line: rgba(236, 214, 162, 0.55);
  --line-soft: rgba(236, 214, 162, 0.18);
  --win-top: rgba(26, 30, 56, 0.94);
  --win-bot: rgba(9, 11, 26, 0.95);
  --sel: rgba(255, 222, 140, 0.2);
  --good: #86e3a4;
  --bad: #ff9a8a;
  --bp: #8fd0ff;
  --bp-deep: #3a86d8;
  --danger: #ff6a6a;
  --shadow-text: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.45);
  --fs: 18px;
  --su: 10px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #07060d;
  color: var(--ink);
  font-family: var(--f-ui);
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
}

.curtain {
  position: absolute;
  inset: 0;
  background: #030208;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  z-index: 60;
}

.curtain.is-down {
  opacity: 1;
  pointer-events: auto;
}

.noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 1.2rem;
}

.win {
  position: relative;
  background: linear-gradient(180deg, var(--win-top), var(--win-bot));
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.55),
    inset 0 0 0 3px var(--line-soft),
    0 10px 30px rgba(0, 0, 0, 0.55);
  color: var(--ink);
  text-shadow: var(--shadow-text);
}

.win::before,
.win::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(255, 210, 120, 0.6);
  pointer-events: none;
}

.win::before {
  top: -4px;
  left: -4px;
}

.win::after {
  right: -4px;
  bottom: -4px;
}

.title-text {
  font-family: var(--f-title);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff6d6 0%, #f1cf80 45%, #b98a3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.8)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.5));
}

.rule {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--gold);
}

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.mbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6em;
  width: 100%;
  min-height: 2.3em;
  padding: 0.35em 0.8em 0.35em 1.5em;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-family: var(--f-ui);
  font-size: 1em;
  font-weight: 500;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.mbtn::before {
  content: "";
  position: absolute;
  left: 0.45em;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 0.36em solid transparent;
  border-bottom: 0.36em solid transparent;
  border-left: 0.55em solid var(--gold);
  transform: translateY(-50%);
  opacity: 0;
  filter: drop-shadow(0 0 4px rgba(255, 210, 120, 0.8));
}

.mbtn:hover,
.mbtn:focus-visible,
.mbtn.is-active {
  background: linear-gradient(90deg, var(--sel), rgba(255, 222, 140, 0.04) 80%, transparent);
  outline: none;
}

.mbtn:hover::before,
.mbtn:focus-visible::before,
.mbtn.is-active::before {
  opacity: 1;
  animation: nudge 0.9s ease-in-out infinite;
}

.mbtn[disabled] {
  color: var(--ink-dim);
  cursor: default;
}

.mbtn[disabled]:hover {
  background: transparent;
}

.mbtn[disabled]::before {
  opacity: 0 !important;
}

.mbtn__side {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 0.85em;
}

.mbtn--primary {
  font-family: var(--f-title);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff3c9;
}

@keyframes nudge {
  0%,
  100% {
    transform: translate(0, -50%);
  }
  50% {
    transform: translate(0.18em, -50%);
  }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  min-height: 3em;
  padding: 0.4em 0.5em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(60, 66, 110, 0.55), rgba(20, 22, 44, 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font-family: var(--f-ui);
  font-weight: 700;
  text-shadow: var(--shadow-text);
  cursor: pointer;
  transition: transform 90ms ease, border-color 120ms ease, background 120ms ease;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(90, 92, 140, 0.7), rgba(30, 30, 60, 0.85));
  outline: none;
}

.tile:active {
  transform: translateY(1px) scale(0.98);
}

.tile[disabled] {
  opacity: 0.45;
  cursor: default;
}

.tile .key {
  position: absolute;
  top: 0.25em;
  left: 0.4em;
  font-size: 0.6em;
  color: var(--ink-dim);
  font-weight: 500;
}

.portrait {
  grid-row: span 3;
  width: 3.2em;
  height: 3.2em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: radial-gradient(circle at 50% 35%, #3c4478, #161a34);
  image-rendering: pixelated;
}

.status__name {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.05em;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status__cls {
  color: var(--ink-soft);
  font-size: 0.85em;
}

.bp__label {
  color: var(--bp);
  font-weight: 700;
  margin-right: 0.2em;
}

.bp__orbs {
  display: flex;
  gap: 0.22em;
}

.orb {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  border: 1px solid rgba(143, 208, 255, 0.5);
  background: rgba(20, 40, 70, 0.8);
}

.orb.is-on {
  background: radial-gradient(circle at 35% 35%, #ffffff, var(--bp) 40%, var(--bp-deep));
  box-shadow: 0 0 8px rgba(120, 190, 255, 0.9);
}

.orb.is-new {
  animation: orb-pop 500ms ease;
}

@keyframes orb-pop {
  0% {
    transform: scale(0.2);
  }
  60% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
  }
}

.xpbar {
  grid-column: 2 / -1;
  height: 0.45em;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.xpbar > span {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, #b98f45, #ffe29a);
  transition: width 900ms ease;
}

.op-sym {
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e0, #ecc978 55%, #9b6f2c);
  color: #2b1b08;
  font-family: var(--f-ui);
  font-size: 1.25em;
  font-weight: 800;
  line-height: 1;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(255, 210, 120, 0.35);
}

.tile--op .op-name {
  font-size: 0.9em;
}

.tile--weak {
  border-color: #ffd36a;
  box-shadow: 0 0 0 1px rgba(255, 211, 106, 0.4), 0 0 16px rgba(255, 200, 90, 0.35);
}

.tile--ab {
  background: linear-gradient(180deg, rgba(50, 90, 150, 0.6), rgba(16, 26, 56, 0.85));
}

.tile--ab .ab-label {
  font-family: var(--f-title);
  letter-spacing: 0.04em;
}

.ab-cost {
  display: inline-flex;
  gap: 0.18em;
}

.ab-cost .orb {
  width: 0.62em;
  height: 0.62em;
}

.ab-list {
  display: grid;
  gap: 0.35em;
  overflow: auto;
}

.ab-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.1em 0.8em;
  width: 100%;
  padding: 0.4em 0.7em;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  text-align: left;
  cursor: pointer;
}

.ab-item:hover,
.ab-item:focus-visible {
  border-color: var(--gold);
  background: var(--sel);
  outline: none;
}

.ab-item[disabled] {
  opacity: 0.5;
  cursor: default;
}

.ab-item__name {
  font-family: var(--f-title);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.ab-item__desc {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.85em;
}

.ab-item__lock {
  color: var(--ink-dim);
  font-size: 0.85em;
}

.q {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  height: 100%;
}

.q__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6em;
  min-height: 1.9em;
}

.q__title {
  font-family: var(--f-title);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  font-size: 0.9em;
}

.speak {
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.speak svg {
  width: 1.15em;
  height: 1.15em;
}

.speak:hover,
.speak:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.q__problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.35em;
  font-size: 2.1em;
  font-weight: 800;
  line-height: 1.1;
  margin: auto 0;
  letter-spacing: 0.01em;
}

.q__problem .word {
  font-weight: 700;
}

.q__story {
  margin: 0 auto;
  max-width: 34em;
  text-align: center;
  font-size: 1.15em;
  font-weight: 500;
  line-height: 1.35;
}

.qbox {
  display: inline-grid;
  place-items: center;
  min-width: 1.4em;
  padding: 0 0.15em;
  border: 2px solid var(--gold);
  border-radius: 6px;
  color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 210, 120, 0.4), inset 0 0 10px rgba(255, 210, 120, 0.2);
  animation: glowbox 1.4s ease-in-out infinite;
}

.qbox.is-filled {
  color: var(--ink);
  animation: none;
}

@keyframes glowbox {
  50% {
    box-shadow: 0 0 22px rgba(255, 210, 120, 0.7), inset 0 0 14px rgba(255, 210, 120, 0.3);
  }
}

.answers {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 0.5em;
}

.tile--ans {
  min-height: 2.1em;
  font-size: 1.45em;
  font-weight: 800;
}

.tile--ans.is-right {
  border-color: var(--good);
  background: linear-gradient(180deg, rgba(60, 150, 100, 0.8), rgba(20, 70, 50, 0.9));
  box-shadow: 0 0 18px rgba(120, 230, 160, 0.6);
}

.tile--ans.is-wrong {
  border-color: var(--bad);
  background: linear-gradient(180deg, rgba(150, 60, 70, 0.8), rgba(70, 20, 30, 0.9));
  animation: shake 300ms ease;
}

@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.keypad {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6em;
}

.keypad--display {
  grid-template-columns: minmax(0, 1fr) minmax(0, 3.2fr);
}

.qbox.is-typing {
  color: var(--ink);
  animation: none;
}

.keypad__display {
  display: grid;
  place-items: center;
  min-height: 2em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 1.8em;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.keypad__keys {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.3em;
}

.keypad--display .keypad__keys {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.keypad__keys .tile {
  min-height: 2.1em;
  font-size: 1.2em;
}

.tile--ok {
  background: linear-gradient(180deg, rgba(60, 130, 90, 0.8), rgba(20, 60, 40, 0.9));
}

.q__feedback {
  margin: 0;
  text-align: center;
  font-weight: 800;
  font-size: 1.05em;
  white-space: nowrap;
}

.q__feedback.is-good {
  color: var(--good);
}

.q__feedback.is-bad {
  color: var(--bad);
}

@keyframes pulse {
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 90, 90, 0.8);
  }
}

@keyframes bob {
  50% {
    translate: 0 -25%;
  }
}

.banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  display: grid;
  justify-items: center;
  gap: 0.2em;
  padding: 0.7em 1em;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(6, 6, 18, 0.78) 20%, rgba(6, 6, 18, 0.78) 80%, transparent);
  animation: banner 2.4s ease forwards;
  text-align: center;
}

.banner__main {
  font-size: calc(var(--su) * 4.2);
}

.banner__sub {
  font-size: calc(var(--su) * 2.2);
  color: var(--ink);
  text-shadow: var(--shadow-text);
}

@keyframes banner {
  0% {
    opacity: 0;
    transform: scaleY(0.4);
  }
  12% {
    opacity: 1;
    transform: scaleY(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.titlecard {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.4em;
  background: rgba(3, 2, 10, 0.72);
  text-align: center;
  pointer-events: auto;
  animation: fade-in-out 3.4s ease forwards;
}

.titlecard__small {
  font-family: var(--f-title);
  font-size: calc(var(--su) * 2.2);
  letter-spacing: 0.4em;
  color: var(--ink-soft);
}

.titlecard__big {
  font-size: calc(var(--su) * 6);
}

.titlecard .rule {
  width: calc(var(--su) * 50);
  font-size: calc(var(--su) * 1.6);
}

.titlecard__sub {
  font-size: calc(var(--su) * 2.4);
  font-style: italic;
  color: var(--ink);
}

@keyframes fade-in-out {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}

.logo-block::before {
  content: "";
  position: absolute;
  inset: -30% -8%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, rgba(6, 4, 16, 0.72) 0%, rgba(6, 4, 16, 0.4) 45%, transparent 70%);
}

.menu--center .mbtn {
  justify-content: center;
  text-align: center;
}

.logo-block {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.15em;
  width: 90%;
  text-align: center;
  pointer-events: none;
  animation: logo-in 1.6s ease both;
}

.logo-block__small {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: calc(var(--su) * 3.2);
  letter-spacing: 0.25em;
  color: #fff3d0;
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 200, 120, 0.5);
}

.logo-block__big {
  font-size: calc(var(--su) * 7.6);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

.logo-block .rule {
  width: calc(var(--su) * 56);
  font-size: calc(var(--su) * 1.6);
}

.logo-block__sub {
  font-size: calc(var(--su) * 2.2);
  font-style: italic;
  color: var(--ink);
  text-shadow: var(--shadow-text);
}

@keyframes logo-in {
  from {
    opacity: 0;
    filter: blur(6px);
  }
}

.menu {
  display: grid;
  align-content: center;
  gap: 0.15em;
  width: min(100%, 26em);
  margin: 0 auto;
  padding: 0.6em;
}

.toggles {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  padding: 0 0.6em 0.5em;
  font-size: 0.8em;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.8em;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink-soft);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--line);
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.5vmin, 28px);
  background: rgba(4, 3, 12, 0.62);
  animation: fade 300ms ease;
  font-size: clamp(14px, calc(var(--fs) * 0.95), 20px);
}

.screen.is-clear {
  background: transparent;
  pointer-events: none;
}

.screen.is-clear > * {
  pointer-events: auto;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  width: min(100%, 64em);
  max-height: 100%;
  min-height: 0;
}

.panel--narrow {
  width: min(100%, 34em);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.8em 1.1em 0.6em;
  border-bottom: 1px solid var(--line-soft);
}

.panel__title {
  margin: 0;
  font-size: 1.45em;
}

.panel__body {
  padding: 1em 1.1em;
  overflow: auto;
  min-height: 0;
}

.panel__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6em;
  padding: 0.7em 1.1em 0.9em;
  border-top: 1px solid var(--line-soft);
}

.close-x {
  margin-left: auto;
  width: 2.2em;
  height: 2.2em;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
}

.close-x:hover,
.close-x:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 2.5em;
  padding: 0.4em 1.3em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(70, 74, 120, 0.7), rgba(24, 26, 52, 0.9));
  color: var(--ink);
  font-family: var(--f-ui);
  font-weight: 700;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 210, 120, 0.3);
  outline: none;
}

.btn--gold {
  border-color: #ffe29a;
  background: linear-gradient(180deg, #f5d98e, #c0924a);
  color: #2b1b08;
  text-shadow: none;
  font-family: var(--f-title);
  letter-spacing: 0.04em;
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: linear-gradient(180deg, #fff0b8, #d8a858);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-soft);
}

.btn--danger {
  border-color: #ff9a8a;
  color: #ffd0c8;
}

.classes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7em;
}

.class-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.2em 0.8em;
  padding: 0.7em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(40, 44, 80, 0.55), rgba(12, 14, 30, 0.7));
  text-align: left;
  cursor: pointer;
}

.class-card:hover,
.class-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.class-card[aria-pressed="true"] {
  border-color: #ffe29a;
  background: linear-gradient(180deg, rgba(90, 80, 60, 0.6), rgba(30, 24, 20, 0.8));
  box-shadow: 0 0 0 1px rgba(255, 226, 154, 0.4), 0 0 20px rgba(255, 200, 100, 0.25);
}

.class-card canvas {
  grid-row: span 2;
  width: 4.2em;
  height: 5.25em;
  image-rendering: pixelated;
}

.class-card__name {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.1em;
  letter-spacing: 0.04em;
  color: #fff3d0;
}

.class-card__desc {
  color: var(--ink-soft);
  font-size: 0.88em;
  line-height: 1.3;
}

.class-detail {
  margin-top: 1em;
  padding: 0.8em 1em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.class-detail h3 {
  margin: 0 0 0.5em;
  font-family: var(--f-title);
  font-size: 1em;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.ab-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5em 1.2em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ab-preview li {
  display: grid;
  gap: 0.1em;
}

.ab-preview b {
  font-family: var(--f-title);
  letter-spacing: 0.03em;
}

.ab-preview small {
  color: var(--ink-soft);
  font-size: 0.85em;
}

.lvl {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.45em;
  border-radius: 99px;
  background: rgba(255, 226, 154, 0.15);
  color: var(--gold);
  font-size: 0.75em;
  font-weight: 700;
  font-family: var(--f-ui);
  vertical-align: 0.1em;
}

.look {
  display: grid;
  grid-template-columns: minmax(12em, 34%) minmax(0, 1fr);
  gap: 1.2em;
}

.look__preview {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.6em;
  padding: 1em 0.5em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 85%, rgba(255, 200, 120, 0.28), transparent 60%), radial-gradient(ellipse at 50% 20%, #2a2f5a, #0c0d1e 75%);
  overflow: hidden;
}

.look__preview canvas {
  width: min(100%, 12.8em);
  aspect-ratio: 32 / 40;
  image-rendering: pixelated;
}

.look__name-tag {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.2em;
  color: #fff3d0;
}

.look__opts {
  display: grid;
  gap: 0.9em;
}

.field {
  display: grid;
  gap: 0.35em;
}

.field__label {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.text-input {
  width: 100%;
  max-width: 18em;
  padding: 0.45em 0.7em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font: inherit;
  font-size: 1.1em;
  font-weight: 700;
  user-select: text;
  -webkit-user-select: text;
}

.text-input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
}

.swatch {
  position: relative;
  width: 2.3em;
  height: 2.3em;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.25);
}

.swatch[aria-pressed="true"] {
  border-color: #fff3c9;
  box-shadow: 0 0 0 2px var(--gold-deep), 0 0 12px rgba(255, 210, 120, 0.6), inset 0 -4px 6px rgba(0, 0, 0, 0.25);
}

.swatch:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.swatch[disabled] {
  cursor: default;
  opacity: 0.35;
}

.swatch .lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.7em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.choice {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  padding: 0.3em 0.55em;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 700;
}

.choice canvas {
  width: 2.6em;
  height: 2.6em;
  image-rendering: pixelated;
}

.choice[aria-pressed="true"] {
  border-color: #ffe29a;
  background: rgba(255, 226, 154, 0.14);
  color: #fff3c9;
}

.choice:hover,
.choice:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.choice[disabled] {
  opacity: 0.45;
  cursor: default;
}

.choice small {
  font-weight: 500;
  color: var(--ink-dim);
  font-size: 0.8em;
}

.grades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8em;
}

.grade-card {
  display: grid;
  gap: 0.4em;
  align-content: start;
  padding: 1em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(40, 44, 80, 0.55), rgba(12, 14, 30, 0.7));
  text-align: left;
  cursor: pointer;
}

.grade-card[aria-pressed="true"] {
  border-color: #ffe29a;
  box-shadow: 0 0 20px rgba(255, 200, 100, 0.25);
}

.grade-card:hover,
.grade-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.grade-card__age {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.6em;
  color: #fff3d0;
}

.grade-card__sub {
  color: var(--gold);
  font-weight: 700;
}

.grade-card__desc {
  color: var(--ink-soft);
  font-size: 0.9em;
  line-height: 1.35;
}

.grade-card__ex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

.grade-card__ex span {
  padding: 0.1em 0.5em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  font-weight: 700;
  font-size: 0.9em;
}

.hint {
  margin: 0.8em 0 0;
  color: var(--ink-soft);
  font-size: 0.9em;
}

.slots {
  display: grid;
  gap: 0.6em;
}

.slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9em;
  padding: 0.6em 0.8em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.slot canvas {
  width: 3.4em;
  height: 4.25em;
  image-rendering: pixelated;
}

.slot__name {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.15em;
  color: #fff3d0;
}

.slot__meta {
  color: var(--ink-soft);
  font-size: 0.9em;
}

.slot__actions {
  display: flex;
  gap: 0.4em;
}

.nights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
  gap: 0.6em;
}

.night-card {
  display: grid;
  gap: 0.2em;
  padding: 0.7em 0.9em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(30, 34, 70, 0.6), rgba(10, 12, 28, 0.8));
  text-align: left;
  cursor: pointer;
}

.night-card:hover,
.night-card:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.night-card[disabled] {
  opacity: 0.4;
  cursor: default;
}

.night-card__n {
  font-family: var(--f-title);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  font-size: 0.85em;
}

.night-card__t {
  font-weight: 700;
  font-size: 1.05em;
}

.stars {
  display: inline-flex;
  gap: 0.15em;
  color: #4a4660;
  font-size: 1.1em;
  letter-spacing: 0;
}

.stars .on {
  color: #ffd66b;
  text-shadow: 0 0 8px rgba(255, 210, 100, 0.8);
}

.set-row {
  display: grid;
  grid-template-columns: minmax(9em, 30%) minmax(0, 1fr);
  align-items: center;
  gap: 0.6em 1em;
  padding: 0.7em 0;
  border-bottom: 1px solid var(--line-soft);
}

.set-row:last-child {
  border-bottom: 0;
}

.set-row__label {
  font-weight: 700;
}

.set-row__label small {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.85em;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}

.seg button {
  padding: 0.4em 0.9em;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font-weight: 700;
}

.seg button[aria-pressed="true"] {
  border-color: #ffe29a;
  background: rgba(255, 226, 154, 0.18);
  color: #fff3c9;
}

.seg button:hover,
.seg button:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
  gap: 0.6em;
}

.stat {
  display: grid;
  gap: 0.3em;
  padding: 0.8em;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.stat__head {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 700;
}

.stat__big {
  font-size: 1.6em;
  font-weight: 800;
}

.stat__bar {
  height: 0.5em;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.stat__bar span {
  display: block;
  height: 100%;
  width: var(--p);
  background: linear-gradient(90deg, #3a86d8, #86e3a4);
}

.results {
  display: grid;
  justify-items: center;
  gap: 0.8em;
  text-align: center;
}

.results__stars {
  display: flex;
  gap: 0.4em;
  font-size: 3em;
  color: #3a3650;
}

.results__stars span {
  display: inline-block;
}

.results__stars .on {
  color: #ffd66b;
  text-shadow: 0 0 16px rgba(255, 210, 100, 0.9);
  animation: star-in 600ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

@keyframes star-in {
  from {
    transform: scale(0) rotate(-40deg);
  }
}

.results__line {
  margin: 0;
  font-size: 1.1em;
}

.results__xp {
  display: grid;
  gap: 0.35em;
  width: min(100%, 24em);
}

.results__xp .xpbar {
  height: 0.7em;
}

.unlock {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: min(100%, 28em);
  padding: 0.7em 1em;
  border: 1px solid #ffe29a;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(120, 96, 50, 0.45), rgba(20, 16, 30, 0.6));
  text-align: left;
  animation: pop-in 500ms ease both;
}

.unlock__icon {
  font-size: 1.8em;
  color: #ffe29a;
  text-shadow: 0 0 12px rgba(255, 210, 120, 0.9);
}

.unlock__title {
  font-family: var(--f-title);
  font-weight: 700;
  color: #fff3d0;
}

.unlock__desc {
  color: var(--ink-soft);
  font-size: 0.9em;
}

.dialog__win {
  display: flex;
  gap: 0.9em;
  align-items: flex-start;
  min-height: 7em;
  padding: 0.9em 1.1em;
  cursor: pointer;
}

.dialog__win canvas {
  flex-shrink: 0;
  width: 4.2em;
  height: 4.2em;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: radial-gradient(circle at 50% 35%, #3c4478, #161a34);
}

.dialog__name {
  display: block;
  margin-bottom: 0.2em;
  font-family: var(--f-title);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.dialog__text {
  margin: 0;
  font-size: 1.12em;
  line-height: 1.4;
}

.dialog__next {
  position: absolute;
  right: 1em;
  bottom: 0.6em;
  width: 0;
  height: 0;
  border-left: 0.45em solid transparent;
  border-right: 0.45em solid transparent;
  border-top: 0.6em solid var(--gold);
  animation: bob 0.8s ease-in-out infinite;
}

.confirm {
  display: grid;
  gap: 1em;
  justify-items: center;
  text-align: center;
}

.confirm__actions {
  display: flex;
  gap: 0.6em;
}

.is-tall .classes,
.is-tall .grades {
  grid-template-columns: minmax(0, 1fr);
}

.is-tall .look {
  grid-template-columns: minmax(0, 1fr);
}

.is-tall .look__preview canvas {
  width: 7em;
}

.is-tall .ab-preview {
  grid-template-columns: minmax(0, 1fr);
}

.is-tall .set-row {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 700px) and (max-width: 1000px) {
  .classes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.about {
  padding: clamp(40px, 6vw, 80px) var(--ml-edge, 24px) clamp(56px, 8vw, 96px);
  background: #ffffff;
  color: #111111;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

.about h2 {
  margin: 0 0 1.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  max-width: 1300px;
}

.about h3 {
  margin: 0 0 0.4rem;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.3rem;
}

.about p {
  margin: 0;
  color: #5b5b5b;
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .about__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .about__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================= Game area ================= */

.game {
  position: relative;
  width: 100%;
  height: var(--game-h, calc(100svh - 76px));
  min-height: 360px;
  overflow: hidden;
  background: #07060d;
  font-size: var(--fs);
  line-height: 1.25;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.game:fullscreen {
  height: 100vh;
}

.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #05040b;
  cursor: pointer;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.layer--mid {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.layer--fx {
  mix-blend-mode: screen;
  pointer-events: none;
}

.layer--tilt {
  filter: blur(var(--blur-tilt, 2px));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.65) 10%, transparent 26%, transparent 78%, rgba(0, 0, 0, 0.7) 92%, #000 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.65) 10%, transparent 26%, transparent 78%, rgba(0, 0, 0, 0.7) 92%, #000 100%);
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 75% at 50% 50%, transparent 55%, rgba(4, 2, 14, 0.5) 100%);
}

.ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ui > * {
  pointer-events: none;
}

.ui .title,
.ui .title * {
  pointer-events: auto;
}

/* ================= HUD ================= */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.hud-tl,
.hud-tr,
.hud-bl,
.hud-br {
  position: absolute;
  display: flex;
  gap: 0.5em;
}

.hud-tl {
  top: 0.6em;
  left: 0.6em;
  flex-direction: column;
  align-items: flex-start;
}

.hud-tr {
  top: 0.6em;
  right: 0.6em;
  align-items: flex-start;
}

.hud-bl {
  left: 0.6em;
  bottom: 0.6em;
}

.hud-br {
  right: 0.6em;
  bottom: 0.6em;
  flex-direction: column;
  align-items: flex-end;
}

.hud .win,
.hud button {
  pointer-events: auto;
}

.hud-time {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.35em 0.8em;
  font-size: 0.9em;
}

.hud-night {
  font-family: var(--f-title);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.hud-clock {
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 2.8em;
}

.dawnbar {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.dawnbar__moon {
  display: inline-flex;
  width: 0.9em;
  height: 0.9em;
  color: #cfd8ff;
}

.dawnbar__moon svg {
  width: 100%;
  height: 100%;
}

.dawnbar__sun {
  color: #ffc26b;
  font-size: 0.9em;
}

.dawnbar__track {
  position: relative;
  width: 5em;
  height: 0.4em;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.dawnbar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #5b5fb8, #ffb86b);
}

.hud-light {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.35em 0.8em;
  font-size: 0.9em;
}

.lightbar {
  position: relative;
  width: 7em;
  height: 0.6em;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.lightbar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #d9862f, #ffe29a);
  box-shadow: 0 0 10px rgba(255, 200, 100, 0.6);
  transition: width 400ms ease;
}

.lightbar__fill.is-low {
  background: linear-gradient(90deg, #b8344a, #ff8a6a);
  animation: pulse-soft 0.9s ease-in-out infinite;
}

.lightbar__limit {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: #ff6a7a;
}

.lightbar__text {
  font-weight: 800;
  min-width: 2.6em;
}

@keyframes pulse-soft {
  50% {
    opacity: 0.6;
  }
}

.lamp-ico {
  display: inline-flex;
  width: 0.8em;
  height: 1.2em;
  color: #ffd27a;
  filter: drop-shadow(0 0 5px rgba(255, 190, 90, 0.9));
}

.lamp-ico svg {
  width: 100%;
  height: 100%;
}

.hud-map {
  padding: 0.25em;
  line-height: 0;
}

.minimap {
  width: 9.5em;
  height: 4.75em;
  image-rendering: pixelated;
}

.hud-btn {
  display: grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  padding: 0;
  cursor: pointer;
}

.hud-btn svg {
  width: 1.1em;
  height: 1.1em;
}

.status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.15em 0.6em;
  padding: 0.45em 0.8em 0.5em 0.5em;
  min-width: 13em;
}

.status .portrait {
  grid-row: span 3;
}

.abilities {
  display: flex;
  gap: 0.4em;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 34em;
}

.ability {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.15em;
  min-width: 5.6em;
  padding: 0.4em 0.6em 0.35em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(50, 80, 140, 0.88), rgba(16, 22, 50, 0.94));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 0.78em;
  letter-spacing: 0.03em;
  text-shadow: var(--shadow-text);
  cursor: pointer;
}

.ability:hover:not([disabled]),
.ability:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(140, 200, 255, 0.5);
  outline: none;
}

.ability[disabled] {
  opacity: 0.45;
  cursor: default;
}

.ability__key {
  position: absolute;
  top: 0.15em;
  left: 0.35em;
  font-family: var(--f-ui);
  font-size: 0.8em;
  color: var(--ink-dim);
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 3em;
  padding: 0.4em 1.4em 0.4em 0.8em;
  border: 2px solid #ffe29a;
  border-radius: 99px;
  background: linear-gradient(180deg, #f5d98e, #c0924a);
  color: #2b1b08;
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.15em;
  letter-spacing: 0.04em;
  box-shadow: 0 0 20px rgba(255, 210, 120, 0.55), 0 6px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  animation: action-in 250ms ease, breathe-glow 1.6s ease-in-out infinite;
}

.action .lamp-ico {
  color: #6a3a08;
  filter: none;
}

.action .op-sym {
  background: radial-gradient(circle at 35% 30%, #ffffff, #fff0c8 55%, #d8b060);
}

@keyframes action-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

@keyframes breathe-glow {
  50% {
    box-shadow: 0 0 32px rgba(255, 220, 140, 0.85), 0 6px 16px rgba(0, 0, 0, 0.5);
  }
}

.hub-go {
  display: grid;
  gap: 0.05em;
  padding: 0.6em 1.1em;
  text-align: right;
  cursor: pointer;
  border-color: #ffe29a;
}

.hub-go:hover,
.hub-go:focus-visible {
  box-shadow: 0 0 20px rgba(255, 210, 120, 0.5), 0 10px 30px rgba(0, 0, 0, 0.55);
  outline: none;
}

.hub-go__n {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: 1.3em;
  color: #fff3c9;
}

.hub-go__t {
  color: var(--ink-soft);
  font-style: italic;
}

.hub-go__cta {
  color: var(--gold);
  font-weight: 800;
}

.toasts {
  position: absolute;
  top: 0.6em;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.4em;
  width: min(90%, 30em);
  pointer-events: none;
}

.toast {
  padding: 0.45em 1em;
  text-align: center;
  font-weight: 700;
  animation: pop-in 300ms ease;
  transition: opacity 500ms ease, transform 500ms ease;
}

.toast--danger {
  border-color: #ff8a8a;
  color: #ffd6d0;
}

.toast--good {
  border-color: #86e3a4;
  color: #d8ffe4;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(-8px);
}

.indicators {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.indicator {
  position: absolute;
  width: 2.2em;
  height: 2.2em;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(40, 10, 50, 0.85);
  border: 2px solid #c080ff;
  box-shadow: 0 0 14px rgba(190, 120, 255, 0.7);
  animation: pulse 0.9s ease-in-out infinite;
}

.indicator[data-kind="lamp"] {
  border-color: #ff8aa0;
  box-shadow: 0 0 14px rgba(255, 110, 140, 0.8);
}

.indicator[data-kind="boss"] {
  border-color: #ff4a6a;
  background: rgba(80, 10, 30, 0.9);
}

.indicator__arrow {
  position: absolute;
  inset: 0;
}

.indicator__arrow::after {
  content: "";
  position: absolute;
  right: -0.55em;
  top: 50%;
  border-top: 0.4em solid transparent;
  border-bottom: 0.4em solid transparent;
  border-left: 0.5em solid #ffb0c0;
  transform: translateY(-50%);
}

.indicator__ico {
  display: inline-flex;
  justify-content: center;
  width: 0.8em;
  height: 1.1em;
  color: #ffd27a;
  font-weight: 900;
  line-height: 1.1;
}

.indicator[data-kind="boss"] .indicator__ico {
  color: #fff;
}

.indicator[data-kind="shadow"] .indicator__ico {
  color: #d8b0ff;
}

.indicator__ico svg {
  width: 100%;
  height: 100%;
}

/* shadow badges: operation + hearts */
.sbadge {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.12em 0.4em 0.12em 0.15em;
  border-radius: 99px;
  background: rgba(14, 8, 30, 0.82);
  border: 1px solid rgba(190, 150, 255, 0.55);
  font-size: 0.78em;
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.sbadge--boss {
  font-size: 0.95em;
  border-color: #ff7a9a;
}

.sbadge__state {
  padding: 0 0.3em;
  color: #bfe8ff;
  font-weight: 800;
}

.op-sym--small {
  width: 1.45em;
  height: 1.45em;
  font-size: 1em;
}

.hearts {
  display: inline-flex;
  gap: 0.05em;
  color: #4a3050;
  font-size: 0.95em;
}

.hearts .on {
  color: #ff6a8a;
  text-shadow: 0 0 6px rgba(255, 100, 140, 0.8);
}

/* the problem window */
.qpanel {
  position: absolute;
  left: 50%;
  bottom: 0.8em;
  transform: translateX(-50%);
  width: min(94%, 36em);
  padding: 0.7em 0.9em 0.9em;
  z-index: 30;
  animation: rise 220ms ease;
}

@keyframes rise {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
}

.is-tall .qpanel {
  width: calc(100% - 1em);
  bottom: 0.5em;
}

.q__title {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

/* floating text in the world */
.floater {
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: 1.5em;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 0 #000, 0 0 3px #000, 0 0 10px rgba(0, 0, 0, 0.6);
  animation: float-up 1.2s ease-out forwards;
}

.floater--dmg {
  color: #fff4c8;
}

.floater--big {
  font-size: 1.9em;
  color: #ffe08a;
}

.floater--good {
  color: var(--good);
}

.floater--bad {
  color: var(--bad);
}

.floater--info {
  font-size: 1.05em;
  color: #d8e8ff;
}

.floater--say {
  padding: 0.35em 0.7em;
  border-radius: 10px;
  background: rgba(255, 252, 240, 0.95);
  color: #2a2230;
  font-size: 0.9em;
  font-weight: 700;
  text-shadow: none;
  white-space: normal;
  width: max-content;
  max-width: 14em;
  animation: say 2.6s ease forwards;
}

@keyframes say {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%);
  }
  10%,
  85% {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
  100% {
    opacity: 0;
  }
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -110%) scale(1.15);
  }
  30% {
    transform: translate(-50%, -120%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -220%) scale(1);
  }
}

/* ================= Title ================= */

.title {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  padding: 1em 1em 1.6em;
}

.title .logo-block {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  align-self: center;
}

.title-menu {
  width: min(100%, 26em);
  padding-bottom: 0.3em;
}

/* hub menu inside a panel */
.hub-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5em;
}

.hub-menu .tile--go {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 0.8em;
  min-height: 2.8em;
  border-color: #ffe29a;
  background: linear-gradient(180deg, rgba(120, 96, 50, 0.75), rgba(46, 34, 20, 0.9));
  font-family: var(--f-title);
  font-size: 1.1em;
  letter-spacing: 0.04em;
}

.hub-menu .tile--go small {
  font-family: var(--f-ui);
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
}

.hub-menu .tile {
  min-height: 2.6em;
  flex-direction: row;
  gap: 0.5em;
  font-weight: 700;
}

.hub-menu .tile svg {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  color: var(--gold);
}

.ico {
  display: inline-flex;
}

/* dialog */
.dialog {
  position: absolute;
  left: 50%;
  bottom: 0.8em;
  transform: translateX(-50%);
  width: min(94%, 40em);
  z-index: 50;
}

/* small screens */
.is-small .status {
  min-width: 0;
  font-size: 0.85em;
}

.is-small .minimap {
  width: 7em;
  height: 3.5em;
}

.is-small .ability {
  min-width: 4.4em;
  font-size: 0.7em;
}

.is-tall .hud-tl {
  flex-direction: column;
}

.is-tall .hud-bl {
  bottom: auto;
  top: 6.4em;
}

.is-tall .hud-bl .status {
  font-size: 0.8em;
}

.is-tall .abilities {
  max-width: 100%;
}

.is-tall .hud-br {
  left: 0.6em;
  align-items: stretch;
}

.is-tall .action {
  align-self: flex-end;
}

.is-tall .answers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.is-tall .keypad__keys {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.bp {
  display: flex;
  align-items: center;
  gap: 0.25em;
  font-size: 0.85em;
}

.results__ops {
  display: block;
  color: var(--ink-soft);
  font-size: 0.9em;
  margin-top: 0.2em;
}

.results__small {
  color: var(--ink-soft);
  font-size: 0.95em;
}

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

.results__level {
  font-size: 1.4em;
}

.is-tall .toasts {
  top: 11.5em;
}

.is-tall .hub-go {
  align-self: flex-end;
}
