/*
 * GAME2 改版視覺層
 * 方向：電影感文化策略遊戲
 * 設計參數：Variance 8 / Motion 7 / Density 5
 * 造型規則：內容表面 18px、控制元件 10px、狀態徽章才使用圓形。
 */

:root {
  --rm-bg: #07110f;
  --rm-bg-deep: #050c0b;
  --rm-surface: #0c1715;
  --rm-surface-high: #12211e;
  --rm-surface-soft: #172824;
  --rm-text: #f4efe5;
  --rm-text-soft: #c9cec8;
  --rm-muted: #a6b0aa;
  --rm-border: rgba(238, 236, 226, 0.16);
  --rm-border-strong: rgba(238, 236, 226, 0.28);
  --rm-accent: #d89246;
  --rm-accent-strong: #f0b667;
  --rm-accent-ink: #111815;
  --rm-danger: #db725f;
  --rm-ok: #75b895;
  --rm-radius-surface: 18px;
  --rm-radius-control: 10px;
  --rm-shadow: 0 28px 80px rgba(2, 8, 7, 0.42);
  --rm-shadow-soft: 0 14px 38px rgba(2, 8, 7, 0.28);
  --rm-font: "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --rm-display: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --fserif: var(--rm-display);
  --fsans: var(--rm-font);
  --gold: var(--rm-accent);
  --accent: var(--rm-accent);
  --accent-dark: #b96f2f;
  --paper: var(--rm-surface);
  --ink: var(--rm-text);
  --ink-soft: var(--rm-muted);
}

html {
  background: var(--rm-bg);
  color-scheme: dark;
}

body.remaster-ui {
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--rm-text);
  background: var(--rm-bg);
  background-image: none;
  background-attachment: scroll;
  font-family: var(--rm-font);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.remaster-ui #app {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

.remaster-ui h1,
.remaster-ui h2,
.remaster-ui h3 {
  font-family: var(--rm-display);
  letter-spacing: -0.035em;
}

.remaster-ui button,
.remaster-ui input,
.remaster-ui select,
.remaster-ui textarea {
  font: inherit;
}

.remaster-ui button {
  margin: 0;
  min-height: 44px;
  border-radius: var(--rm-radius-control);
  border: 1px solid var(--rm-border-strong);
  background: var(--rm-surface-high);
  color: var(--rm-text);
  box-shadow: none;
  font-weight: 750;
  transition: transform 180ms cubic-bezier(.16, 1, .3, 1), border-color 180ms ease, background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.remaster-ui button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(240, 182, 103, 0.78);
  background: var(--rm-surface-soft);
  box-shadow: none;
}

.remaster-ui button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  box-shadow: none;
}

.remaster-ui button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.remaster-ui :focus-visible {
  outline: 3px solid var(--rm-accent-strong) !important;
  outline-offset: 3px;
}

.remaster-ui ::selection {
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
}

.remaster-ui .audio-toggle {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 120;
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border: 1px solid var(--rm-border-strong);
  border-radius: 50%;
  background: rgba(8, 18, 16, 0.92);
  color: var(--rm-text);
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 30px rgba(2, 8, 7, 0.34);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.remaster-ui .audio-toggle::after {
  content: attr(data-label);
  position: absolute;
  right: 58px;
  top: 50%;
  width: max-content;
  transform: translateY(-50%);
  padding: 7px 10px;
  border: 1px solid var(--rm-border);
  border-radius: 8px;
  background: rgba(8, 18, 16, 0.96);
  color: var(--rm-text-soft);
  font-size: 12px;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.remaster-ui .audio-toggle:hover::after,
.remaster-ui .audio-toggle:focus-visible::after {
  opacity: 1;
}

/* Home */

.remaster-ui .remaster-home {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100dvh !important;
  overflow: hidden;
  color: var(--rm-text);
  background: var(--rm-bg) !important;
}

.remaster-ui .remaster-home .ps5-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: url("assets/ui/hero-remaster.webp") !important;
  background-position: center center !important;
  background-size: cover !important;
  filter: saturate(0.82) contrast(1.04) brightness(0.74);
  transform: scale(1.015);
  animation: rmHeroSettle 1500ms cubic-bezier(.16, 1, .3, 1) both;
}

.remaster-ui .remaster-home::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 12, 11, 0.97) 0%, rgba(5, 12, 11, 0.84) 34%, rgba(5, 12, 11, 0.34) 66%, rgba(5, 12, 11, 0.68) 100%),
    linear-gradient(180deg, rgba(5, 12, 11, 0.26), rgba(5, 12, 11, 0.06) 52%, rgba(5, 12, 11, 0.92));
}

.remaster-ui .remaster-home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.remaster-ui .remaster-home .ps5-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 64% 42%, transparent 18%, rgba(2, 8, 7, 0.18) 62%, rgba(2, 8, 7, 0.72) 100%);
}

.remaster-ui .remaster-home .ps5-embers,
.remaster-ui .remaster-home .ps5-focus-glow,
.remaster-ui .remaster-home .ps5-sidebar,
.remaster-ui .remaster-home .ps5-topbar,
.remaster-ui .remaster-home .ps5-nav-toggle,
.remaster-ui .remaster-home .ps5-nav-scrim,
.remaster-ui .remaster-home .home-cta-bar,
.remaster-ui .remaster-home .ps5-hints,
.remaster-ui .remaster-home .ps5-actions {
  display: none !important;
}

.remaster-ui .game-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: max(16px, env(safe-area-inset-top)) clamp(24px, 5vw, 80px) 12px;
  border-bottom: 1px solid rgba(238, 236, 226, 0.11);
}

.remaster-ui .game-brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.remaster-ui .game-brand:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
}

.remaster-ui .game-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--rm-accent);
  border-radius: 50%;
  color: var(--rm-accent-strong);
  font-size: 18px;
  font-weight: 900;
}

.remaster-ui .game-brand span:last-child {
  display: grid;
  line-height: 1.05;
}

