:root {
  --color-bg: #06080f;
  --color-bg-deep: #020308;
  --color-panel: rgba(12, 18, 28, 0.74);
  --color-panel-strong: rgba(12, 18, 28, 0.92);
  --color-panel-soft: rgba(255, 250, 242, 0.045);
  --color-border: rgba(242, 226, 201, 0.12);
  --color-border-strong: rgba(205, 162, 104, 0.34);
  --color-text: #f4ecdf;
  --color-text-muted: rgba(244, 236, 223, 0.74);
  --color-text-subtle: rgba(244, 236, 223, 0.47);
  --color-accent: #cda268;
  --color-accent-soft: rgba(205, 162, 104, 0.14);
  --color-accent-glow: rgba(205, 162, 104, 0.36);
  --color-accent-cool: rgba(113, 137, 179, 0.3);
  --color-focus: #8ac0ff;
  --color-danger: #f06767;
  --color-success: #6bc9a1;
  --color-rank-gold: #d6ab73;
  --color-rank-silver: #b6c4d6;
  --color-rank-bronze: #c07d58;
  --shadow-soft: 0 22px 60px rgba(0, 0, 0, 0.24);
  --shadow-deep: 0 30px 100px rgba(0, 0, 0, 0.52);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  --spacing-2xs: 0.25rem;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: clamp(1.75rem, 3vw, 2.5rem);
  --font-size-3xl: clamp(2.5rem, 7vw, 5.5rem);
  --wax-growth: 0px;
  --transition-fast: 180ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 550ms cubic-bezier(0.2, 0.75, 0.2, 1);
  --z-site-controls: 160;
  --z-modal: 1000;
  --z-overlay: 999;
  --z-candle-overlay: 1020;
  --touch-target-min: 46px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background:
    radial-gradient(circle at 18% 14%, rgba(112, 138, 182, 0.18), transparent 24%),
    radial-gradient(circle at 76% 18%, rgba(205, 162, 104, 0.14), transparent 22%),
    radial-gradient(circle at 50% 110%, rgba(20, 34, 57, 0.52), transparent 40%),
    linear-gradient(180deg, #090d16 0%, #06080f 45%, #020308 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -7;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 20% 24%, rgba(255, 245, 226, 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 76% 18%, rgba(255, 245, 226, 0.45) 0 1px, transparent 1.7px),
    radial-gradient(circle at 63% 62%, rgba(255, 245, 226, 0.3) 0 1px, transparent 1.8px),
    radial-gradient(circle at 34% 74%, rgba(255, 245, 226, 0.3) 0 1px, transparent 1.8px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 35%);
  background-size: 34rem 34rem, 42rem 42rem, 28rem 28rem, 30rem 30rem, 100% 100%;
  filter: blur(0.2px);
}

body::after {
  z-index: -6;
  inset: 8vh 8vw auto auto;
  width: min(58vw, 46rem);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.48;
  background:
    radial-gradient(circle, transparent 55%, rgba(205, 162, 104, 0.08) 56%, rgba(205, 162, 104, 0.08) 56.6%, transparent 57.6%),
    radial-gradient(circle, transparent 67%, rgba(121, 144, 182, 0.08) 68%, transparent 69.2%),
    radial-gradient(circle, transparent 77%, rgba(205, 162, 104, 0.06) 78%, transparent 79.2%),
    conic-gradient(from 10deg, rgba(205, 162, 104, 0.08), transparent 12%, rgba(121, 144, 182, 0.06) 20%, transparent 32%, rgba(205, 162, 104, 0.08) 40%, transparent 52%, rgba(121, 144, 182, 0.06) 62%, transparent 74%, rgba(205, 162, 104, 0.07) 84%, transparent 100%);
  filter: blur(0.5px);
  animation: sigilPulse 20s ease-in-out infinite alternate;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

p {
  color: var(--color-text-muted);
}

.container {
  position: relative;
  z-index: 2;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 2vw, 2rem);
}

.site-controls {
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top));
  right: max(0.9rem, env(safe-area-inset-right));
  padding: 0.65rem 0.75rem 0.7rem;
  border: 1px solid rgba(205, 162, 104, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%),
    rgba(6, 10, 16, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: var(--z-site-controls);
}

