:root {
  --ink: #020304;
  --moon: #e9edf0;
  --moon-dim: #a8b0b7;
  --silver: #c4c8ca;
  --blue-black: #061522;
  --ember: #ec8a24;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.landing {
  position: relative;
  display: grid;
  width: 100vw;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: var(--moon);
  background: #000;
  font-family: Georgia, "Times New Roman", serif;
}

.background-video,
.scene-shade,
.scene-vignette,
.film-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.background-video {
  z-index: -5;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  filter: saturate(0.72) contrast(1.08) brightness(0.78);
  animation: awaken-scene 2.4s ease-out 0.25s forwards;
  will-change: opacity;
}

.scene-shade {
  z-index: -4;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.74) 0%, rgba(0, 0, 0, 0.08) 47%, rgba(0, 0, 0, 0.8) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.46));
}

.scene-vignette {
  z-index: -3;
  pointer-events: none;
  box-shadow: inset 0 0 15vw 5vw rgba(0, 0, 0, 0.88);
}

.film-grain {
  z-index: 10;
  pointer-events: none;
  opacity: 0.055;
  mix-blend-mode: screen;
  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='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.68'/%3E%3C/svg%3E");
}

.sound-control,
.skip-intro {
  position: fixed;
  z-index: 20;
  border: 0;
  color: rgba(235, 239, 241, 0.76);
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.66rem;
  transition: color 180ms ease, opacity 180ms ease;
}

.sound-control {
  top: clamp(1rem, 2.5vw, 2rem);
  right: clamp(1rem, 2.5vw, 2.2rem);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sound-control:hover,
.skip-intro:hover {
  color: #fff;
}

.sound-control:focus-visible,
.skip-intro:focus-visible,
.role-card:focus-visible,
.dialog-close:focus-visible,
.submit-button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
}

.sound-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #747b7e;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.sound-pulse.is-active {
  background: var(--ember);
  box-shadow: 0 0 11px 2px rgba(236, 138, 36, 0.66);
}

.sound-pulse.is-active::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(236, 138, 36, 0.44);
  border-radius: 50%;
  animation: sound-ring 1.8s ease-out infinite;
}

.skip-intro {
  right: clamp(1rem, 2.5vw, 2.2rem);
  bottom: clamp(1rem, 2.5vw, 2rem);
  opacity: 0.68;
}

.logo-stage {
  position: absolute;
  z-index: 2;
  top: clamp(1.1rem, 3.5vh, 2.8rem);
  left: 50%;
  width: min(39vh, 390px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  pointer-events: none;
}

.game-logo {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.87) translateY(-1.2rem);
  filter: blur(23px) brightness(0.55) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
}

.landing--forming .game-logo {
  animation: forge-logo 2.6s cubic-bezier(0.2, 0.74, 0.2, 1) forwards;
}

.landing--ready .game-logo {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0) brightness(1) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
  animation: logo-breathe 6s ease-in-out infinite;
}

.mist {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  opacity: 0;
  filter: blur(22px);
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at center, rgba(218, 227, 230, 0.62) 0%, rgba(135, 151, 158, 0.22) 38%, transparent 72%);
}

.mist--one {
  width: 140%;
  height: 38%;
  top: 29%;
  left: -65%;
}

.mist--two {
  width: 128%;
  height: 42%;
  top: 45%;
  right: -59%;
}

.mist--three {
  width: 78%;
  height: 54%;
  top: -10%;
  left: 10%;
}

.mist--four {
  width: 115%;
  height: 35%;
  right: -7%;
  bottom: -4%;
}

.landing--forming .mist--one {
  animation: gather-left 2.7s ease-in-out forwards;
}

.landing--forming .mist--two {
  animation: gather-right 2.7s ease-in-out forwards;
}

.landing--forming .mist--three {
  animation: gather-down 2.65s ease-in-out forwards;
}

.landing--forming .mist--four {
  animation: gather-up 2.75s ease-in-out forwards;
}