.remaster-ui .game-brand b {
  color: var(--rm-text);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.remaster-ui .game-brand small {
  margin-top: 5px;
  color: var(--rm-muted);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.remaster-ui .game-nav nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.remaster-ui .game-nav nav button {
  min-height: 42px;
  padding: 8px 15px;
  border-color: transparent;
  background: transparent;
  color: var(--rm-text-soft);
  font-size: 14px;
}

.remaster-ui .game-nav nav button:hover {
  border-color: transparent;
  background: rgba(238, 236, 226, 0.07);
  color: var(--rm-text);
}

.remaster-ui .nav-primary {
  justify-self: end;
  min-width: 118px;
  padding: 10px 18px;
  border-color: var(--rm-accent);
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
}

.remaster-ui .nav-primary:hover:not(:disabled),
.remaster-ui .home-primary:hover:not(:disabled),
.remaster-ui .story-start:hover:not(:disabled),
.remaster-ui .setup-footer .primary-start-button:hover:not(:disabled) {
  border-color: var(--rm-accent-strong);
  background: var(--rm-accent-strong);
  color: var(--rm-accent-ink);
}

.remaster-ui .remaster-home .ps5-content.home-layout {
  position: relative;
  z-index: 2;
  display: grid !important;
  grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
  align-items: center !important;
  gap: clamp(42px, 7vw, 108px);
  width: min(1480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 104px clamp(24px, 5vw, 80px) 92px !important;
  text-align: left !important;
}

.remaster-ui .home-copy {
  align-self: center;
  max-width: 680px;
  animation: rmRise 760ms cubic-bezier(.16, 1, .3, 1) 80ms both;
}

.remaster-ui .home-kicker,
.remaster-ui .story-kicker,
.remaster-ui .setup-kicker {
  margin: 0 0 16px;
  color: var(--rm-accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.remaster-ui .home-copy h1 {
  display: grid;
  margin: 0;
  color: var(--rm-text);
  font-size: clamp(54px, 6.4vw, 94px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-shadow: 0 12px 34px rgba(2, 8, 7, 0.42);
}

.remaster-ui .home-copy h1 em {
  padding: 4px 0 7px;
  color: var(--rm-text-soft);
  font: inherit;
  font-size: 0.76em;
  font-style: normal;
  letter-spacing: -0.055em;
}

.remaster-ui .home-summary {
  max-width: 34em;
  margin: 24px 0 0;
  color: var(--rm-text-soft);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.8;
}

.remaster-ui .home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.remaster-ui .home-primary,
.remaster-ui .home-secondary {
  min-width: 142px;
  min-height: 52px;
  padding: 12px 22px;
  white-space: nowrap;
}

.remaster-ui .home-primary {
  border-color: var(--rm-accent);
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
}

.remaster-ui .home-secondary {
  background: rgba(12, 23, 21, 0.62);
  color: var(--rm-text);
}

.remaster-ui .home-facts {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: clamp(20px, 3vw, 42px);
  margin: 32px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--rm-border);
}

.remaster-ui .home-facts div {
  display: grid;
  gap: 1px;
}

.remaster-ui .home-facts dt {
  color: var(--rm-text);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
}

.remaster-ui .home-facts dd {
  margin: 0;
  color: var(--rm-muted);
  font-size: 12px;
}

.remaster-ui .home-tribe-console {
  align-self: center;
  width: 100%;
  max-width: 720px;
  min-width: 0;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-surface);
  background: linear-gradient(145deg, rgba(18, 33, 30, 0.91), rgba(7, 17, 15, 0.88));
  box-shadow: var(--rm-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  animation: rmRise 780ms cubic-bezier(.16, 1, .3, 1) 180ms both;
}

.remaster-ui .tribe-console-heading {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 0.75fr);
  align-items: end;
  gap: 24px;
  margin-bottom: 18px;
}

.remaster-ui .tribe-console-heading span,
.remaster-ui .tribe-stage-label {
  color: var(--rm-accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.remaster-ui .tribe-console-heading h2 {
  margin: 3px 0 0;
  color: var(--rm-text);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
}

.remaster-ui .tribe-console-heading p {
  margin: 0;
  color: var(--rm-muted);
  font-size: 12px;
  line-height: 1.65;
}

.remaster-ui .remaster-home .tribe-stage {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.28fr);
  min-height: 282px;
  overflow: hidden;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 15%, rgba(216, 146, 70, 0.16), transparent 44%),
    rgba(5, 13, 12, 0.76);
}

.remaster-ui .remaster-home .tribe-stage-media {
  width: 100% !important;
  height: 100% !important;
  min-height: 282px;
  padding: 18px 12px 0;
  background: transparent !important;
}

.remaster-ui .remaster-home .tribe-stage-img {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 20px 28px rgba(2, 8, 7, 0.56));
  transition: opacity 180ms ease, transform 360ms cubic-bezier(.16, 1, .3, 1);
}

.remaster-ui .remaster-home .tribe-stage-info {
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 28px !important;
  background: linear-gradient(90deg, transparent, rgba(7, 17, 15, 0.32));
  text-align: left !important;
}

.remaster-ui .tribe-stage-info b {
  color: var(--rm-text);
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.35;
}

.remaster-ui .tribe-stage-info p {
  max-width: 32em;
  margin: 0;
  color: var(--rm-text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.remaster-ui .remaster-home .tribe-carousel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px !important;
  width: 100% !important;
  margin: 12px 0 0 !important;
  padding: 0 !important;
}

.remaster-ui .remaster-home .tribe-card,
.remaster-ui .remaster-home .tribe-card:hover,
.remaster-ui .remaster-home .tribe-card.selected {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 9px;
  width: 100% !important;
  height: 62px !important;
  min-height: 62px;
  padding: 6px 9px;
  overflow: hidden;
  transform: none !important;
  border: 1px solid var(--rm-border) !important;
  border-radius: var(--rm-radius-control) !important;
  background: rgba(238, 236, 226, 0.035) !important;
  opacity: 0.72 !important;
  box-shadow: none !important;
  text-align: left;
}

.remaster-ui .remaster-home .tribe-card:hover {
  opacity: 1 !important;
  border-color: var(--rm-border-strong) !important;
}

.remaster-ui .remaster-home .tribe-card.selected {
  border-color: var(--rm-accent) !important;
  background: rgba(216, 146, 70, 0.13) !important;
  opacity: 1 !important;
}

.remaster-ui .remaster-home .tribe-card img {
  width: 42px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top center;
}

.remaster-ui .remaster-home .tribe-card::after {
  display: none;
}

.remaster-ui .remaster-home .tribe-name {
  position: static !important;
  padding: 0 !important;
  color: var(--rm-text) !important;
  background: transparent !important;
  font-size: 12px !important;
  font-weight: 750;
  line-height: 1.3;
  text-shadow: none !important;
}

.remaster-ui .home-integrity {
  position: absolute;
  left: clamp(24px, 5vw, 80px);
  right: clamp(84px, 8vw, 120px);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--rm-muted);
  font-size: 11px;
}

.remaster-ui .home-integrity span {
  flex: none;
  color: var(--rm-accent-strong);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.remaster-ui .home-integrity p {
  margin: 0;
}

/* Story */

.remaster-ui .story-screen,
.remaster-ui .setup-screen,
.remaster-ui .end-screen {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100dvh;
  color: var(--rm-text);
  background:
    linear-gradient(180deg, rgba(5, 12, 11, 0.64), rgba(5, 12, 11, 0.96)),
    url("assets/ui/hero-remaster.webp") center / cover fixed;
}

.remaster-ui .story-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) clamp(18px, 5vw, 72px) 10px;
  border-bottom: 1px solid var(--rm-border);
  background: rgba(7, 17, 15, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.remaster-ui .story-topbar > span {
  color: var(--rm-text-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.remaster-ui .story-back,
.remaster-ui .story-start {
  min-width: 96px;
  padding: 9px 16px;
}

.remaster-ui .story-back {
  justify-self: start;
  background: transparent;
}

.remaster-ui .story-start {
  justify-self: end;
  border-color: var(--rm-accent);
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
}

.remaster-ui .story-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(58px, 9vw, 116px) clamp(18px, 5vw, 72px) 96px;
}

.remaster-ui .story-hero {
  max-width: 850px;
  padding-bottom: clamp(56px, 8vw, 96px);
}

.remaster-ui .story-hero h1 {
  max-width: 13em;
  margin: 0;
  color: var(--rm-text);
  font-size: clamp(42px, 6.5vw, 84px);
  line-height: 1.04;
}

.remaster-ui .story-lead {
  max-width: 48em;
  margin: 24px 0 0;
  color: var(--rm-text-soft);
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.8;
}

.remaster-ui .story-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 46px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--rm-border);
}

.remaster-ui .story-stats div {
  display: grid;
}

.remaster-ui .story-stats b {
  font-size: 26px;
  line-height: 1;
}

.remaster-ui .story-stats span {
  margin-top: 5px;
  color: var(--rm-muted);
  font-size: 12px;
}

.remaster-ui .story-loop {
  display: grid;
  grid-template-columns: 1.24fr 0.76fr;
  grid-template-rows: repeat(2, minmax(230px, auto));
  gap: 16px;
  margin: 0;
}

.remaster-ui .story-loop article {
  position: relative;
  display: flex;
  overflow: hidden;
  min-width: 0;
  min-height: 230px;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-surface);
  background: var(--rm-surface);
  box-shadow: var(--rm-shadow-soft);
}

.remaster-ui .story-loop article b {
  display: block;
  color: var(--rm-text);
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.15;
}

.remaster-ui .story-loop article small {
  display: block;
  max-width: 36em;
  margin-top: 12px;
  color: var(--rm-text-soft);
  font-size: 14px;
  line-height: 1.75;
}

.remaster-ui .story-loop-primary {
  grid-row: 1 / 3;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 80% 10%, rgba(216, 146, 70, 0.18), transparent 42%),
    linear-gradient(145deg, #152723, #091310) !important;
}

.remaster-ui .story-materials {
  display: grid;
  grid-template-columns: repeat(2, minmax(80px, 1fr));
  gap: 10px;
  width: min(360px, 82%);
  margin-left: auto;
  transform: rotate(-3deg);
}

.remaster-ui .story-materials img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(2, 8, 7, 0.42));
}

.remaster-ui .story-loop-choice,
.remaster-ui .story-loop-house {
  align-items: flex-end;
  gap: 22px;
}

.remaster-ui .story-loop-choice {
  background: linear-gradient(130deg, #1b211d, #0c1715) !important;
}

.remaster-ui .story-loop-house {
  background: linear-gradient(145deg, #12211e, #081210) !important;
}

.remaster-ui .story-loop-choice img {
  width: min(32%, 120px);
  align-self: center;
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(2, 8, 7, 0.48);
  transform: rotate(-5deg);
}

.remaster-ui .story-loop-house img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
}

.remaster-ui .story-loop-house::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 17, 15, 0.96), rgba(7, 17, 15, 0.3));
}

.remaster-ui .story-loop-house div {
  position: relative;
  z-index: 1;
}

.remaster-ui .culture-context {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(500px, 1.14fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: start;
  margin-top: clamp(80px, 12vw, 150px);
}

.remaster-ui .culture-context-copy h3 {
  margin: 0;
  color: var(--rm-text);
  font-size: clamp(32px, 4.3vw, 58px);
  line-height: 1.1;
}

.remaster-ui .culture-context-copy p {
  margin: 22px 0 0;
  color: var(--rm-text-soft);
  font-size: 16px;
  line-height: 1.85;
}

.remaster-ui .culture-context-copy ul {
  display: grid;
  gap: 13px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.remaster-ui .culture-context-copy li {
  position: relative;
  padding-left: 24px;
  color: var(--rm-text-soft);
}

.remaster-ui .culture-context-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.63em;
  width: 9px;
  height: 2px;
  background: var(--rm-accent);
}

.remaster-ui .story-tribe-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.remaster-ui .story-tribe-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: end;
  gap: 14px;
  min-width: 0;
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background: rgba(12, 23, 21, 0.82);
  box-shadow: none;
}