.candle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-candle-overlay);
  overflow: hidden;
}

.candle-holder {
  position: absolute;
  bottom: -2.1rem;
  width: 9rem;
  height: 23rem;
  opacity: 0.94;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.36));
  transform-origin: bottom center;
}

.candle-holder::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  width: 8.2rem;
  height: 1.6rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.16) 42%, transparent 76%);
  filter: blur(5px);
  pointer-events: none;
}

.candle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 7rem;
  height: 15rem;
  overflow: visible;
  isolation: isolate;
  transform: translateX(-50%);
  border-radius: 3.5rem / 1rem;
  box-shadow:
    inset 1.25rem 0 1.35rem rgba(255, 244, 212, 0.22),
    inset -1.15rem 0 1.65rem rgba(79, 32, 7, 0.26),
    inset 0 -2.7rem 2.9rem rgba(40, 14, 4, 0.28),
    0 0.55rem 1.35rem rgba(0, 0, 0, 0.22);
  background:
    radial-gradient(ellipse at 34% 18%, rgba(255, 247, 220, 0.34) 0%, rgba(255, 247, 220, 0) 26%),
    radial-gradient(ellipse at 66% 62%, rgba(132, 55, 12, 0.18) 0%, rgba(132, 55, 12, 0) 34%),
    linear-gradient(90deg, rgba(255, 248, 224, 0.42) 0%, rgba(255, 232, 176, 0.2) 16%, rgba(223, 153, 63, 0.1) 34%, rgba(128, 56, 16, 0.08) 74%, rgba(55, 20, 6, 0.26) 100%),
    linear-gradient(180deg, #efbd65 0%, #dfa03d 18%, #b6631e 46%, #7b3511 76%, #2b0d05 100%);
}

.candle::before,
.candle::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.candle::before {
  top: 0;
  width: 100%;
  height: 2rem;
  border-radius: 50% / 58% 58% 42% 42%;
  clip-path: polygon(0% 57%, 2% 40%, 8% 24%, 18% 10%, 31% 3%, 46% 1%, 56% 5%, 61% 14%, 64% 23%, 67% 31%, 72% 16%, 79% 7%, 89% 16%, 96% 31%, 100% 54%, 99% 71%, 95% 84%, 87% 94%, 75% 99%, 63% 100%, 56% 92%, 52% 78%, 44% 73%, 33% 88%, 20% 99%, 9% 95%, 2% 82%, 0% 67%);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 243, 214, 0.34) 0%, rgba(255, 243, 214, 0.18) 14%, rgba(255, 243, 214, 0) 34%),
    radial-gradient(ellipse at 50% 6%, rgba(73, 26, 7, 0.5) 0%, rgba(73, 26, 7, 0) 46%),
    radial-gradient(ellipse at 50% 62%, rgba(101, 42, 12, 0.54) 34%, rgba(101, 42, 12, 0.22) 48%, rgba(101, 42, 12, 0) 62%),
    radial-gradient(ellipse at 66% 46%, rgba(86, 32, 8, 0.86) 0%, rgba(86, 32, 8, 0.55) 18%, rgba(86, 32, 8, 0) 42%),
    radial-gradient(ellipse at 60% 72%, rgba(93, 37, 9, 0.72) 0%, rgba(93, 37, 9, 0.42) 24%, rgba(93, 37, 9, 0) 56%),
    radial-gradient(ellipse at 54% 58%, rgba(255, 236, 192, 0.22) 0%, rgba(255, 236, 192, 0) 40%),
    radial-gradient(circle at 50% 42%, rgba(244, 199, 110, 0.98) 0%, rgba(220, 144, 42, 0.96) 26%, rgba(143, 71, 16, 0.94) 56%, rgba(87, 33, 8, 0.96) 82%);
  border: 1px solid rgba(221, 156, 64, 0.44);
  box-shadow:
    inset 0 0.18rem 0 rgba(255, 245, 214, 0.34),
    inset 0 -0.16rem 0 rgba(255, 226, 164, 0.14),
    inset 0 -0.42rem 0.65rem rgba(88, 34, 9, 0.26),
    0 0.22rem 0.45rem rgba(0, 0, 0, 0.18);
  z-index: 1;
}

