
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#startScreen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  background-image: url('assets/start-bg-v2.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(3.5rem, 8vw, 5rem);
}

#startScreen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 260ms ease;
}

.home-page-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(180deg, rgba(4, 9, 28, 0.58) 0%, rgba(4, 9, 28, 0.68) 48%, rgba(4, 9, 28, 0.78) 100%);
}

.hero-section,
.home-sections,
.home-footer {
  position: relative;
  z-index: 2;
  width: min(96vw, 1180px);
}

.hero-section {
  min-height: min(100svh, 860px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(5.2rem, 10vh, 7.2rem) 0 clamp(1.4rem, 4vh, 2.6rem);
}

.start-screen-title {
  position: static;
  margin: 0;
  z-index: 2;
  display: inline-block;
  max-width: min(90vw, 720px);
  text-align: center;
  font-size: clamp(2.5rem, 7.4vw, 5.8rem);
  line-height: 1.05;
  letter-spacing: 0.09em;
  color: #ffd700;
  background: linear-gradient(
    to bottom,
    #fff6b0 0%,
    #ffd700 40%,
    #ffb300 60%,
    #ffd700 80%,
    #fff6b0 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(75, 43, 0, 0.5);
  text-shadow:
    0 0 6px rgba(255, 215, 0, 0.9),
    0 0 12px rgba(255, 215, 0, 0.8),
    0 0 24px rgba(255, 200, 0, 0.6),
    0 0 40px rgba(255, 180, 0, 0.4);
  animation: titleGlowPulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 2px rgba(255, 238, 166, 0.75));
  pointer-events: none;
}

.hero-subtitle {
  margin: 0.5rem 0 1.45rem;
  text-align: center;
  font-size: clamp(0.98rem, 1.8vw, 1.2rem);
  font-weight: 700;
  color: rgba(248, 250, 255, 0.95);
  letter-spacing: 0.03em;
}

.hero-lead {
  margin: 0 0 1rem;
  width: min(92vw, 720px);
  text-align: center;
  color: rgba(235, 242, 255, 0.95);
  line-height: 1.75;
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
}

.hero-value-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 120, 0.35);
  background: rgba(13, 22, 52, 0.55);
  color: rgba(248, 231, 176, 0.95);
  font-size: 0.84rem;
  font-weight: 700;
}

@keyframes titleGlowPulse {
  0% {
    text-shadow:
      0 0 6px rgba(255, 215, 0, 0.8),
      0 0 12px rgba(255, 215, 0, 0.7),
      0 0 24px rgba(255, 200, 0, 0.5);
  }

  50% {
    text-shadow:
      0 0 10px rgba(255, 215, 0, 1),
      0 0 20px rgba(255, 215, 0, 0.9),
      0 0 36px rgba(255, 200, 0, 0.7);
  }

  100% {
    text-shadow:
      0 0 6px rgba(255, 215, 0, 0.8),
      0 0 12px rgba(255, 215, 0, 0.7),
      0 0 24px rgba(255, 200, 0, 0.5);
  }
}

#startLocalBtn,
#startOnlineBtn,
#gamesHubBtn,
#homeGroupOneDeviceBtn,
#homeGroupMultiDeviceBtn,
#homeGroupDeviceBackBtn,
#homeGroupTwoTeamsBtn,
#homeGroupThreeTeamsBtn,
#homeGroupTeamsBackBtn,
#resumeGameBtn,
#discardResumeGameBtn,
#instructionsBtn,
#contactBtn,
#installGuideBtn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-family: inherit;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.2;
  border-radius: 14px;
  border: 2px solid rgba(244, 206, 108, 0.88);
  cursor: pointer;
  background: rgba(10, 20, 52, 0.94);
  color: #f6d989;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: all 0.3s ease;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

#startLocalBtn::before,
#startLocalBtn::after,
#startOnlineBtn::before,
#startOnlineBtn::after,
#gamesHubBtn::before,
#gamesHubBtn::after,
#homeGroupOneDeviceBtn::before,
#homeGroupOneDeviceBtn::after,
#homeGroupMultiDeviceBtn::before,
#homeGroupMultiDeviceBtn::after,
#homeGroupDeviceBackBtn::before,
#homeGroupDeviceBackBtn::after,
#homeGroupTwoTeamsBtn::before,
#homeGroupTwoTeamsBtn::after,
#homeGroupThreeTeamsBtn::before,
#homeGroupThreeTeamsBtn::after,
#homeGroupTeamsBackBtn::before,
#homeGroupTeamsBackBtn::after,
#resumeGameBtn::before,
#resumeGameBtn::after,
#discardResumeGameBtn::before,
#discardResumeGameBtn::after,
#instructionsBtn::before,
#instructionsBtn::after,
#contactBtn::before,
#contactBtn::after,
#installGuideBtn::before,
#installGuideBtn::after {
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  #startLocalBtn:hover,
  #startOnlineBtn:hover,
  #gamesHubBtn:hover,
  #homeGroupOneDeviceBtn:hover,
  #homeGroupMultiDeviceBtn:hover,
  #homeGroupDeviceBackBtn:hover,
  #homeGroupTwoTeamsBtn:hover,
  #homeGroupThreeTeamsBtn:hover,
  #homeGroupTeamsBackBtn:hover,
  #resumeGameBtn:hover,
  #discardResumeGameBtn:hover,
  #instructionsBtn:hover,
  #contactBtn:hover,
  #installGuideBtn:hover {
    background: rgba(14, 27, 67, 0.97);
    transform: scale(1.03);
    box-shadow:
      0 10px 24px rgba(1, 7, 25, 0.4),
      0 0 0 1px rgba(244, 206, 108, 0.24) inset;
  }

  #homepagePrimaryStep #gamesHubBtn:hover {
    background: linear-gradient(160deg, rgba(33, 51, 104, 0.98) 0%, rgba(16, 29, 68, 0.99) 100%);
    box-shadow:
      0 12px 28px rgba(1, 7, 25, 0.48),
      0 0 0 1px rgba(188, 211, 255, 0.3) inset,
      0 0 18px rgba(159, 185, 243, 0.18);
  }
}

.start-actions {
  position: static;
  z-index: 2;
  display: grid;
  gap: 1rem;
  width: min(92vw, 500px);
}

.play-flow-shell {
  display: grid;
  gap: 0.8rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-flow-step {
  display: grid;
  gap: 0.75rem;
}

#homepagePrimaryStep #gamesHubBtn {
  margin-top: 0.62rem;
  min-height: 60px;
  border-color: rgba(189, 209, 255, 0.42);
  background: linear-gradient(160deg, rgba(26, 41, 88, 0.96) 0%, rgba(13, 24, 56, 0.98) 100%);
  box-shadow:
    0 10px 24px rgba(1, 7, 25, 0.42),
    0 0 0 1px rgba(170, 198, 255, 0.24) inset,
    0 1px 0 rgba(214, 229, 255, 0.2) inset;
}

#homepagePrimaryStep #startLocalBtn.cta-primary {
  min-height: 66px;
  border-color: rgba(255, 221, 137, 0.98);
  background: linear-gradient(145deg, rgba(255, 214, 107, 0.96) 0%, rgba(232, 172, 39, 0.98) 100%);
  color: #2d1800;
  box-shadow:
    0 16px 34px rgba(255, 183, 56, 0.32),
    0 0 0 1px rgba(255, 245, 211, 0.45) inset;
}

#homepagePrimaryStep #startOnlineBtn.cta-secondary {
  border-color: rgba(189, 209, 255, 0.48);
  background: rgba(13, 24, 56, 0.95);
  color: rgba(233, 242, 255, 0.98);
}

.games-hub-btn__title {
  font-size: clamp(1rem, 2vw, 1.1rem);
  color: rgba(236, 245, 255, 0.98);
  letter-spacing: 0.01em;
  font-weight: 800;
}

.resume-game-prompt {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  border: 1px solid rgba(255, 215, 120, 0.35);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(13, 21, 52, 0.55);
}

.resume-game-prompt-text {
  margin: 0;
  text-align: center;
  color: rgba(255, 233, 170, 0.98);
  font-weight: 700;
}

.resume-game-actions {
  display: grid;
  gap: 0.55rem;
}

#discardResumeGameBtn {
  border-color: rgba(255, 215, 120, 0.28);
  color: rgba(255, 232, 172, 0.86);
}

.home-secondary-actions {
  display: grid;
  gap: 0.55rem;
  width: min(100%, 460px);
  margin-top: 0.4rem;
}

.home-secondary-actions .secondary-button {
  background: rgba(12, 22, 54, 0.72);
  border-color: rgba(255, 215, 120, 0.26);
  color: rgba(238, 244, 255, 0.9);
  font-size: clamp(0.95rem, 1.8vw, 1.02rem);
  letter-spacing: 0.02em;
  min-height: 48px;
}

.flow-back-button {
  border-color: rgba(255, 215, 120, 0.28);
  background: rgba(12, 20, 46, 0.32);
  color: rgba(255, 231, 161, 0.8);
  box-shadow: 0 0 0 1px rgba(255, 215, 120, 0.06) inset;
}