.remaster-ui .story-tribe-card img {
  width: 92px;
  height: 126px;
  max-width: none;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
  box-shadow: 0 12px 26px rgba(2, 8, 7, 0.34);
}

.remaster-ui .story-tribe-card div {
  display: grid;
  gap: 6px;
}

.remaster-ui .story-tribe-card b {
  color: var(--rm-text);
  font-size: 16px;
}

.remaster-ui .story-tribe-card span {
  color: var(--rm-muted);
  font-size: 11px;
  line-height: 1.5;
}

.remaster-ui .story-lore {
  margin-top: 72px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-surface);
  background: rgba(12, 23, 21, 0.84);
}

.remaster-ui .story-lore summary {
  padding: 22px 24px;
  color: var(--rm-text);
  font-weight: 800;
  cursor: pointer;
}

.remaster-ui .story-lore[open] summary {
  border-bottom: 1px solid var(--rm-border);
}

.remaster-ui .story-lore p {
  max-width: 70em;
  margin: 0;
  padding: 20px 24px 0;
  color: var(--rm-text-soft);
  line-height: 1.85;
}

.remaster-ui .story-lore p:last-child {
  padding-bottom: 24px;
}

.remaster-ui .story-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.remaster-ui .story-actions .primary-start-button,
.remaster-ui .setup-footer .primary-start-button {
  min-width: 142px;
  border-color: var(--rm-accent) !important;
  background: var(--rm-accent) !important;
  color: var(--rm-accent-ink) !important;
}

.remaster-ui .story-actions .secondary-lore-button {
  min-width: 120px;
  color: var(--rm-text);
  background: var(--rm-surface-high);
}

/* STEAM education mission desk */

.remaster-ui .education-screen {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  color: var(--rm-text);
  background:
    linear-gradient(180deg, rgba(5, 12, 11, 0.72), rgba(5, 12, 11, 0.98) 520px),
    url("assets/ui/hero-remaster.webp") center top / cover fixed;
}

.remaster-ui .education-screen::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(238, 236, 226, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 236, 226, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 320px);
  mask-image: linear-gradient(180deg, transparent, #000 320px);
}

.remaster-ui .education-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) clamp(18px, 4vw, 64px) 10px;
  border-bottom: 1px solid var(--rm-border);
  background: rgba(7, 17, 15, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.remaster-ui .education-brand {
  display: grid;
  justify-items: center;
  line-height: 1.1;
}

.remaster-ui .education-brand span {
  color: var(--rm-accent-strong);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.remaster-ui .education-brand b {
  margin-top: 4px;
  font-size: 14px;
}

.remaster-ui .education-top-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.remaster-ui .education-top-actions button {
  min-width: 96px;
  padding: 8px 14px;
}

.remaster-ui .education-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 60px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 128px) clamp(18px, 4vw, 64px) clamp(52px, 7vw, 86px);
}

.remaster-ui .education-hero > div {
  max-width: 980px;
}

.remaster-ui .education-hero h1 {
  max-width: 15em;
  margin: 0;
  color: var(--rm-text);
  font-size: clamp(42px, 5.7vw, 82px);
  line-height: 1.04;
}

.remaster-ui .education-hero p:last-child {
  max-width: 55em;
  margin: 24px 0 0;
  color: var(--rm-text-soft);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.8;
}

.remaster-ui .education-hero dl {
  display: grid;
  gap: 18px;
  min-width: 150px;
  margin: 0;
  padding-left: 28px;
  border-left: 1px solid var(--rm-border-strong);
}

.remaster-ui .education-hero dl div {
  display: grid;
}

.remaster-ui .education-hero dt {
  color: var(--rm-text);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.remaster-ui .education-hero dd {
  margin: 5px 0 0;
  color: var(--rm-muted);
  font-size: 11px;
}

.remaster-ui .education-workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 64px) 110px;
}

.remaster-ui .education-controls {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 18px;
  max-height: calc(100dvh - 112px);
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-surface);
  background: rgba(12, 23, 21, 0.92);
  box-shadow: var(--rm-shadow-soft);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.remaster-ui .education-control-head {
  display: grid;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rm-border);
}

.remaster-ui .education-control-head span {
  color: var(--rm-text);
  font-size: 18px;
  font-weight: 850;
}

.remaster-ui .education-control-head small,
.remaster-ui .education-seed small {
  margin-top: 3px;
  color: var(--rm-muted);
  font-size: 10px;
}

.remaster-ui .education-controls fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.remaster-ui .education-controls legend,
.remaster-ui .education-theme-field > span {
  margin-bottom: 9px;
  color: var(--rm-accent-strong);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.remaster-ui .grade-band-list {
  display: grid;
  gap: 6px;
}

.remaster-ui .grade-band-button {
  display: grid;
  min-height: 54px;
  padding: 9px 11px;
  border-color: transparent;
  background: rgba(238, 236, 226, 0.035);
  text-align: left;
}

.remaster-ui .grade-band-button b {
  font-size: 12px;
}

.remaster-ui .grade-band-button small {
  color: var(--rm-muted);
  font-size: 9px;
}

.remaster-ui .grade-band-button.is-active {
  border-color: var(--rm-accent);
  background: rgba(216, 146, 70, 0.12);
  color: var(--rm-text);
  box-shadow: inset 3px 0 var(--rm-accent);
}

.remaster-ui .education-theme-field {
  display: grid;
}

.remaster-ui .education-theme-field select {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--rm-border-strong);
  border-radius: var(--rm-radius-control);
  background: var(--rm-surface-high);
  color: var(--rm-text);
}

.remaster-ui .education-generate {
  display: grid;
  min-height: 64px;
  padding: 10px 14px;
  border-color: var(--rm-accent);
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
  text-align: left;
}

.remaster-ui .education-generate span {
  font-size: 9px;
  letter-spacing: 0.12em;
}

.remaster-ui .education-generate b {
  font-size: 15px;
}

.remaster-ui .education-seed {
  display: grid;
  padding: 13px;
  border: 1px solid var(--rm-border);
  border-radius: 10px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .education-seed span {
  color: var(--rm-muted);
  font-size: 9px;
}

.remaster-ui .education-seed code {
  overflow: hidden;
  margin-top: 3px;
  color: var(--rm-accent-strong);
  font-size: 12px;
  text-overflow: ellipsis;
}

.remaster-ui .education-control-note {
  padding: 14px;
  border-left: 3px solid var(--rm-accent);
  background: rgba(216, 146, 70, 0.07);
}

.remaster-ui .education-control-note b {
  font-size: 11px;
}

.remaster-ui .education-control-note p {
  margin: 5px 0 0;
  color: var(--rm-muted);
  font-size: 10px;
  line-height: 1.6;
}

.remaster-ui .lesson-plan {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-surface);
  background: var(--rm-surface);
  box-shadow: var(--rm-shadow);
}

.remaster-ui .lesson-header {
  padding: clamp(30px, 5vw, 72px);
  border-bottom: 1px solid var(--rm-border);
  background:
    radial-gradient(circle at 88% 4%, rgba(216, 146, 70, 0.16), transparent 34%),
    linear-gradient(145deg, #13231f, #091411);
}

.remaster-ui .lesson-eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.remaster-ui .lesson-eyebrow span {
  padding: 4px 8px;
  border: 1px solid var(--rm-border-strong);
  border-radius: 6px;
  color: var(--rm-accent-strong);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.remaster-ui .lesson-header h2 {
  max-width: 18em;
  margin: 24px 0 0;
  color: var(--rm-text);
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.08;
}

.remaster-ui .lesson-header > p {
  max-width: 56em;
  margin: 20px 0 0;
  color: var(--rm-text-soft);
  line-height: 1.8;
}

.remaster-ui .lesson-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 30px 0 0;
  border: 1px solid var(--rm-border);
  background: var(--rm-border);
}

.remaster-ui .lesson-meta div {
  display: grid;
  min-width: 0;
  padding: 13px 16px;
  background: rgba(7, 17, 15, 0.84);
}

.remaster-ui .lesson-meta dt {
  color: var(--rm-muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.remaster-ui .lesson-meta dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--rm-text);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remaster-ui .lesson-plan > section {
  padding: clamp(28px, 4vw, 56px);
  border-bottom: 1px solid var(--rm-border);
}

.remaster-ui .lesson-section-heading {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 26px;
}

.remaster-ui .lesson-section-heading > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rm-accent);
  border-radius: 50%;
  color: var(--rm-accent-strong);
  font-size: 10px;
  font-weight: 900;
}

.remaster-ui .lesson-section-heading > div {
  display: grid;
}

.remaster-ui .lesson-section-heading b {
  color: var(--rm-text);
  font-size: 18px;
}

.remaster-ui .lesson-section-heading small {
  max-width: 60em;
  margin-top: 3px;
  color: var(--rm-muted);
  font-size: 10px;
  line-height: 1.6;
}

.remaster-ui .lesson-anchors {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(180px, 0.72fr) minmax(240px, 1.56fr);
  gap: 12px;
}

.remaster-ui .lesson-anchor-card,
.remaster-ui .lesson-anchor-prompt {
  min-width: 0;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background: var(--rm-surface-high);
}