.candle::after {
  top: 0.76rem;
  width: 2.92rem;
  height: 0.98rem;
  margin-left: 0.34rem;
  border-radius: 48% 52% 56% 44% / 52% 54% 46% 48%;
  box-shadow:
    0 0 1.3rem rgba(0, 0, 0, 0.48),
    inset 0 0.05rem 0 rgba(255, 223, 163, 0.28);
  background:
    radial-gradient(ellipse at 36% 82%, rgba(255, 237, 194, 0.1) 0%, rgba(255, 237, 194, 0) 44%),
    radial-gradient(ellipse at 58% 54%, rgba(19, 10, 4, 0.96) 0%, rgba(68, 27, 7, 0.82) 23%, rgba(150, 86, 28, 0.4) 43%, rgba(237, 186, 96, 0.12) 65%, transparent 84%);
  z-index: 3;
}

.candle-left {
  left: -2.25rem;
  transform: scale(0.8);
}

.candle-right {
  right: -2.25rem;
  transform: scale(0.8);
  opacity: 0.78;
}

.candle-blinking-glow,
.candle-aura,
.candle-wax-veil,
.candle-drip,
.candle-thread,
.candle-glow,
.candle-flame {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.candle-blinking-glow {
  top: -15rem;
  width: 28rem;
  height: 34rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 172, 72, 0.6) 0%, rgba(255, 205, 116, 0.42) 16%, rgba(191, 96, 32, 0.24) 34%, rgba(104, 46, 120, 0.14) 52%, rgba(104, 46, 120, 0.04) 66%, rgba(104, 46, 120, 0) 82%);
  filter: blur(82px);
  mix-blend-mode: screen;
  opacity: 0.58;
  animation: candleRoomFlicker 5.8s ease-in-out infinite;
}

.candle-aura {
  top: -5.8rem;
  width: 8.6rem;
  height: 8.6rem;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 52%, rgba(141, 106, 196, 0.13) 53%, transparent 56%),
    radial-gradient(circle, transparent 67%, rgba(205, 162, 104, 0.1) 68%, transparent 71%),
    conic-gradient(from 8deg, transparent 0 12%, rgba(141, 106, 196, 0.16) 12% 13%, transparent 13% 37%, rgba(205, 162, 104, 0.14) 37% 38%, transparent 38% 62%, rgba(141, 106, 196, 0.16) 62% 63%, transparent 63% 87%, rgba(205, 162, 104, 0.14) 87% 88%, transparent 88%);
  filter: blur(0.35px);
  opacity: 0.38;
  animation: candleSigilFloat 10s ease-in-out infinite alternate;
}

.candle-wax-veil {
  top: 0.9rem;
  width: 4.58rem;
  height: 1.28rem;
  margin-left: 0.24rem;
  border-radius: 50% 50% 39% 45% / 38% 40% 60% 62%;
  clip-path: polygon(4% 47%, 12% 31%, 24% 19%, 39% 12%, 51% 15%, 58% 21%, 62% 28%, 67% 32%, 73% 23%, 81% 15%, 90% 19%, 95% 31%, 96% 47%, 92% 59%, 82% 69%, 69% 76%, 58% 72%, 51% 64%, 44% 65%, 33% 74%, 21% 74%, 10% 67%, 4% 57%);
  background:
    radial-gradient(ellipse at 44% 10%, rgba(255, 251, 236, 0.3) 0%, rgba(255, 251, 236, 0) 38%),
    radial-gradient(ellipse at 57% 40%, rgba(255, 245, 214, 0.78) 0%, rgba(244, 205, 126, 0.72) 29%, rgba(186, 106, 28, 0.24) 76%, rgba(186, 106, 28, 0) 100%);
  box-shadow:
    0 0 0 1px rgba(118, 54, 18, 0.16),
    inset 0 0.07rem 0 rgba(255, 250, 232, 0.12),
    inset 0 -0.08rem 0.2rem rgba(92, 44, 12, 0.14);
  filter: blur(0.12px);
  z-index: 2;
}