.landing--ready .mist {
  animation: drift-away 2s ease-out forwards;
}

.entry-panel {
  position: absolute;
  z-index: 5;
  top: calc(clamp(1.1rem, 3.5vh, 2.8rem) + min(39vh, 390px) - 0.75rem);
  left: 50%;
  bottom: auto;
  width: min(760px, calc(100% - 2rem));
  transform: translateX(-50%);
  text-align: center;
  animation: reveal-entry 1.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.entry-kicker {
  margin: 0 0 1rem;
  color: rgba(226, 231, 233, 0.77);
  text-shadow: 0 2px 13px #000;
  text-transform: uppercase;
  letter-spacing: 0.33em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.62rem, 1vw, 0.72rem);
}

.role-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.role-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 94px;
  padding: 1.15rem 1.3rem;
  overflow: hidden;
  border: 1px solid rgba(218, 224, 227, 0.26);
  border-radius: 2px;
  color: var(--moon);
  text-align: left;
  background: linear-gradient(115deg, rgba(2, 8, 13, 0.9), rgba(7, 19, 28, 0.74));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 12% 50%, rgba(236, 138, 36, 0.18), transparent 42%);
  transition: opacity 200ms ease;
}

.role-card:hover {
  transform: translateY(-3px);
  border-color: rgba(236, 138, 36, 0.68);
  background: linear-gradient(115deg, rgba(3, 11, 17, 0.96), rgba(10, 27, 38, 0.9));
}

.role-card:hover::before {
  opacity: 1;
}

.role-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(211, 219, 222, 0.28);
  color: #c7cdd0;
  font-size: 0.78rem;
}

.role-text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.28rem;
}

.role-text strong {
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  font-weight: 600;
  letter-spacing: 0.035em;
}

.role-text small {
  color: var(--moon-dim);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.role-arrow {
  position: relative;
  z-index: 1;
  color: var(--ember);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.4rem;
  transition: transform 180ms ease;
}

.role-card:hover .role-arrow {
  transform: translateX(4px);
}

.login-dialog {
  width: min(520px, calc(100% - 1.5rem));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(211, 218, 221, 0.28);
  border-radius: 3px;
  color: var(--moon);
  background: rgba(2, 7, 11, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.92);
}

.login-dialog[open] {
  animation: dialog-in 300ms ease-out both;
}

.login-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px) saturate(0.5);
}

.dialog-shell {
  position: relative;
  padding: clamp(2rem, 5vw, 3.3rem);
  background:
    linear-gradient(145deg, rgba(11, 28, 40, 0.46), transparent 44%),
    radial-gradient(circle at 50% 0%, rgba(236, 138, 36, 0.08), transparent 38%);
}

.dialog-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border: 0;
  color: #a7afb3;
  background: transparent;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.7rem;
  font-weight: 200;
}

.dialog-eyebrow {
  margin: 0 0 0.75rem;
  color: var(--ember);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.64rem;
}

.dialog-shell h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.65rem);
  font-weight: 500;
  line-height: 1.08;
}

.dialog-description {
  margin: 1rem 0 1.7rem;
  color: #abb3b7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-form label {
  display: grid;
  gap: 0.48rem;
}

.login-form label > span {
  color: #c2c9cc;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.63rem;
}

