:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c0d11;
  color: #f7f1df;
  --bg: #0c0d11;
  --panel: #15161b;
  --panel-2: #1d1f25;
  --line: #6f727b;
  --muted: #c8c2b3;
  --text: #f7f1df;
  --gold: #f2c75c;
  --gold-strong: #ffe18a;
  --ink: #16120a;
  --danger: #db7c71;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overflow-wrap: anywhere;
  background:
    radial-gradient(circle at 50% -10%, #2b271d 0, #131419 38rem),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.experience,
.panel {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 1px solid #5e6067;
  border-radius: 0;
  overflow: auto;
  scroll-padding-top: max(12px, env(safe-area-inset-top));
  scroll-padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(18, 19, 24, 0.97);
  box-shadow: 0 24px 70px var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.2;
}

.lede {
  max-width: 58ch;
  margin-bottom: 0;
  color: #ddd6c6;
  font-size: 1rem;
  line-height: 1.6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Opening cinematic */
.experience--story {
  min-height: min(760px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: minmax(300px, 54vh) auto;
}

.story-visual {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-bottom: 1px solid #5e6067;
  background:
    radial-gradient(circle at 50% 25%, rgba(118, 106, 78, 0.2), transparent 32%),
    linear-gradient(#101117, #090a0d);
}

.sanctuary-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sanctuary-backdrop::before,
.sanctuary-backdrop::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 40%;
  height: 76%;
  background: linear-gradient(110deg, #19191c, #0b0c0f 70%);
  opacity: 0.92;
}

.sanctuary-backdrop::before {
  left: 0;
  clip-path: polygon(0 0, 62% 18%, 100% 100%, 0 100%);
}

.sanctuary-backdrop::after {
  right: 0;
  transform: scaleX(-1);
  clip-path: polygon(0 0, 62% 18%, 100% 100%, 0 100%);
}

.window-cross {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 92px;
  height: 148px;
  transform: translateX(-50%);
  border: 8px solid #363637;
  border-radius: 48px 48px 8px 8px;
  background: #15161a;
  box-shadow: 0 0 0 1px #050506;
}

.window-cross::before,
.window-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16%;
  background: #49494a;
  transform: translateX(-50%);
}

.window-cross::before {
  width: 8px;
  height: 70%;
}

.window-cross::after {
  width: 58%;
  height: 8px;
  top: 40%;
}

.pew {
  position: absolute;
  bottom: 8%;
  width: 33%;
  height: 34px;
  background: #30261d;
  border-top: 5px solid #55412e;
  box-shadow: 0 18px 0 -10px #201912;
  opacity: 0.85;
}

.pew--left {
  left: 4%;
  transform: perspective(300px) rotateY(10deg) skewY(3deg);
}

.pew--right {
  right: 4%;
  transform: perspective(300px) rotateY(-10deg) skewY(-3deg);
}

.player-silhouette,
.demon-silhouette,
.angel-silhouette,
.gold-wave,
.divine-scroll {
  position: absolute;
  opacity: 0;
}

.player-silhouette {
  left: 48%;
  bottom: 11%;
  width: 38px;
  height: 82px;
  border-radius: 45% 45% 18% 18%;
  background: #060709;
  transform: translateX(-50%) rotate(4deg);
}

.player-silhouette::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -20px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #060709;
}

.demon-silhouette {
  right: 14%;
  bottom: 12%;
  width: 66px;
  height: 120px;
  background: #040406;
  border-radius: 58% 42% 20% 20%;
  transform: skewX(-7deg);
}

.demon-silhouette::before,
.demon-silhouette::after {
  content: "";
  position: absolute;
  top: -24px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 35px solid #040406;
}

.demon-silhouette::before {
  left: 5px;
  transform: rotate(-22deg);
}

.demon-silhouette::after {
  right: 5px;
  transform: rotate(22deg);
}

.gold-wave {
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 229, 149, 0.94), rgba(242, 199, 92, 0.32) 28%, transparent 62%);
  transform: scale(0.2);
}

.divine-scroll {
  left: 50%;
  top: 44%;
  width: 150px;
  min-height: 86px;
  padding: 22px;
  transform: translate(-50%, -50%) scale(0.9);
  border: 2px solid #ffe6a1;
  border-radius: 15px 4px 15px 4px;
  background: linear-gradient(135deg, #c8922f, #f4d273 45%, #9f6f1f);
  color: #211606;
  text-align: center;
  font-size: 2rem;
  box-shadow: 0 0 40px rgba(255, 213, 105, 0.7);
}

.angel-silhouette {
  left: 50%;
  bottom: 7%;
  width: 48px;
  height: 120px;
  transform: translateX(-50%);
  border-radius: 46% 46% 20% 20%;
  background: linear-gradient(#fff8d7, #d0aa58);
  box-shadow: 0 0 46px rgba(255, 224, 146, 0.72);
}

.angel-silhouette::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 11px;
  width: 26px;
  height: 26px;
  border: 3px solid #ffe69a;
  border-radius: 50%;
  box-shadow: 0 -12px 0 -9px #ffe69a;
}

.wing {
  position: absolute;
  top: 14px;
  width: 80px;
  height: 72px;
  border: 2px solid #f6e7ba;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(208,170,88,0.3));
}

.wing--left {
  right: 32px;
  border-radius: 90% 15% 70% 20%;
  transform: rotate(-18deg);
}

.wing--right {
  left: 32px;
  border-radius: 15% 90% 20% 70%;
  transform: rotate(18deg);
}

.story-visual--fall .player-silhouette,
.story-visual--sanctuary .player-silhouette,
.story-visual--prayer .player-silhouette,
.story-visual--attack .player-silhouette,
.story-visual--intervention .player-silhouette,
.story-visual--message .player-silhouette,
.story-visual--arrival .player-silhouette {
  opacity: 1;
}

.story-visual--fall .sanctuary-backdrop {
  animation: flee-shake 2.2s ease-in-out infinite;
}

.story-visual--sanctuary .window-cross {
  box-shadow: 0 0 30px rgba(242, 199, 92, 0.08);
}

.story-visual--prayer .player-silhouette {
  transform: translateX(-50%) translateY(22px) rotate(72deg) scaleY(0.75);
}

.story-visual--attack .demon-silhouette {
  opacity: 1;
  animation: demon-enter 1.8s ease-out both;
}

.story-visual--intervention .demon-silhouette,
.story-visual--message .demon-silhouette {
  opacity: 0.45;
}

.story-visual--intervention .gold-wave,
.story-visual--message .gold-wave,
.story-visual--arrival .gold-wave {
  opacity: 1;
  animation: divine-pulse 2.4s ease-out infinite;
}

.story-visual--message .divine-scroll {
  opacity: 1;
  animation: scroll-float 2.8s ease-in-out infinite;
}

.story-visual--arrival .angel-silhouette {
  opacity: 1;
  animation: angel-descend 2.2s ease-out both;
}

.story-visual.is-paused *,
.story-visual.is-paused *::before,
.story-visual.is-paused *::after {
  animation-play-state: paused !important;
}

.story-copy {
  padding: 24px;
}

.story-progress {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.story-dot {
  display: block;
  width: 22px;
  height: 5px;
  border: 1px solid #8d8b84;
  border-radius: 999px;
  background: transparent;
}

.story-dot--active {
  border-color: var(--gold-strong);
  background: var(--gold-strong);
}

.story-controls,
.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
}

/* Shared controls */
.button {
  width: 100%;
  min-width: 44px;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid #a5a39e;
  border-radius: 12px;
  background: #23252b;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.button:hover:not(:disabled) {
  background: #2c2f37;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:focus-visible,
.combatant:focus-visible,
.text-button:focus-visible,
summary:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.button:disabled,
.combatant:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button--primary {
  background: #e8e8e3;
  color: #111217;
  font-weight: 800;
}

.button--primary:hover:not(:disabled) {
  background: #ffffff;
}

.button--gold {
  border-color: #ffe59a;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
}

.button--gold:hover:not(:disabled) {
  background: #ffe18a;
}

.button--quiet {
  background: transparent;
}

.button-title,
.button-detail {
  display: block;
}

.button-title {
  font-weight: 800;
}

.button-detail {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 600;
  opacity: 0.82;
}

.is-tutorial {
  box-shadow: 0 0 0 3px rgba(255, 225, 138, 0.28);
}

.text-button {
  min-width: 44px;
  min-height: 44px;
  margin-top: 14px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #e4dcc8;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* Battle */
.experience--battle {
  padding: 20px;
}

.battle-header {
  display: grid;
  gap: 14px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid #555860;
}

.battle-header h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 3.6rem);
}

.phase-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #777a83;
  border-radius: 12px;
  background: #202228;
}

.phase-badge span {
  color: var(--muted);
}

.phase-badge strong {
  color: var(--gold-strong);
  text-transform: capitalize;
}

.battle-status {
  min-height: 48px;
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: #22231f;
  color: #f4edda;
  line-height: 1.45;
}

.battle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.arena-card {
  position: relative;
  min-height: 520px;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #686a72;
  border-radius: 18px;
  background:
    linear-gradient(rgba(12, 13, 17, 0.12), rgba(12, 13, 17, 0.88)),
    radial-gradient(circle at 50% 76%, rgba(241, 202, 102, 0.24), transparent 28%),
    linear-gradient(145deg, #28251f, #101116 56%);
}

.arena-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(242, 199, 92, 0.1) 50%, transparent 50.5%),
    linear-gradient(180deg, transparent 42%, rgba(255,255,255,0.04) 42.5%, transparent 43%);
}