.candle-drip {
  top: 1.58rem;
  transform: none;
  z-index: 2;
  height: calc(var(--drip-height) + var(--wax-growth, 0px));
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 245, 214, 0.96) 0%, rgba(241, 196, 109, 0.92) 34%, rgba(201, 120, 39, 0.92) 68%, rgba(150, 74, 19, 0.94) 100%);
  box-shadow:
    inset 0.12rem 0 0 rgba(255, 252, 232, 0.34),
    inset -0.12rem 0 0 rgba(116, 53, 17, 0.14),
    0 0.12rem 0.22rem rgba(0, 0, 0, 0.1);
}

.candle-drip::before,
.candle-drip::after {
  content: "";
  position: absolute;
}

.candle-drip::before {
  top: 0.22rem;
  left: 0.12rem;
  width: 26%;
  height: 72%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 252, 232, 0.4), rgba(255, 252, 232, 0));
}

.candle-drip::after {
  left: 50%;
  bottom: -0.2rem;
  width: calc(100% + 0.34rem);
  height: 0.8rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, rgba(240, 188, 98, 0.96) 0%, rgba(181, 100, 30, 0.82) 62%, rgba(181, 100, 30, 0) 100%);
}

.candle-drip-a {
  top: 2.02rem;
  left: 1.52rem;
  width: 0.8rem;
  --drip-height: 3.72rem;
}

.candle-drip-b {
  top: 2.28rem;
  left: 3.18rem;
  width: 0.64rem;
  --drip-height: 1.94rem;
}

.candle-drip-c {
  top: 2.08rem;
  left: 4.42rem;
  width: 0.76rem;
  --drip-height: 2.92rem;
}

.candle-right .candle-drip-a {
  top: 1.86rem;
  left: 1.44rem;
  width: 0.7rem;
  --drip-height: 2.7rem;
}

.candle-right .candle-drip-b {
  top: 2.12rem;
  left: 3.08rem;
  width: 0.82rem;
  --drip-height: 4.27rem;
}

.candle-right .candle-drip-c {
  top: 1.95rem;
  left: 4.56rem;
  width: 0.62rem;
  --drip-height: 2.1rem;
}

.candle-glow {
  width: 2.8rem;
  height: 8.2rem;
  top: -6rem;
  border-radius: 50% 50% 35% 35%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(150, 187, 255, 0.5) 28%, rgba(255, 209, 116, 0.62) 58%, rgba(224, 118, 25, 0.2) 90%, rgba(224, 118, 25, 0) 100%);
  box-shadow:
    0 -3.9rem 3.4rem rgba(220, 138, 12, 0.54),
    0 3.6rem 4.8rem rgba(220, 138, 12, 0.46),
    inset 0.22rem 0 0.2rem rgba(141, 182, 255, 0.36),
    inset -0.22rem 0 0.2rem rgba(141, 182, 255, 0.28);
  filter: blur(2px);
  z-index: 4;
  animation: candleCorePulse 3.1s ease-in-out infinite;
}

.candle-glow::before,
.candle-glow::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
}

.candle-glow::before {
  width: 68%;
  height: 58%;
  bottom: 0;
  background: rgba(0, 0, 0, 0.38);
}

.candle-glow::after {
  top: -1.4rem;
  width: 6.8rem;
  height: 8rem;
  background: radial-gradient(circle, rgba(255, 233, 176, 0.34) 0%, rgba(255, 188, 86, 0.18) 42%, rgba(255, 188, 86, 0) 80%);
  filter: blur(15px);
}