.seo-text {
  position: static;
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.seo-text h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.3;
  color: rgba(243, 244, 246, 0.95);
}

.seo-text p {
  margin: 0;
  font-size: clamp(0.88rem, 1.1vw, 1rem);
  line-height: 1.65;
  color: rgba(243, 244, 246, 0.9);
}

.hero-quick-intro {
  margin-top: 0.78rem;
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 120, 0.24);
  background: rgba(9, 17, 44, 0.5);
  padding: 0.72rem 0.82rem;
  text-align: right;
}

.hero-quick-intro h2 {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  color: rgba(255, 231, 161, 0.95);
}

.hero-quick-intro p {
  margin: 0.28rem 0 0;
  line-height: 1.65;
  color: rgba(236, 243, 255, 0.9);
  font-size: clamp(0.86rem, 1.2vw, 0.97rem);
}

.hero-quick-intro-note {
  color: rgba(255, 226, 138, 0.9);
  font-size: clamp(0.81rem, 1vw, 0.9rem);
}

.scroll-hint {
  margin: 1.1rem 0 0;
  color: rgba(255, 226, 138, 0.94);
  font-size: clamp(0.86rem, 1.7vw, 1rem);
  letter-spacing: 0.04em;
}

.intro-section .compact-cards .mode-card {
  padding: 0.78rem 0.88rem;
}

.home-sections {
  display: grid;
  gap: clamp(0.85rem, 2.1vw, 1.25rem);
  margin-top: clamp(0.5rem, 2vw, 1rem);
}

.home-pair-row {
  display: grid;
  gap: inherit;
}

.home-panel {
  background: rgba(8, 14, 36, 0.66);
  border: 1px solid rgba(255, 215, 120, 0.35);
  border-radius: 16px;
  padding: clamp(0.95rem, 2.2vw, 1.28rem);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.34),
    0 0 16px rgba(255, 193, 67, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home-panel h2 {
  margin: 0 0 0.75rem;
  color: #ffe6a8;
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
}

.home-panel > .section-body-text {
  max-inline-size: 64ch;
  margin-bottom: 0.68rem;
}

.panel-wide > h2 {
  margin-bottom: 0.85rem;
}

.card-grid {
  display: grid;
  gap: 0.76rem;
}

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

.features-grid,
.faq-list,
.mode-grid {
  grid-template-columns: 1fr;
}

.mini-card,
.mode-card {
  display: grid;
  align-content: start;
  gap: 0.36rem;
  background: rgba(20, 30, 68, 0.66);
  border: 1px solid rgba(255, 215, 120, 0.26);
  border-radius: 14px;
  padding: 0.9rem 0.98rem;
  color: rgba(245, 248, 255, 0.96);
  min-height: 100%;
}

.support-grid {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.support-block {
  display: grid;
  align-content: start;
  gap: 0.36rem;
  min-height: 100%;
  padding: 0.9rem 0.98rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 120, 0.24);
  background: rgba(20, 30, 68, 0.62);
}

.mode-card h3,
.faq-item h3,
.support-block h3 {
  margin: 0 0 0.4rem;
  color: rgba(255, 225, 142, 0.95);
  font-size: 1rem;
}

.mode-card p,
.faq-item p,
.support-block p,
.more-text {
  margin: 0;
  color: rgba(224, 234, 255, 0.9);
  line-height: 1.7;
}


.section-body-text,
.section-body-note {
  margin: 0;
  color: rgba(224, 234, 255, 0.9);
  line-height: 1.72;
}

.footer-info-panel .section-body-text,
.footer-info-panel .section-body-note {
  max-inline-size: 66ch;
}

.section-body-note {
  margin-top: 0.45rem;
  font-size: 0.91rem;
  color: rgba(210, 226, 255, 0.84);
}

.inline-email-link {
  color: rgba(255, 225, 142, 0.95);
  text-decoration: underline;
  text-decoration-color: rgba(255, 215, 120, 0.75);
  text-underline-offset: 2px;
  word-break: break-word;
}

.inline-email-link:hover,
.inline-email-link:focus-visible {
  color: #ffe9ab;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.62rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  background: rgba(26, 40, 87, 0.78);
  border: 1px solid rgba(255, 215, 120, 0.32);
  color: rgba(247, 250, 255, 0.95);
  font-size: 0.88rem;
}

.home-footer {
  margin-top: clamp(0.9rem, 2.2vw, 1.25rem);
  display: grid;
  gap: 0.74rem;
  padding: clamp(0.92rem, 2.2vw, 1.15rem) clamp(0.98rem, 2.2vw, 1.3rem);
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 120, 0.14);
  border-top-color: rgba(255, 215, 120, 0.24);
  background: linear-gradient(180deg, rgba(7, 12, 30, 0.72), rgba(5, 10, 24, 0.72));
}

.footer-closure {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1rem;
  color: rgba(221, 231, 250, 0.84);
  font-size: 0.81rem;
}

.footer-brand {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 225, 142, 0.9);
  letter-spacing: 0.03em;
}

.footer-meta {
  margin: 0;
  color: rgba(202, 217, 244, 0.78);
}

.footer-email {
  color: rgba(248, 227, 169, 0.86);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 215, 120, 0.28);
  line-height: 1.25;
}

.footer-email:hover,
.footer-email:focus-visible {
  color: #ffe9ab;
  border-bottom-color: rgba(255, 215, 120, 0.72);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  padding-top: 0.05rem;
  border-top: 1px solid rgba(122, 146, 198, 0.18);
}

.footer-link {
  text-decoration: none;
  color: rgba(211, 224, 248, 0.84);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.26rem 0.5rem;
  font-size: 0.77rem;
  line-height: 1.35;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.footer-link + .footer-link {
  position: relative;
}

.footer-link + .footer-link::before {
  content: "•";
  position: absolute;
  inset-inline-start: -0.08rem;
  color: rgba(157, 179, 226, 0.52);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: rgba(255, 231, 169, 0.92);
}

.secondary-button {
  opacity: 0.92;
  border-color: rgba(244, 206, 108, 0.9);
}



@media (min-width: 1024px) {
  #startScreen {
    background-image:
      radial-gradient(circle at 16% 22%, rgba(70, 105, 206, 0.22), transparent 44%),
      radial-gradient(circle at 84% 14%, rgba(255, 202, 98, 0.08), transparent 42%),
      radial-gradient(circle at 50% 122%, rgba(34, 63, 138, 0.36), transparent 56%),
      linear-gradient(160deg, #030713 0%, #081230 46%, #050a1c 100%);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
  }

  #startScreen::before {
    opacity: 1;
    background-image:
      radial-gradient(circle at 22% 34%, rgba(112, 152, 255, 0.14), transparent 36%),
      radial-gradient(circle at 78% 28%, rgba(247, 198, 93, 0.1), transparent 34%),
      radial-gradient(circle at 50% 78%, rgba(25, 44, 96, 0.36), transparent 52%);
    mix-blend-mode: screen;
  }

  .home-page-overlay {
    background:
      linear-gradient(180deg, rgba(3, 9, 26, 0.62) 0%, rgba(3, 8, 24, 0.74) 52%, rgba(3, 8, 23, 0.86) 100%),
      radial-gradient(circle at top, rgba(255, 216, 111, 0.08), transparent 60%);
  }

  .hero-section,
  .home-sections,
  .home-footer {
    width: min(95vw, 1500px);
  }

  .hero-section {
    width: min(94vw, 1360px);
  }

  .home-sections,
  .home-footer {
    width: min(95vw, 1500px);
  }

  .hero-section {
    min-height: min(88svh, 780px);
    padding: clamp(5.8rem, 11vh, 8.4rem) 0 clamp(1rem, 2.8vh, 1.8rem);
  }

  .start-screen-title {
    max-width: min(90vw, 860px);
    font-size: clamp(5.2rem, 8.2vw, 7.6rem);
    letter-spacing: 0.08em;
  }

  .hero-subtitle {
    margin: 0.85rem 0 1.85rem;
    font-size: clamp(1.28rem, 1.75vw, 1.66rem);
    letter-spacing: 0.05em;
  }

  .start-actions {
    width: min(90vw, 680px);
    gap: 1.16rem;
  }

  .home-flow-step {
    gap: 0.9rem;
  }

  .home-secondary-actions {
    gap: 0.72rem;
    margin-top: 0.5rem;
  }

  #startScreen #startLocalBtn,
  #startScreen #startOnlineBtn,
  #startScreen #gamesHubBtn,
  #startScreen #homeGroupOneDeviceBtn,
  #startScreen #homeGroupMultiDeviceBtn,
  #startScreen #homeGroupDeviceBackBtn,
  #startScreen #homeGroupTwoTeamsBtn,
  #startScreen #homeGroupThreeTeamsBtn,
  #startScreen #homeGroupTeamsBackBtn,
  #startScreen #resumeGameBtn,
  #startScreen #discardResumeGameBtn,
  #startScreen #instructionsBtn,
  #startScreen #contactBtn,
  #startScreen #installGuideBtn {
    min-width: 420px;
    max-width: 620px;
    min-height: 66px;
    padding: 14px 30px;
    font-size: clamp(1.42rem, 1.62vw, 1.76rem);
    border-radius: 16px;
  }

  #startScreen #startLocalBtn,
  #startScreen #startOnlineBtn,
  #startScreen #gamesHubBtn,
  #startScreen #instructionsBtn,
  #startScreen #contactBtn,
  #startScreen #homepagePrimaryStep #gamesHubBtn .games-hub-btn__title {
    font-size: clamp(1.42rem, 1.62vw, 1.76rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
  }

  #startScreen #homepagePrimaryStep #gamesHubBtn {
    width: 100%;
    min-width: 420px;
    max-width: 620px;
    justify-self: stretch;
    align-self: stretch;
  }

  .scroll-hint {
    margin-top: 1.3rem;
    font-size: clamp(1rem, 1.15vw, 1.16rem);
  }

  #startScreen .home-sections {
    margin-top: clamp(0.2rem, 0.9vh, 0.58rem);
    gap: clamp(1rem, 1.4vw, 1.3rem);
  }
}