.arena-light {
  position: absolute;
  left: 50%;
  bottom: -30%;
  width: 60%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(241, 203, 109, 0.09);
  filter: blur(10px);
}

.enemy-row {
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.combatant {
  position: relative;
  min-width: 0;
  min-height: 176px;
  padding: 14px;
  border: 1px solid #7f8189;
  border-radius: 16px;
  background: rgba(27, 29, 35, 0.92);
  color: var(--text);
}

button.combatant {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.combatant--demon.is-selected {
  border: 2px solid var(--gold-strong);
  box-shadow: 0 0 0 2px rgba(255, 225, 138, 0.16);
}

.combatant.is-defeated {
  opacity: 0.58;
}

.combatant--angel {
  z-index: 1;
  width: min(300px, 100%);
  min-height: 190px;
  justify-self: center;
  border-color: #c7a95f;
  background: linear-gradient(145deg, rgba(58, 49, 30, 0.94), rgba(26, 27, 31, 0.96));
}

.combatant-portrait {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 1.5rem;
}

.angel-mark {
  color: #ffe6a1;
  background: radial-gradient(circle, rgba(255, 232, 164, 0.25), transparent 70%);
}

.demon-mark {
  color: #e49a90;
  background: #2c1919;
}

.combatant-name,
.combatant-role,
.defeated-label {
  display: block;
}

.combatant-name {
  font-weight: 800;
}

.combatant-role {
  margin-top: 2px;
  color: #d7cfbc;
  font-size: 0.8rem;
}

.combatant-order {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #a5a39e;
  border-radius: 50%;
  background: #111217;
  color: #fff;
  font-weight: 800;
}

.defeated-label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hp-group {
  margin-top: 12px;
}

.hp-label-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 0.72rem;
}

.hp-progress {
  display: block;
  width: 100%;
  height: 11px;
  overflow: hidden;
  border: 1px solid #a4a49d;
  border-radius: 999px;
  background: #25272d;
  accent-color: #f0d383;
}

.hp-progress::-webkit-progress-bar {
  background: #25272d;
}

.hp-progress::-webkit-progress-value {
  background: #f0d383;
}

.hp-progress::-moz-progress-bar {
  background: #f0d383;
}

.versus-line {
  z-index: 1;
  width: 70%;
  height: 1px;
  justify-self: center;
  background: linear-gradient(90deg, transparent, #797b82, transparent);
}

.battle-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.intent-panel,
.command-panel,
.result-panel {
  padding: 18px;
  border: 1px solid #696b73;
  border-radius: 16px;
  background: #1a1c21;
}

.section-heading h2 {
  margin-bottom: 0;
}

.intent-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.intent-list li {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid #50525a;
}

.intent-list span,
.cooldown-note {
  color: #d8d1c0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.cooldown-note {
  margin: 12px 0 0;
}

.result-panel--victory {
  border-color: #c4a65d;
  background: linear-gradient(145deg, #312a1c, #1a1c21);
}

.result-panel .button {
  margin-top: 10px;
}

.battle-log {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #565860;
  border-radius: 12px;
  color: #ddd6c6;
}

.battle-log summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.battle-log ol {
  margin-bottom: 4px;
  padding-left: 22px;
  line-height: 1.5;
}

/* Sanctuary respite */
.experience--respite {
  display: grid;
  min-height: min(700px, calc(100dvh - 28px));
}

.respite-visual {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border-bottom: 1px solid #60626a;
  background: linear-gradient(#201e19, #101116);
}

.window-cross--lit {
  box-shadow: 0 0 90px rgba(242, 199, 92, 0.34);
  background: #3b3321;
}

.respite-glow {
  position: absolute;
  left: 50%;
  bottom: -30%;
  width: 70%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 207, 114, 0.3), transparent 62%);
}

.respite-copy {
  padding: 24px;
}

.fellowship-card,
.next-call {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid #766f5d;
  border-radius: 16px;
  background: #1d1d1c;
}

.fellowship-card h2,
.fellowship-card p {
  margin-bottom: 0;
}

.card-kicker {
  display: block;
  margin-bottom: 4px;
  color: #d9c98f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #ffe18a;
  border-radius: 10px 3px 10px 3px;
  background: #c89533;
  color: #211606;
  font-size: 1.4rem;
}

.next-call strong,
.next-call span {
  display: block;
}

.next-call span {
  margin-top: 3px;
  color: #d5cebd;
  line-height: 1.4;
}

.respite-copy > .button {
  margin-top: 22px;
}

.test-results {
  margin-top: 24px;
}

.test-result {
  margin: 8px 0;
  padding: 12px 14px;
  border: 1px solid #74767d;
  border-radius: 10px;
  background: #22242a;
}

.test-result--fail {
  border-width: 2px;
  border-color: var(--danger);
}

@keyframes flee-shake {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-8px); }
  55% { transform: translateX(6px); }
}

@keyframes demon-enter {
  from { transform: translateX(90px) skewX(-7deg); opacity: 0; }
  to { transform: translateX(0) skewX(-7deg); opacity: 1; }
}

@keyframes divine-pulse {
  0% { transform: scale(0.25); opacity: 0.3; }
  65% { transform: scale(1.15); opacity: 0.9; }
  100% { transform: scale(1.5); opacity: 0.15; }
}

@keyframes scroll-float {
  0%, 100% { transform: translate(-50%, -50%) scale(0.96); }
  50% { transform: translate(-50%, calc(-50% - 10px)) scale(1); }
}