.login-form input {
  width: 100%;
  height: 52px;
  padding: 0 0.95rem;
  border: 1px solid rgba(202, 210, 213, 0.22);
  border-radius: 2px;
  color: #f2f4f5;
  background: rgba(0, 0, 0, 0.42);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.login-form input::placeholder {
  color: #667076;
}

.login-form input:focus {
  border-color: rgba(236, 138, 36, 0.72);
}

.submit-button {
  min-height: 54px;
  margin-top: 0.45rem;
  border: 1px solid #d79a50;
  border-radius: 2px;
  color: #16100a;
  background: linear-gradient(180deg, #efb05e, #c87823);
  box-shadow: 0 9px 24px rgba(185, 93, 17, 0.2);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.69rem;
  font-weight: 700;
  transition: filter 180ms ease, transform 180ms ease;
}

.submit-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.form-notice {
  margin: 1rem 0 0;
  padding: 0.8rem 0.9rem;
  border-left: 2px solid var(--ember);
  color: #bdc4c7;
  background: rgba(236, 138, 36, 0.07);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.77rem;
  line-height: 1.5;
}

.portal-page {
  position: relative;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
  color: var(--moon);
  background: #000;
  font-family: Georgia, "Times New Roman", serif;
}

.portal-page--player .portal-header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.93);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.42);
}

.portal-page--waiting .portal-header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.93);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.42);
}

.portal-page--player .portal-background-video {
  filter: saturate(0.72) brightness(0.58) contrast(1.1);
}

.portal-page--player .portal-shade {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(1, 7, 11, 0.54) 48%, rgba(0, 0, 0, 0.88)),
    radial-gradient(circle at 50% 48%, transparent 0%, rgba(0, 0, 0, 0.62) 82%);
}

.portal-page--waiting .portal-background-video {
  filter: saturate(0.58) brightness(0.53) contrast(1.1);
}

.portal-page--waiting .portal-shade {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(1, 7, 11, 0.5) 50%, rgba(0, 0, 0, 0.84)),
    radial-gradient(circle at 50% 48%, transparent 0%, rgba(0, 0, 0, 0.65) 82%);
}

.portal-background-video,
.portal-shade,
.portal-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portal-background-video {
  z-index: -4;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.48) brightness(0.44) contrast(1.14);
}

.portal-shade {
  z-index: -3;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(1, 7, 11, 0.62) 38%, rgba(0, 0, 0, 0.92)),
    radial-gradient(circle at 50% 44%, transparent 0%, rgba(0, 0, 0, 0.78) 76%);
}

.portal-grain {
  z-index: -2;
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: screen;
  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='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.68'/%3E%3C/svg%3E");
}

.portal-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 96px;
  padding: 0 clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(211, 219, 222, 0.16);
  background: rgba(1, 6, 10, 0.72);
  backdrop-filter: blur(16px);
}

.portal-back,
.portal-mode {
  color: #aab2b6;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.63rem;
}

.portal-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  transition: color 180ms ease;
}

.portal-back:hover {
  color: #fff;
}

.portal-back:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 5px;
}

.portal-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.75));
}

.portal-mode {
  justify-self: end;
  color: rgba(236, 138, 36, 0.88);
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 7rem) 0 4rem;
}

.portal-hero {
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 6vh, 4.5rem);
  text-align: center;
}

.portal-eyebrow,
.portal-card-kicker {
  margin: 0;
  color: var(--ember);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.65rem;
}

.portal-hero h1 {
  margin: 0.8rem 0 1rem;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  text-shadow: 0 10px 30px #000;
}

.portal-hero > p:last-child {
  max-width: 650px;
  margin: 0 auto;
  color: #b2b9bc;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.84rem, 1.5vw, 1rem);
  line-height: 1.75;
}

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

.portal-card {
  position: relative;
  min-height: 270px;
  padding: 2rem;
  overflow: hidden;
  border: 1px solid rgba(211, 219, 222, 0.2);
  color: #e9edef;
  background: linear-gradient(145deg, rgba(4, 13, 20, 0.92), rgba(2, 7, 11, 0.78));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(13px);
}

.portal-card--accent {
  border-color: rgba(236, 138, 36, 0.48);
  background:
    radial-gradient(circle at 100% 0%, rgba(236, 138, 36, 0.14), transparent 42%),
    linear-gradient(145deg, rgba(5, 15, 22, 0.94), rgba(2, 7, 11, 0.82));
}

.portal-card-number {
  position: absolute;
  top: 1.35rem;
  right: 1.5rem;
  color: rgba(213, 220, 223, 0.19);
  font-size: 2.4rem;
}