.candle-thread {
  width: 0.3rem;
  height: 2.16rem;
  top: -1rem;
  z-index: 4;
  border-radius: 46% 46% 0 0;
  background: linear-gradient(180deg, #d7a45c, #51262d, #121212, #000, #ecbe43 92%);
}

.candle-flame {
  width: 1.5rem;
  height: 7.8rem;
  bottom: 100%;
  transform-origin: 50% 100%;
  border-radius: 52% 52% 22% 22%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 247, 215, 0.98) 18%, rgba(255, 214, 130, 0.96) 42%, rgba(252, 154, 42, 0.8) 68%, rgba(252, 154, 42, 0) 100%);
  z-index: 5;
  animation:
    candleFlameLean 6.2s ease-in-out infinite,
    candleFlameStretch 4.8s ease-in-out infinite;
}

.candle-flame::before,
.candle-flame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.candle-flame::before {
  box-shadow:
    0 0 24px rgba(247, 93, 0, 0.5),
    0 -12px 11px rgba(247, 128, 0, 0.68),
    0 -30px 28px rgba(255, 205, 124, 0.28);
  animation: candleFlameShimmer 2.2s ease-in-out infinite alternate;
}

.candle-flame::after {
  inset: 14% 28% 20%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 238, 178, 0.82) 58%, rgba(255, 238, 178, 0) 100%);
  animation: candleInnerFlicker 1.7s ease-in-out infinite alternate;
}

.candle-right .candle-blinking-glow {
  animation-duration: 6.6s;
  animation-delay: -1.4s;
}

.candle-right .candle-aura {
  animation-duration: 11.4s;
  animation-delay: -2.2s;
  opacity: 0.3;
}

.candle-right .candle::after {
  margin-left: -0.28rem;
  border-radius: 52% 48% 44% 56% / 54% 52% 48% 46%;
  background:
    radial-gradient(ellipse at 64% 82%, rgba(255, 237, 194, 0.1) 0%, rgba(255, 237, 194, 0) 44%),
    radial-gradient(ellipse at 42% 54%, rgba(19, 10, 4, 0.96) 0%, rgba(68, 27, 7, 0.82) 23%, rgba(150, 86, 28, 0.4) 43%, rgba(237, 186, 96, 0.12) 65%, transparent 84%);
}

.candle-right .candle-wax-veil {
  margin-left: -0.22rem;
}

.candle-right .candle-glow {
  animation-duration: 3.8s;
  animation-delay: -0.9s;
}

.candle-right .candle-flame {
  animation-duration: 5.5s, 4.2s;
  animation-delay: -1.1s, -0.4s;
}

.language-switcher {
  display: grid;
  gap: 0.35rem;
  min-width: 8.8rem;
}

.language-switcher-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  text-align: left;
}

.language-select {
  min-height: 2.6rem;
  padding: 0.55rem 2.1rem 0.55rem 0.9rem;
  border: 1px solid rgba(205, 162, 104, 0.18);
  border-radius: 16px;
  color: var(--color-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 65%),
    rgba(11, 16, 24, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.015);
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 65%),
    linear-gradient(45deg, transparent 50%, rgba(244, 236, 223, 0.72) 50%),
    linear-gradient(135deg, rgba(244, 236, 223, 0.72) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size:
    auto,
    0.45rem 0.45rem,
    0.45rem 0.45rem;
  background-position:
    0 0,
    calc(100% - 0.95rem) 50%,
    calc(100% - 0.65rem) 50%;
}

.language-select option {
  color: #09131f;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.985);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow),
    visibility 0s linear var(--transition-slow);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow),
    visibility 0s linear 0s;
}

.screen.exiting {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-20px) scale(0.985);
}

.screen-shell {
  position: relative;
  min-height: 100%;
  isolation: isolate;
}

.screen-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(205, 162, 104, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    linear-gradient(320deg, rgba(205, 162, 104, 0.05), transparent 42%);
  pointer-events: none;
  z-index: -3;
}