@media (min-width: 1024px) {
  .home-sections:not(.info-page-content) {
    grid-template-columns: 1fr;
    gap: clamp(0.95rem, 1.45vw, 1.3rem);
    align-items: start;
  }

  .home-sections:not(.info-page-content) > .home-panel {
    grid-column: 1 / -1;
    padding: clamp(1.06rem, 1.15vw, 1.34rem);
  }

  .home-sections:not(.info-page-content) > .home-pair-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(0.95rem, 1.45vw, 1.3rem);
    align-items: stretch;
  }

  .home-sections:not(.info-page-content) > .home-pair-row > .home-panel {
    grid-column: span 6;
    height: 100%;
  }

  .home-sections:not(.info-page-content) > .intro-section,
  .home-sections:not(.info-page-content) > [aria-labelledby="categoriesTitle"],
  .home-sections:not(.info-page-content) > [aria-labelledby="faqTitle"],
  .home-sections:not(.info-page-content) > .support-hub {
    grid-column: 1 / -1;
  }

  .home-sections:not(.info-page-content) .card-grid.mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .home-sections:not(.info-page-content) .mode-grid > .mode-card {
    min-height: 178px;
  }

  .home-sections:not(.info-page-content) .intro-section .compact-cards .mode-card {
    min-height: 164px;
  }

  .home-sections:not(.info-page-content) .support-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .home-sections:not(.info-page-content) .intro-section {
    padding: clamp(1.12rem, 1.25vw, 1.46rem);
  }

  .home-sections:not(.info-page-content) .intro-section > .card-grid.mode-grid {
    margin-top: 0.24rem;
  }

  .home-sections:not(.info-page-content) .panel-help,
  .home-sections:not(.info-page-content) .support-hub {
    background: rgba(8, 14, 36, 0.58);
    border-color: rgba(255, 215, 120, 0.3);
  }

  .home-sections:not(.info-page-content) .panel-help {
    align-content: start;
  }

  .home-sections:not(.info-page-content) .panel-help .home-secondary-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.66rem;
  }

  .home-sections:not(.info-page-content) .panel-help #instructionsBtn,
  .home-sections:not(.info-page-content) .panel-help #installGuideBtn,
  .home-sections:not(.info-page-content) .panel-help #contactBtn {
    min-width: 0;
    max-width: 100%;
    min-height: 58px;
    padding: 0.74rem 0.82rem;
    font-size: clamp(1.01rem, 1.02vw, 1.14rem);
    line-height: 1.35;
    letter-spacing: 0;
  }
}

@media (min-width: 1480px) {
  .home-sections:not(.info-page-content) > .intro-section .card-grid.mode-grid,
  .home-sections:not(.info-page-content) > [aria-labelledby="modesTitle"] .card-grid.mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .hero-section {
    min-height: min(84svh, 760px);
  }

  .start-screen-title {
    font-size: clamp(5.8rem, 7.1vw, 8.2rem);
  }
}

@media (max-width: 700px) {
  #startScreen {
    padding-top: 0.48rem;
  }

  #startScreen:not(.info-page-shell) {
    padding-bottom: clamp(2.6rem, 8vw, 3.6rem);
  }

  #startScreen:not(.info-page-shell) .hero-section {
    min-height: min(90svh, 730px);
    justify-content: flex-start;
    padding-top: clamp(4.15rem, 11.5vh, 5.3rem);
    padding-bottom: clamp(1rem, 3.2vh, 1.85rem);
  }

  #startScreen:not(.info-page-shell) .start-screen-title {
    margin-top: 0.15rem;
  }

  #startScreen:not(.info-page-shell) .hero-subtitle {
    margin: 0.44rem 0 1.05rem;
  }

  #startScreen:not(.info-page-shell) .hero-lead {
    margin-bottom: 0.62rem;
  }

  #startScreen:not(.info-page-shell) .hero-value-points {
    margin-bottom: 0.7rem;
  }

  #startScreen:not(.info-page-shell) .start-actions {
    gap: 0.55rem;
  }

  #startScreen:not(.info-page-shell) .scroll-hint {
    margin-top: 0.72rem;
  }

  #startScreen:not(.info-page-shell) .home-sections {
    margin-top: 0.3rem;
  }

  #startScreen.info-page-shell {
    padding-top: 0.52rem;
  }

  .info-page-shell {
    gap: 0.62rem;
  }

  .footer-info-panel .section-body-text,
  .footer-info-panel .section-body-note {
    max-inline-size: 100%;
  }

  .home-footer {
    padding: 0.84rem 0.76rem 0.9rem;
    gap: 0.62rem;
  }

  .footer-closure {
    grid-template-columns: 1fr;
    justify-content: flex-start;
    text-align: right;
    gap: 0.18rem;
    font-size: 0.79rem;
  }

  .footer-brand {
    width: auto;
  }

  .footer-nav {
    justify-content: flex-start;
    gap: 0.12rem;
    padding-top: 0.45rem;
  }

  .footer-link {
    padding-inline: 0.35rem;
  }

  .footer-link + .footer-link::before {
    inset-inline-start: -0.02rem;
  }
}

@media (min-width: 701px) {
  .home-sections {
    gap: clamp(0.72rem, 1.35vw, 1rem);
  }

  .home-panel {
    padding: clamp(0.84rem, 1.55vw, 1.08rem) clamp(0.9rem, 1.7vw, 1.18rem);
  }

  .home-panel h2 {
    margin-bottom: 0.56rem;
  }

  .card-grid {
    gap: 0.54rem;
  }

  .mode-card,
  .mini-card {
    display: grid;
    align-content: start;
    gap: 0.26rem;
    padding: 0.76rem 0.84rem;
    min-height: 100%;
  }

  .mode-card h3,
  .faq-item h3,
  .support-block h3 {
    margin-bottom: 0.18rem;
  }

  .section-body-text,
  .section-body-note,
  .more-text,
  .mode-card p,
  .faq-item p,
  .support-block p {
    max-inline-size: 62ch;
  }

  .chips-wrap {
    margin-top: 0.34rem;
  }

  .section-body-note {
    margin-top: 0.36rem;
  }

  #startLocalBtn,
  #startOnlineBtn,
  #gamesHubBtn,
  #homeGroupOneDeviceBtn,
  #homeGroupMultiDeviceBtn,
  #homeGroupDeviceBackBtn,
  #homeGroupTwoTeamsBtn,
  #homeGroupThreeTeamsBtn,
  #homeGroupTeamsBackBtn,
  #resumeGameBtn,
  #discardResumeGameBtn,
  #instructionsBtn,
  #contactBtn,
  #installGuideBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 340px;
    max-width: 460px;
    min-height: 58px;
    padding: 12px 26px;
    margin: 0 auto;
    box-sizing: border-box;
    text-align: center;
    direction: rtl;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.2;
    font-size: clamp(20px, 1.8vw, 28px);
  }

  #startLocalBtn,
  #startOnlineBtn,
  #gamesHubBtn,
  #homeGroupOneDeviceBtn,
  #homeGroupMultiDeviceBtn,
  #homeGroupTwoTeamsBtn,
  #homeGroupThreeTeamsBtn {
    min-height: 56px;
    font-size: clamp(1.16rem, 1.8vw, 1.52rem);
  }

  #homeGroupDeviceBackBtn,
  #homeGroupTeamsBackBtn,
  #discardResumeGameBtn,
  #instructionsBtn,
  #contactBtn,
  #installGuideBtn {
    min-height: 42px;
    font-size: 0.9rem;
  }

  .home-secondary-actions .secondary-button {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-width: 1px;
    border-color: rgba(244, 206, 108, 0.62);
    background: rgba(10, 20, 52, 0.82);
    color: rgba(246, 217, 137, 0.9);
    opacity: 0.86;
  }

  .features-grid,
  .faq-list,
  .mode-grid,
  .support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #homepagePrimaryStep #gamesHubBtn {
    min-width: 340px;
    max-width: 460px;
    width: 100%;
    min-height: 56px;
    margin-top: 0.7rem;
    padding: 12px 26px;
  }

  #homepagePrimaryStep .games-hub-btn__title {
    font-size: clamp(1.1rem, 1.7vw, 1.42rem);
  }
}