.portal-card h2 {
  margin: 0.75rem 0 0.85rem;
  font-size: 1.55rem;
  font-weight: 500;
}

.portal-card > p:not(.portal-card-kicker) {
  margin: 0;
  color: #9da6aa;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  line-height: 1.7;
}

.portal-placeholder {
  position: absolute;
  right: 2rem;
  bottom: 1.7rem;
  left: 2rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(211, 219, 222, 0.14);
  color: #707b80;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.58rem;
}

.waiting-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(760px, calc(100% - 2rem));
  min-height: calc(100svh - 96px);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) 0;
}

.waiting-panel {
  position: relative;
  width: 100%;
  padding: clamp(2rem, 5vw, 4.5rem);
  overflow: hidden;
  border: 1px solid rgba(211, 219, 222, 0.22);
  color: var(--moon);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(236, 138, 36, 0.11), transparent 38%),
    linear-gradient(155deg, rgba(3, 10, 15, 0.95), rgba(0, 3, 5, 0.88));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(16px);
}

.waiting-panel::before,
.waiting-panel::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border-color: rgba(236, 138, 36, 0.58);
  pointer-events: none;
}

.waiting-panel::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.waiting-panel::after {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.waiting-seal {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 1.5rem;
}

.waiting-seal img {
  position: absolute;
  inset: 13px;
  width: calc(100% - 26px);
  height: calc(100% - 26px);
  object-fit: contain;
  opacity: 0.82;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.8));
  animation: waiting-breathe 2.2s ease-in-out infinite;
}

.waiting-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(236, 138, 36, 0.2);
  border-top-color: rgba(236, 138, 36, 0.95);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(236, 138, 36, 0.08);
  animation: waiting-turn 3s linear infinite;
}

.waiting-panel h1 {
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.25rem, 6vw, 4.6rem);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 10px 30px #000;
}

.waiting-description {
  max-width: 560px;
  margin: 0 auto;
  color: #aeb6ba;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.82rem, 1.7vw, 0.98rem);
  line-height: 1.75;
}

.waiting-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
  color: #d7dcde;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.62rem;
}

.waiting-dots {
  display: inline-flex;
  gap: 0.32rem;
}

.waiting-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ember);
  animation: waiting-dot 1.2s ease-in-out infinite;
}

.waiting-dots i:nth-child(2) {
  animation-delay: 160ms;
}

.waiting-dots i:nth-child(3) {
  animation-delay: 320ms;
}

.waiting-progress {
  width: min(360px, 82%);
  height: 2px;
  margin: 1.4rem auto 0;
  overflow: hidden;
  background: rgba(211, 219, 222, 0.13);
}

.waiting-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: translateX(-100%);
  transform-origin: left;
  background: linear-gradient(90deg, #8c4517, var(--ember), #f2bd73);
  box-shadow: 0 0 12px rgba(236, 138, 36, 0.64);
  animation: waiting-progress 3s linear forwards;
}

.waiting-countdown {
  margin: 0.8rem 0 0;
  color: #788287;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.56rem;
}

.player-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vh, 4rem) 0 4rem;
  align-items: start;
}

.role-station {
  padding: 1.5rem;
  border: 1px solid rgba(211, 219, 222, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(236, 138, 36, 0.1), transparent 34%),
    linear-gradient(160deg, rgba(3, 10, 15, 0.96), rgba(0, 3, 5, 0.9));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(15px);
}

.role-station-heading {
  margin-bottom: 1.2rem;
}

.role-station-heading h2 {
  margin: 0.55rem 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 500;
}

.role-station-heading > p:last-child,
.role-warning {
  margin: 0;
  color: #8e989d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  line-height: 1.55;
}

.role-card-display {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(222, 188, 135, 0.25);
  background: #020609;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.68),
    inset 0 0 50px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  perspective: 1200px;
}

.role-card-display:disabled {
  cursor: default;
}