.remaster-ui .lesson-anchor-card {
  position: relative;
}

.remaster-ui .lesson-anchor-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  opacity: 0.72;
}

.remaster-ui .material-anchor img {
  padding: 24px;
  object-fit: contain;
}

.remaster-ui .lesson-anchor-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 24%, rgba(7, 17, 15, 0.94));
}

.remaster-ui .lesson-anchor-card > div {
  position: absolute;
  z-index: 1;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
}

.remaster-ui .lesson-anchor-card span,
.remaster-ui .lesson-anchor-prompt span {
  color: var(--rm-accent-strong);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.remaster-ui .lesson-anchor-card b {
  font-size: 17px;
}

.remaster-ui .lesson-anchor-card small {
  color: var(--rm-muted);
  font-size: 9px;
}

.remaster-ui .lesson-anchor-prompt {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  border-color: rgba(216, 146, 70, 0.32);
  background: linear-gradient(145deg, rgba(216, 146, 70, 0.13), rgba(238, 236, 226, 0.025));
}

.remaster-ui .lesson-anchor-prompt b {
  margin-top: 9px;
  color: var(--rm-text);
  font-size: 15px;
  line-height: 1.65;
}

.remaster-ui .lesson-goal-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: 28px;
}

.remaster-ui .lesson-goal-grid > ol {
  display: grid;
  gap: 13px;
  align-content: start;
  margin: 0;
  padding: 0;
  counter-reset: lesson-goals;
  list-style: none;
}

.remaster-ui .lesson-goal-grid > ol li {
  position: relative;
  padding: 13px 14px 13px 42px;
  border: 1px solid var(--rm-border);
  border-radius: 10px;
  color: var(--rm-text-soft);
  background: rgba(238, 236, 226, 0.025);
  font-size: 12px;
  counter-increment: lesson-goals;
}

.remaster-ui .lesson-goal-grid > ol li::before {
  content: counter(lesson-goals, decimal-leading-zero);
  position: absolute;
  left: 13px;
  color: var(--rm-accent-strong);
  font-size: 9px;
  font-weight: 900;
}

.remaster-ui .steam-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.remaster-ui .steam-grid article {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--rm-border);
  border-radius: 10px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .steam-grid article:first-child {
  grid-column: 1 / 3;
}

.remaster-ui .steam-grid article > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rm-border-strong);
  border-radius: 8px;
  color: var(--rm-accent-strong);
  font-size: 17px;
  font-weight: 900;
}

.remaster-ui .steam-grid b {
  font-size: 11px;
}

.remaster-ui .steam-grid p {
  margin: 4px 0 0;
  color: var(--rm-muted);
  font-size: 10px;
  line-height: 1.55;
}

.remaster-ui .lesson-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remaster-ui .lesson-timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 43px;
  width: 1px;
  background: var(--rm-border-strong);
}

.remaster-ui .lesson-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  padding: 0 0 18px;
}

.remaster-ui .lesson-time {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  width: 86px;
  height: 70px;
  border: 1px solid var(--rm-border-strong);
  border-radius: 12px;
  background: var(--rm-surface);
}

.remaster-ui .lesson-time b {
  color: var(--rm-accent-strong);
  font-size: 20px;
  line-height: 1;
}

.remaster-ui .lesson-time small {
  color: var(--rm-muted);
  font-size: 8px;
}

.remaster-ui .lesson-step {
  padding: 16px 18px;
  border: 1px solid var(--rm-border);
  border-radius: 12px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .lesson-step > span {
  color: var(--rm-accent-strong);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.remaster-ui .lesson-step h3 {
  margin: 3px 0 9px;
  font-size: 16px;
}

.remaster-ui .lesson-step p {
  margin: 3px 0;
  color: var(--rm-text-soft);
  font-size: 11px;
  line-height: 1.65;
}

.remaster-ui .lesson-step > small {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(216, 146, 70, 0.1);
  color: var(--rm-accent-strong);
  font-size: 8px;
}

.remaster-ui .lesson-kit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.remaster-ui .lesson-kit-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--rm-border);
  border-radius: 12px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .lesson-kit-grid h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.remaster-ui .lesson-kit-grid ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remaster-ui .lesson-kit-grid li {
  padding: 4px 7px;
  border: 1px solid var(--rm-border);
  border-radius: 5px;
  color: var(--rm-text-soft);
  font-size: 9px;
}

.remaster-ui .lesson-kit-grid p {
  margin: 5px 0;
  color: var(--rm-text-soft);
  font-size: 10px;
  line-height: 1.65;
}

.remaster-ui .evidence-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.remaster-ui .evidence-ledger article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--rm-border);
  border-top: 3px solid var(--rm-border-strong);
  border-radius: 10px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .evidence-ledger article[data-status="official"] {
  border-top-color: var(--rm-accent);
}

.remaster-ui .evidence-ledger article > span {
  color: var(--rm-muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.remaster-ui .evidence-ledger h3 {
  margin: 5px 0 8px;
  font-size: 16px;
}

.remaster-ui .evidence-ledger p {
  margin: 0;
  color: var(--rm-text-soft);
  font-size: 10px;
  line-height: 1.7;
}

.remaster-ui .culture-safety-panel {
  margin-top: 16px;
  border: 1px solid rgba(216, 146, 70, 0.32);
  border-radius: 12px;
  background: rgba(216, 146, 70, 0.06);
}

.remaster-ui .culture-safety-panel summary {
  padding: 14px 16px;
  color: var(--rm-accent-strong);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.remaster-ui .culture-safety-panel ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 18px 18px 36px;
  color: var(--rm-text-soft);
  font-size: 10px;
  line-height: 1.6;
}

.remaster-ui .lesson-sources {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
  padding: clamp(28px, 4vw, 50px);
  background: rgba(5, 12, 11, 0.72);
}

.remaster-ui .lesson-sources > div b {
  font-size: 15px;
}

.remaster-ui .lesson-sources > div p {
  margin: 7px 0 0;
  color: var(--rm-muted);
  font-size: 10px;
  line-height: 1.65;
}

.remaster-ui .lesson-sources ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remaster-ui .lesson-sources li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rm-border);
}

.remaster-ui .lesson-sources li span {
  color: var(--rm-accent-strong);
  font-size: 8px;
}

.remaster-ui .lesson-sources a {
  color: var(--rm-text-soft);
  font-size: 10px;
  text-decoration-color: rgba(216, 146, 70, 0.5);
  text-underline-offset: 3px;
}

.remaster-ui .lesson-sources a:hover {
  color: var(--rm-text);
}

/* Setup and end */

.remaster-ui .setup-screen,
.remaster-ui .end-screen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(18px, 3vw, 36px);
}

.remaster-ui .setup-panel {
  position: relative;
  width: min(1280px, 100%);
  min-height: calc(100dvh - clamp(36px, 6vw, 72px));
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 46px) !important;
  overflow: visible;
  border: 1px solid var(--rm-border) !important;
  border-image: none !important;
  border-radius: var(--rm-radius-surface) !important;
  background: rgba(7, 17, 15, 0.94) !important;
  background-clip: border-box !important;
  color: var(--rm-text) !important;
  box-shadow: var(--rm-shadow) !important;
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
}

.remaster-ui .setup-header {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rm-border);
}

.remaster-ui .setup-back {
  position: static !important;
  align-self: start;
  width: 96px;
  min-height: 44px;
  padding: 8px 14px;
  background: transparent;
  color: var(--rm-text);
}

.remaster-ui .setup-header h1,
.remaster-ui .setup-panel > h1 {
  margin: 0;
  color: var(--rm-text) !important;
  font-size: clamp(32px, 4.3vw, 58px) !important;
  line-height: 1.05;
}

.remaster-ui .setup-header > div > p:last-child {
  max-width: 56em;
  margin: 14px 0 0;
  color: var(--rm-text-soft);
}

.remaster-ui .setup-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(24px, 4vw, 54px);
  margin-top: 24px;
}

.remaster-ui .setup-config,
.remaster-ui .setup-roster {
  min-width: 0;
}

.remaster-ui .setup-config {
  padding: 22px;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background: rgba(238, 236, 226, 0.035);
}

.remaster-ui .setup-panel .name-field {
  display: grid;
  gap: 9px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.remaster-ui .setup-panel .name-field-label,
.remaster-ui .setup-section-label {
  color: var(--rm-text);
  font-size: 13px;
  font-weight: 800;
}

.remaster-ui .setup-panel .name-field-label small {
  color: var(--rm-muted);
  font-size: 11px;
  font-weight: 600;
}

.remaster-ui .setup-panel input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--rm-border-strong);
  border-radius: var(--rm-radius-control);
  background: #101c19;
  color: var(--rm-text);
  box-shadow: none;
}

.remaster-ui .setup-panel input[type="text"]::placeholder {
  color: var(--rm-muted);
  opacity: 1;
}

.remaster-ui .setup-section-label {
  margin-top: 24px;
}

.remaster-ui .setup-panel .player-count-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 9px 0 0;
}