html.is-safari #startScreen .hero-section,
html.is-safari #startScreen .home-sections,
html.is-safari #startScreen .home-footer {
  width: min(95vw, 1500px);
}

html.is-safari:not(.is-ios-safari) {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

@media (min-width: 900px) {
  html.is-safari:not(.is-ios-safari) {
    font-size: 15.25px;
  }
}

.contact-modal-content {
  width: min(560px, 100%);
  position: relative;
}

.contact-modal-subtitle {
  margin: 0;
  color: rgba(228, 237, 255, 0.9);
}

.contact-helper-text,
.contact-privacy-note {
  margin: 0;
  color: rgba(210, 226, 255, 0.86);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-input-label {
  display: block;
  margin: 0;
  color: rgba(233, 241, 255, 0.95);
  font-weight: 700;
  font-size: 0.95rem;
}

.contact-message-input,
.contact-optional-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(112, 140, 220, 0.58);
  background: rgba(11, 19, 45, 0.8);
  color: #eef4ff;
  padding: 0.75rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.contact-message-input {
  resize: vertical;
  min-height: 150px;
  max-height: 42vh;
  line-height: 1.7;
}

.contact-optional-input {
  min-height: 44px;
  line-height: 1.4;
}

.contact-message-input:focus,
.contact-optional-input:focus {
  outline: none;
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2);
}

.contact-feedback {
  margin: 0;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.contact-feedback.is-error {
  color: #ffd2d2;
}

.contact-feedback.is-success {
  color: #b5ffd7;
}

.contact-feedback.is-info {
  color: #c8d8ff;
}

.contact-modal-actions {
  gap: 0.6rem;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.contact-modal-actions > button {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.instructions-content {
  width: min(680px, 100%);
}

.instructions-accordion {
  display: grid;
  gap: 0.7rem;
}

.instructions-section {
  background: rgba(20, 36, 79, 0.62);
  border: 1px solid rgba(93, 128, 220, 0.45);
  border-radius: 12px;
  padding: 0.2rem 0.75rem 0.75rem;
}

.instructions-section summary {
  list-style: none;
  cursor: pointer;
  font-size: clamp(1rem, 1.1vw, 1.15rem);
  font-weight: 800;
  padding: 0.8rem 1.9rem 0.6rem 0;
  position: relative;
}

.instructions-section summary::-webkit-details-marker {
  display: none;
}

.instructions-section summary::after {
  content: "▾";
  position: absolute;
  inset-inline-end: 0;
  top: 0.78rem;
  font-size: 1.05rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.instructions-section[open] summary::after {
  transform: rotate(180deg);
}

.instructions-section p {
  margin: 0.15rem 0 0;
  line-height: 1.85;
  color: #eef3ff;
  font-size: clamp(0.98rem, 0.8vw + 0.78rem, 1.08rem);
}

.instructions-section p + p {
  margin-top: 0.65rem;
}

.install-guide-content {
  width: min(540px, 100%);
}

.install-guide-steps {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.55rem;
}

.install-guide-steps p {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.08);
  display: grid;
  gap: 0.28rem;
  text-align: start;
  line-height: 1.6;
}

.install-step-platform {
  font-weight: 800;
}

.install-step-action {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.install-inline-en {
  unicode-bidi: plaintext;
  direction: ltr;
  display: inline-block;
}

#installGuideDesktopMessage {
  margin: 0.3rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.08);
}

.online-modal-content {
  width: min(560px, 100%);
}


.online-mode-title {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dim);
}

.online-mode-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.online-mode-actions > button,
.online-panel > button {
  flex: 1 1 180px;
}

.online-panel {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.online-team-count {
  margin-top: 0.2rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(147, 197, 253, 0.32);
  background: rgba(147, 197, 253, 0.08);
  display: grid;
  gap: 0.45rem;
}

.online-team-count-label {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.online-team-count-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.55rem;
}

.online-feedback {
  margin-top: 0.55rem;
  font-weight: 700;
}

.online-feedback.is-error {
  color: #ff8b8b;
}

.online-feedback.is-success {
  color: #6ee7b7;
}

.online-feedback.is-info {
  color: #93c5fd;
}


.online-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 12px;
  background: rgba(255, 209, 102, 0.08);
}

.online-code-box .secondary-btn {
  min-width: 120px;
  white-space: nowrap;
}

.waiting-status {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(147, 197, 253, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.3);
  font-weight: 700;
}

.waiting-status.is-connected {
  background: rgba(110, 231, 183, 0.12);
  border-color: rgba(110, 231, 183, 0.35);
  color: #6ee7b7;
}

.online-room-code {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: 0.18em;
  font-weight: 900;
  color: var(--accent);
  word-break: break-word;
}

:root {
  --bg-1: #060816;
  --bg-2: #160a2e;
  --bg-3: #062234;
  --panel: rgba(12, 18, 44, 0.66);
  --panel-2: rgba(25, 34, 77, 0.72);
  --stroke: rgba(148, 178, 255, 0.28);
  --text: #f6f8ff;
  --muted: #adc0eb;
  --accent: #ffd166;
  --accent-glow: #ffcb47;
  --ok: #21d39d;
  --danger: #ff527b;
  --neon-1: #52f5ff;
  --neon-2: #b86eff;
  --board-col-width: clamp(110px, 9.5vw, 160px);
  --layout-max: 1320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

button,
input,
label,
[role="button"] {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  font-family: "Cairo", "Noto Kufi Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: clamp(0.96rem, 0.24vw + 0.9rem, 1.06rem);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
  background-size: 220% 220%;
  animation: gradientShift 32s ease-in-out infinite;
  position: relative;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: -1;
}

.bg-animated,
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-animated {
  z-index: -2;
}

.bg-particles::before,
.bg-particles::after {
  content: "";
  position: absolute;
  inset: -20%;
  background-image:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.5px),
    radial-gradient(circle at 65% 76%, rgba(255, 255, 255, 0.2) 0 1.5px, transparent 2px),
    radial-gradient(circle at 84% 24%, rgba(255, 209, 102, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle at 39% 62%, rgba(82, 245, 255, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 74% 45%, rgba(184, 110, 255, 0.16) 0 1px, transparent 2px);
  background-size: 240px 240px, 320px 320px, 260px 260px, 300px 300px, 280px 280px;
  animation: particlesFloat 38s linear infinite;
}

.bg-particles::after {
  opacity: 0.55;
  transform: scale(1.12);
  animation-duration: 52s;
  animation-direction: reverse;
}

#gameScreen {
  position: relative;
  padding-top: clamp(0.65rem, 1.2vw, 1rem);
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: auto;
  touch-action: manipulation;
}

.game-utility-bar {
  position: relative;
  z-index: 6;
  max-width: min(1440px, calc(100vw - 40px));
  margin-inline: auto;
  padding-inline: clamp(0.55rem, 0.9vw, 0.85rem);
  margin-bottom: clamp(0.45rem, 0.8vw, 0.7rem);
  display: flex;
  justify-content: flex-start;
}

.game-contact-btn {
  position: relative;
  inset: auto;
  min-height: 40px;
  padding: 0.52rem 0.95rem;
  font-size: 0.88rem;
  white-space: nowrap;
  border-color: rgba(255, 209, 102, 0.45);
  background: linear-gradient(145deg, rgba(34, 53, 105, 0.9), rgba(16, 28, 62, 0.94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.game-home-btn {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  width: 100%;
  min-height: 48px;
  justify-content: center;
  padding: 0.74rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 209, 102, 0.42);
  background:
    linear-gradient(160deg, rgba(255, 209, 102, 0.18), rgba(255, 209, 102, 0.03)),
    linear-gradient(145deg, rgba(28, 44, 91, 0.95), rgba(12, 22, 53, 0.95));
  color: #ffefc0;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.12px;
  text-align: center;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 209, 102, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.game-home-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: rgba(255, 209, 102, 0.62);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.38),
    0 0 16px rgba(255, 209, 102, 0.2),
    inset 0 0 0 1px rgba(255, 209, 102, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-home-btn:focus-visible {
  outline: none;
  border-color: rgba(82, 245, 255, 0.82);
  box-shadow:
    0 0 0 3px rgba(11, 26, 66, 0.95),
    0 0 0 5px rgba(82, 245, 255, 0.46),
    0 12px 24px rgba(0, 0, 0, 0.38);
}

.game-home-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  max-width: var(--layout-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: clamp(0.8rem, 1vw, 1.2rem);
  padding: clamp(0.7rem, 1.2vw, 1.15rem);
}

.sidebar,
.board-wrap,
.modal-content {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.sidebar {
  padding: clamp(0.75rem, 1vw, 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sidebar h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.4rem, 1.1vw + 1.2rem, 1.9rem);
  line-height: 1.2;
  color: var(--accent);
  letter-spacing: 0.4px;
  text-shadow: 0 0 20px rgba(255, 209, 102, 0.3);
}

.error-banner {
  background: rgba(116, 24, 48, 0.8);
  border: 1px solid rgba(255, 135, 164, 0.5);
  color: #ffd9e2;
  border-radius: 10px;
  padding: 0.7rem;
  font-weight: 700;
}

.team-card,
.status-card {
  background: var(--panel-2);
  border: 1px solid rgba(146, 170, 255, 0.45);
  border-radius: 14px;
  padding: 0.8rem;
}

.team-card {
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(82, 245, 255, 0.1);
}

.team-card::before {
  content: "";
  position: absolute;
  inset: -140% 15% auto;
  height: 300%;
  background: linear-gradient(90deg, transparent, rgba(82, 245, 255, 0.18), transparent);
  transform: rotate(20deg);
  animation: sheenSweep 6s linear infinite;
}

.team-card.active {
  border-color: rgba(255, 209, 102, 0.85);
  box-shadow:
    0 0 0 1px rgba(255, 209, 102, 0.8),
    0 0 18px rgba(255, 209, 102, 0.35),
    0 0 28px rgba(82, 245, 255, 0.2);
}

.team-card.active::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(120deg, rgba(82, 245, 255, 0.3), rgba(184, 110, 255, 0.45), rgba(255, 209, 102, 0.4))
    border-box;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: borderPulse 2.6s ease-in-out infinite;
}

.team-card h2,
.status-card p {
  margin: 0;
}

.score {
  margin: 0.45rem 0 0;
  font-size: clamp(1.5rem, 1.7vw, 2.1rem);
  font-weight: 900;
  color: #fdf4cf;
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.35);
}

.score.score-pop {
  animation: scorePop 360ms ease-out;
}

.primary-btn,
.secondary-btn,
.success-btn,
.danger-btn,
.ghost-btn {
  border: none;
  border-radius: 11px;
  font-weight: 800;
  font-size: clamp(0.92rem, 0.5vw + 0.7rem, 1rem);
  line-height: 1.25;
  padding: 0.72rem 0.95rem;
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
  position: relative;
  overflow: hidden;
}

.primary-btn:active,
.secondary-btn:active,
.success-btn:active,
.danger-btn:active,
.ghost-btn:active {
  transform: translateY(1px) scale(0.98);
}

.primary-btn {
  background: linear-gradient(135deg, #ffe07a, #ffc13d);
  color: #2b1800;
  box-shadow: 0 8px 20px rgba(255, 203, 71, 0.35);
}

.secondary-btn {
  background: linear-gradient(135deg, #4d71d1, #3657b4);
  color: #fff;
}

.success-btn {
  background: linear-gradient(135deg, #25e9ad, #18bf89);
  color: #04281a;
}

.danger-btn {
  background: linear-gradient(135deg, #ff6a8c, #ed3f67);
  color: #fff;
}

#otherTeamBtn {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff;
}

.ghost-btn {
  background: rgba(86, 109, 183, 0.15);
  color: #d4e2ff;
  border: 1px solid rgba(112, 140, 220, 0.6);
  align-self: flex-start;
}

.sound-toggle-btn {
  width: 100%;
}

.host-category-cta-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.primary-btn:hover,
.secondary-btn:hover,
.success-btn:hover,
.danger-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

#otherTeamBtn:hover {
  background: linear-gradient(135deg, #f57c00, #ef6c00);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}

.board-wrap {
  padding: 0.9rem;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.board {
  display: grid;
  grid-template-columns: repeat(var(--board-columns, 6), minmax(var(--board-col-width), 1fr));
  gap: clamp(0.42rem, 0.8vw, 0.6rem);
  grid-auto-rows: minmax(96px, auto);
  min-width: fit-content;
}

.board-cell {
  min-height: 96px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  border-radius: 12px;
  border: 1px solid rgba(113, 139, 220, 0.5);
  padding: 0.55rem;
}

.category {
  background: linear-gradient(150deg, rgba(54, 88, 170, 0.5), rgba(25, 42, 95, 0.5));
  color: #f0f5ff;
  font-size: clamp(0.9rem, 0.8vw + 0.72rem, 1.05rem);
  font-weight: 900;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile {
  background: linear-gradient(145deg, rgba(39, 60, 131, 0.5), rgba(13, 22, 57, 0.62));
  color: var(--accent);
  font-size: clamp(1.3rem, 1.2vw + 0.95rem, 1.6rem);
  font-weight: 900;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 16px rgba(5, 10, 28, 0.4);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease, opacity 0.22s ease;
  position: relative;
}

.tile:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.55), 0 0 18px rgba(255, 209, 102, 0.25),
    0 12px 20px rgba(5, 10, 28, 0.45);
}

.tile.tile-pulse {
  animation: tilePulse 360ms ease-out;
}

.tile.used,
.tile:disabled {
  background: linear-gradient(145deg, rgba(18, 27, 57, 0.82), rgba(12, 18, 37, 0.82));
  color: #8691b5;
  filter: saturate(0.15);
  opacity: 0.74;
}

.tile.used:not(.missing)::after {
  content: "✓";
  position: absolute;
  inset-inline-end: 8px;
  inset-block-end: 6px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #b9ffd9;
}

.tile.missing {
  color: #ffb7b7;
  font-size: 0.95rem;
}

.games-promo-popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 2.5vw, 1.2rem);
  z-index: 5200;
}

.games-promo-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 9, 24, 0.74);
  backdrop-filter: blur(8px);
}

.games-promo-popup__card {
  position: relative;
  width: min(680px, 100%);
  max-height: min(92vh, 860px);
  overflow-y: auto;
  border-radius: 22px;
  border: 1px solid rgba(244, 206, 108, 0.62);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 212, 103, 0.12), transparent 42%),
    linear-gradient(160deg, rgba(12, 24, 63, 0.98), rgba(7, 16, 44, 0.98));
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.48),
    0 0 30px rgba(247, 203, 89, 0.18);
  color: #f4f8ff;
  padding: clamp(1rem, 3.2vw, 1.5rem);
  display: grid;
  gap: clamp(0.65rem, 2vw, 0.95rem);
  text-align: center;
}

.games-promo-popup__close {
  position: absolute;
  top: 0.72rem;
  inset-inline-end: 0.72rem;
  inline-size: 2.2rem;
  block-size: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(244, 206, 108, 0.62);
  background: rgba(13, 26, 65, 0.82);
  color: #ffe29d;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.games-promo-popup__title {
  margin: 0;
  padding-inline: 2.2rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
  color: #ffdf86;
}

.games-promo-popup__subtitle {
  margin: 0;
  font-size: clamp(1rem, 2.7vw, 1.2rem);
  color: rgba(244, 238, 220, 0.95);
}

.games-promo-popup__media-wrap {
  margin: 0 auto;
  width: min(100%, 560px);
  border-radius: 16px;
  border: 1px solid rgba(244, 206, 108, 0.34);
  overflow: hidden;
  background: rgba(5, 12, 36, 0.62);
}

.games-promo-popup__media {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.games-promo-popup__body {
  margin: 0;
  line-height: 1.8;
  color: rgba(228, 236, 255, 0.92);
}

.games-promo-popup__cta {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.72rem 1.4rem;
  border-radius: 13px;
  border: 2px solid rgba(244, 206, 108, 0.9);
  color: #f6d989;
  background: rgba(10, 20, 52, 0.97);
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 540px) {
  .games-promo-popup__card {
    border-radius: 18px;
    padding: 0.95rem;
  }

  .games-promo-popup__title {
    padding-inline: 1.9rem;
  }
}

@media (min-width: 1024px) {
  .games-promo-popup {
    padding: clamp(1.2rem, 2.2vw, 1.6rem);
  }

  .games-promo-popup__card {
    width: min(760px, 92vw);
    max-height: min(88vh, 900px);
    padding: clamp(1.35rem, 2.1vw, 1.9rem);
    gap: clamp(0.8rem, 1.5vw, 1.1rem);
    border-radius: 24px;
  }

  .games-promo-popup__title {
    font-size: clamp(1.55rem, 2vw, 2.2rem);
  }

  .games-promo-popup__subtitle {
    font-size: clamp(1.08rem, 1.25vw, 1.3rem);
  }

  .games-promo-popup__media-wrap {
    width: min(100%, 620px);
    border-radius: 18px;
  }

  .games-promo-popup__body {
    font-size: 1.08rem;
  }

  .games-promo-popup__cta {
    min-height: 54px;
    padding: 0.84rem 1.75rem;
    font-size: 1.03rem;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 20, 0.66);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.24s ease;
  z-index: 4000;
  pointer-events: auto;
}

#installGuideModal {
  z-index: 4500;
  pointer-events: auto;
}

#groupModeModal {
  z-index: 4600;
}

#installGuideModal .modal-content {
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
}

