@charset "UTF-8";
:root {
  color-scheme: dark;
  /* Palette : nuit sidérale, nébuleuse, or stellaire et lune. Toutes les surfaces en dérivent. */
  --ink: #070B21;
  --panel: #14152E;
  --gold: #E4C777;
  --gold-bright: #FFF0BB;
  --gold-deep: #A58B51;
  --text: #E8EDFF;
  --text-soft: #CDD3EB;
  --muted: #AAB6D9;
  --faint: #8390BA;
  /* Réservée au danger : aucun lieu n'utilise ce cramoisi, il ne se fond jamais. */
  --danger: #ff3b5c;
  --danger-soft: #ff7a8e;
  --ice: #bff0ff;
  --line: #d7c29b4f;
  --line-soft: #d7c29b22;
  /* Cadre commun : filet d'or, liseré sombre, halo intérieur. */
  --frame-border: 1px solid #697090;
  --frame-inset: inset 0 0 0 2px #070819, inset 0 0 0 3px #cfbb9644;
  /* Rôles typographiques : Cinzel pour titres, libellés et boutons ;
     EB Garamond, embarquée, pour les phrases et tous les chiffres (figures
     alignées, un « 1 » qui ne se confond pas avec le « I » romain).
     Aucun texte sous 12 px ; les phrases en EB Garamond commencent à 14 px. */
  --display: "Cinzel", Georgia, serif;
  --serif: "EB Garamond", Georgia, "Palatino Linotype", "Book Antiqua", serif;
  --numeric: "EB Garamond", Georgia, serif;
}
.num {
  font-family: var(--numeric);
  font-variant-numeric: lining-nums tabular-nums;
}
.sr-only,
.svg-defs {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
}
body {
  font-size: 16px;
}
/* Nothing in Mystical scrolls, from a phone held sideways to a large screen:
   what is too long turns into pages, never into a scrollbar. */