.remaster-ui .setup-panel .player-count-row .option-button {
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border-color: var(--rm-border);
  background: var(--rm-surface-high);
  color: var(--rm-text-soft);
}

.remaster-ui .setup-panel .player-count-row .option-button.is-active {
  border-color: var(--rm-accent);
  background: rgba(216, 146, 70, 0.15);
  color: var(--rm-text);
}

.remaster-ui .setup-meta {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 24px 0 0 !important;
  color: var(--rm-muted) !important;
  text-align: left !important;
}

.remaster-ui .setup-meta span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(238, 236, 226, 0.09);
}

.remaster-ui .setup-meta b {
  color: var(--rm-text);
}

.remaster-ui .setup-panel .player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.remaster-ui .setup-panel .player-tag {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
  font-size: 12px;
}

.remaster-ui .setup-panel .player-tag-fixed {
  color: var(--rm-text-soft);
  font-size: 14px;
}

.remaster-ui .setup-panel .tribe-pick-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.remaster-ui .setup-panel .tribe-pick,
.remaster-ui .setup-panel .tribe-pick:hover:not(:disabled),
.remaster-ui .setup-panel .tribe-pick.is-active {
  position: relative;
  display: grid;
  grid-template-rows: minmax(150px, 1fr) auto auto;
  min-width: 0;
  min-height: 226px;
  padding: 8px;
  overflow: hidden;
  transform: none;
  border: 1px solid var(--rm-border) !important;
  border-radius: 12px !important;
  background: var(--rm-surface-high) !important;
  color: var(--rm-text) !important;
  box-shadow: none !important;
}

.remaster-ui .setup-panel .tribe-pick:hover:not(:disabled) {
  border-color: var(--rm-border-strong) !important;
  transform: translateY(-2px);
}

.remaster-ui .setup-panel .tribe-pick.is-active {
  border-color: var(--rm-accent) !important;
  background: rgba(216, 146, 70, 0.12) !important;
}

.remaster-ui .setup-panel .tribe-pick.is-active::after {
  content: "已選";
  top: 14px;
  right: 14px;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
  font-size: 10px;
}

.remaster-ui .setup-panel .tribe-pick img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  border-radius: 8px;
  object-fit: cover;
  object-position: top center;
}

.remaster-ui .setup-panel .tribe-pick span {
  padding: 9px 3px 0;
  font-size: 13px;
  line-height: 1.3;
}

.remaster-ui .setup-panel .tribe-pick small {
  padding: 4px 3px 3px;
  color: var(--rm-muted);
  font-size: 10px;
  line-height: 1.35;
}

.remaster-ui .bot-roster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.remaster-ui .bot-roster > span {
  display: grid;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(238, 236, 226, 0.09);
  border-radius: 10px;
  background: rgba(238, 236, 226, 0.025);
}

.remaster-ui .bot-roster b {
  color: var(--rm-text-soft);
  font-size: 12px;
}

.remaster-ui .bot-roster small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--rm-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remaster-ui .setup-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rm-border);
  background: rgba(7, 17, 15, 0.95);
}

.remaster-ui .setup-footer p {
  margin: 0 auto 0 0;
  color: var(--rm-muted);
  font-size: 13px;
}

.remaster-ui .setup-footer .primary-start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  min-height: 52px;
  margin: 0;
  padding: 10px 22px;
  font-size: 16px;
  white-space: nowrap;
}

.remaster-ui .end-screen .setup-panel {
  min-height: auto;
}

.remaster-ui .end-kicker {
  color: var(--rm-accent-strong);
}

.remaster-ui .winner-banner,
.remaster-ui .end-objectives,
.remaster-ui .end-score-scroll {
  border-color: var(--rm-border) !important;
  background: rgba(238, 236, 226, 0.035) !important;
  color: var(--rm-text);
}

.remaster-ui .score-table th,
.remaster-ui .score-table td {
  color: var(--rm-text-soft);
  border-color: var(--rm-border);
}

/* Board */

.remaster-ui .table-surface {
  position: relative;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 640px;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--rm-text);
  background:
    linear-gradient(180deg, rgba(5, 12, 11, 0.74), rgba(5, 12, 11, 0.93)),
    url("assets/ui/table-wood.jpg") center / cover !important;
  box-shadow: none;
}

.remaster-ui .table-surface::before {
  background:
    radial-gradient(ellipse at 52% 42%, rgba(216, 146, 70, 0.07), transparent 50%),
    linear-gradient(90deg, rgba(3, 9, 8, 0.42), transparent 30%, transparent 72%, rgba(3, 9, 8, 0.5));
}

.remaster-ui .table-surface .board-viewport {
  width: 100%;
  height: 100%;
  grid-template-columns: 248px minmax(0, 1fr) 62px !important;
  grid-template-rows: 64px 70px minmax(0, 1fr) 176px !important;
  grid-template-areas:
    "header header header"
    "versus versus versus"
    "resources buildings side"
    "hand hand hand" !important;
  gap: 10px !important;
  padding: 10px 14px 12px !important;
  overflow: hidden !important;
}

.remaster-ui .bv-header {
  min-width: 0;
  margin: 0;
}

.remaster-ui .bv-header > .row {
  min-height: 44px;
}

.remaster-ui .bv-header h1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: var(--rm-text) !important;
  font-size: 18px !important;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-shadow: none;
}