.modal.is-closing {
  opacity: 0;
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-content {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  transform: scale(0.92) translateY(10px);
  opacity: 0;
}

.modal.is-open .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: modalIn 280ms ease-out forwards;
}

.modal.is-closing .modal-content {
  animation: modalOut 220ms ease-in forwards;
}

#questionText {
  margin: 0;
  line-height: 1.9;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.question-timer {
  align-self: flex-end;
  padding: 0.28rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(112, 140, 220, 0.58);
  background: rgba(20, 36, 79, 0.58);
  font-weight: 900;
  letter-spacing: 0.5px;
}

.question-timer.timer-red {
  color: var(--danger);
}


.late-other-team-prompt {
  align-self: flex-end;
  margin-top: -0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(214, 227, 255, 0.82);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.late-other-team-prompt:hover,
.late-other-team-prompt:focus-visible {
  color: #f3f7ff;
}

.late-other-team-prompt.is-disabled {
  opacity: 0.52;
  cursor: default;
  text-decoration-thickness: 1px;
}

.question-status {
  margin: 0;
  text-align: center;
  font-weight: 800;
  color: var(--danger);
}

.other-team-selector {
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(112, 140, 220, 0.45);
  background: rgba(12, 22, 52, 0.42);
}

.other-team-selector h3 {
  margin: 0 0 0.5rem;
  text-align: center;
  color: #f3f7ff;
  font-size: 1rem;
}

.other-team-options {
  justify-content: center;
}

.question-media {
  display: grid;
  gap: 0.6rem;
}

.question-video-wrapper {
  width: 100%;
  max-width: min(100%, 760px);
  margin-inline: auto;
}

.question-image-viewport {
  position: relative;
  width: 100%;
  max-width: min(100%, 760px);
  height: min(50vh, 420px);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 178, 255, 0.45);
  box-shadow: 0 14px 34px rgba(1, 7, 24, 0.5);
  background: rgba(3, 8, 24, 0.92);
  touch-action: none;
}