.screen-shell::after {
  content: "";
  position: absolute;
  inset: 8vh 5vw auto auto;
  width: min(42vw, 32rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 63%, rgba(255, 255, 255, 0.04) 64%, transparent 65%),
    radial-gradient(circle, transparent 76%, rgba(205, 162, 104, 0.06) 77%, transparent 78%);
  opacity: 0.26;
  filter: blur(0.3px);
  pointer-events: none;
  z-index: -2;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.72;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: ambientFloat 14s ease-in-out infinite alternate;
  z-index: -1;
}

.ambient-orb-a,
.ambient-orb-d {
  width: 28rem;
  height: 28rem;
  background: radial-gradient(circle, rgba(214, 164, 91, 0.38) 0%, rgba(214, 164, 91, 0) 70%);
}

.ambient-orb-b,
.ambient-orb-e {
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(96, 139, 199, 0.26) 0%, rgba(96, 139, 199, 0) 70%);
}

.ambient-orb-c,
.ambient-orb-f {
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(214, 164, 91, 0.3) 0%, rgba(214, 164, 91, 0) 70%);
}

.ambient-orb-a,
.ambient-orb-c,
.ambient-orb-e {
  top: -10rem;
  right: -8rem;
}

.ambient-orb-b,
.ambient-orb-d,
.ambient-orb-f {
  bottom: -8rem;
  left: -6rem;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(205, 162, 104, 0.14) 0 1px, transparent 1.5px);
  background-size: 6rem 6rem, 6rem 6rem, 14rem 14rem;
  opacity: 0.12;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92), transparent 76%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92), transparent 76%);
  pointer-events: none;
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.eyebrow::before {
  content: "";
  width: 2.7rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(205, 162, 104, 0.75), transparent);
  opacity: 0.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: 0.9rem 1.45rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    color var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 48%);
  opacity: 0.75;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary {
  background:
    linear-gradient(180deg, rgba(255, 240, 219, 0.18), transparent 45%),
    linear-gradient(135deg, #d6ab73 0%, #9d6a34 100%);
  color: #140e07;
  box-shadow: 0 18px 42px rgba(157, 106, 52, 0.34);
}

.btn-secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 65%),
    rgba(255, 255, 255, 0.035);
  color: var(--color-text);
  border-color: rgba(205, 162, 104, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn-danger {
  background:
    linear-gradient(180deg, rgba(255, 219, 214, 0.16), transparent 50%),
    linear-gradient(135deg, #e98679 0%, #b23c44 100%);
  color: #180607;
  box-shadow: 0 16px 34px rgba(178, 60, 68, 0.3);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.input-group {
  display: grid;
  gap: var(--spacing-sm);
}

.input-group label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.input-group input {
  width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(205, 162, 104, 0.14);
  border-radius: 20px;
  color: var(--color-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 65%),
    rgba(7, 11, 18, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(255, 255, 255, 0.015);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.input-group input::placeholder {
  color: rgba(244, 236, 223, 0.34);
}

.input-group input:focus {
  outline: none;
  border-color: rgba(138, 192, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(138, 192, 255, 0.08);
}

.input-group input.error {
  border-color: rgba(240, 103, 103, 0.8);
}

.button-group {
  display: flex;
  gap: var(--spacing-sm);
}

.button-group .btn {
  flex: 1;
}

.players-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  min-height: 2.1rem;
  padding: 0 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(205, 162, 104, 0.24);
  background:
    linear-gradient(180deg, rgba(205, 162, 104, 0.14), transparent 75%),
    rgba(205, 162, 104, 0.04);
  color: var(--color-accent);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.error-message {
  min-height: 1.25rem;
  color: #ff9b9b;
  font-size: var(--font-size-xs);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
}

.modal.active {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 9, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-content {
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(92vw, 30rem);
  padding: clamp(1.4rem, 4vw, 2rem);
  border-radius: 28px;
  border: 1px solid rgba(205, 162, 104, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%),
    rgba(9, 14, 22, 0.96);
  box-shadow: var(--shadow-deep);
  transform: translate(-50%, -50%);
  z-index: calc(var(--z-modal) + 1);
  animation: modalRise 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-content::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -14%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 58%, rgba(205, 162, 104, 0.08) 59%, transparent 60.5%),
    radial-gradient(circle, transparent 72%, rgba(121, 144, 182, 0.07) 73%, transparent 74.5%);
  opacity: 0.8;
  pointer-events: none;
}

.modal-content h3 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  margin-top: var(--spacing-sm);
}

.modal-player-name {
  margin: 0.35rem 0 1.4rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--spacing-sm);
  margin: 1.4rem 0 1.6rem;
}

.score-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-sm);
  margin: 0 0 1.2rem;
}

.score-shortcut-btn {
  min-height: 3.35rem;
  border-radius: 20px;
  border: 1px solid rgba(240, 103, 103, 0.22);
  background:
    linear-gradient(180deg, rgba(240, 103, 103, 0.14), transparent 70%),
    rgba(255, 255, 255, 0.025);
  color: #ffd7d3;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.score-shortcut-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 103, 103, 0.42);
  box-shadow: 0 12px 28px rgba(240, 103, 103, 0.12);
}

.score-shortcut-btn:active {
  transform: translateY(0);
}

.avatar-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 0.8rem;
  border-radius: 22px;
  border: 1px solid rgba(205, 162, 104, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 65%),
    rgba(255, 255, 255, 0.02);
  font-size: 2rem;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.avatar-option:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 164, 91, 0.34);
  background:
    linear-gradient(180deg, rgba(214, 164, 91, 0.2), rgba(214, 164, 91, 0.08)),
    rgba(255, 255, 255, 0.04);
}

