@charset "UTF-8";
:root {
  color-scheme: dark;
  /* Palette : basalte immergé, bronze et nacre. Toutes les surfaces en dérivent. */
  --ink: #03131D;
  --panel: #0B2833;
  --gold: #C4AE75;
  --gold-bright: #E6F3EC;
  --gold-deep: #8b996d;
  --text: #E6F3EC;
  --text-soft: #c3dedb;
  --muted: #9fbdbf;
  --faint: #78999e;
  /* Réservée au danger : aucun lieu n'utilise ce cramoisi, il ne se fond jamais. */
  --danger: #ff3b5c;
  --danger-soft: #ff7a8e;
  --ice: #bff0ff;
  --line: #49c9c14f;
  --line-soft: #49c9c122;
  /* Cadre commun : filet d'or, liseré sombre, halo intérieur. */
  --frame-border: 1px solid #5ea49b;
  --frame-inset: inset 0 0 0 2px #091011, inset 0 0 0 3px #92cfc744;
  /* 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: #40646a;
  color: #fff;
}
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: #12262a;
  stroke-width: 0.8;
}
svg.glyph .cut {
  stroke: #12262a;
  stroke-width: 1.8;
  fill: none;
}
.button.primary svg.glyph {
  stroke: #19353a;
  filter: drop-shadow(0 1px 0 rgba(208, 255, 249, 0.45));
}
.button.primary svg.glyph .fill {
  fill: #19353a;
  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(162, 214, 207, 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: #c1d2d0;
}
.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: #100f0e55;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #a2d7d016;
  border-color: #a2d7d088;
}
.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, #222a2baa, #111617aa);
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
.button:hover {
  border-color: var(--gold);
  background: #2c3537;
}
.button.primary {
  color: #151f21;
  background: linear-gradient(135deg, #beede7, #8bc3bc);
  border-color: #c3ebe6;
  box-shadow: 0 3px 22px #7cc0b720;
}
.button.primary:hover {
  background: #c4f1eb;
  transform: translateY(-1px);
}
.button.danger {
  color: #e8a697;
  border-color: #68989277;
}
.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: #111718 url("../assets/backgrounds/menu.png") center 45% / cover
    no-repeat;
}
.home:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      #0a0d0ec7 0%,
      #0b101142 22%,
      #070e0f70 65%,
      #0a0d0e 100%
    ),
    linear-gradient(
      90deg,
      #070a0b77,
      transparent 35%,
      transparent 65%,
      #070a0b77
    );
  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 #000,
    0 1px 0 #c3f3ed;
  color: #b5e4de;
  margin-left: 0.08em;
  font-weight: 400;
}
.home-subtitle {
  margin: 19px 0 22px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 12px;
  color: #d0e7e4;
}
.title-rule {
  width: 170px;
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 0 0 22px;
  color: #92c3bc;
  font-size: 16px;
}
.title-rule:before,
.title-rule:after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #82b6af);
  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: #9dacaa;
  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: #bbcac8;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 12px;
}
.home-nav button svg {
  color: #8ebdb7;
  width: 17px;
}
.home-nav button:hover {
  color: var(--gold-bright);
}
.ember {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #a6f2e8;
  border-radius: 50%;
  box-shadow: 0 0 9px #98eadf;
  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, #272f3155, transparent 50%), #101314;
}

.realm-feature {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 42px;
}
.realm-art {
  height: 530px;
  position: relative;
  background-color: #161c1d;
  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%, #0a0d0eeb 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: #a4bbb8;
  display: flex;
  justify-content: space-between;
}
.stage-list-head {
  display: grid;
  grid-template-columns: 1fr 90px 80px 100px;
  color: #8a9896;
  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 #a2d7d012;
}
.stage-row:hover:not(:disabled) {
  background: #a2d7d00a;
}
.stage-row.current {
  background: #a2d7d00b;
  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: #808f8d;
  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: #9a9286;
}

.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: #92c6bf;
}
.empty-record {
  color: #535d5f;
}
.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(
    #0c0f10ec,
    #0d1516d1 25%,
    #0c1112de 85%,
    #0a0d0deb
  );
  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: #8ea19f;
  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: #a0b0ae;
  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: #899b99;
  margin-top: 5px;
}
.hud-stat .value.danger {
  color: #a8ebe2;
}
.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: #434f51;
}
.objective-dot.complete {
  background: #9bd4cc;
  box-shadow: 0 0 5px #9bd4cc55;
}
.board-frame {
  position: relative;
  padding: 6px;
  background: linear-gradient(
    135deg,
    #50646855,
    #1a2021cc 16%,
    #2e414499 65%,
    #6c9c9655
  );
  border: 1px solid #6aa19a57;
  box-shadow:
    0 10px 45px #0006,
    inset 0 0 0 2px #0a0c0c66;
}
.board-frame:before,
.board-frame:after {
  content: "✦";
  position: absolute;
  top: -10px;
  font-size: 16px;
  color: #93beb8;
  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(#0a0d0ebd, #252f3182);
  border: 1px solid #95c5bf29;
  box-shadow: inset 0 2px 9px #0005;
}
.bag-slot:empty:before {
  content: "·";
  font: 18px var(--serif);
  color: #5e727643;
}
.bag-slot .artifact-icon {
  height: 100%;
  width: 100%;
  max-width: 55px;
}
.bag-slot.filled {
  border-color: #92c3bd55;
}
.bag-slot small {
  position: absolute;
  right: 3px;
  bottom: 2px;
  font-size: 12px;
  color: #c0f1ea;
  background: #161b1ccc;
  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, #31414488, #131f2188);
  border: 1px solid #83aea82e;
  position: relative;
  max-width: 210px;
}
.resource-button:hover:not(:disabled) {
  border-color: #a2d7d099;
  background: #354f5477;
}
.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: #a3b2b0;
  white-space: nowrap;
}
.resource-text .resource-value {
  display: block;
  font: 20px var(--display);
  color: #c8e0dd;
}
.resource-button kbd {
  position: absolute;
  right: 5px;
  bottom: 5px;
  font: 12px var(--display);
  color: #7f9592;
}
.resource-button.active {
  border-color: #93c0ba77;
}
.resource-button.active .resource-value {
  font-size: 13px;
  color: #a2cdc7;
}
.game-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #748785;
  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: #5a797f33;
}
.wall-track i {
  display: block;
  height: 100%;
  background: #8bb8b2;
}
.status-note {
  color: #aacfca;
}
.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: #030607cb;
  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, #32464955, transparent 50%), #161e1f;
  border: 1px solid #8ec1ba77;
  box-shadow:
    0 25px 120px #000b,
    inset 0 0 0 5px #0b101177;
  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: #a8b7b5;
  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: #b5c3c1;
}
.modal-copy p + p {
  margin-top: 15px;
}
.modal-copy strong {
  color: #d4f2ee;
}
.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: #a8b8b6;
}
.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: #9caeac;
  text-transform: uppercase;
}
.tutorial-tip {
  margin: 18px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: #abbdbb;
  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: #acbdbb;
}
.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: #bce4df;
}
.rule-row p {
  font-size: 12px;
  line-height: 1.75;
  color: #aabab8;
}
.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: #9caeac;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
  line-height: 2;
}
.keyboard-hints kbd {
  border: 1px solid #9bc8c244;
  padding: 3px 5px;
  margin: 0 3px;
  color: #b0dad4;
  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: #809794;
}
.settings-row input[type="range"] {
  width: 160px;
  accent-color: #95cfc7;
}
.settings-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: #96cac3;
}
.storage-note {
  margin: 17px 0;
  color: #879f9c;
  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: #8fc3bc88;
  background: #63a39b17;
}
.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: #a9c9c5;
}
.profile-form {
  display: flex;
  gap: 8px;
}
.profile-form input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  background: #0a0d0e;
  color: #d3e4e2;
  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: #b5e2dc;
  margin-top: 12px;
  min-height: 18px;
}
.storage-warning {
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: #39656d2b;
  color: #a7d5cf;
  font-size: 12px;
  border-bottom: 1px solid #49807955;
  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: #b2c4c2;
  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: #202d2ff5;
  border: 1px solid #83b4ad77;
  box-shadow: 0 8px 35px #0008;
  color: #d0eae7;
  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: #8bc4bc20;
    border-bottom: 1px solid var(--line);
    color: #b2d2ce;
  }
  .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: #192021;
  color: #cde6e3;
}