.question-image-viewport.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 8, 24, 0.84) 0%, rgba(19, 37, 84, 0.78) 50%, rgba(3, 8, 24, 0.84) 100%);
  animation: questionImageLoading 1.2s ease-in-out infinite;
  pointer-events: none;
}

#questionVideo {
  display: block;
  width: 100%;
  max-height: min(54vh, 430px);
  border-radius: 16px;
  border: 1px solid rgba(148, 178, 255, 0.45);
  background: rgba(3, 8, 24, 0.92);
  box-shadow: 0 14px 34px rgba(1, 7, 24, 0.5);
}

#questionImage {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes questionImageLoading {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

#questionImage.map-question-image {
  transform: none;
  contain: none;
}

#questionModal.image-question-active {
  overscroll-behavior: none;
}

#questionModal.image-question-active .modal-content {
  overscroll-behavior: contain;
}

html.image-question-active,
body.image-question-active {
  overscroll-behavior: none;
}

@media (max-width: 900px) {
  .question-media.map-question-media {
    display: block;
  }

  .question-media.map-question-media .question-image-viewport {
    border-radius: 8px;
    box-shadow: none;
    border-width: 1px;
    border-color: rgba(148, 178, 255, 0.22);
    contain: content;
  }

  .question-media.map-question-media #questionImage.map-question-image {
    border-radius: 8px;
    backface-visibility: hidden;
    will-change: auto;
    contain: none;
    transform: none;
  }
}

#questionAudio {
  width: 100%;
  max-width: min(100%, 760px);
  margin-inline: auto;
}

.answer {
  margin: 0;
  background: rgba(20, 36, 79, 0.72);
  border: 1px solid rgba(93, 128, 220, 0.62);
  border-radius: 12px;
  padding: 0.8rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.answer.reveal-anim {
  animation: answerSlideIn 320ms ease-out;
}

.double-answer-status {
  margin: -0.2rem 0 0;
  color: #cfe0ff;
  font-size: 0.9rem;
  font-weight: 700;
}

.choices-box {
  background: rgba(20, 36, 79, 0.72);
  border: 1px solid rgba(93, 128, 220, 0.62);
  border-radius: 12px;
  padding: 0.75rem;
}

.choices-box h3 {
  margin: 0 0 0.55rem;
}

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

.choice-item {
  background: rgba(35, 58, 123, 0.75);
  border: 1px solid rgba(96, 134, 234, 0.8);
  border-radius: 8px;
  padding: 0.55rem;
}


.hint-box {
  background: rgba(20, 36, 79, 0.72);
  border: 1px solid rgba(93, 128, 220, 0.62);
  border-radius: 12px;
  padding: 0.75rem;
}

.hint-box h3 {
  margin: 0 0 0.55rem;
}

.hint-text {
  margin: 0;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.category-modal-content {
  width: min(640px, 100%);
  min-height: 0;
}

.category-team-inputs {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
}

.category-counter {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.team-shuffle-setup-helper {
  display: grid;
  gap: 0.35rem;
  margin: 0.15rem 0 0.45rem;
}

.team-shuffle-setup-btn {
  justify-self: start;
}

.team-shuffle-setup-status {
  margin: 0;
  color: #c6d7ff;
  font-size: 0.9rem;
}

.category-host-note {
  margin: 0.35rem 0 0;
  color: #ffd67d;
  font-size: 0.92rem;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 0.92rem;
  max-height: 50vh;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.1rem 0.1rem 0.15rem;
}

.category-group-section {
  display: grid;
  gap: 0.58rem;
  padding: 0.46rem 0.5rem 0.52rem;
  border-radius: 14px;
  border: 1px solid rgba(110, 140, 220, 0.2);
  background: linear-gradient(160deg, rgba(13, 21, 52, 0.78), rgba(10, 17, 42, 0.58));
  box-shadow: inset 0 1px 0 rgba(170, 191, 244, 0.08), inset 0 0 0 999px color-mix(in srgb, var(--category-group-accent) 4%, transparent);
}

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

.category-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.18rem 0 0.08rem;
  padding-inline: 0.12rem;
  font-size: 0.98rem;
  font-weight: 850;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: rgba(183, 199, 238, 0.92);
}

.category-group-title:first-child {
  margin-top: 0.08rem;
}

.category-group-icon {
  width: 0.92rem;
  height: 0.92rem;
  color: rgba(166, 186, 236, 0.78);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.category-group-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-group-title-text {
  display: inline-block;
}

.category-option {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  background: rgba(15, 28, 66, 0.9);
  border: 1px solid rgba(94, 130, 220, 0.38);
  border-radius: 12px;
  padding: 0.5rem;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  min-height: 80px;
}

.category-option:hover {
  background: rgba(19, 34, 76, 0.92);
  box-shadow: inset 0 0 0 1px rgba(132, 160, 234, 0.18), 0 6px 16px rgba(4, 8, 22, 0.34);
  transform: translateY(-1px);
}

.category-option:focus-within {
  box-shadow: inset 0 0 0 1px rgba(141, 170, 244, 0.24), 0 0 0 2px rgba(111, 146, 233, 0.2);
}

.category-option.is-selected {
  background: rgba(25, 43, 93, 0.97);
  border-color: rgba(226, 189, 104, 0.88);
  box-shadow: inset 0 0 0 1px rgba(236, 205, 136, 0.34), 0 12px 22px rgba(6, 12, 30, 0.5), 0 0 0 1px rgba(236, 205, 136, 0.2);
}

.category-option.is-locked {
  opacity: 0.58;
}

.category-option input {
  accent-color: var(--accent);
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-option-media {
  width: 34px;
  min-width: 34px;
  border-radius: 9px;
  background: var(--category-card-gradient, linear-gradient(145deg, rgba(44, 74, 134, 0.92), rgba(18, 44, 102, 0.97)));
  border: 1px solid rgba(126, 160, 237, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: center;
  min-height: 34px;
}

.category-option-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-option-fallback-icon {
  width: 16px;
  height: 16px;
  color: rgba(230, 238, 255, 0.92);
}

.category-option-fallback-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-option-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.34rem;
}

.category-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-option-label {
  display: block;
  line-height: 1.34;
  font-size: 0.94rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
}

.category-option-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(134, 162, 228, 0.32);
  color: rgba(194, 210, 245, 0.72);
  background: rgba(14, 25, 59, 0.52);
  flex: 0 0 auto;
  padding: 0;
  cursor: pointer;
  transition: border-color 130ms ease, color 130ms ease, background-color 130ms ease, opacity 130ms ease;
  opacity: 0.9;
}

.category-option-help-btn:hover,
.category-option-help-btn:focus-visible,
.category-option.is-help-open .category-option-help-btn {
  border-color: rgba(180, 203, 255, 0.54);
  color: rgba(228, 236, 255, 0.88);
  background: rgba(19, 34, 78, 0.76);
  opacity: 1;
  outline: none;
}

.category-option-help-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-help-floating-popover {
  position: fixed;
  z-index: 4700;
  width: min(290px, calc(100vw - 20px));
  border-radius: 11px;
  border: 1px solid rgba(131, 158, 223, 0.34);
  background: rgba(8, 16, 41, 0.98);
  box-shadow: 0 14px 34px rgba(2, 7, 19, 0.58);
  padding: 0.52rem 0.62rem;
  color: rgba(222, 232, 255, 0.94);
  line-height: 1.5;
  font-size: 0.77rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.category-help-floating-popover.is-open {
  opacity: 1;
  transform: translateY(0);
}

.category-help-floating-title {
  display: block;
  color: rgba(242, 247, 255, 0.96);
  font-size: 0.79rem;
  margin-bottom: 0.12rem;
}

.category-help-floating-text {
  margin: 0;
}

.category-help-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4800;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.72rem;
  background: rgba(4, 8, 20, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.category-help-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.category-help-sheet {
  width: min(100%, 420px);
  border-radius: 14px;
  border: 1px solid rgba(133, 161, 226, 0.34);
  background: linear-gradient(180deg, rgba(13, 24, 58, 0.98), rgba(8, 15, 38, 0.99));
  box-shadow: 0 18px 36px rgba(2, 6, 18, 0.6);
  padding: 0.72rem 0.76rem 0.8rem;
  transform: translateY(12px);
  transition: transform 160ms ease;
}

.category-help-sheet-backdrop.is-open .category-help-sheet {
  transform: translateY(0);
}

.category-help-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-help-sheet-title {
  margin: 0;
  font-size: 0.94rem;
  color: rgba(239, 246, 255, 0.96);
}

.category-help-sheet-close-btn {
  border: 1px solid rgba(136, 163, 227, 0.42);
  background: rgba(18, 31, 74, 0.72);
  color: rgba(219, 231, 255, 0.93);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
}

.category-help-sheet-text {
  margin: 0.45rem 0 0;
  color: rgba(218, 230, 255, 0.91);
  font-size: 0.82rem;
  line-height: 1.52;
}

.category-modal-content .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(8, 14, 35, 0.96), rgba(8, 14, 35, 0.78) 72%, transparent);
  padding-top: 0.42rem;
  margin-top: 0.2rem;
}

.category-modal-content .modal-actions > button {
  flex: 1 1 120px;
}

.category-modal-content .category-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
}

.category-modal-content .category-action-row > button {
  min-height: 46px;
}

.category-modal-content .category-start-btn {
  font-size: clamp(1rem, 0.34vw + 0.9rem, 1.08rem);
  box-shadow: 0 12px 30px rgba(18, 155, 111, 0.42);
  letter-spacing: 0.01em;
}

.category-modal-content .category-random-btn {
  background: linear-gradient(135deg, rgba(69, 99, 182, 0.66), rgba(45, 73, 152, 0.66));
  border: 1px solid rgba(127, 157, 238, 0.56);
  color: rgba(233, 241, 255, 0.95);
  box-shadow: none;
}

.category-modal-content .category-cancel-btn {
  background: transparent;
  border: 1px solid rgba(108, 132, 206, 0.4);
  color: rgba(188, 204, 240, 0.84);
  box-shadow: none;
  min-width: 88px;
}

@media (min-width: 860px) {
  .category-modal-content {
    width: min(980px, 100%);
  }

  .category-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.72rem;
  }

  .category-option {
    min-height: 92px;
    padding: 0.62rem 0.64rem;
  }

  .category-option-body {
    gap: 0.2rem;
  }

  .category-option-label {
    font-size: 1rem;
  }

  .category-help-sheet-backdrop {
    display: none;
  }
}

@media (min-width: 1180px) {
  .category-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#categoryModal.is-readonly .category-option,
#categoryModal.is-readonly .team-name-input[readonly],
#categoryModal.is-readonly .modal-actions > button[aria-disabled="true"] {
  cursor: not-allowed;
}

#categoryModal.is-readonly .team-name-input[readonly],
#categoryModal.is-readonly .modal-actions > button[aria-disabled="true"] {
  opacity: 0.7;
}