html {
  overflow: hidden;
  overscroll-behavior: none;
}
body,
#app {
  overflow: clip;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 4px;
}
button {
  touch-action: manipulation;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
::selection {
  background: #343e7e;
  color: #ffffff;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
}
button {
  border: 0;
  background: none;
}
strong {
  font-weight: 600;
}
small {
  font-size: 13px;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
/* Glyphes gravés : traits dorés épais, formes pleines et entailles sombres. */
svg.glyph {
  stroke: url(#ico-gold);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.9));
  overflow: visible;
}
svg.glyph .fill {
  fill: url(#ico-gold);
  stroke: #10132d;
  stroke-width: 0.8;
}
svg.glyph .cut {
  stroke: #10132d;
  stroke-width: 1.8;
  fill: none;
}
.button.primary svg.glyph {
  stroke: currentColor;
  filter: drop-shadow(0 1px 0 #070b21);
}
.button.primary svg.glyph .fill {
  fill: currentColor;
  stroke: none;
}
button svg {
  pointer-events: none;
}
#app {
  height: 100dvh;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.serif {
  font-family: var(--serif);
}
.boot-screen {
  height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 20px;
}
.boot-screen h1 {
  font-size: 70px;
  letter-spacing: 0.12em;
}
.sigil {
  font-size: 52px;
  color: var(--gold);
}
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4.3vw;
  border-bottom: 1px solid rgba(214, 193, 155, 0.16);
  position: relative;
  z-index: 2;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.15em;
  font: 20px var(--display);
  color: var(--gold-bright);
}
.brand-mark {
  font-size: 33px;
  line-height: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 12px;
  color: #d2be98;
}
.profile-button svg {
  color: var(--gold);
}
.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--gold);
  background: #0a0c1f55;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #d7c29b16;
  border-color: #d7c29b88;
}
.button {
  min-height: 46px;
  padding: 13px 24px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #181d41aa, #0c0f25aa);
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.button:hover {
  border-color: var(--gold);
  background: #1f2650;
}
.button.primary {
  color: #11142f;
  background: linear-gradient(135deg, #edd5a9, #c3b18f);
  border-color: #ebd3a8;
  box-shadow: 0 3px 22px #c0ae8d20;
}
.button.primary:hover {
  background: #f1d9ab;
  transform: translateY(-1px);
}
.button.danger {
  color: #e8d1a6;
  border-color: #61678677;
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.text-button:hover {
  color: var(--gold-bright);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  color: var(--muted);
  font-size: 12px;
}
.back-link svg {
  width: 17px;
}
.back-link:hover {
  color: var(--gold);
}
.home {
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #0d0f26 url("../assets/backgrounds/menu.png") center 45% / cover
    no-repeat;
}
.home:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      #07091ac7 0%,
      #080a1c42 22%,
      #07081870 65%,
      #08091a 100%
    ),
    linear-gradient(
      90deg,
      #06071677,
      transparent 35%,
      transparent 65%,
      #06071677
    );
  pointer-events: none;
}
.home .topbar {
  border: 0;
}
.home-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 191px);
  text-align: center;
  padding: 36px 24px 45px;
}
.home-title {
  font-size: clamp(76px, 10vw, 154px);
  letter-spacing: 0.085em;
  line-height: 0.93;
  text-shadow:
    0 3px 35px #000000,
    0 1px 0 #f3daad;
  color: #e4cda3;
  margin-left: 0.08em;
  font-weight: 400;
}
.home-subtitle {
  margin: 19px 0 22px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 12px;
  color: #e7d0a5;
}
.title-rule {
  width: 170px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 0 0 22px;
  color: #c3b18f;
  font-size: 16px;
}
.title-rule:before,
.title-rule:after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #b6a587);
  flex: 1;
}
.title-rule:after {
  transform: rotate(180deg);
}
.home-primary-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 31px;
}
.home-primary-actions .button {
  min-width: 224px;
  min-height: 54px;
}
.journey-progress {
  margin-top: 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.home-bottom {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: auto;
  padding: 0 40px 25px;
}
.home-nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 12px 0;
}
.home-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #cab793;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 12px;
}
.home-nav button svg {
  color: #bdab8b;
  width: 17px;
}
.home-nav button:hover {
  color: var(--gold-bright);
}
.ember {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #f2daac;
  border-radius: 50%;
  box-shadow: 0 0 9px #ead3a7;
  bottom: 10%;
  opacity: 0;
  animation: ember 8s infinite ease-out;
  pointer-events: none;
}
.ember:nth-child(2) {
  left: 25%;
  animation-delay: 2s;
}
.ember:nth-child(3) {
  left: 70%;
  animation-delay: 4s;
}
.ember:nth-child(4) {
  left: 52%;
  animation-delay: 1s;
}
.ember:nth-child(5) {
  left: 83%;
  animation-delay: 6s;
}
@keyframes ember {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  100% {
    transform: translate(50px, -600px);
    opacity: 0;
  }
}
.page {
  height: 100dvh;
  background:
    radial-gradient(ellipse at 90% 0, #1c214855, transparent 50%), #0c0e23;
}

.realm-feature {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 42px;
}
.realm-art {
  height: 530px;
  position: relative;
  background-color: #10132d;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 32px 27px;
  overflow: hidden;
}
.realm-art:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 18%, #07091aeb 92%);
}
.realm-art > * {
  position: relative;
}
.realm-art .eyebrow {
  font-size: 12px;
}
.realm-art h2 {
  font-size: 42px;
  margin: 13px 0;
}
.realm-art p {
  font: 14px/1.8 var(--serif);
  color: #ccc5ba;
}
.realm-art .realm-stats {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #bbaa8a;
  display: flex;
  justify-content: space-between;
}
.stage-list-head {
  display: grid;
  grid-template-columns: 1fr 90px 80px 100px;
  color: #616786;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px 17px;
  border-bottom: 1px solid var(--line);
}
.stage-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 90px 80px 100px;
  align-items: center;
  min-height: 48px;
  padding: 7px 16px;
  text-align: left;
  border-bottom: 1px solid #d7c29b12;
}
.stage-row:hover:not(:disabled) {
  background: #d7c29b0a;
}
.stage-row.current {
  background: #d7c29b0b;
  border-left: 2px solid var(--gold);
  padding-left: 14px;
}
.stage-name {
  display: flex;
  align-items: center;
  gap: 13px;
  font: 15px var(--display);
}
.stage-number {
  font: 12px var(--display);
  color: #5c617e;
  width: 23px;
}
.stage-row.current .stage-number {
  color: var(--gold);
}
.stage-metric {
  font-size: 12px;
  color: #beb6a9;
}
.stage-record {
  color: var(--gold);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stage-record svg {
  height: 15px;
  width: 15px;
}
.stage-row:disabled {
  opacity: 0.38;
}
.realm-note {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 18px;
  color: #636988;
}

.artifact-icon {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  vertical-align: middle;
  container-type: size;
}
.artifact-crop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
}
.artifact-crop img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
}
@supports (width: 1cqw) {
  .artifact-crop {
    width: calc(min(100cqw, 100cqh) * var(--crop-width)) !important;
    height: calc(min(100cqw, 100cqh) * var(--crop-height)) !important;
  }
}
.medal {
  color: var(--gold);
}
.medal.silver {
  color: #bfcbd0;
}
.medal.bronze {
  color: #c6b391;
}
.empty-record {
  color: #39458b;
}
.game-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
}
.game-page:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #090b1dec,
    #0b0d21d1 25%,
    #090b1dde 85%,
    #070919eb
  );
  pointer-events: none;
}
.game-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 62px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.game-location {
  display: flex;
  align-items: center;
  gap: 16px;
}
.game-location .brand {
  font-size: 18px;
}
.game-location .brand-mark {
  font-size: 27px;
}
.game-location .separator {
  height: 22px;
  width: 1px;
  background: var(--line);
}
.game-location-name {
  font: 15px var(--display);
  color: #ccc4b7;
}
.game-location-name small {
  font: 12px var(--display);
  color: #676d8e;
  margin-left: 10px;
}
.game-actions {
  display: flex;
  gap: 7px;
}
.game-actions .icon-button {
  border: 0;
  width: 40px;
  height: 44px;
}
.game-table {
  position: relative;
  margin: auto;
  flex-shrink: 0;
}
.game-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 2.3fr 1fr 1fr;
  align-items: center;
  gap: 14px;
  height: 103px;
}
.hud-stat {
  text-align: center;
}
.hud-stat .label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #71789b;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.hud-stat .value {
  font: 27px var(--display);
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.hud-stat .detail {
  display: block;
  font-size: 12px;
  color: #636988;
  margin-top: 5px;
}
.hud-stat .value.danger {
  color: #ebd3a8;
}
.family-focus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 5px;
}
.family-focus-content {
  min-width: 0;
  flex: 1;
  text-align: center;
}
.family-focus-title {
  display: flex;
  justify-content: center;
  gap: 9px;
  align-items: center;
  font: 13px var(--display);
  color: #ccc4b8;
  margin-bottom: 6px;
  white-space: nowrap;
}
.family-focus-title small {
  font: 12px var(--display);
  color: var(--muted);
}
.family-focus .icon-button {
  width: 30px;
  height: 46px;
  border: none;
  background: transparent;
}
.family-focus-icons {
  display: flex;
  gap: 9px;
  justify-content: center;
}
.family-focus-item .artifact-icon {
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
}
.objective-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.objective-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2f3874;
}
.objective-dot.complete {
  background: #d4bf99;
  box-shadow: 0 0 5px #d4bf9955;
}
.board-frame {
  position: relative;
  padding: 6px;
  background: linear-gradient(
    135deg,
    #3a458c55,
    #131633cc 16%,
    #232b5a99 65%,
    #646a8955
  );
  border: 1px solid #676d8e57;
  box-shadow:
    0 10px 45px #00000066,
    inset 0 0 0 2px #07081966;
}
.board-frame:before,
.board-frame:after {
  content: "✦";
  position: absolute;
  top: -10px;
  font-size: 16px;
  color: #beac8c;
  z-index: 1;
}
.board-frame:before {
  left: -7px;
}
.board-frame:after {
  right: -7px;
}
#board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 20/7;
  touch-action: none;
  outline-offset: -3px;
}
.bag-slots {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}
.bag-slot {
  position: relative;
  height: clamp(36px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#08091abd, #1b204682);
  border: 1px solid #c5b29029;
  box-shadow: inset 0 2px 9px #00000055;
}
.bag-slot:empty:before {
  content: "·";
  font: 18px var(--serif);
  color: #4350a143;
}
.bag-slot .artifact-icon {
  height: 100%;
  width: 100%;
  max-width: 55px;
}
.bag-slot.filled {
  border-color: #c3b18f55;
}
.bag-slot small {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 12px;
  color: #f1d9ab;
  background: #0f132ccc;
  padding: 1px 2px;
}
.resource-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 5px;
}
.resource-button,
.resource-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  flex: 1;
  padding: 3px 12px;
  background: linear-gradient(135deg, #242b5c88, #10132d88);
  border: 1px solid #6f76992e;
  position: relative;
  max-width: 210px;
}
.resource-button:hover:not(:disabled) {
  border-color: #d7c29b99;
  background: #2a336977;
}
.resource-button .artifact-icon,
.resource-display .artifact-icon {
  width: 33px;
  height: 33px;
}
.resource-text {
  text-align: left;
  min-width: 0;
}
.resource-text .resource-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #72799d;
  white-space: nowrap;
}
.resource-text .resource-value {
  display: block;
  font: 20px var(--display);
  color: #e0caa1;
}
.resource-button kbd {
  position: absolute;
  right: 5px;
  bottom: 5px;
  font: 12px var(--display);
  color: #5f6583;
}
.resource-button.active {
  border-color: #c0ae8d77;
}
.resource-button.active .resource-value {
  font-size: 13px;
  color: #cdb995;
}
.game-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #565c77;
  padding: 0 28px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.wall-status {
  display: flex;
  align-items: center;
  gap: 7px;
}
.wall-track {
  height: 3px;
  width: 55px;
  background: #51567033;
}
.wall-track i {
  display: block;
  height: 100%;
  background: #b8a788;
}
.status-note {
  color: #cfbb96;
}
.orientation-note {
  display: none;
}
.canvas-help {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #030410cb;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: clip;
  backdrop-filter: blur(10px);
  animation: fade-in 0.16s ease-out;
}
.modal {
  width: min(580px, 100%);
  flex: none;
  /* Never a scroll container: fitDialog() turns long content into pages and
     draws what is still a little too tall slightly smaller. */
  scale: var(--fit, 1);
  background:
    radial-gradient(ellipse at 50% 0, #262e6055, transparent 50%), #11142f;
  border: 1px solid #c1af8e77;
  box-shadow:
    0 25px 120px #000000bb,
    inset 0 0 0 5px #080a1c77;
  position: relative;
  padding: 40px;
}
.modal.wide {
  width: min(850px, 100%);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
}
.modal-heading {
  text-align: center;
  margin-bottom: 26px;
  padding: 0 15px;
}
.modal-heading .eyebrow {
  font-size: 12px;
}
.modal-heading h2 {
  font-size: 36px;
  margin-top: 11px;
}
.modal-heading p {
  font: 15px/1.65 var(--serif);
  color: #b7a687;
  margin-top: 13px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
}
.modal-actions .button {
  flex: 1;
  white-space: nowrap;
}
.modal-actions.stacked {
  flex-direction: column;
}
.modal-actions .text-button {
  justify-content: center;
}
.modal-copy {
  font-size: 13px;
  line-height: 1.8;
  color: #c3b18f;
}
.modal-copy p + p {
  margin-top: 15px;
}
.modal-copy strong {
  color: #f2daac;
}
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.tutorial-step {
  text-align: center;
}
.tutorial-step h3 {
  font-size: 18px;
  margin-bottom: 7px;
}
.tutorial-step p {
  font-size: 12px;
  line-height: 1.6;
  color: #b8a788;
}
.stage-objectives {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.stage-objectives strong {
  display: block;
  font: 25px var(--display);
  color: var(--gold-bright);
  margin-bottom: 5px;
}
.stage-objectives span {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #6f7699;
  text-transform: uppercase;
}
.tutorial-tip {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #bdab8b;
  text-align: center;
}
.result-emblem {
  text-align: center;
  margin-bottom: 8px;
}
.result-emblem .artifact-icon {
  width: 110px;
  height: 110px;
}
.result-emblem.silver .artifact-icon {
  filter: grayscale(1) brightness(1.12);
}
.result-emblem.bronze .artifact-icon {
  filter: sepia(0.55) saturate(0.85) brightness(0.76);
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  margin: 26px 0;
  padding: 23px 0;
  border-block: 1px solid var(--line);
  gap: 10px;
}
.result-stats strong {
  display: block;
  font: 26px var(--display);
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.result-stats span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.stage-reserves {
  margin: 10px 0;
  padding: 8px 10px;
  border-block: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}
.stage-reserves p {
  margin: 0 0 5px;
  color: var(--muted);
}
.stage-reserves ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stage-reserves li { white-space: nowrap; }
.stage-reserves strong { color: var(--gold-bright); }
.result-note {
  text-align: center;
  font: 15px/1.7 var(--serif);
  color: #bdab8b;
}
.rules-list {
  counter-reset: rules;
  display: grid;
  gap: 18px;
}
.rule-row {
  display: flex;
  gap: 18px;
  align-items: start;
}
.rule-row > .artifact-icon {
  width: 45px;
  height: 45px;
  border: 1px solid var(--line);
}
.rule-row h3 {
  font-size: 19px;
  margin: 0 0 6px;
  color: #e4cda3;
}
.rule-row p {
  font-size: 12px;
  line-height: 1.75;
  color: #baa989;
}
.rule-bonus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 25px;
  margin-top: 25px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.rule-bonus-grid .rule-row {
  gap: 10px;
}
.rule-bonus-grid .rule-row > .artifact-icon {
  width: 38px;
  height: 38px;
}
.rule-bonus-grid h3 {
  font-size: 15px;
}
.rule-bonus-grid p {
  font-size: 12px;
}
.keyboard-hints {
  font-size: 12px;
  color: #6f7699;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
  line-height: 2;
}
.keyboard-hints kbd {
  border: 1px solid #c8b59244;
  padding: 3px 5px;
  margin: 0 3px;
  color: #dac59d;
  font: 12px var(--display);
}
.settings-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.settings-row label,
.settings-label {
  font-size: 13px;
  color: #d5cbbc;
  line-height: 1.7;
}
.settings-row small {
  display: block;
  font-size: 12px;
  color: #616785;
}
.settings-row input[type="range"] {
  width: 160px;
  accent-color: #cfbb96;
}
.settings-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: #cab793;
}
.storage-note {
  margin: 17px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.profile-list {
  display: grid;
  gap: 8px;
  margin-bottom: 23px;
}
.profile-row {
  padding: 13px 16px;
  display: flex;
  gap: 15px;
  align-items: center;
  border: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.profile-row.selected {
  border-color: #c3b18f88;
  background: #686f8f17;
}
.profile-row .profile-avatar {
  font: 25px var(--display);
  color: var(--gold);
  width: 34px;
}
.profile-row .profile-info {
  flex: 1;
}
.profile-row strong {
  display: block;
  font: 17px var(--display);
  margin-bottom: 5px;
}
.profile-row small {
  font-size: 12px;
  color: var(--muted);
}
.profile-check {
  color: #c9b693;
}
.profile-form {
  display: flex;
  gap: 8px;
}
.profile-form input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  background: #08091a;
  color: #e4cda3;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 12px;
}
.profile-form .button {
  padding-inline: 17px;
}
.form-error {
  font-size: 12px;
  line-height: 1.6;
  color: #e2cca2;
  margin-top: 12px;
  min-height: 18px;
}
.storage-warning {
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #313b792b;
  color: #d5c09a;
  font-size: 12px;
  border-bottom: 1px solid #52577155;
  position: relative;
  z-index: 3;
}
.storage-warning button {
  text-decoration: underline;
  min-height: 32px;
}
.import-summary {
  padding: 17px;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.8;
  color: #c4b290;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  padding: 13px 23px;
  background: #191d41f5;
  border: 1px solid #737a9e77;
  box-shadow: 0 8px 35px #00000088;
  color: #ead3a7;
  font-size: 12px;
  max-width: calc(100vw - 40px);
  text-align: center;
  transition:
    opacity 0.18s,
    transform 0.18s;
  line-height: 1.5;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (min-width: 1600px) {
  .home-main {
    padding-bottom: 75px;
  }
  .game-hud {
    height: 117px;
  }
  .game-hud .value {
    font-size: 32px;
  }
  .family-focus-item .artifact-icon {
    width: 52px;
    height: 52px;
  }
  .resource-bar {
    margin-top: 16px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding-inline: 28px;
    height: 74px;
  }
  .home-main {
    min-height: calc(100dvh - 187px);
  }
  .home-title {
    font-size: 108px;
  }
  .realm-feature {
    grid-template-columns: 255px 1fr;
    gap: 25px;
  }
  .realm-art {
    padding: 25px 20px;
  }
  .realm-art h2 {
    font-size: 35px;
  }

  .stage-list-head,
  .stage-row {
    grid-template-columns: 1fr 70px 65px 70px;
    padding-inline: 10px;
  }
  .stage-row.current {
    padding-left: 8px;
  }
  .game-topbar {
    height: 54px;
    padding-inline: 18px;
  }
  .game-hud {
    height: 96px;
    gap: 7px;
  }
  .game-footer {
    padding: 0 18px;
  }
  .resource-button,
  .resource-display {
    padding-inline: 7px;
    gap: 7px;
    min-height: 45px;
  }
  .resource-text .resource-label {
    font-size: 12px;
  }
  .resource-button .artifact-icon,
  .resource-display .artifact-icon {
    width: 29px;
    height: 29px;
  }
  .resource-text .resource-value {
    font-size: 19px;
  }
  .family-focus-title {
    font-size: 12px;
  }
  .family-focus-icons {
    gap: 5px;
  }
  .family-focus-item .artifact-icon {
    width: 39px;
    height: 39px;
  }
  .hud-stat .value {
    font-size: 24px;
  }
  .bag-slots {
    gap: 4px;
  }
  .game-location-name {
    font-size: 13px;
  }
  .game-location-name small {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 66px;
    padding-inline: 20px;
  }
  .brand {
    font-size: 17px;
  }
  .brand-mark {
    font-size: 28px;
  }
  .topbar-right {
    gap: 12px;
  }
  .home-main {
    min-height: calc(100dvh - 163px);
    padding: 30px 20px;
  }
  .home-title {
    font-size: clamp(52px, 14vw, 104px);
  }
  .home-subtitle {
    font-size: 12px;
    letter-spacing: 0.27em;
    margin-top: 16px;
  }
  .home-primary-actions {
    margin-top: 25px;
    gap: 10px;
  }
  .home-primary-actions .button {
    min-width: 210px;
  }
  .home-bottom {
    padding-inline: 20px;
    padding-bottom: 20px;
  }
  .home-nav {
    gap: 12px;
    justify-content: space-between;
  }
  .home-nav button {
    font-size: 12px;
    letter-spacing: 0.08em;
    gap: 6px;
    flex-direction: column;
    padding: 4px;
  }
  .home-nav button svg {
    height: 16px;
  }

  .realm-feature {
    display: block;
  }
  .realm-art {
    height: 210px;
    margin-bottom: 22px;
    padding: 20px;
    background-position: center 40%;
  }
  .realm-art h2 {
    font-size: 34px;
    margin: 8px 0;
  }
  .realm-art p {
    font-size: 13px;
    max-width: 350px;
  }
  .realm-art .realm-stats {
    position: absolute;
    right: 20px;
    top: 14px;
    gap: 15px;
    font-size: 12px;
    padding: 0;
    border: 0;
    margin: 0;
  }
  .stage-list-head,
  .stage-row {
    grid-template-columns: 1fr 64px 54px 67px;
    padding-inline: 8px;
  }
  .stage-name {
    font-size: 13px;
    gap: 5px;
  }
  .stage-row {
    min-height: 53px;
  }
  .stage-metric {
    font-size: 12px;
  }
  .stage-list-head {
    font-size: 12px;
  }

  .modal-backdrop {
    padding: 14px;
  }
  .modal {
    padding: 34px 22px;
  }
  .modal-heading h2 {
    font-size: 31px;
  }
  .modal-heading p {
    font-size: 14px;
  }
  .tutorial-grid {
    gap: 12px;
  }
  .tutorial-step h3 {
    font-size: 16px;
  }
  .tutorial-step p {
    font-size: 12px;
  }
  .tutorial-step .tile-plaque,
  .tutorial-step .tile-medallion {
    height: 48px;
    width: 48px;
  }
  .stage-objectives {
    gap: 20px;
  }
  .stage-objectives strong {
    font-size: 23px;
  }
  .stage-objectives span {
    font-size: 12px;
  }
  .modal-actions .button {
    font-size: 12px;
    padding-inline: 15px;
  }
  .rule-bonus-grid {
    grid-template-columns: 1fr;
  }
  .settings-row input[type="range"] {
    width: 130px;
  }
  .profile-form .button {
    font-size: 12px;
    padding-inline: 10px;
  }
  .game-topbar {
    height: 47px;
    padding-inline: 12px;
  }
  .game-location .brand {
    font-size: 15px;
  }
  .game-location .brand-mark {
    font-size: 23px;
  }
  .game-location {
    gap: 9px;
  }
  .game-location-name {
    font-size: 12px;
  }
  .game-location-name small {
    margin-left: 4px;
  }
  .game-hud {
    height: 81px;
    gap: 5px;
  }
  .hud-stat .label {
    font-size: 12px;
    letter-spacing: 0.1em;
  }
  .hud-stat .value {
    font-size: 19px;
  }
  .hud-stat .detail {
    font-size: 12px;
  }
  .family-focus {
    gap: 1px;
  }
  .family-focus .icon-button {
    width: 22px;
    min-width: 22px;
    padding: 0;
  }
  .family-focus-title {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .family-focus-title small {
    display: none;
  }
  .family-focus-icons {
    gap: 3px;
  }
  .family-focus-item .artifact-icon {
    height: 30px;
    width: 30px;
  }
  .objective-dots {
    gap: 3px;
    margin-top: 2px;
  }
  .objective-dot {
    height: 3px;
    width: 3px;
  }
  .board-frame {
    padding: 4px;
  }
  .bag-slot {
    height: 31px;
  }
  .resource-bar {
    gap: 4px;
    margin-top: 8px;
  }
  .resource-button,
  .resource-display {
    padding: 2px 4px;
    gap: 3px;
    min-height: 40px;
  }
  .resource-button .artifact-icon,
  .resource-display .artifact-icon {
    width: 23px;
    height: 23px;
  }
  .resource-text .resource-label {
    font-size: 12px;
    letter-spacing: 0;
  }
  .resource-text .resource-value {
    font-size: 16px;
  }
  .resource-button kbd {
    display: none;
  }
  .resource-button.active .resource-value {
    font-size: 12px;
  }
  .game-footer {
    padding: 0 12px;
    font-size: 12px;
  }
  .game-actions {
    gap: 0;
  }
  .game-actions .icon-button {
    width: 34px;
    height: 42px;
  }
  .game-actions svg {
    width: 17px;
  }
}
@media (orientation: portrait) {
  .game-page {
    overflow: hidden;
  }
  .game-table {
    margin: 24px auto;
  }
  .game-hud {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    height: 145px;
    align-content: start;
    row-gap: 12px;
  }
  .family-focus {
    grid-column: 1/-1;
    grid-row: 2;
    border: 0;
  }
  .family-focus-icons {
    gap: 12px;
  }
  .family-focus-item .artifact-icon {
    width: 41px;
    height: 41px;
  }
  .family-focus-title {
    font-size: 13px;
  }
  .family-focus .icon-button {
    width: 44px;
  }
  .family-focus-content {
    flex: 0 1 210px;
  }
  .family-focus-title small {
    display: inline;
  }
  .hud-stat {
    padding-top: 5px;
  }
  .game-hud .hud-stat:nth-last-child(2) {
    grid-column: 3;
    grid-row: 1;
  }
  .game-hud .hud-stat:last-child {
    grid-column: 4;
    grid-row: 1;
  }
  .orientation-note {
    position: relative;
    display: block;
    text-align: center;
    padding: 10px 18px;
    font-size: 12px;
    line-height: 1.6;
    background: #c4b29020;
    border-bottom: 1px solid var(--line);
    color: #d2be98;
  }
  .bag-slots {
    grid-template-columns: repeat(15, minmax(0, 1fr));
    gap: 2px;
  }
  .bag-slot {
    height: 33px;
  }
  .resource-bar {
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
  }
  .resource-button,
  .resource-display {
    flex: 1 1 28%;
    min-height: 51px;
    gap: 10px;
  }
  .resource-button .artifact-icon,
  .resource-display .artifact-icon {
    width: 31px;
    height: 31px;
  }
  .resource-text .resource-label {
    font-size: 12px;
  }
  .resource-text .resource-value {
    font-size: 19px;
  }
  .game-topbar .game-location-name {
    display: none;
  }
  .game-table .game-hud {
    margin-bottom: 12px;
  }
  .board-frame {
    overflow: hidden;
  }
  .game-footer {
    margin-top: auto;
  }
}

.settings-row select {
  max-width: 48%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #121632;
  color: #e6cfa5;
}