.role-card-display:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
}

.role-card-display::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 30px 4px rgba(0, 0, 0, 0.52);
}

.role-card-cover,
.revealed-role-card,
.role-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.role-card-cover {
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  background:
    radial-gradient(circle, rgba(16, 43, 60, 0.72), transparent 48%),
    linear-gradient(145deg, #07131c, #010406 72%);
  transition: opacity 650ms ease, transform 650ms ease, filter 650ms ease;
}

.role-card-cover::before {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border: 1px solid rgba(200, 208, 211, 0.13);
}

.role-card-cover img {
  width: 105px;
  height: 105px;
  object-fit: contain;
  opacity: 0.54;
  filter: grayscale(0.5) drop-shadow(0 10px 22px #000);
}

.role-card-cover span {
  color: #7e898e;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.59rem;
}

.revealed-role-card,
.role-card-back {
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  backface-visibility: hidden;
  filter: blur(13px) brightness(0.5);
  transition: opacity 700ms ease, transform 700ms ease, filter 700ms ease;
}

.revealed-role-card {
  transform: rotateY(0deg) scale(0.94);
}

.role-card-back {
  transform: rotateY(180deg) scale(0.94);
}

.role-card-display.is-visible .role-card-cover {
  opacity: 0;
  transform: scale(1.08);
  filter: blur(12px);
  pointer-events: none;
}

.role-card-display.is-visible .revealed-role-card {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
  filter: blur(0) brightness(1);
}

.role-card-display.is-visible.is-showing-back .revealed-role-card {
  opacity: 0;
  transform: rotateY(-180deg) scale(0.96);
  filter: blur(5px) brightness(0.72);
}

.role-card-display.is-visible.is-showing-back .role-card-back {
  opacity: 1;
  transform: rotateY(0deg) scale(1);
  filter: blur(0) brightness(1);
}

.role-reveal-button {
  width: 100%;
  min-height: 52px;
  margin-top: 1rem;
  border: 1px solid #d79a50;
  color: #160f08;
  background: linear-gradient(180deg, #efb05e, #c87823);
  box-shadow: 0 10px 25px rgba(185, 93, 17, 0.22);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  transition: transform 180ms ease, filter 180ms ease;
}

.role-reveal-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.09);
}

.role-reveal-button:disabled {
  border-color: #596064;
  color: #949b9e;
  background: linear-gradient(180deg, #3d4447, #272c2f);
  box-shadow: none;
  cursor: not-allowed;
  filter: grayscale(1);
}

.role-reveal-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.role-warning {
  margin-top: 0.75rem;
  color: #8c6d52;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.57rem;
}

.player-main {
  min-width: 0;
}

.player-hero {
  max-width: 760px;
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
  text-align: left;
}

.player-hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.player-hero > p:last-child {
  margin: 0;
}

.player-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.player-status-grid .portal-card {
  min-height: 255px;
  padding: 1.5rem;
}

.player-status-grid .portal-placeholder {
  right: 1.5rem;
  left: 1.5rem;
}

@media (max-width: 1050px) {
  .player-shell {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  }

  .player-status-grid {
    grid-template-columns: 1fr;
  }

  .player-status-grid .portal-card {
    min-height: 210px;
  }
}

@media (max-width: 800px) {
  .portal-header {
    grid-template-columns: 1fr auto;
    min-height: 78px;
    padding: 0 1rem;
  }

  .portal-logo {
    order: -1;
    justify-self: start;
    width: 64px;
    height: 64px;
  }

  .portal-back {
    justify-self: end;
  }

  .portal-mode {
    display: none;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-card {
    min-height: 230px;
  }

  .player-shell {
    grid-template-columns: 1fr;
    width: min(620px, calc(100% - 1.25rem));
    padding-top: 1.25rem;
  }

  .role-station {
    order: 2;
  }

  .role-card-display {
    width: min(330px, 100%);
    margin: 0 auto;
  }

  .player-main {
    order: 1;
  }

  .player-hero {
    text-align: center;
  }

  .player-hero > p:last-child {
    margin: 0 auto;
  }
}

@keyframes awaken-scene {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes forge-logo {
  0% {
    opacity: 0;
    transform: scale(0.82) translateY(-1.5rem);
    filter: blur(26px) brightness(0.45) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
  }
  58% {
    opacity: 0.74;
    filter: blur(7px) brightness(0.82) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0) brightness(1) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
  }
}

@keyframes logo-breathe {
  0%,
  100% {
    filter: brightness(0.98) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.9));
  }
  50% {
    filter: brightness(1.06) drop-shadow(0 18px 38px rgba(0, 0, 0, 0.94));
  }
}

@keyframes gather-left {
  0% { opacity: 0; transform: translateX(-22%) scale(1.25); }
  34% { opacity: 0.7; }
  72% { opacity: 0.82; }
  100% { opacity: 0; transform: translateX(78%) scale(0.62); }
}

@keyframes gather-right {
  0% { opacity: 0; transform: translateX(26%) scale(1.3); }
  30% { opacity: 0.68; }
  72% { opacity: 0.8; }
  100% { opacity: 0; transform: translateX(-73%) scale(0.58); }
}

@keyframes gather-down {
  0% { opacity: 0; transform: translateY(-30%) scale(1.2); }
  38% { opacity: 0.54; }
  100% { opacity: 0; transform: translateY(75%) scale(0.5); }
}

@keyframes gather-up {
  0% { opacity: 0; transform: translateY(35%) scale(1.18); }
  38% { opacity: 0.65; }
  100% { opacity: 0; transform: translateY(-82%) scale(0.55); }
}

@keyframes drift-away {
  0% { opacity: 0.28; transform: scale(0.68); }
  100% { opacity: 0; transform: scale(1.5); }
}

@keyframes reveal-entry {
  from { opacity: 0; transform: translate(-50%, 18px); filter: blur(8px); }
  to { opacity: 1; transform: translate(-50%, 0); filter: blur(0); }
}

@keyframes sound-ring {
  from { opacity: 0.7; transform: scale(0.65); }
  to { opacity: 0; transform: scale(1.55); }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes waiting-turn {
  to { transform: rotate(360deg); }
}

@keyframes waiting-breathe {
  0%, 100% { opacity: 0.7; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes waiting-dot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@keyframes waiting-progress {
  to { transform: translateX(0); }
}

@media (max-width: 680px) {
  .waiting-shell {
    min-height: calc(100svh - 78px);
    width: calc(100% - 1.25rem);
    padding: 1.25rem 0;
  }

  .waiting-panel {
    padding: 2rem 1.25rem;
  }

  .waiting-seal {
    width: 106px;
    height: 106px;
  }

  .waiting-status {
    flex-direction: column;
    gap: 0.55rem;
  }

  .logo-stage {
    top: max(4.5rem, 8vh);
    width: min(36vh, 315px);
  }

  .entry-panel {
    top: calc(max(4.5rem, 8vh) + min(36vh, 315px) - 0.5rem);
    bottom: auto;
    width: min(460px, calc(100% - 1.25rem));
  }

  .role-actions {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .role-card {
    min-height: 72px;
    padding: 0.8rem 0.95rem;
  }

  .role-number {
    width: 38px;
    height: 38px;
  }

  .entry-kicker {
    margin-bottom: 0.7rem;
  }

  .sound-control {
    right: 1rem;
  }

  .skip-intro {
    left: 1rem;
    right: auto;
  }
}

@media (max-height: 720px) and (min-width: 681px) {
  .logo-stage {
    top: 0.4rem;
    width: min(36vh, 275px);
  }

  .entry-panel {
    top: calc(0.4rem + min(36vh, 275px) - 0.5rem);
    bottom: auto;
  }

  .role-card {
    min-height: 78px;
  }
}

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