.team-name-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.team-name-input {
  width: 100%;
  border: 1px solid rgba(112, 140, 220, 0.6);
  background: rgba(12, 20, 48, 0.62);
  color: var(--text);
  border-radius: 9px;
  padding: 0.45rem 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.team-name-input:focus {
  outline: none;
  border-color: rgba(255, 209, 102, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2);
}

.score-adjustments {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.adjust-btn {
  flex: 1;
  font-size: 0.84rem;
  padding: 0.52rem 0.5rem;
  min-height: 44px;
}

@media (min-width: 1200px) {
  #gameScreen .game-utility-bar {
    max-width: min(1440px, calc(100vw - 40px));
    padding-inline: clamp(0.55rem, 0.9vw, 0.85rem);
  }

  #gameScreen .app {
    max-width: min(1440px, calc(100vw - 40px));
    grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
    gap: clamp(0.65rem, 0.9vw, 1rem);
    padding: clamp(0.55rem, 0.9vw, 0.85rem);
  }

  #gameScreen .board-wrap {
    padding: clamp(0.55rem, 0.85vw, 0.8rem);
  }

  #gameScreen .board {
    --board-col-width: clamp(130px, 7.7vw, 190px);
    gap: clamp(0.5rem, 0.7vw, 0.68rem);
    grid-auto-rows: minmax(112px, auto);
  }

  #gameScreen .board-cell {
    min-height: 112px;
    padding: 0.62rem 0.58rem;
  }

  #gameScreen .category {
    font-size: clamp(1rem, 0.48vw + 0.88rem, 1.18rem);
    line-height: 1.42;
  }

  #gameScreen .tile {
    font-size: clamp(1.5rem, 0.7vw + 1.18rem, 1.95rem);
  }

  #gameScreen .team-name-label {
    font-size: 0.9rem;
  }

  #gameScreen .team-name-input {
    font-size: 1rem;
  }

  #gameScreen .score {
    font-size: clamp(1.72rem, 1.1vw + 1.25rem, 2.35rem);
  }

  #gameScreen .status-card p {
    font-size: clamp(0.96rem, 0.42vw + 0.84rem, 1.1rem);
  }

  #gameScreen #currentTurn {
    font-size: clamp(1.06rem, 0.42vw + 0.9rem, 1.26rem);
    font-weight: 800;
  }

  #gameScreen .primary-btn,
  #gameScreen .secondary-btn,
  #gameScreen .success-btn,
  #gameScreen .danger-btn,
  #gameScreen .ghost-btn {
    font-size: clamp(0.98rem, 0.3vw + 0.86rem, 1.08rem);
    min-height: 48px;
    padding: 0.76rem 1rem;
  }

  #gameScreen .adjust-btn {
    min-height: 46px;
    font-size: 0.92rem;
  }
}

.click-pop {
  animation: clickPop 240ms ease-out;
}