@keyframes angel-descend {
  from { transform: translate(-50%, -190px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@media (min-width: 600px) {
  .story-copy,
  .respite-copy {
    padding: 34px;
  }

  .story-controls,
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-header {
    grid-template-columns: 1fr auto;
  }

  .phase-badge {
    min-width: 260px;
  }

  .experience--battle {
    padding: 28px;
  }
}

@media (min-width: 820px) {
  .experience--story,
  .experience--respite {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    grid-template-rows: 1fr;
  }

  .story-visual,
  .respite-visual {
    min-height: 680px;
    border-right: 1px solid #5e6067;
    border-bottom: 0;
  }

  .story-copy,
  .respite-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .battle-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  }

  .arena-card {
    min-height: 620px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .story-dot--active,
  .gold-wave,
  .arena-light,
  .respite-glow {
    forced-color-adjust: none;
  }

  .button,
  .combatant,
  .intent-panel,
  .command-panel,
  .result-panel,
  .battle-status {
    border: 1px solid CanvasText;
  }
}

/* Fellowship teaching, Divine Message mission, and first expedition increment. */
.experience--fellowship,
.experience--mission,
.experience--ally {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.fellowship-layout,
.fellowship-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.fellowship-card--large {
  align-content: center;
  min-height: 220px;
}

.tutorial-card,
.mission-copy {
  padding: clamp(18px, 5vw, 30px);
  border: 1px solid #6f6652;
  border-radius: 18px;
  background: rgba(20, 20, 24, 0.94);
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.tab-button {
  min-width: 44px;
  min-height: 48px;
  border: 1px solid #83765d;
  border-radius: 12px;
  background: #222127;
  color: #f4f0e7;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab-button.is-active {
  border-color: #e4c46b;
  background: #3a3020;
}

.tab-button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.ability-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.ability-list article {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #5d584d;
  border-radius: 12px;
  background: #1c1b20;
}

.member-overview {
  min-height: 150px;
  line-height: 1.6;
}

.experience--mission {
  display: grid;
  gap: 18px;
  align-items: center;
}

.mission-scroll {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px solid #8a7441;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(243, 205, 100, 0.27), rgba(22, 20, 17, 0.94) 58%);
  color: #f4d778;
  font-size: clamp(4rem, 18vw, 9rem);
  box-shadow: inset 0 0 70px rgba(225, 179, 64, 0.12);
}

.mission-facts {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.mission-facts div {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.5fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #4b473f;
}

.mission-facts dt {
  color: #c9c2b2;
  font-weight: 700;
}

.mission-facts dd {
  margin: 0;
}

.party-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}

.combatant--ally {
  text-align: left;
}

.combatant--ally.is-spent {
  opacity: 0.66;
}

.healer-mark {
  color: #f0d882;
}

.arena-card--field {
  background:
    linear-gradient(to bottom, rgba(61, 48, 39, 0.28), rgba(15, 17, 19, 0.92)),
    repeating-linear-gradient(105deg, transparent 0 52px, rgba(120, 98, 68, 0.06) 53px 55px);
}

.experience--ally .respite-copy {
  max-width: 820px;
}

@media (min-width: 700px) {
  .fellowship-layout,
  .fellowship-pair,
  .experience--mission {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .party-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mission-scroll,
  .combatant--ally,
  .tab-button {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* Daily login reward prototype */
.experience--login {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.login-panel {
  width: min(100%, 880px);
  padding: clamp(20px, 5vw, 48px);
  border: 1px solid #6f613e;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(28, 27, 24, 0.98), rgba(15, 16, 20, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.login-rewards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 24px 0;
  list-style: none;
}

.login-reward {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #514b3d;
  border-radius: 16px;
  background: #17181d;
}

.login-reward.is-current {
  border-width: 3px;
  border-color: #f2c75c;
}

.login-reward.is-bonus {
  grid-column: 1 / -1;
  background: radial-gradient(circle at top, rgba(242, 199, 92, 0.17), #17181d 68%);
}

.login-reward strong {
  font-size: 1.05rem;
}

.login-bonus-note {
  color: #f4d778;
  font-weight: 700;
}

.login-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 0;
  border-top: 1px solid #4b473f;
  border-bottom: 1px solid #4b473f;
}

@media (min-width: 700px) {
  .login-rewards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .login-reward.is-bonus {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-reward {
    transition-duration: 0.01ms !important;
  }
}

/* Sanctuary-as-the-UI hub */
.experience--sanctuary-hub {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  overflow: auto;
  border-color: #6d5730;
  background: #090a0d;
  color: var(--text);
}

.experience--sanctuary-hub button,
.experience--sanctuary-hub summary {
  font: inherit;
}

.experience--sanctuary-hub button {
  min-width: 44px;
  min-height: 48px;
  cursor: pointer;
}

.experience--sanctuary-hub button:focus-visible,
.experience--sanctuary-hub summary:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.hub-topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(208, 166, 77, 0.4);
  background: rgba(8, 9, 12, 0.96);
}

.hub-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.hub-profile > span:last-child {
  display: grid;
  min-width: 0;
}

.hub-profile strong,
.hub-profile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-profile small {
  color: #d0c8b8;
  font-size: 0.72rem;
}

.hub-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid #c79c45;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #5d4b32, #171820 62%);
  color: #f4d778;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.hub-resources {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f7f1df;
  font-size: 0.78rem;
  white-space: nowrap;
}

.hub-resources span {
  padding: 5px 7px;
  border: 1px solid rgba(165, 139, 88, 0.28);
  border-radius: 999px;
  background: rgba(20, 21, 26, 0.88);
}

.hub-resources b {
  color: var(--gold-strong);
}

.hub-top-actions {
  display: flex;
  gap: 4px;
}

.hub-icon-button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f2dfb3;
  font-size: 1rem;
}

.hub-shell {
  min-height: 0;
}

.hub-center {
  position: relative;
  display: grid;
  min-width: 0;
  background: #090a0d;
}

.hub-objective {
  padding: 15px;
  border: 1px solid rgba(199, 156, 69, 0.48);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(29, 27, 24, 0.96), rgba(14, 15, 19, 0.96));
}

.hub-objective--mobile {
  position: relative;
  z-index: 8;
  margin: 10px 10px 0;
  padding: 0;
}

.hub-objective--mobile .hub-card-kicker {
  display: block;
  padding: 9px 12px 0;
}

.hub-objective--mobile button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.hub-objective--mobile strong {
  color: var(--gold-strong);
  font-size: 0.8rem;
}

.hub-card-kicker {
  color: var(--gold-strong);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-objective h2 {
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: #fff1c7;
}

.hub-objective p {
  margin-bottom: 12px;
  color: #d7d0c1;
  font-size: 0.83rem;
  line-height: 1.45;
}

.hub-objective > button {
  width: 100%;
  border: 1px solid #8d7137;
  border-radius: 10px;
  background: #241f17;
  color: #fff1c7;
  font-weight: 800;
}

.hub-scene {
  position: relative;
  min-height: clamp(430px, 58dvh, 690px);
  overflow: hidden;
  isolation: isolate;
  background-image:
    linear-gradient(180deg, rgba(4, 5, 7, 0.05) 0%, rgba(4, 5, 7, 0.08) 52%, rgba(4, 5, 7, 0.68) 100%),
    url("../assets/images/bg/sancuarty_start.png");
  background-position: center center;
  background-size: cover;
}

.hub-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 56%, transparent 0 35%, rgba(0, 0, 0, 0.18) 72%, rgba(0, 0, 0, 0.48) 100%);
}

.hub-hotspot {
  position: absolute;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: clamp(92px, 26vw, 124px);
  min-height: 74px;
  padding: 8px;
  border: 1px solid rgba(232, 187, 88, 0.7);
  border-radius: 14px;
  background: rgba(10, 10, 13, 0.82);
  color: #f9e8bb;
  text-align: center;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
}

.hub-hotspot:hover,
.hub-hotspot:focus-visible {
  border-color: #ffe18a;
  background: rgba(29, 25, 18, 0.94);
}

.hub-hotspot--altar {
  top: 17%;
  left: 50%;
  transform: translateX(-50%);
}

.hub-hotspot--nave {
  top: 42%;
  left: 5%;
}

.hub-hotspot--chapel {
  top: 42%;
  right: 5%;
}

.hub-hotspot--sacristy {
  bottom: 8%;
  left: 5%;
}

.hub-hotspot--courtyard {
  right: 5%;
  bottom: 8%;
}

.hub-glyph {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  color: var(--gold-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  line-height: 1;
}

.hub-hotspot-copy {
  display: grid;
  gap: 1px;
}

.hub-hotspot-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hub-hotspot-copy span {
  color: #f4eee0;
  font-size: 0.72rem;
}

.hub-notification {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #20140d;
  border-radius: 50%;
  background: #bd592b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.hub-mobile-nav,
.hub-rail {
  position: relative;
  z-index: 16;
}

.hub-mobile-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0 10px;
  padding: 7px;
  border: 1px solid rgba(199, 156, 69, 0.42);
  border-radius: 14px;
  background: rgba(10, 11, 14, 0.97);
}

.hub-nav-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 44px;
  min-height: 54px;
  padding: 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e9e2d3;
  text-align: center;
  text-decoration: none;
}

.hub-nav-button.is-active {
  background: linear-gradient(180deg, #4a3b20, #282016);
  color: #ffe18a;
  box-shadow: inset 0 0 0 1px #9c7a39;
}

.hub-nav-label {
  font-size: 0.68rem;
  line-height: 1.1;
}

.hub-nav-detail {
  color: #bdb4a4;
  font-size: 0.64rem;
}

.hub-more-menu {
  position: relative;
  min-width: 0;
}

.hub-more-summary {
  list-style: none;
  cursor: pointer;
}

.hub-more-summary::-webkit-details-marker {
  display: none;
}

.hub-more-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 6px;
  width: min(310px, calc(100vw - 42px));
  padding: 12px;
  border: 1px solid #8d7137;
  border-radius: 14px;
  background: #111216;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.58);
}

.hub-more-popover strong {
  color: #ffe18a;
}

.hub-more-popover button {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #514a3d;
  border-radius: 8px;
  background: #1b1c21;
  color: #f7f1df;
  text-align: left;
}

.hub-more-popover button:disabled {
  color: #a9a397;
  cursor: not-allowed;
  opacity: 0.8;
}

.hub-divine-message {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 10px;
  padding: 10px;
  border: 1px solid #a9843e;
  border-radius: 12px;
  background: linear-gradient(100deg, #d7bd84, #ecd6a4 45%, #b89c67);
  color: #251b0e;
}

.hub-message-art {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: rgba(45, 30, 14, 0.15);
  color: #4b3215;
  font-size: 1.7rem;
}

.hub-message-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.hub-message-copy .hub-card-kicker {
  color: #5d4017;
}

.hub-message-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.hub-message-copy span:last-child {
  font-size: 0.75rem;
}

.hub-message-button {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid #6f4e1f;
  border-radius: 9px;
  background: #382714;
  color: #fff0c8;
  font-weight: 800;
}

.hub-status {
  margin: 0 10px 12px;
  padding: 10px 12px;
  border-left: 3px solid #d3aa50;
  background: #15161b;
  color: #e8e1d3;
  font-size: 0.82rem;
  line-height: 1.45;
}

.hub-rail,
.hub-context,
.hub-tablet-footer {
  display: none;
}

.hub-activity {
  padding: 15px;
  border: 1px solid rgba(199, 156, 69, 0.4);
  border-radius: 12px;
  background: rgba(12, 13, 16, 0.94);
}

.hub-activity ul {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
}

.hub-activity li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid #39362f;
  color: #dcd4c4;
  font-size: 0.78rem;
  line-height: 1.35;
}

.hub-activity li:last-child {
  border-bottom: 0;
}

.hub-activity li > span:first-child {
  color: #f1c65c;
}

.hub-world-map {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid #997837;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 0%, #352a19, #111217 70%);
  color: #ffe2a0;
  text-align: left;
}

.hub-world-map > span:last-child {
  display: grid;
}

.hub-world-map small {
  color: #cdc4b1;
}

@media (min-width: 520px) {
  .hub-divine-message {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .hub-message-button {
    grid-column: auto;
    width: auto;
    min-width: 138px;
    padding-inline: 16px;
  }
}

@media (min-width: 900px) and (min-aspect-ratio: 4/3) {
  .experience--sanctuary-hub {
    min-height: min(900px, calc(100dvh - 28px));
  }

  .hub-topbar {
    grid-template-columns: 250px minmax(0, 1fr) auto;
    padding-inline: 18px;
  }

  .hub-resources {
    justify-content: center;
    gap: 14px;
    font-size: 0.86rem;
  }

  .hub-shell {
    display: grid;
    grid-template-columns: 154px minmax(0, 1fr) 242px;
    min-height: 0;
  }

  .hub-rail {
    display: grid;
    grid-auto-rows: min-content;
    align-content: start;
    gap: 7px;
    padding: 14px 10px;
    border-right: 1px solid rgba(199, 156, 69, 0.35);
    background: linear-gradient(180deg, #0c0d10, #101115);
  }

  .hub-rail .hub-nav-button {
    grid-template-columns: 38px 1fr;
    justify-items: start;
    min-height: 68px;
    padding: 8px 10px;
    text-align: left;
  }

  .hub-rail .hub-nav-label {
    font-size: 0.82rem;
  }

  .hub-rail .hub-more-menu {
    margin-top: 4px;
    border-top: 1px solid #3b372f;
    padding-top: 8px;
  }

  .hub-rail .hub-more-summary {
    width: 100%;
  }

  .hub-rail .hub-more-popover {
    right: auto;
    bottom: auto;
    left: calc(100% + 8px);
    top: 0;
  }

  .hub-center {
    min-height: 0;
  }

  .hub-objective--mobile,
  .hub-mobile-nav {
    display: none;
  }

  .hub-scene {
    min-height: 610px;
    height: calc(100dvh - 250px);
    max-height: 720px;
    background-position: center center;
  }

  .hub-hotspot {
    width: 122px;
  }

  .hub-hotspot--altar {
    top: 34%;
  }

  .hub-hotspot--nave {
    top: 52%;
    left: 10%;
  }

  .hub-hotspot--chapel {
    top: 52%;
    right: 10%;
  }

  .hub-hotspot--sacristy {
    bottom: 8%;
    left: 9%;
  }

  .hub-hotspot--courtyard {
    right: 9%;
    bottom: 8%;
  }

  .hub-divine-message {
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .hub-status {
    margin: 0;
    border-left: 0;
    border-top: 1px solid #5b4a2c;
  }

  .hub-context {
    display: grid;
    grid-auto-rows: min-content;
    gap: 12px;
    padding: 14px 12px;
    border-left: 1px solid rgba(199, 156, 69, 0.35);
    background: linear-gradient(180deg, #0b0c0f, #101115);
  }

  .hub-tablet-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(199, 156, 69, 0.35);
    background: #0c0d10;
  }

  .hub-favorites > div {
    display: flex;
    gap: 8px;
    margin-top: 7px;
  }

  .hub-favorites .hub-nav-button {
    grid-template-columns: auto auto;
    width: auto;
    min-width: 130px;
    min-height: 50px;
    padding-inline: 12px;
    border: 1px solid #5a4b32;
    background: #16171c;
  }

  .hub-layout-note {
    margin: 0;
    color: #cfc7b9;
    font-size: 0.78rem;
    line-height: 1.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-hotspot,
  .hub-nav-button,
  .hub-message-button,
  .hub-world-map {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .experience--sanctuary-hub,
  .hub-topbar,
  .hub-scene,
  .hub-mobile-nav,
  .hub-rail,
  .hub-context,
  .hub-objective,
  .hub-activity,
  .hub-divine-message,
  .hub-status {
    forced-color-adjust: auto;
  }

  .hub-hotspot,
  .hub-nav-button,
  .hub-world-map,
  .hub-message-button,
  .hub-more-popover button {
    border: 1px solid ButtonText;
  }
}

@media (max-width: 359px) {
  .hub-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hub-resources {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
  }

  .hub-top-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .hub-profile small {
    display: none;
  }
}

/* Opening story: full-frame background art with cinematic approach */
.experience--story {
  position: relative;
  display: block;
  min-height: 540px;
  height: min(820px, calc(100dvh - 28px));
  overflow: hidden;
  isolation: isolate;
  background: #08090c;
}

.story-visual {
  position: absolute;
  inset: 0;
  min-height: 0;
  overflow: hidden;
  border-bottom: 0;
  background: #08090c;
}

.story-background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.story-background-image--next {
  z-index: 0;
  opacity: 0;
  transform: scale(0.96);
}

.story-background-image--bridge {
  z-index: 1;
  opacity: 0;
  transform: scale(0.985);
}

.story-background-image--current {
  z-index: 2;
  transform: scale(1.018);
  animation: story-shot-settle 540ms cubic-bezier(0.16, 0.8, 0.2, 1) both;
}

.story-transition-bloom,
.story-motion-streaks {
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.story-transition-bloom {
  z-index: 3;
  inset: -14%;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 243, 213, 0.82), rgba(245, 205, 118, 0.34) 19%, transparent 47%),
    radial-gradient(circle at 50% 54%, rgba(255, 226, 154, 0.22), transparent 64%);
  mix-blend-mode: screen;
  will-change: opacity, transform;
}

.story-motion-streaks {
  z-index: 4;
  inset: -18%;
  background:
    repeating-radial-gradient(ellipse at 50% 46%, transparent 0 6%, rgba(255, 242, 209, 0.09) 6.4% 6.8%, transparent 7.2% 11%),
    radial-gradient(ellipse at 50% 46%, transparent 0 35%, rgba(255, 235, 190, 0.08) 54%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(0.8px);
  transform: scale(0.72);
}

.story-image-shade {
  position: absolute;
  z-index: 5;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.12) 0%, rgba(5, 6, 8, 0.04) 42%, rgba(5, 6, 8, 0.36) 68%, rgba(5, 6, 8, 0.84) 100%),
    linear-gradient(90deg, rgba(4, 5, 7, 0.22), transparent 34%, transparent 66%, rgba(4, 5, 7, 0.22));
  pointer-events: none;
}

.story-image-vfx {
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 52%, rgba(255, 231, 166, 0.88), rgba(226, 177, 65, 0.2) 28%, transparent 58%);
}

/* The first two dismissals deliberately tunnel the eye: distant Sanctuary -> doors -> altar. */
.story-visual--fall .story-background-image--current {
  object-position: center center;
  transform-origin: 51% 39%;
}

.story-visual--fall .story-background-image--bridge,
.story-visual--fall .story-background-image--next {
  object-position: center 47%;
  transform-origin: 50% 44%;
}

.story-visual--sanctuary .story-background-image--current {
  object-position: center 48%;
  transform-origin: 50% 44%;
}

.story-visual--sanctuary .story-background-image--bridge,
.story-visual--sanctuary .story-background-image--next {
  object-position: center 54%;
  transform-origin: 50% 53%;
}

.story-visual--prayer .story-background-image,
.story-visual--attack .story-background-image,
.story-visual--intervention .story-background-image,
.story-visual--message .story-background-image,
.story-visual--arrival .story-background-image {
  object-position: center 54%;
  transform-origin: 50% 52%;
}

.story-visual.is-transitioning .story-background-image--current {
  animation: story-dismiss-rush 1.35s cubic-bezier(0.12, 0.82, 0.18, 1) both;
}

.story-visual.is-transitioning .story-background-image--bridge {
  animation: story-bridge-surge 1.35s cubic-bezier(0.16, 0.76, 0.2, 1) both;
}

.story-visual.is-transitioning .story-background-image--next {
  animation: story-next-lock 1.35s cubic-bezier(0.18, 0.72, 0.2, 1) both;
}

.story-visual.is-transitioning .story-transition-bloom {
  animation: story-triggered-bloom 1.35s cubic-bezier(0.18, 0.72, 0.2, 1) both;
}

.story-visual.is-transitioning .story-motion-streaks {
  animation: story-motion-tunnel 1.35s cubic-bezier(0.12, 0.82, 0.18, 1) both;
}

.story-visual--attack:not(.is-transitioning) {
  animation: story-attack-jolt 520ms 180ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.story-visual--attack .story-image-shade {
  background:
    radial-gradient(circle at 78% 48%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.58) 48%, rgba(0, 0, 0, 0.78)),
    linear-gradient(180deg, rgba(5, 6, 8, 0.08), rgba(5, 6, 8, 0.78));
}

.story-visual--intervention .story-image-vfx {
  opacity: 0.82;
  animation: story-divine-impact 1.05s cubic-bezier(0.16, 0.82, 0.18, 1) both;
}

.story-visual--message .story-image-vfx {
  opacity: 0.58;
  animation: story-divine-reveal 900ms cubic-bezier(0.16, 0.82, 0.18, 1) both;
}

.story-visual--arrival .story-image-vfx {
  opacity: 0.44;
  animation: story-divine-reveal 900ms cubic-bezier(0.16, 0.82, 0.18, 1) both;
}

.story-dialog {
  position: absolute;
  z-index: 8;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(231, 186, 91, 0.72);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 18, 21, 0.92), rgba(8, 9, 12, 0.96));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 232, 177, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: story-dialog-in 680ms cubic-bezier(0.18, 0.72, 0.2, 1) both;
}

.story-dialog .eyebrow {
  margin-bottom: 5px;
  color: var(--gold-strong);
}

.story-dialog h1 {
  margin: 0 0 8px;
  color: #fff5d7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 4.8vw, 2rem);
  line-height: 1.08;
}

.story-dialog .lede {
  margin: 0;
  max-width: 62ch;
  color: #f2eee4;
  font-size: clamp(0.92rem, 2.7vw, 1.05rem);
  line-height: 1.5;
}

.story-dialog .story-progress {
  margin-top: 14px;
}

.story-dialog .story-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.story-dialog .story-controls .button {
  width: 100%;
  min-height: 48px;
}

.experience--story.is-transitioning .story-dialog {
  pointer-events: none;
  animation: story-dialog-dismiss 420ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes story-shot-settle {
  from { transform: scale(1.055) translate3d(0, -0.35%, 0); opacity: 0.86; }
  to { transform: scale(1.018) translate3d(0, 0, 0); opacity: 1; }
}

@keyframes story-dismiss-rush {
  0% { transform: scale(1.018) translate3d(0, 0, 0); opacity: 1; filter: blur(0); }
  44% { transform: scale(1.12) translate3d(0, -0.8%, 0); opacity: 1; filter: blur(0); }
  74% { transform: scale(1.26) translate3d(0, -1.7%, 0); opacity: 0.82; filter: blur(0.8px); }
  100% { transform: scale(1.42) translate3d(0, -2.4%, 0); opacity: 0; filter: blur(3px); }
}

@keyframes story-bridge-surge {
  0%, 20% { transform: scale(0.985); opacity: 0; }
  38% { transform: scale(1.03); opacity: 0.76; }
  68% { transform: scale(1.14); opacity: 0.94; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes story-next-lock {
  0%, 46% { transform: scale(0.96); opacity: 0; }
  70% { transform: scale(1.015); opacity: 0.54; }
  100% { transform: scale(1.055); opacity: 1; }
}

@keyframes story-triggered-bloom {
  0%, 22% { opacity: 0; transform: scale(0.72); }
  52% { opacity: 0.16; transform: scale(0.92); }
  78% { opacity: 0.72; transform: scale(1.08); }
  100% { opacity: 0.08; transform: scale(1.28); }
}

@keyframes story-motion-tunnel {
  0%, 24% { opacity: 0; transform: scale(0.72); }
  56% { opacity: 0.2; transform: scale(1.02); }
  82% { opacity: 0.34; transform: scale(1.34); }
  100% { opacity: 0; transform: scale(1.72); }
}

@keyframes story-dialog-dismiss {
  to { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.985); }
}

@keyframes story-attack-jolt {
  0%, 100% { transform: translate3d(0, 0, 0); }
  22% { transform: translate3d(-0.7%, 0.2%, 0); }
  46% { transform: translate3d(0.55%, -0.18%, 0); }
  70% { transform: translate3d(-0.28%, 0.1%, 0); }
}

@keyframes story-divine-impact {
  0% { opacity: 0; transform: scale(0.72); filter: brightness(1); }
  24% { opacity: 1; transform: scale(1.02); filter: brightness(1.75); }
  58% { opacity: 0.72; transform: scale(1.13); filter: brightness(1.2); }
  100% { opacity: 0.42; transform: scale(1.18); filter: brightness(1); }
}

@keyframes story-divine-reveal {
  from { opacity: 0; transform: scale(0.88); }
  55% { opacity: 0.78; transform: scale(1.04); }
  to { opacity: 0.48; transform: scale(1.08); }
}

@keyframes story-dialog-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}


@media (min-width: 700px) {
  .story-dialog {
    left: max(28px, env(safe-area-inset-left));
    right: auto;
    bottom: max(28px, env(safe-area-inset-bottom));
    width: min(690px, calc(100% - 56px));
    padding: 24px;
  }

  .story-dialog .story-controls {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    max-width: 430px;
  }
}

@media (max-height: 620px) {
  .experience--story {
    min-height: 0;
    height: 100%;
  }

  .story-dialog {
    max-height: calc(100dvh - 32px);
    overflow: auto;
    padding: 14px;
  }

  .story-dialog .lede {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-background-image,
  .story-transition-bloom,
  .story-motion-streaks,
  .story-image-vfx,
  .story-dialog {
    animation: none !important;
    transform: none !important;
  }
}


.battle-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auto-toggle {
  min-width: 104px;
  min-height: 44px;
  border: 1px solid #8f929a;
  border-radius: 999px;
  background: #202229;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.auto-toggle.is-on {
  border-color: var(--gold-strong);
  background: var(--gold);
  color: var(--ink);
}

.auto-toggle.is-tutorial {
  outline: 3px solid var(--gold-strong);
  outline-offset: 3px;
}

.auto-tutorial {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 16px;
  border-bottom: 1px solid #5e6067;
  background: rgba(242, 199, 92, 0.12);
}

.auto-tutorial span {
  color: var(--muted);
}

/* Selected battle HUD — portrait Standard / landscape cinematic command layout. */
.experience--combat {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #9a7738;
  border-radius: 18px;
  background: #090b10;
  color: #f5ead0;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(242, 199, 92, 0.08);
}

.combat-topbar {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 74px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(217, 169, 76, 0.34);
  background: linear-gradient(180deg, rgba(4, 7, 12, 0.98), rgba(7, 10, 15, 0.9));
}

.combat-player-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.combat-player-summary > div {
  min-width: 0;
}

.combat-player-summary strong,
.combat-player-summary span {
  display: block;
}

.combat-player-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.combat-player-summary > div > span {
  margin-top: 1px;
  color: #b9ae99;
  font-size: 0.66rem;
}

.battle-portrait {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid #d7ae5d;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(244, 210, 130, 0.2), rgba(8, 10, 14, 0.96) 70%);
  color: #ffe3a0;
  box-shadow: 0 0 16px rgba(221, 171, 75, 0.18);
}

.battle-portrait--demon {
  border-color: #9d493f;
  background: radial-gradient(circle, rgba(120, 24, 20, 0.32), #0b0b0d 72%);
  color: #d45a4d;
}

.combat-title-lockup {
  grid-column: 1 / -1;
  grid-row: 2;
  text-align: center;
}

.combat-title-lockup h1 {
  margin: 0;
  color: #f3d48d;
  font-size: clamp(1rem, 4vw, 1.3rem);
  line-height: 1.1;
}

.combat-brand {
  display: none;
  color: #dfb664;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.04em;
}

.combat-wave {
  display: block;
  margin-top: 3px;
  color: #d7c9ad;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.combat-resource-strip {
  display: flex;
  gap: 7px;
  justify-self: end;
  align-items: center;
  color: #ede1c5;
  font-size: 0.68rem;
}

.combat-resource-strip > span {
  padding: 7px 8px;
  border: 1px solid rgba(217, 169, 76, 0.22);
  border-radius: 999px;
  background: rgba(5, 8, 12, 0.75);
  white-space: nowrap;
}

.combat-menu-button,
.combat-utility-rail button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #886c39;
  border-radius: 50%;
  background: rgba(5, 8, 12, 0.88);
  color: #f3d38c;
}

.combat-live-status {
  position: absolute;
  z-index: 7;
  top: 118px;
  left: 50%;
  width: min(86%, 760px);
  min-height: 0;
  transform: translateX(-50%);
  padding: 7px 12px;
  border: 1px solid rgba(226, 182, 89, 0.26);
  border-radius: 999px;
  background: rgba(5, 7, 11, 0.84);
  color: #f3e8d0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.3;
  pointer-events: none;
}

.combat-stage {
  position: relative;
  min-height: 0;
  height: calc(100% - 74px);
  padding: 62px 58px 226px 12px;
  background:
    linear-gradient(180deg, rgba(5, 8, 14, 0.18), rgba(5, 7, 10, 0.38) 48%, rgba(3, 4, 7, 0.94) 92%),
    radial-gradient(circle at 50% 70%, rgba(225, 169, 70, 0.2), transparent 32%),
    url("../assets/images/bg/sancuarty_start.png") center 38% / cover no-repeat,
    #101218;
}

.experience--combat-field .combat-stage {
  background:
    linear-gradient(180deg, rgba(7, 10, 16, 0.18), rgba(4, 5, 8, 0.55) 58%, rgba(2, 3, 5, 0.96) 94%),
    radial-gradient(circle at 56% 70%, rgba(220, 107, 47, 0.17), transparent 28%),
    linear-gradient(145deg, #252017, #11141b 44%, #080a0e 74%);
}

.experience--combat-field .combat-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(104, 54, 28, 0.4), transparent 14%),
    radial-gradient(ellipse at 78% 42%, rgba(104, 54, 28, 0.36), transparent 16%),
    repeating-linear-gradient(98deg, transparent 0 9%, rgba(15, 12, 11, 0.24) 10% 11%);
}

.enemy-hud-strip {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.enemy-hud-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  min-height: 66px;
  padding: 6px 8px;
  border: 1px solid rgba(205, 165, 84, 0.34);
  border-radius: 9px;
  background: rgba(5, 7, 11, 0.87);
  color: #f1e6cc;
  text-align: left;
}

.enemy-hud-card .battle-portrait {
  width: 36px;
  height: 36px;
}

.enemy-hud-card.is-selected {
  border-color: #f0c767;
  box-shadow: 0 0 0 2px rgba(240, 199, 103, 0.15), 0 0 20px rgba(240, 199, 103, 0.1);
}

.enemy-hud-card.is-defeated {
  opacity: 0.42;
}

.enemy-hud-copy {
  min-width: 0;
}

.enemy-hud-copy strong,
.enemy-hud-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enemy-hud-copy strong {
  font-size: 0.72rem;
}

.enemy-hud-copy small {
  margin-top: 3px;
  color: #d69d78;
  font-size: 0.58rem;
}

.combat-hp {
  position: relative;
  min-width: 0;
  margin-top: 3px;
}

.combat-hp-progress {
  display: block;
  width: 100%;
  height: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  overflow: hidden;
  background: #1a1a1a;
}

.combat-hp-progress::-webkit-progress-bar { background: #1a1a1a; }
.combat-hp-progress::-webkit-progress-value { background: #2c964c; }
.combat-hp-progress::-moz-progress-bar { background: #2c964c; }
.enemy-hud-card .combat-hp-progress::-webkit-progress-value { background: #a3312b; }
.enemy-hud-card .combat-hp-progress::-moz-progress-bar { background: #a3312b; }

.combat-hp > span {
  position: absolute;
  inset: -1px 3px auto auto;
  color: #fff;
  font-size: 0.54rem;
  line-height: 10px;
  text-shadow: 0 1px 2px #000;
}

.battlefield-figures {
  position: absolute;
  z-index: 2;
  inset: 132px 50px 218px 8px;
  pointer-events: none;
}

.enemy-figures,
.ally-figures {
  position: absolute;
  left: 50%;
  width: 86%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-around;
  align-items: end;
}

.enemy-figures {
  top: 5%;
  height: 44%;
}

.ally-figures {
  bottom: 1%;
  width: 72%;
  height: 46%;
}

.battle-figure {
  display: grid;
  place-items: center;
  border-radius: 45% 45% 22% 22%;
  text-shadow: 0 0 20px currentColor;
  filter: drop-shadow(0 18px 12px rgba(0,0,0,0.65));
}

.battle-figure--demon {
  width: clamp(64px, 16vw, 126px);
  height: clamp(120px, 28vw, 230px);
  color: #8f2924;
  background: linear-gradient(160deg, rgba(75, 24, 22, 0.8), rgba(5, 5, 7, 0.98));
  clip-path: polygon(30% 4%, 42% 18%, 50% 0, 58% 18%, 72% 4%, 68% 26%, 94% 48%, 73% 53%, 84% 100%, 16% 100%, 27% 53%, 6% 48%, 32% 26%);
}

.battle-figure--ally {
  width: clamp(72px, 18vw, 142px);
  height: clamp(118px, 26vw, 220px);
  border: 1px solid rgba(235, 199, 116, 0.25);
  color: #f2d48d;
  background: linear-gradient(160deg, rgba(221, 199, 150, 0.34), rgba(14, 15, 18, 0.96) 72%);
  clip-path: polygon(44% 0, 56% 0, 62% 17%, 73% 28%, 68% 43%, 91% 100%, 9% 100%, 32% 43%, 27% 28%, 38% 17%);
  box-shadow: 0 0 38px rgba(231, 194, 105, 0.16);
}

.battle-figure.is-defeated { opacity: 0.12; }

.combat-utility-rail {
  position: absolute;
  z-index: 6;
  left: 8px;
  bottom: 235px;
  display: grid;
  gap: 7px;
}

.combat-utility-rail button {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 0.62rem;
}

.combat-utility-rail button:disabled {
  opacity: 0.56;
}

.turn-order-rail {
  position: absolute;
  z-index: 6;
  top: 128px;
  right: 7px;
  width: 48px;
  padding: 8px 4px;
  border: 1px solid rgba(213, 171, 83, 0.5);
  border-radius: 9px;
  background: rgba(4, 6, 9, 0.88);
  text-align: center;
}

.turn-order-rail > strong {
  display: none;
}

.turn-order-rail ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.turn-order-rail .battle-portrait {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  font-size: 0.72rem;
}

.turn-order-rail li.is-spent { opacity: 0.45; }

.turn-order-note {
  display: block;
  margin-top: 7px;
  color: #d8b96e;
  font-size: 0.52rem;
  text-transform: uppercase;
}

.combat-command-dock {
  position: absolute;
  z-index: 6;
  right: 8px;
  bottom: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(0, 2fr);
  gap: 8px;
  align-items: stretch;
}

.active-actor-card,
.companion-card,
.skill-deck,
.combat-result {
  border: 1px solid rgba(212, 168, 78, 0.5);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(9, 12, 17, 0.96), rgba(18, 16, 13, 0.94));
}

.active-actor-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  text-align: center;
  box-shadow: inset 0 0 22px rgba(226, 178, 76, 0.08);
}

.active-actor-card .battle-portrait {
  width: 56px;
  height: 56px;
}

.active-actor-card strong,
.active-actor-card > div > span {
  display: block;
}

.active-actor-card strong { font-size: 0.76rem; }
.active-actor-card > div > span { color: #b9ae99; font-size: 0.58rem; }

.skill-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.skill-button {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 7px 4px;
  border: 0;
  border-right: 1px solid rgba(215, 170, 82, 0.28);
  background: rgba(6, 8, 11, 0.32);
  color: #f4ead2;
  text-align: center;
}

.skill-button:last-child { border-right: 0; }
.skill-button--gold { background: radial-gradient(circle at 50% 36%, rgba(219, 163, 57, 0.2), rgba(6, 8, 11, 0.32) 64%); }
.skill-button--locked { opacity: 0.5; }
.skill-button.is-tutorial { box-shadow: inset 0 0 0 2px #f0c45e, inset 0 0 28px rgba(240, 196, 94, 0.16); }

.skill-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #b58b42;
  border-radius: 50%;
  background: #111218;
  color: #f5c75e;
  font-size: 1.35rem;
}

.skill-button strong {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
}

.skill-button small { color: #d6c6a6; font-size: 0.58rem; }

.companion-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.companion-strip:empty { display: none; }

.companion-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 54px;
  padding: 6px 8px;
  color: #efe4cd;
  text-align: left;
}

.companion-card .battle-portrait { width: 36px; height: 36px; }
.companion-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.66rem; }
.companion-card.is-spent { opacity: 0.52; }

.combat-result {
  grid-column: 2;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
}

.combat-result h2,
.combat-result p { margin: 0; }
.combat-result h2 { font-size: 1rem; color: #f2d38a; }
.combat-result p { color: #d9cfbb; font-size: 0.68rem; }
.combat-result .button { margin-top: 5px; }
.combat-result--victory { box-shadow: inset 0 0 32px rgba(226, 177, 75, 0.1); }

.combat-log {
  position: relative;
  z-index: 9;
  margin: 0;
  border-top: 1px solid rgba(213, 171, 83, 0.28);
  background: #090b0f;
  color: #ddd2bc;
}

.combat-log summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.combat-log ol {
  margin: 0;
  padding: 0 18px 14px 34px;
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (min-width: 600px) {
  .combat-topbar {
    grid-template-columns: minmax(190px, 1fr) minmax(220px, auto) minmax(180px, 1fr);
    padding: 10px 14px;
  }

  .combat-title-lockup {
    grid-column: 2;
    grid-row: 1;
  }

  .combat-brand { display: block; }
  .combat-resource-strip { grid-column: 3; }
  .enemy-hud-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 820px) and (orientation: landscape) {
  .experience--combat {
    height: 100%;
    min-height: 0;
  }

  .combat-topbar {
    min-height: 88px;
    grid-template-columns: minmax(240px, 1fr) minmax(280px, auto) minmax(240px, 1fr);
    padding: 12px 18px;
  }

  .combat-player-summary { grid-template-columns: 58px minmax(0, 1fr); }
  .combat-player-summary .battle-portrait { width: 56px; height: 56px; }
  .combat-player-summary strong { font-size: 0.98rem; }
  .combat-title-lockup h1 { font-size: 1.5rem; }
  .combat-brand { font-size: 1.15rem; }
  .combat-wave { font-size: 0.72rem; }
  .combat-resource-strip { font-size: 0.8rem; }

  .combat-live-status {
    top: 98px;
    width: min(60%, 800px);
  }

  .combat-stage {
    min-height: 0;
    height: calc(100% - 88px);
    padding: 78px 118px 176px 92px;
  }

  .enemy-hud-strip {
    gap: 18px;
  }

  .enemy-hud-card {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 76px;
    padding: 8px 11px;
  }

  .enemy-hud-card .battle-portrait { width: 50px; height: 50px; }
  .enemy-hud-copy strong { font-size: 0.83rem; }
  .enemy-hud-copy small { font-size: 0.65rem; }

  .battlefield-figures {
    inset: 150px 120px 170px 90px;
  }

  .enemy-figures { width: 78%; }
  .ally-figures { width: 58%; }

  .combat-utility-rail {
    left: 18px;
    bottom: 190px;
    gap: 10px;
  }

  .combat-utility-rail button {
    width: 54px;
    height: 54px;
    font-size: 0.72rem;
  }

  .turn-order-rail {
    top: 98px;
    right: 18px;
    width: 82px;
    padding: 10px 8px;
  }

  .turn-order-rail > strong {
    display: block;
    margin-bottom: 8px;
    color: #e2bd6d;
    font-size: 0.62rem;
    text-transform: uppercase;
  }

  .turn-order-rail .battle-portrait { width: 44px; height: 44px; }

  .combat-command-dock {
    right: 24px;
    bottom: 18px;
    left: 24px;
    grid-template-columns: minmax(160px, 0.8fr) minmax(420px, 2.4fr) minmax(270px, 1.3fr);
    gap: 12px;
  }

  .active-actor-card { min-height: 142px; }
  .active-actor-card .battle-portrait { width: 74px; height: 74px; }
  .active-actor-card strong { font-size: 0.88rem; }
  .skill-button { min-height: 142px; }
  .skill-icon { width: 64px; height: 64px; font-size: 1.75rem; }
  .skill-button strong { font-size: 0.8rem; }
  .skill-button small { font-size: 0.66rem; }

  .companion-strip {
    grid-column: 3;
    align-self: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .companion-card {
    min-height: 142px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .companion-card .battle-portrait { width: 58px; height: 58px; }
  .combat-result { grid-column: 2 / 4; }
}

@media (max-width: 420px) {
  .experience--combat { border-radius: 0; border-right: 0; border-left: 0; }
  .combat-topbar { padding-inline: 8px; }
  .combat-resource-strip > span { padding-inline: 6px; }
  .combat-stage { padding-left: 7px; padding-right: 52px; }
  .combat-command-dock { right: 5px; left: 5px; grid-template-columns: minmax(92px, 0.62fr) minmax(0, 2fr); }
  .skill-icon { width: 42px; height: 42px; }
  .skill-button strong { font-size: 0.62rem; }
  .skill-button small { font-size: 0.52rem; }
}

@media (forced-colors: active) {
  .experience--combat,
  .enemy-hud-card,
  .active-actor-card,
  .companion-card,
  .skill-deck,
  .skill-button,
  .turn-order-rail,
  .combat-result,
  .combat-menu-button,
  .combat-utility-rail button {
    border: 1px solid CanvasText;
  }

  .battle-figure { forced-color-adjust: none; }
}

.experience--combat button:focus-visible,
.experience--combat summary:focus-visible {
  outline: 3px solid #fff1ae;
  outline-offset: 3px;
}

.combat-menu-popover {
  position: absolute;
  z-index: 12;
  top: 68px;
  right: 8px;
  display: grid;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid #9a7738;
  border-radius: 10px;
  background: #090b0f;
  box-shadow: 0 16px 34px rgba(0,0,0,0.5);
}

.combat-menu-popover button {
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(217,169,76,0.22);
  background: transparent;
  color: #f0e2c3;
  text-align: left;
}

.combat-menu-popover button:last-child { border-bottom: 0; }

@media (min-width: 820px) and (orientation: landscape) {
  .combat-menu-popover { top: 78px; right: 18px; }
}


.combat-utility-rail button.is-on {
  border-color: #f0c767;
  background: #7c5a1d;
  color: #fff2c0;
  box-shadow: 0 0 0 2px rgba(240, 199, 103, 0.16), 0 0 22px rgba(240, 199, 103, 0.16);
}

.combat-utility-rail button.is-tutorial {
  outline: 3px solid #f0c767;
  outline-offset: 3px;
}

.combat-auto-tutorial {
  position: absolute;
  z-index: 11;
  top: 86px;
  left: 10px;
  display: grid;
  gap: 2px;
  width: min(270px, calc(100% - 20px));
  padding: 9px 11px;
  border: 1px solid rgba(240, 199, 103, 0.72);
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.96);
  box-shadow: 0 12px 28px rgba(0,0,0,0.48);
  color: #f5ead0;
  font-size: 0.72rem;
  line-height: 1.35;
}

.combat-auto-tutorial strong { color: #f0c767; }
.combat-auto-tutorial span { color: #d8cfbd; }

@media (min-width: 820px) and (orientation: landscape) {
  .combat-auto-tutorial {
    top: 104px;
    left: 84px;
    width: 310px;
  }
}

@media (max-height: 700px) {
  .combat-topbar { min-height: 64px; padding-block: 6px; }
  .combat-stage { height: calc(100% - 64px); padding-top: 54px; padding-bottom: 168px; }
  .combat-live-status { top: 92px; }
  .battlefield-figures { top: 110px; bottom: 166px; }
  .combat-command-dock { bottom: 5px; }
  .skill-button { min-height: 92px; }
  .active-actor-card { min-height: 92px; }
  .combat-utility-rail { bottom: 174px; }
}


/* Full-viewport invariant: responsive enhancements stay inside the game surface. */
.app-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 !important;
}

.app-shell > .experience,
.app-shell > .panel {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0;
  margin: 0 !important;
  border-radius: 0;
}

/* Fellowship production direction: stained-glass formation + tactical roster. */
.experience--fellowship {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  border: 0;
  background:
    linear-gradient(rgba(8, 8, 10, 0.86), rgba(8, 8, 10, 0.96)),
    url("../assets/images/bg/sancuarty_start.png") center / cover no-repeat;
  color: #f7f1df;
}

.fellowship-topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid rgba(196, 164, 87, 0.45);
  background: rgba(10, 10, 12, 0.94);
}

.fellowship-title-row,
.fellowship-resources {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fellowship-title-row h1 {
  margin: 0;
  color: #f3d889;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fellowship-back,
.fellowship-resources button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #7d6a3f;
  border-radius: 10px;
  background: #18171a;
  color: #f2d88a;
  font: inherit;
  cursor: pointer;
}

.fellowship-back:disabled {
  opacity: 0.38;
  cursor: default;
}

.fellowship-resources {
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.86rem;
}

.fellowship-resources > span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #5f543a;
  border-radius: 999px;
  background: rgba(18, 17, 18, 0.94);
  color: #eee4ca;
}

.fellowship-resources b {
  color: #f2c75c;
}

.fellowship-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #4e4635;
  background: rgba(14, 14, 16, 0.96);
}

.fellowship-section-tab {
  min-height: 52px;
  border: 0;
  border-right: 1px solid #38332a;
  background: transparent;
  color: #d7cdb4;
  font: 700 0.92rem/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.fellowship-section-tab.is-active {
  color: #ffe39a;
  background: linear-gradient(180deg, rgba(126, 94, 31, 0.38), rgba(58, 44, 21, 0.16));
  box-shadow: inset 0 -2px #e4bd58;
}

.fellowship-status {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 5px 18px;
  border-bottom: 1px solid rgba(89, 77, 53, 0.55);
  background: rgba(18, 17, 18, 0.91);
  color: #d6ceb9;
  font-size: 0.78rem;
}

.fellowship-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  overflow: hidden;
}

.fellowship-formation-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: clamp(12px, 2vw, 22px);
  background:
    radial-gradient(circle at 50% 15%, rgba(246, 203, 91, 0.13), transparent 30%),
    linear-gradient(rgba(10, 10, 12, 0.26), rgba(10, 10, 12, 0.75));
}

.fellowship-stage-heading,
.fellowship-roster-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.fellowship-stage-heading h2,
.fellowship-roster-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.fellowship-capacity {
  min-width: 58px;
  padding: 7px 10px;
  border: 1px solid #7e6939;
  border-radius: 999px;
  color: #f6d77e;
  text-align: center;
}

.fellowship-windows {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  gap: clamp(8px, 1.5vw, 16px);
  margin-top: 14px;
}

.fellowship-window-wrap {
  min-width: 0;
  padding: 2px;
  border-radius: 54px 54px 10px 10px;
  background: linear-gradient(#77633a, #2a2418);
}

.fellowship-window-wrap.is-selected {
  background: linear-gradient(#ffe28c, #9d722b);
  box-shadow: 0 0 22px rgba(246, 198, 76, 0.38);
}

.fellowship-window {
  width: 100%;
  min-width: 0;
  min-height: clamp(230px, 38vh, 430px);
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  place-items: center;
  gap: 4px;
  padding: 12px 8px 14px;
  border: 1px solid #16130f;
  border-radius: 52px 52px 8px 8px;
  color: #f9f3e6;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.fellowship-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.96;
  background:
    linear-gradient(30deg, transparent 46%, rgba(12, 12, 16, 0.55) 47% 49%, transparent 50%) 0 0 / 34px 34px,
    linear-gradient(-30deg, transparent 46%, rgba(12, 12, 16, 0.48) 47% 49%, transparent 50%) 0 0 / 38px 38px;
}

.fellowship-window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 15%, rgba(0, 0, 0, 0.12) 48%, rgba(0, 0, 0, 0.76) 100%);
}

.fellowship-window--blue {
  background: radial-gradient(circle at 50% 22%, #88c8f7 0, #285e9d 32%, #17243e 78%);
}

.fellowship-window--green {
  background: radial-gradient(circle at 50% 22%, #9acb87 0, #42704c 34%, #1f3128 78%);
}

.fellowship-window--red {
  background: radial-gradient(circle at 50% 22%, #e58b72 0, #8a3931 35%, #381c1c 78%);
}

.fellowship-window--empty {
  border-style: dashed;
  border-color: #6b6048;
  background: radial-gradient(circle at 50% 30%, rgba(107, 96, 72, 0.18), rgba(15, 15, 17, 0.92));
  cursor: default;
}

.fellowship-window-role {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 231, 159, 0.7);
  border-radius: 50%;
  background: rgba(12, 12, 15, 0.68);
  color: #ffe39a;
  font-size: 1.3rem;
}

.fellowship-window-figure {
  display: grid;
  place-items: center;
  width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 13vw, 10rem);
  line-height: 1;
  color: rgba(248, 236, 209, 0.94);
  text-shadow: 0 10px 25px rgba(0, 0, 0, 0.56);
}

.fellowship-window-level,
.fellowship-empty-note {
  color: #dcd2bd;
  font-size: 0.72rem;
}

.fellowship-window-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
}

.fellowship-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #f1dfaa;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fellowship-role--tank { color: #a9d5ff; }
.fellowship-role--dps { color: #ffb09c; }
.fellowship-role--healer { color: #b7e9a8; }

.fellowship-drag-hint {
  margin: 9px 0 0;
  color: #d4cab3;
  font-size: 0.76rem;
  text-align: center;
}

.fellowship-roster {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(137, 115, 67, 0.52);
}

.fellowship-roster-heading span {
  color: #bfb49e;
  font-size: 0.76rem;
}

.fellowship-filters {
  display: flex;
  gap: 6px;
  margin: 10px 0;
  overflow-x: auto;
}

.fellowship-filters button {
  min-width: 52px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #5b5140;
  border-radius: 8px;
  background: #171719;
  color: #dfd7c8;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.fellowship-filters button.is-active {
  border-color: #d9b956;
  background: #382d19;
  color: #ffe49b;
}

.fellowship-roster-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 150px);
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}

.fellowship-roster-card {
  min-height: 185px;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid #655b48;
  border-radius: 8px;
  background: #171719;
  overflow: hidden;
  scroll-snap-align: start;
}

.fellowship-roster-card.is-selected {
  border-color: #f2cf69;
  box-shadow: 0 0 13px rgba(242, 199, 92, 0.32);
}

.fellowship-roster-select {
  min-width: 0;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 3px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #f3ecdd;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fellowship-roster-card--blue .fellowship-roster-select {
  background: linear-gradient(180deg, rgba(64, 111, 163, 0.6), rgba(18, 22, 31, 0.98));
}
.fellowship-roster-card--green .fellowship-roster-select {
  background: linear-gradient(180deg, rgba(67, 112, 76, 0.6), rgba(18, 27, 22, 0.98));
}
.fellowship-roster-card--red .fellowship-roster-select {
  background: linear-gradient(180deg, rgba(139, 57, 49, 0.62), rgba(31, 19, 19, 0.98));
}

.fellowship-roster-figure {
  justify-self: center;
  align-self: stretch;
  display: grid;
  place-items: center;
  font-size: 4rem;
  color: rgba(249, 237, 210, 0.92);
}

.fellowship-roster-level,
.fellowship-stars {
  color: #f4cf69;
  font-size: 0.7rem;
}

.fellowship-roster-select strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.83rem;
}

.fellowship-roster-toggle {
  min-height: 36px;
  border: 0;
  border-top: 1px solid #514735;
  background: #201d18;
  color: #e7d5a4;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.fellowship-roster-card--locked {
  place-items: center;
  padding: 12px;
  color: #9b958a;
  background: linear-gradient(#19191b, #0f0f11);
  text-align: center;
}

.fellowship-roster-card--locked .fellowship-roster-figure {
  filter: grayscale(1);
  opacity: 0.28;
}

.fellowship-roster-card--locked span:last-child {
  font-size: 0.68rem;
}

.fellowship-detail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: clamp(14px, 2vw, 22px);
  border-left: 1px solid #6a5833;
  background: linear-gradient(145deg, rgba(43, 24, 20, 0.93), rgba(14, 14, 16, 0.98) 55%);
}

.fellowship-detail-hero {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid #6d5b36;
  border-radius: 12px;
  overflow: hidden;
}

.fellowship-detail-hero--blue { background: linear-gradient(120deg, #24496d, #17191f 58%); }
.fellowship-detail-hero--green { background: linear-gradient(120deg, #315b3a, #17191f 58%); }
.fellowship-detail-hero--red { background: linear-gradient(120deg, #78342c, #1c1718 58%); }

.fellowship-detail-figure {
  align-self: stretch;
  display: grid;
  place-items: end center;
  font-size: clamp(5rem, 10vw, 8rem);
  color: rgba(249, 237, 210, 0.95);
}

.fellowship-detail h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
}

.fellowship-level-line {
  display: block;
  margin-top: 8px;
  color: #d7ccb6;
  font-size: 0.76rem;
}

.fellowship-member-description {
  margin: 12px 0;
  color: #ddd4c3;
  font-size: 0.82rem;
  line-height: 1.5;
}

.fellowship-detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #6a5937;
}

.fellowship-detail-tab {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #cfc5b2;
  font: 700 0.74rem/1 inherit;
  cursor: pointer;
}

.fellowship-detail-tab.is-active {
  color: #ffe293;
  box-shadow: inset 0 -2px #d6b451;
}

.fellowship-stat-list {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
}

.fellowship-stat-list > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(95, 82, 58, 0.45);
}

.fellowship-stat-list dt {
  color: #bfb5a4;
  font-size: 0.78rem;
}

.fellowship-stat-list dd {
  margin: 0;
  font-weight: 800;
}

.fellowship-skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.fellowship-skill-grid article,
.fellowship-placeholder-panel {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #594d38;
  border-radius: 10px;
  background: rgba(23, 22, 24, 0.94);
  font-size: 0.78rem;
}

.fellowship-skill-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #cfad4e;
  border-radius: 50%;
  background: #42351c;
  color: #ffe38d;
  font-size: 1.1rem;
}

.fellowship-placeholder-panel {
  margin-top: 12px;
  line-height: 1.5;
}

.fellowship-detail-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
  margin-top: 16px;
}

.fellowship-detail-actions .button {
  width: 100%;
}

.fellowship-bonds-panel {
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 32px;
  overflow: auto;
  text-align: center;
}

.fellowship-bonds-panel h2,
.fellowship-bonds-panel p {
  max-width: 54ch;
  margin: 0;
}

.fellowship-ornament {
  color: #efca69;
  font-size: 3rem;
}

.fellowship-tutorial-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid #705d35;
  background: #161513;
}

.fellowship-tutorial-cta strong {
  display: block;
  font-size: 0.82rem;
}

.fellowship-tutorial-cta .button {
  width: auto;
  min-width: 210px;
}

.fellowship-bottom-nav {
  min-height: 62px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid #675734;
  background: rgba(10, 10, 12, 0.98);
}

.fellowship-bottom-nav-button {
  min-width: 44px;
  min-height: 56px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  border-right: 1px solid #322d25;
  background: transparent;
  color: #c7bda8;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}

.fellowship-bottom-nav-button > span:first-child {
  font-size: 1.35rem;
}

.fellowship-bottom-nav-button.is-active {
  color: #ffe194;
  background: radial-gradient(circle at 50% 110%, rgba(204, 154, 44, 0.45), transparent 62%);
}

.fellowship-bottom-nav-button:disabled {
  opacity: 0.42;
}

.fellowship-window:focus-visible,
.fellowship-roster-select:focus-visible,
.fellowship-roster-toggle:focus-visible,
.fellowship-section-tab:focus-visible,
.fellowship-detail-tab:focus-visible,
.fellowship-bottom-nav-button:focus-visible,
.fellowship-filters button:focus-visible,
.fellowship-back:focus-visible,
.fellowship-resources button:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

@media (max-width: 899px) {
  .experience--fellowship {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  }

  .fellowship-main {
    display: block;
    overflow: auto;
  }

  .fellowship-formation-stage {
    overflow: visible;
  }

  .fellowship-detail {
    overflow: visible;
    border-top: 1px solid #6a5833;
    border-left: 0;
  }

  .fellowship-window {
    min-height: clamp(205px, 34vh, 320px);
  }
}

@media (max-width: 560px) {
  .fellowship-topbar {
    align-items: flex-start;
    padding-inline: 10px;
  }

  .fellowship-resources {
    gap: 5px;
  }

  .fellowship-resources > span {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .fellowship-resources button {
    min-width: 38px;
    min-height: 38px;
  }

  .fellowship-section-tab {
    min-height: 46px;
    font-size: 0.74rem;
  }

  .fellowship-status {
    padding-inline: 10px;
  }

  .fellowship-formation-stage,
  .fellowship-detail {
    padding: 10px;
  }

  .fellowship-windows {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .fellowship-window-wrap {
    border-radius: 34px 34px 8px 8px;
  }

  .fellowship-window {
    min-height: 190px;
    padding: 8px 4px 10px;
    border-radius: 32px 32px 6px 6px;
  }

  .fellowship-window-role {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .fellowship-window-figure {
    font-size: clamp(3.3rem, 18vw, 5.2rem);
  }

  .fellowship-window-name {
    font-size: 0.68rem;
  }

  .fellowship-role {
    font-size: 0.56rem;
  }

  .fellowship-drag-hint {
    display: none;
  }

  .fellowship-detail-hero {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 124px;
  }

  .fellowship-detail-tabs {
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    overflow-x: auto;
  }

  .fellowship-tutorial-cta {
    align-items: stretch;
    padding: 8px 10px;
  }

  .fellowship-tutorial-cta > div {
    display: none;
  }

  .fellowship-tutorial-cta .button {
    width: 100%;
    min-width: 0;
  }

  .fellowship-bottom-nav-button {
    min-height: 52px;
    font-size: 0.58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fellowship-window,
  .fellowship-roster-card,
  .fellowship-section-tab,
  .fellowship-detail-tab {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .fellowship-window,
  .fellowship-roster-card,
  .fellowship-detail,
  .fellowship-section-tab,
  .fellowship-bottom-nav-button {
    forced-color-adjust: auto;
    border-color: CanvasText;
  }
}


.fellowship-slot-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(242, 199, 92, 0.22);
}

.fellowship-slot-actions > span {
  grid-column: 1 / -1;
  color: #ddd6c6;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fellowship-slot-actions button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(242, 199, 92, 0.42);
  background: rgba(12, 13, 17, 0.92);
  color: #f7f1df;
}

.fellowship-slot-actions button:disabled {
  border-color: rgba(242, 199, 92, 0.7);
  color: #ffe18a;
  opacity: 1;
}