.remaster-ui .bv-header h1 span {
  color: var(--rm-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.remaster-ui .bv-header .chip {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-control);
  background: rgba(238, 236, 226, 0.04);
  color: var(--rm-text-soft);
  box-shadow: none;
}

.remaster-ui .tutorial-open-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.remaster-ui .event-banner {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(620px, 52vw);
  min-height: 48px;
  padding: 7px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(216, 146, 70, 0.36);
  border-radius: 12px;
  background: rgba(12, 23, 21, 0.92);
  color: var(--rm-text);
  box-shadow: var(--rm-shadow-soft);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.remaster-ui .event-icon,
.remaster-ui .obj-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--rm-accent);
  border-radius: 50%;
  color: var(--rm-accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.remaster-ui .event-text {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.remaster-ui .event-text b {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--rm-text);
  font-size: 12px;
}

.remaster-ui .event-text b i {
  padding: 2px 5px;
  border: 1px solid rgba(216, 146, 70, 0.35);
  border-radius: 4px;
  color: var(--rm-accent-strong);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.remaster-ui .event-text small {
  overflow: hidden;
  color: var(--rm-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remaster-ui .event-dur {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(216, 146, 70, 0.13);
  color: var(--rm-accent-strong);
  font-size: 11px;
  white-space: nowrap;
}

.remaster-ui .bv-versus .versus-strip {
  min-height: 66px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background: rgba(7, 17, 15, 0.76);
  box-shadow: none;
}

.remaster-ui .bv-versus .vs-player {
  min-width: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--rm-text-soft);
}

.remaster-ui .bv-versus .vs-player.active {
  background: rgba(216, 146, 70, 0.11);
  box-shadow: inset 3px 0 var(--rm-accent);
}

.remaster-ui .bv-versus .vs-player img {
  width: 38px;
  height: 38px;
  border: 1px solid var(--rm-border-strong);
}

.remaster-ui .card-box.light-frame,
.remaster-ui .bv-resources,
.remaster-ui .bv-buildings,
.remaster-ui .bv-side .action-menu,
.remaster-ui .bv-side .log-box,
.remaster-ui .bv-side .card-box {
  border: 1px solid var(--rm-border) !important;
  border-image: none !important;
  border-radius: var(--rm-radius-surface) !important;
  background: rgba(7, 17, 15, 0.9) !important;
  color: var(--rm-text) !important;
  box-shadow: var(--rm-shadow-soft) !important;
}

.remaster-ui .bv-resources {
  padding: 14px !important;
  overflow: auto;
}

.remaster-ui .bv-resources h3 {
  margin: 12px 0 8px;
  padding: 0;
  border: 0;
  color: var(--rm-text) !important;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.remaster-ui .bv-resources .row {
  gap: 6px;
}

.remaster-ui .bv-resources .chip {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid rgba(238, 236, 226, 0.08);
  border-radius: 8px;
  background: rgba(238, 236, 226, 0.035);
  color: var(--rm-text-soft) !important;
  font-size: 11px;
}

.remaster-ui .battle-archive,
.remaster-ui .mini-log {
  margin-top: 10px;
  border-top: 1px solid rgba(238, 236, 226, 0.09);
}

.remaster-ui .battle-archive summary,
.remaster-ui .mini-log summary {
  padding: 10px 0;
  color: var(--rm-text-soft);
  font-size: 11px;
  font-weight: 750;
}

.remaster-ui .mini-log-box {
  max-height: 112px;
  color: var(--rm-muted) !important;
  font-size: 10px;
}

.remaster-ui .bv-buildings {
  position: relative;
  padding: 12px 18px 10px !important;
  overflow: hidden;
}

.remaster-ui .board-coach {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 0 0 6px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 146, 70, 0.28);
  border-radius: 10px;
  background: rgba(216, 146, 70, 0.09);
  color: var(--rm-text);
  text-align: left;
}

.remaster-ui .board-coach span {
  display: grid;
}

.remaster-ui .board-coach small {
  color: var(--rm-accent-strong);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.remaster-ui .board-coach b {
  color: var(--rm-text);
  font-size: 12px;
}

.remaster-ui .board-coach em {
  color: var(--rm-accent-strong);
  font-size: 10px;
  font-style: normal;
}

.remaster-ui .bld-centerpiece-title {
  justify-content: center;
  margin: 4px 0 2px;
  color: var(--rm-text) !important;
  font-size: 14px;
}

.remaster-ui .bld-progressbar {
  overflow: hidden;
  width: 120px;
  height: 5px;
  border-radius: 3px;
  background: rgba(238, 236, 226, 0.11);
}

.remaster-ui .bld-progressbar i {
  background: var(--rm-accent);
}

.remaster-ui .bld-remain {
  color: var(--rm-muted);
  font-size: 10px;
}

.remaster-ui .bld-centerpiece {
  padding: 0 0 4px;
}

.remaster-ui .bld-grid {
  gap: 8px;
}

.remaster-ui .bld-cell {
  border-color: var(--rm-border) !important;
  border-radius: 10px;
  background: rgba(238, 236, 226, 0.025) !important;
  box-shadow: none !important;
}

.remaster-ui .table-decks {
  left: 14px;
  top: 66px;
  gap: 8px;
}

.remaster-ui .table-deck {
  padding: 5px;
  border: 1px solid var(--rm-border) !important;
  border-radius: 10px;
  background: rgba(7, 17, 15, 0.92) !important;
  color: var(--rm-text);
  box-shadow: none;
}

.remaster-ui .table-deck:hover {
  border-color: var(--rm-accent) !important;
  box-shadow: none;
}

.remaster-ui .table-deck.is-locked {
  cursor: help;
  opacity: 0.68;
}

.remaster-ui .table-deck.is-locked:hover {
  border-color: rgba(255, 205, 120, 0.55) !important;
}

.remaster-ui .table-deck.is-locked .table-deck-count {
  background: rgba(255, 205, 120, 0.72);
  color: #1d1710;
}

.remaster-ui .table-deck-stack img {
  border-radius: 7px;
}

.remaster-ui .table-deck-count {
  background: var(--rm-accent);
  color: var(--rm-accent-ink);
}

.remaster-ui .table-deck-label {
  border: 1px solid var(--rm-border);
  background: var(--rm-surface);
  color: var(--rm-text-soft);
}

.remaster-ui .bv-side {
  min-width: 0;
}

.remaster-ui .bv-side.is-collapsed,
.remaster-ui .bv-side.is-collapsed .hud-toggle {
  width: 54px !important;
  min-width: 54px !important;
}

.remaster-ui .bv-side.is-collapsed .hud-toggle,
.remaster-ui .bv-side .hud-toggle {
  min-height: 126px !important;
  margin: 12px 0 0 !important;
  border: 1px solid rgba(216, 146, 70, 0.45);
  border-radius: 12px 0 0 12px;
  background: rgba(7, 17, 15, 0.96);
  color: var(--rm-accent-strong);
  box-shadow: var(--rm-shadow-soft);
}

.remaster-ui .hud-toggle-count b {
  color: var(--rm-text);
}

.remaster-ui .bv-side .action-menu {
  padding: 16px !important;
}

.remaster-ui .bv-side .action-menu button {
  width: 100%;
  min-height: 42px;
  margin: 3px 0;
  padding: 8px 10px;
  border-color: var(--rm-border) !important;
  background: rgba(238, 236, 226, 0.04) !important;
  color: var(--rm-text-soft) !important;
  font-size: 12px;
  text-align: left;
}

.remaster-ui .bv-side .action-menu button:hover:not(:disabled) {
  border-color: rgba(216, 146, 70, 0.66) !important;
  background: rgba(216, 146, 70, 0.09) !important;
  color: var(--rm-text) !important;
}

.remaster-ui .bv-side .action-menu button.action-suggest {
  border-color: var(--rm-accent) !important;
  background: rgba(216, 146, 70, 0.13) !important;
  color: var(--rm-text) !important;
}

.remaster-ui .bv-side .action-menu .danger {
  border-color: rgba(219, 114, 95, 0.6) !important;
  background: rgba(219, 114, 95, 0.09) !important;
  color: #f2b0a3 !important;
}

.remaster-ui .action-group-label,
.remaster-ui .ap-tracker-label {
  color: var(--rm-accent-strong) !important;
}

.remaster-ui .turn-hint,
.remaster-ui .obj-desc,
.remaster-ui .obj-count,
.remaster-ui .goal-next,
.remaster-ui .advanced-actions p {
  color: var(--rm-muted) !important;
}

.remaster-ui .objective-panel,
.remaster-ui .goal-panel,
.remaster-ui .advanced-actions {
  border-color: var(--rm-border) !important;
  background: rgba(238, 236, 226, 0.025) !important;
}

.remaster-ui .obj-bar {
  background: var(--rm-accent) !important;
}

.remaster-ui .action-drawer-scrim {
  border: 0;
  border-radius: 0;
  background: rgba(2, 8, 7, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.remaster-ui .bv-hand {
  min-width: 0;
  min-height: 176px;
  margin: 0;
  padding: 10px 20px 8px;
  border: 1px solid var(--rm-border) !important;
  border-radius: var(--rm-radius-surface) !important;
  background: linear-gradient(180deg, rgba(12, 23, 21, 0.7), rgba(5, 12, 11, 0.92)) !important;
  box-shadow: var(--rm-shadow-soft);
}

.remaster-ui .bv-hand .hand-card,
.remaster-ui .bv-hand .hand-card:nth-child(odd),
.remaster-ui .bv-hand .hand-card:nth-child(even),
.remaster-ui .bv-hand .hand-card:nth-child(3n) {
  width: 112px;
  min-width: 112px;
  height: 148px;
  min-height: 148px;
  padding: 7px;
  border: 1px solid var(--rm-border-strong) !important;
  border-radius: 11px;
  background: #d8d1c4 !important;
  color: #15201d;
  box-shadow: 0 12px 26px rgba(2, 8, 7, 0.38);
}

.remaster-ui .bv-hand .hand-card::before {
  margin: -7px -7px 6px;
  border-radius: 10px 10px 0 0;
  background: #415149;
  color: var(--rm-text);
  font-size: 11px;
}

.remaster-ui .bv-hand .hand-card.culture {
  background: #d9d3c7 !important;
}

.remaster-ui .bv-hand .hand-card.culture::before {
  background: #6b5133;
}

.remaster-ui .bv-hand .hand-card:hover,
.remaster-ui .bv-hand .hand-card:focus-visible,
.remaster-ui .bv-hand .hand-card.is-inspected {
  transform: translateY(-10px) scale(1.03);
  border-color: var(--rm-accent) !important;
  box-shadow: 0 18px 30px rgba(2, 8, 7, 0.52);
}

.remaster-ui .bv-hand .hand-card .card-thumb {
  border: 0;
  border-radius: 7px;
}

.remaster-ui .bv-hand .hand-card-info {
  border: 1px solid var(--rm-border-strong);
  background: rgba(7, 17, 15, 0.98);
  color: var(--rm-text);
}

.remaster-ui .bv-hand .hand-card:hover .hand-card-info,
.remaster-ui .bv-hand .hand-card:focus-visible .hand-card-info,
.remaster-ui .bv-hand .hand-card.is-inspected .hand-card-info {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.remaster-ui .empty-hand-state {
  width: min(620px, 88%);
  min-height: 136px;
  border: 1px solid var(--rm-border);
  border-radius: 14px;
  background: rgba(238, 236, 226, 0.025);
  color: var(--rm-text-soft);
}

.remaster-ui .empty-deck {
  color: var(--rm-text-soft);
}

.remaster-ui .empty-deck img {
  border-color: var(--rm-border-strong);
}

.remaster-ui .link-open-hud {
  min-height: 0;
  margin-left: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rm-accent-strong);
}

.remaster-ui .mat-dock {
  left: 28px;
  bottom: 22px;
  gap: 8px;
}

.remaster-ui .mat-dock-coin {
  width: 46px;
  height: 46px;
}

.remaster-ui .mat-dock-coin img {
  border: 1px solid var(--rm-border-strong);
  box-shadow: 0 8px 16px rgba(2, 8, 7, 0.38);
}

.remaster-ui .mat-dock-num {
  color: var(--rm-text);
  font-size: 18px;
}

/* Dialogs */

.remaster-ui .overlay {
  z-index: 200;
  padding: 18px;
  background: rgba(2, 8, 7, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.remaster-ui .modal {
  width: min(620px, calc(100vw - 36px));
  max-height: min(88dvh, 760px);
  padding: clamp(24px, 4vw, 42px) !important;
  overflow: auto;
  border: 1px solid var(--rm-border-strong) !important;
  border-image: none !important;
  border-radius: var(--rm-radius-surface) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(216, 146, 70, 0.08), transparent 36%),
    var(--rm-surface) !important;
  background-clip: border-box !important;
  color: var(--rm-text) !important;
  box-shadow: 0 34px 90px rgba(2, 8, 7, 0.72) !important;
}

.remaster-ui .modal h3 {
  margin: 0 0 12px;
  color: var(--rm-text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.remaster-ui .modal p,
.remaster-ui .modal .muted {
  color: var(--rm-text-soft) !important;
}

.remaster-ui .modal button {
  border-color: var(--rm-border-strong);
  background: var(--rm-surface-high);
  color: var(--rm-text);
}

.remaster-ui .modal .cta,
.remaster-ui .modal .primary,
.remaster-ui .modal .primary-start-button,
.remaster-ui .dice-roll-button,
.remaster-ui .dice-continue-button {
  border-color: var(--rm-accent) !important;
  background: var(--rm-accent) !important;
  color: var(--rm-accent-ink) !important;
}

.remaster-ui .die,
.remaster-ui .die-cube {
  border-color: var(--rm-border-strong) !important;
  background: #d7d0c4 !important;
  color: #17201d !important;
  box-shadow: 0 16px 38px rgba(2, 8, 7, 0.4) !important;
}

.remaster-ui .dice-stage {
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 86%, rgba(216, 146, 70, 0.13), transparent 52%);
}

.remaster-ui .share-material-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.remaster-ui .share-material-option {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px;
  text-align: left;
}

.remaster-ui .share-material-option.is-needed {
  border-color: var(--rm-accent) !important;
  background: rgba(216, 146, 70, 0.1) !important;
}

.remaster-ui .share-material-option img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.remaster-ui .share-material-option span {
  display: grid;
}

.remaster-ui .share-material-option small {
  color: var(--rm-muted);
  font-size: 10px;
}

.remaster-ui .quiz-option,
.remaster-ui .rps-btn {
  border-color: var(--rm-border) !important;
  background: var(--rm-surface-high) !important;
  color: var(--rm-text) !important;
}

.remaster-ui .toast,
.remaster-ui .game-impact {
  border: 1px solid var(--rm-border-strong);
  border-radius: 12px;
  background: rgba(12, 23, 21, 0.96);
  color: var(--rm-text);
  box-shadow: var(--rm-shadow-soft);
}

@keyframes rmRise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rmHeroSettle {
  from { opacity: 0; transform: scale(1.055); }
  to { opacity: 1; transform: scale(1.015); }
}

@media (max-width: 1120px) {
  .remaster-ui .remaster-home .ps5-content.home-layout {
    grid-template-columns: minmax(0, 0.76fr) minmax(450px, 1.24fr);
    gap: 34px;
  }

  .remaster-ui .home-copy h1 {
    font-size: clamp(50px, 6vw, 70px);
  }

  .remaster-ui .remaster-home .tribe-card,
  .remaster-ui .remaster-home .tribe-card:hover,
  .remaster-ui .remaster-home .tribe-card.selected {
    grid-template-columns: 36px 1fr;
    padding-inline: 6px;
  }

  .remaster-ui .remaster-home .tribe-card img {
    width: 36px;
    height: 46px;
  }

  .remaster-ui .culture-context {
    grid-template-columns: minmax(0, 0.8fr) minmax(430px, 1.2fr);
    gap: 40px;
  }

  .remaster-ui .setup-panel .tribe-pick,
  .remaster-ui .setup-panel .tribe-pick:hover:not(:disabled),
  .remaster-ui .setup-panel .tribe-pick.is-active {
    min-height: 198px;
    grid-template-rows: minmax(120px, 1fr) auto auto;
  }

  .remaster-ui .setup-panel .tribe-pick img {
    min-height: 120px;
  }
}

@media (max-width: 900px) {
  .remaster-ui .game-nav {
    grid-template-columns: 1fr auto;
    min-height: 70px;
    padding-inline: 18px;
  }

  .remaster-ui .game-nav nav {
    display: none;
  }

  .remaster-ui .nav-primary {
    min-width: 106px;
  }

  .remaster-ui .remaster-home {
    min-height: 100dvh;
    overflow: visible;
  }

  .remaster-ui .remaster-home .ps5-bg {
    position: fixed;
    background-position: 58% center !important;
  }

  .remaster-ui .remaster-home::before {
    position: fixed;
    background: linear-gradient(180deg, rgba(5, 12, 11, 0.72), rgba(5, 12, 11, 0.96) 48%, rgba(5, 12, 11, 0.99));
  }

  .remaster-ui .remaster-home .ps5-content.home-layout {
    grid-template-columns: 1fr;
    align-items: start !important;
    gap: 42px;
    min-height: auto;
    padding: 104px 18px 58px !important;
  }

  .remaster-ui .home-copy {
    max-width: 650px;
  }

  .remaster-ui .home-copy h1 {
    font-size: clamp(48px, 13vw, 76px);
  }

  .remaster-ui .home-summary {
    max-width: 30em;
  }

  .remaster-ui .home-tribe-console {
    max-width: 680px;
  }

  .remaster-ui .home-integrity {
    position: static;
    padding: 0 18px max(86px, calc(22px + env(safe-area-inset-bottom)));
  }

  .remaster-ui .story-loop {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .remaster-ui .story-loop-primary {
    grid-row: auto;
    min-height: 480px !important;
  }

  .remaster-ui .culture-context,
  .remaster-ui .setup-grid {
    grid-template-columns: 1fr;
  }

  .remaster-ui .culture-context {
    gap: 36px;
  }

  .remaster-ui .setup-grid {
    gap: 20px;
  }

  .remaster-ui .setup-config {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }

  .remaster-ui .setup-meta {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .remaster-ui .setup-meta span {
    display: grid;
    justify-content: start;
  }

  .remaster-ui .table-surface {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
  }

  .remaster-ui .table-surface .board-viewport {
    height: auto;
    min-height: 100dvh;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    grid-template-areas:
      "header"
      "versus"
      "buildings"
      "resources"
      "hand"
      "side" !important;
    padding: 10px 10px 224px !important;
    overflow: visible !important;
  }

  .remaster-ui .event-banner {
    position: static;
    width: min(100%, 640px);
    margin: 6px auto 0;
    transform: none;
  }

  .remaster-ui .bv-header {
    min-height: 110px;
  }

  .remaster-ui .bv-resources,
  .remaster-ui .bv-buildings {
    min-height: 360px;
    overflow: visible;
  }

  .remaster-ui .bv-hand {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    min-height: 0;
    max-height: 210px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) !important;
    border-width: 1px 0 0 !important;
    border-radius: 16px 16px 0 0 !important;
    background: rgba(7, 17, 15, 0.96) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .remaster-ui .bv-side {
    position: fixed !important;
    inset: auto 10px 220px;
    z-index: 90;
    width: auto !important;
    min-width: 0 !important;
    pointer-events: none;
  }

  .remaster-ui .bv-side .hud-toggle {
    pointer-events: auto;
    width: 58px !important;
    min-width: 58px !important;
    min-height: 54px !important;
    margin: 0 0 0 auto !important;
    border-radius: 12px;
  }

  .remaster-ui .bv-side .action-menu {
    pointer-events: auto;
    width: min(420px, calc(100vw - 20px));
    max-height: min(66dvh, 640px);
    margin: 8px 0 0 !important;
    overflow: auto;
  }

  .remaster-ui .audio-toggle {
    bottom: calc(224px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) {
  .remaster-ui .game-brand small {
    display: none;
  }

  .remaster-ui .nav-primary {
    min-width: 98px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .remaster-ui .home-kicker,
  .remaster-ui .story-kicker,
  .remaster-ui .setup-kicker {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .remaster-ui .home-copy h1 {
    font-size: clamp(44px, 14.2vw, 62px);
  }

  .remaster-ui .home-summary {
    margin-top: 18px;
    font-size: 15px;
  }

  .remaster-ui .home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 22px;
  }

  .remaster-ui .home-primary,
  .remaster-ui .home-secondary {
    min-width: 0;
    width: 100%;
    padding-inline: 10px;
  }

  .remaster-ui .home-facts {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .remaster-ui .home-facts dt {
    font-size: 17px;
  }

  .remaster-ui .home-tribe-console {
    padding: 14px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  .remaster-ui .tribe-console-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .remaster-ui .tribe-console-heading p {
    max-width: 40em;
  }

  .remaster-ui .remaster-home .tribe-stage {
    max-width: none;
    margin: 0;
    grid-template-columns: minmax(118px, 0.72fr) minmax(0, 1.28fr);
    min-height: 220px;
  }

  .remaster-ui .remaster-home .tribe-stage-media {
    min-height: 220px;
    padding: 12px 4px 0;
  }

  .remaster-ui .remaster-home .tribe-stage-img {
    max-height: 230px;
  }

  .remaster-ui .remaster-home .tribe-stage-info {
    position: static;
    inset: auto;
    padding: 18px 14px !important;
  }

  .remaster-ui .tribe-stage-info b {
    font-size: 16px;
  }

  .remaster-ui .tribe-stage-info p {
    font-size: 11px;
  }

  .remaster-ui .remaster-home .tribe-carousel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remaster-ui .home-integrity {
    display: grid;
    gap: 6px;
  }

  .remaster-ui .story-topbar {
    grid-template-columns: auto 1fr auto;
    padding-inline: 12px;
  }

  .remaster-ui .story-topbar > span {
    justify-self: center;
    font-size: 11px;
  }

  .remaster-ui .story-back,
  .remaster-ui .story-start {
    min-width: 72px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .remaster-ui .story-shell {
    padding: 52px 14px 84px;
  }

  .remaster-ui .story-hero h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .remaster-ui .story-lead {
    font-size: 15px;
  }

  .remaster-ui .story-stats {
    gap: 28px;
  }

  .remaster-ui .story-loop-primary {
    min-height: 390px !important;
  }

  .remaster-ui .story-loop-choice,
  .remaster-ui .story-loop-house {
    min-height: 250px !important;
  }

  .remaster-ui .story-loop-choice {
    align-items: center;
  }

  .remaster-ui .story-tribe-row {
    grid-template-columns: 1fr;
  }

  .remaster-ui .culture-context-copy h3 {
    font-size: 36px;
  }

  .remaster-ui .story-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .remaster-ui .story-actions button {
    min-width: 0 !important;
  }

  .remaster-ui .setup-screen,
  .remaster-ui .end-screen {
    padding: 10px;
  }

  .remaster-ui .setup-panel {
    min-height: calc(100dvh - 20px);
    padding: 20px 14px 14px !important;
  }

  .remaster-ui .setup-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .remaster-ui .setup-back {
    width: 82px;
  }

  .remaster-ui .setup-header h1 {
    font-size: 38px !important;
  }

  .remaster-ui .setup-config {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .remaster-ui .setup-meta {
    grid-template-columns: 1fr;
  }

  .remaster-ui .setup-meta span {
    display: flex;
  }

  .remaster-ui .setup-panel .tribe-pick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remaster-ui .setup-panel .tribe-pick,
  .remaster-ui .setup-panel .tribe-pick:hover:not(:disabled),
  .remaster-ui .setup-panel .tribe-pick.is-active {
    min-height: 232px;
    grid-template-rows: minmax(158px, 1fr) auto auto;
  }

  .remaster-ui .setup-panel .tribe-pick img {
    min-height: 158px;
  }

  .remaster-ui .bot-roster {
    grid-template-columns: 1fr;
  }

  .remaster-ui .setup-footer {
    align-items: stretch;
    gap: 10px;
  }

  .remaster-ui .setup-footer p {
    display: none;
  }

  .remaster-ui .setup-footer .primary-start-button {
    width: 100%;
  }

  .remaster-ui .bv-header h1 span {
    display: none;
  }

  .remaster-ui .event-banner {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .remaster-ui .event-dur {
    display: none;
  }

  .remaster-ui .bv-versus .versus-strip {
    overflow-x: auto;
  }

  .remaster-ui .bv-buildings {
    padding-inline: 10px !important;
  }

  .remaster-ui .board-coach {
    grid-template-columns: 1fr;
  }

  .remaster-ui .board-coach em {
    display: none;
  }

  .remaster-ui .table-decks {
    position: static;
    flex-direction: row;
    justify-content: center;
    margin-top: 10px;
  }

  .remaster-ui .mat-dock {
    position: static !important;
    display: flex;
    justify-content: center;
    margin: 10px auto 0 !important;
  }

  .remaster-ui .audio-toggle {
    right: 12px;
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .remaster-ui .audio-toggle::after {
    display: none;
  }

  .remaster-ui .modal {
    width: calc(100vw - 24px);
    max-height: 92dvh;
    padding: 22px 16px !important;
  }
}

.remaster-ui .quiz-review-note {
  margin: 10px 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--rm-accent);
  border-radius: 0 8px 8px 0;
  background: rgba(216, 146, 70, 0.08);
  color: var(--rm-text-soft);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .remaster-ui .education-workspace {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .remaster-ui .lesson-anchors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remaster-ui .lesson-anchor-prompt {
    grid-column: 1 / 3;
    min-height: 130px;
  }

  .remaster-ui .lesson-goal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .remaster-ui .education-topbar {
    grid-template-columns: auto 1fr auto;
    padding-inline: 12px;
  }

  .remaster-ui .education-brand {
    justify-self: start;
    margin-left: 10px;
  }

  .remaster-ui .education-top-actions button:first-child {
    display: none;
  }

  .remaster-ui .education-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 64px;
  }

  .remaster-ui .education-hero dl {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px 0 0;
    border-top: 1px solid var(--rm-border-strong);
    border-left: 0;
  }

  .remaster-ui .education-workspace {
    grid-template-columns: 1fr;
  }

  .remaster-ui .education-controls {
    position: static;
    max-height: none;
  }

  .remaster-ui .grade-band-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remaster-ui .grade-band-button:last-child {
    grid-column: 1 / 3;
  }

  .remaster-ui .evidence-ledger {
    grid-template-columns: 1fr;
  }

  .remaster-ui .lesson-sources {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .remaster-ui .education-topbar {
    min-height: 66px;
  }

  .remaster-ui .education-topbar .story-back,
  .remaster-ui .education-topbar .story-start {
    min-width: 68px;
    padding-inline: 10px;
  }

  .remaster-ui .education-brand span {
    display: none;
  }

  .remaster-ui .education-brand b {
    margin: 0;
    font-size: 12px;
  }

  .remaster-ui .education-hero h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .remaster-ui .education-hero dl {
    gap: 7px;
  }

  .remaster-ui .education-hero dt {
    font-size: 22px;
  }

  .remaster-ui .education-workspace {
    padding-inline: 10px;
  }

  .remaster-ui .education-controls {
    padding: 16px;
  }

  .remaster-ui .grade-band-list {
    grid-template-columns: 1fr;
  }

  .remaster-ui .grade-band-button:last-child {
    grid-column: auto;
  }

  .remaster-ui .lesson-meta,
  .remaster-ui .lesson-anchors,
  .remaster-ui .lesson-kit-grid {
    grid-template-columns: 1fr;
  }

  .remaster-ui .lesson-anchor-prompt {
    grid-column: auto;
  }

  .remaster-ui .steam-grid {
    grid-template-columns: 1fr;
  }

  .remaster-ui .steam-grid article:first-child {
    grid-column: auto;
  }

  .remaster-ui .lesson-timeline::before {
    left: 29px;
  }

  .remaster-ui .lesson-timeline li {
    grid-template-columns: 60px 1fr;
    gap: 9px;
  }

  .remaster-ui .lesson-time {
    width: 60px;
    height: 62px;
  }

  .remaster-ui .lesson-step {
    padding: 13px;
  }

  .remaster-ui .lesson-sources li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .remaster-ui .share-material-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.remaster-ui,
  .remaster-ui .education-screen {
    color: #161b19 !important;
    background: #fff !important;
  }

  .remaster-ui .education-screen::after,
  .remaster-ui .education-topbar,
  .remaster-ui .education-hero,
  .remaster-ui .education-controls,
  .remaster-ui .audio-toggle {
    display: none !important;
  }

  .remaster-ui .education-workspace {
    display: block;
    width: 100%;
    padding: 0;
  }

  .remaster-ui .lesson-plan {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .remaster-ui .lesson-plan *,
  .remaster-ui .lesson-plan h2,
  .remaster-ui .lesson-plan h3,
  .remaster-ui .lesson-plan b,
  .remaster-ui .lesson-plan p,
  .remaster-ui .lesson-plan li,
  .remaster-ui .lesson-plan dd {
    color: #161b19 !important;
  }

  .remaster-ui .lesson-header,
  .remaster-ui .lesson-plan > section,
  .remaster-ui .lesson-sources,
  .remaster-ui .lesson-meta div,
  .remaster-ui .lesson-anchor-card,
  .remaster-ui .lesson-anchor-prompt,
  .remaster-ui .lesson-goal-grid > ol li,
  .remaster-ui .steam-grid article,
  .remaster-ui .lesson-step,
  .remaster-ui .lesson-kit-grid article,
  .remaster-ui .evidence-ledger article {
    background: #fff !important;
  }

  .remaster-ui .lesson-plan > section,
  .remaster-ui .lesson-timeline li,
  .remaster-ui .lesson-kit-grid article,
  .remaster-ui .evidence-ledger article {
    break-inside: avoid;
  }

  .remaster-ui .lesson-anchor-card img {
    filter: grayscale(0.2);
  }
}

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

  .remaster-ui .ps5-bg,
  .remaster-ui .hand-card,
  .remaster-ui .draw-pop,
  .remaster-ui .event-banner,
  .remaster-ui .game-impact {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .remaster-ui .home-tribe-console,
  .remaster-ui .story-topbar,
  .remaster-ui .setup-panel,
  .remaster-ui .audio-toggle,
  .remaster-ui .overlay,
  .remaster-ui .event-banner,
  .remaster-ui .bv-hand {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-color: var(--rm-surface) !important;
  }
}