.podium-content {
  width: min(760px, 100%);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.podium-subtitle {
  margin: 0;
  color: var(--muted);
}

.podium-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.result-share-section {
  margin-top: 0.85rem;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(15, 27, 61, 0.8);
  text-align: right;
}

.result-share-summary {
  border-radius: 11px;
  border: 1px solid rgba(140, 170, 255, 0.28);
  background: rgba(11, 19, 45, 0.74);
  padding: 0.65rem;
  margin-bottom: 0.72rem;
  display: grid;
  gap: 0.2rem;
}

.result-share-summary-title,
.result-share-summary-score,
.result-share-summary-line {
  margin: 0;
}

.result-share-summary-title {
  font-weight: 900;
  color: #ffe7a6;
}

.result-share-summary-score {
  font-weight: 800;
}

.result-share-summary-line {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.result-share-actions > button {
  min-height: 46px;
}

.result-share-feedback {
  margin: 0.6rem 0 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.result-share-feedback.is-success {
  color: #86efac;
}

.result-share-feedback.is-error {
  color: #fda4af;
}

.podium-column {
  background: rgba(20, 36, 79, 0.72);
  border: 1px solid rgba(93, 128, 220, 0.62);
  border-radius: 14px;
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.podium-label {
  margin: 0;
  font-weight: 900;
}

.podium-team-name,
.podium-score {
  margin: 0;
  font-weight: 800;
}

.podium-score {
  color: #fdf4cf;
}

.podium-step {
  border-radius: 10px;
  margin-top: 0.4rem;
}

.podium-column.winner .podium-step {
  height: 130px;
  background: linear-gradient(180deg, #ffd166, #d29a1e);
}

.podium-column.loser .podium-step {
  height: 88px;
  background: linear-gradient(180deg, #8fa8ff, #5f79d8);
}

.podium-column.tie .podium-step {
  height: 108px;
  background: linear-gradient(180deg, #7cc9ff, #5f79d8);
}

@keyframes clickPop {
  0% { transform: scale(1); }
  50% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes particlesFloat {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(2.4%, -3.4%, 0);
  }
}

@keyframes tilePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes modalIn {
  from {
    transform: scale(0.92) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes modalOut {
  from {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  to {
    transform: scale(0.95) translateY(8px);
    opacity: 0;
  }
}

@keyframes answerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scorePop {
  0% {
    transform: scale(0.85);
  }
  60% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes borderPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes sheenSweep {
  from {
    transform: rotate(20deg) translateX(-45%);
  }
  to {
    transform: rotate(20deg) translateX(75%);
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  main {
    min-width: 0;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    align-items: start;
  }

  .sidebar h1,
  .error-banner,
  .status-card,
  .sound-toggle-btn,
  #newGameBtn {
    grid-column: 1 / -1;
  }

  .team-card {
    padding: 0.68rem;
  }

  .score {
    margin-top: 0.25rem;
  }

  .status-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
  }

  .status-card p {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
  }

  .board-wrap {
    padding: 0.7rem;
  }

  .board {
    --board-col-width: clamp(130px, 31vw, 160px);
    grid-auto-rows: minmax(78px, auto);
  }

  .board-cell {
    min-height: 78px;
    padding: 0.45rem;
  }

  .category {
    line-height: 1.25;
  }

  .modal-content {
    padding: 0.9rem;
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(12, 18, 44, 0.95), rgba(12, 18, 44, 0.78));
    padding-top: 0.4rem;
  }

  .contact-modal-content .contact-message-input,
  .contact-modal-content .contact-feedback {
    position: relative;
    z-index: 1;
  }

  .contact-modal-content .contact-modal-actions {
    z-index: 5;
    isolation: isolate;
  }
}

@media (max-width: 768px) {
  .app {
    padding: 0.55rem;
    gap: 0.7rem;
  }

  .sidebar {
    gap: 0.5rem;
  }

  .team-name-input {
    min-height: 40px;
  }

  .modal {
    padding: 0.55rem;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #categoryModal {
    padding-top: max(0.55rem, env(safe-area-inset-top));
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
    align-items: stretch;
  }

  #categoryModal .category-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - max(1.1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    height: calc(100svh - max(1.1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    max-height: calc(100dvh - max(1.1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    max-height: calc(100svh - max(1.1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    overflow: hidden;
    gap: 0.6rem;
    min-height: 0;
  }

  #categoryModalTitle {
    margin-bottom: 0;
    font-size: clamp(1.05rem, 5vw, 1.2rem);
  }

  #categoryModal .category-team-inputs {
    gap: 0.12rem;
    margin-bottom: 0.2rem;
    flex-shrink: 0;
  }

  #categoryModal .team-name-label {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
  }

  #categoryModal .team-name-input {
    min-height: 36px;
    margin-bottom: 0.2rem;
    padding-top: 0.34rem;
    padding-bottom: 0.34rem;
  }

  #categoryModal .category-counter {
    font-size: 0.88rem;
    flex-shrink: 0;
  }

  #categoryModal .category-group-title {
    margin-top: 0.72rem;
    margin-bottom: 0.1rem;
    font-size: 0.94rem;
    gap: 0.34rem;
  }

  #categoryModal .category-group-title:first-child {
    margin-top: 0.1rem;
  }

  #categoryModal .category-group-icon {
    width: 0.84rem;
    height: 0.84rem;
  }

  #categoryModal .category-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-bottom: 0.5rem;
    gap: 0.7rem;
  }

  #categoryModal .category-group-section {
    padding: 0.42rem 0.4rem 0.44rem;
    gap: 0.5rem;
  }

  #categoryModal .category-group-grid {
    gap: 0.46rem;
  }

  #categoryModal .category-option {
    min-height: 74px;
    padding: 0.42rem;
    gap: 0.44rem;
  }

  #categoryModal .category-option-media {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  #categoryModal .category-option-fallback-icon {
    width: 14px;
    height: 14px;
  }

  #categoryModal .category-option-label {
    font-size: 0.89rem;
  }

  #categoryModal .modal-actions {
    position: sticky;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.3rem;
    flex-shrink: 0;
    margin-top: auto;
    bottom: calc(-0.1rem + env(safe-area-inset-bottom));
    padding-bottom: calc(0.12rem + env(safe-area-inset-bottom));
  }

  #categoryModal .category-action-row {
    grid-template-columns: 1fr;
    gap: 0.38rem;
  }

  #categoryModal .category-action-row > button {
    width: 100%;
  }

  #categoryModal .modal-actions > button {
    min-height: 38px;
    padding-top: 0.44rem;
    padding-bottom: 0.44rem;
    font-size: 0.9rem;
  }

  .install-guide-content {
    width: min(100%, 560px);
    max-height: calc(100vh - 1.1rem);
    margin-top: 0.25rem;
  }

  #installGuideModal {
    align-items: flex-start;
    padding-top: max(0.55rem, env(safe-area-inset-top));
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom));
  }

  #installGuideModal .install-guide-content {
    width: min(100%, 560px);
    max-height: calc(100vh - max(1.1rem, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    margin-inline: auto;
    margin-top: 0;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions > button {
    width: 100%;
  }

  .choices-list,
  .podium-board {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  body {
    background-size: cover;
  }
}


.local-teams-modal-content {
  width: min(420px, 100%);
}

.team-shuffle-modal-content {
  width: min(560px, 100%);
}

.team-shuffle-intro {
  margin: 0 0 0.55rem;
  color: var(--muted);
  line-height: 1.7;
}

.team-shuffle-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(124, 152, 228, 0.5);
  background: rgba(10, 19, 46, 0.86);
  color: var(--text);
  padding: 0.64rem 0.72rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 122px;
}

.team-shuffle-result {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.team-shuffle-team {
  border: 1px solid rgba(255, 215, 120, 0.24);
  border-radius: 12px;
  background: rgba(14, 25, 60, 0.76);
  padding: 0.58rem 0.62rem;
}

.team-shuffle-team h3 {
  margin: 0 0 0.24rem;
  font-size: 0.97rem;
  color: rgba(255, 225, 142, 0.95);
}

.team-shuffle-team p {
  margin: 0;
  color: rgba(226, 236, 255, 0.9);
  line-height: 1.65;
}

.local-team-count-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

body.local-three-teams .category-team-inputs {
  gap: 0.15rem;
}

/* Standalone trust/info pages */
.info-page-shell {
  justify-content: flex-start;
  gap: clamp(0.75rem, 2vw, 1.1rem);
  padding-top: clamp(1rem, 3vw, 1.8rem);
}

.info-page-content {
  width: min(94vw, 1040px);
  margin-top: 0;
}

.info-page-header,
.info-page-card {
  max-inline-size: min(100%, 820px);
  margin-inline: auto;
}

.info-page-header h1 {
  margin: 0.2rem 0 0.65rem;
  color: #ffe6a8;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.35;
}

.info-page-card {
  display: grid;
  gap: 0.72rem;
}

.info-page-card .section-body-text {
  font-size: clamp(0.96rem, 0.45vw + 0.9rem, 1.08rem);
}

.info-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.34rem 0.74rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 120, 0.44);
  color: rgba(255, 230, 161, 0.95);
  background: rgba(14, 23, 55, 0.56);
  text-decoration: none;
  font-size: 0.87rem;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.info-home-link:hover,
.info-home-link:focus-visible {
  color: #fff0c2;
  border-color: rgba(255, 215, 120, 0.78);
  background: rgba(22, 35, 80, 0.78);
}

.info-list {
  margin: 0;
  padding-inline-start: 1.2rem;
  color: rgba(224, 234, 255, 0.93);
  display: grid;
  gap: 0.3rem;
  line-height: 1.72;
}

.info-list li::marker {
  color: rgba(255, 215, 120, 0.88);
}

.contact-page-card {
  gap: 1rem;
}

.contact-layout-columns {
  display: grid;
  gap: clamp(0.9rem, 1.4vw, 1.15rem);
}

.contact-layout-column {
  display: grid;
  align-content: start;
  gap: 0.72rem;
}

@media (min-width: 1200px) {
  .info-page-shell {
    padding-top: clamp(1.2rem, 2.6vw, 2rem);
    gap: clamp(0.95rem, 1.8vw, 1.3rem);
  }

  .info-page-content {
    width: min(93vw, 1320px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.9rem, 1.4vw, 1.22rem);
    align-items: start;
  }

  .info-page-content > .info-page-header {
    grid-column: 1 / -1;
    max-inline-size: min(100%, 1080px);
  }

  .info-page-content > .info-page-card {
    max-inline-size: 100%;
    height: 100%;
  }

  .info-page-content .section-body-text,
  .info-page-content .section-body-note,
  .info-page-content .info-list {
    max-inline-size: 64ch;
  }

  .info-page-content .card-grid.mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-page-content.contact-page-content {
    grid-template-columns: minmax(0, 1fr);
    width: min(93vw, 1240px);
  }

  .info-page-content.contact-page-content > .info-page-header,
  .info-page-content.contact-page-content > .contact-page-card {
    max-inline-size: min(100%, 1120px);
  }

  .info-page-content.contact-page-content .contact-layout-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 700px) {
  .info-page-shell {
    padding-top: clamp(0.7rem, 3vw, 1rem);
  }

  .info-page-header h1 {
    font-size: clamp(1.28rem, 5.6vw, 1.7rem);
  }

  .info-home-link {
    font-size: 0.82rem;
    padding: 0.32rem 0.62rem;
  }
}