.avatar-option.selected {
  border-color: rgba(214, 164, 91, 0.56);
  box-shadow: 0 0 0 1px rgba(214, 164, 91, 0.35) inset;
}

.round-transition {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: calc(var(--z-modal) + 10);
  background:
    radial-gradient(circle at center, rgba(205, 162, 104, 0.16) 0%, rgba(205, 162, 104, 0) 30%),
    radial-gradient(circle at center, rgba(121, 144, 182, 0.08) 0%, rgba(121, 144, 182, 0) 46%),
    rgba(3, 6, 12, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.round-transition::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(54vw, 34rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 60%, rgba(205, 162, 104, 0.1) 61%, transparent 62.5%),
    radial-gradient(circle, transparent 74%, rgba(255, 255, 255, 0.05) 75%, transparent 76.5%);
  opacity: 0.75;
  animation: roundSigilPulse 14s ease-in-out infinite alternate;
}

.round-transition.active {
  display: flex;
}

.round-transition-content {
  text-align: center;
  padding: 2rem;
  animation: roundReveal 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.round-transition.fade-out .round-transition-content {
  animation: roundHide 500ms ease forwards;
}

.round-transition-kicker {
  font-size: var(--font-size-xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(248, 242, 232, 0.58);
}

.round-transition-content h2 {
  font-size: clamp(4rem, 18vw, 8rem);
  line-height: 0.92;
  color: var(--color-text);
}

.round-transition-subtext {
  margin-top: var(--spacing-sm);
  color: rgba(248, 242, 232, 0.7);
  font-size: var(--font-size-sm);
}

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

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

@keyframes ambientFloat {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(1.25rem, -1.5rem, 0) scale(1.08);
  }
}

@keyframes candleRoomFlicker {
  0%,
  100% {
    transform: translate(-50%, -0.14rem) scale(0.96, 0.94);
    opacity: 0.42;
  }
  20% {
    transform: translate(-48.6%, -0.56rem) scale(1.04, 1.01);
    opacity: 0.56;
  }
  42% {
    transform: translate(-50.9%, -0.22rem) scale(0.98, 0.96);
    opacity: 0.45;
  }
  67% {
    transform: translate(-47.8%, -0.78rem) scale(1.08, 1.04);
    opacity: 0.6;
  }
  84% {
    transform: translate(-49.2%, -0.34rem) scale(1.02, 0.99);
    opacity: 0.5;
  }
}

@keyframes candleSigilFloat {
  0% {
    transform: translateX(-50%) rotate(-7deg) scale(0.96);
    opacity: 0.26;
  }
  50% {
    transform: translateX(-50%) rotate(2deg) scale(1.02);
    opacity: 0.42;
  }
  100% {
    transform: translateX(-50%) rotate(8deg) scale(1.06);
    opacity: 0.34;
  }
}

@keyframes candleCorePulse {
  0%,
  100% {
    transform: translate(-50%, -0.08rem) scale(0.98, 1.01);
    opacity: 0.82;
    box-shadow:
      0 -3rem 2.6rem rgba(220, 138, 12, 0.42),
      0 3rem 3.6rem rgba(220, 138, 12, 0.36),
      inset 0.2rem 0 0.18rem rgba(141, 182, 255, 0.32),
      inset -0.2rem 0 0.18rem rgba(141, 182, 255, 0.24);
  }
  28% {
    transform: translate(-49%, -0.34rem) scale(1.04, 1.08);
    opacity: 0.98;
  }
  57% {
    transform: translate(-50.5%, -0.02rem) scale(1, 1.02);
    opacity: 0.86;
  }
  79% {
    transform: translate(-49.1%, -0.42rem) scale(1.08, 1.1);
    opacity: 1;
    box-shadow:
      0 -4rem 3.5rem rgba(220, 138, 12, 0.56),
      0 4rem 4.8rem rgba(220, 138, 12, 0.48),
      inset 0.24rem 0 0.22rem rgba(141, 182, 255, 0.38),
      inset -0.24rem 0 0.22rem rgba(141, 182, 255, 0.3);
  }
}

@keyframes candleFlameLean {
  0%,
  100% {
    transform: translateX(-50%) rotate(-1.2deg);
    opacity: 0.94;
  }
  25% {
    transform: translateX(-49.2%) rotate(1.6deg);
    opacity: 1;
  }
  50% {
    transform: translateX(-50.7%) rotate(-2.4deg);
    opacity: 0.88;
  }
  75% {
    transform: translateX(-49.1%) rotate(1.2deg);
    opacity: 0.97;
  }
}

@keyframes candleFlameStretch {
  0%,
  100% {
    height: 7.6rem;
  }
  30% {
    height: 8.2rem;
  }
  55% {
    height: 8.7rem;
  }
  78% {
    height: 8.15rem;
  }
}

@keyframes candleFlameShimmer {
  0%,
  100% {
    opacity: 0.84;
    box-shadow:
      0 0 22px rgba(247, 93, 0, 0.44),
      0 -11px 9px rgba(247, 128, 0, 0.58),
      0 -26px 22px rgba(255, 205, 124, 0.22);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 30px rgba(247, 93, 0, 0.56),
      0 -14px 12px rgba(247, 128, 0, 0.68),
      0 -34px 30px rgba(255, 205, 124, 0.3);
  }
}

@keyframes candleInnerFlicker {
  0%,
  100% {
    transform: scale(0.94, 1);
    opacity: 0.88;
  }
  33% {
    transform: scale(1.03, 0.94);
    opacity: 0.98;
  }
  66% {
    transform: scale(0.97, 1.06);
    opacity: 0.9;
  }
}

@keyframes sigilPulse {
  0% {
    transform: translate3d(0, 0, 0) scale(0.98) rotate(0deg);
    opacity: 0.34;
  }
  100% {
    transform: translate3d(0.5rem, -0.75rem, 0) scale(1.04) rotate(8deg);
    opacity: 0.56;
  }
}

@keyframes roundSigilPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.98) rotate(0deg);
    opacity: 0.34;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.04) rotate(8deg);
    opacity: 0.56;
  }
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes roundReveal {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes roundHide {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

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

@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .site-controls {
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    padding: 0.55rem 0.6rem 0.6rem;
  }

  .language-switcher {
    min-width: 7.7rem;
  }

  .candle-right {
    display: none;
  }

  .candle-left {
    left: auto;
    right: -1.95rem;
    transform: scale(0.64);
    opacity: 0.72;
  }

  .button-group {
    flex-direction: column;
  }

  .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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