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

:root {
  --bg-dark: #0b1020;
  --bg-navy: #131a33;
  --accent: #ff6a3d;
  --accent-2: #2fd3c9;
  --text: #eef1f8;
  --text-dim: #9aa4c2;
  --panel: #171f3d;
  --panel-border: #2a355e;
  --green: #35d07f;
  --red: #ff5c5c;
  --gold: #ffc93c;
}

html, body {
  height: 100%;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Germania One', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.screen.active { display: flex; opacity: 1; }
.screen.overlay { background: rgba(5,8,20,0.78); z-index: 50; backdrop-filter: blur(4px); }

/* =========================================================
   PREMIUM LOADING SCREEN
========================================================= */

#screen-loading {
  position: absolute;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(60, 105, 220, 0.2), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(0, 190, 255, 0.08), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 92, 48, 0.09), transparent 25%),
    linear-gradient(145deg, #060a17 0%, #0c142b 48%, #070b18 100%);
}

#screen-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 75%);
}

#screen-loading::after {
  content: "";
  position: absolute;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(110, 150, 240, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 80px rgba(110, 150, 240, 0.02),
    0 0 0 160px rgba(110, 150, 240, 0.015),
    0 0 110px rgba(40, 90, 190, 0.13);
}

.premium-loader {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  animation: loaderFadeIn 0.6s ease;
}

@keyframes loaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.loader-stage {
  position: relative;
  width: 145px;
  height: 145px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.loader-rings {
  position: absolute;
  inset: 0;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
}

.ring-one {
  inset: 0;
  border-width: 1px;
  border-color:
    rgba(255,255,255,0.05)
    rgba(255, 106, 61, 0.7)
    rgba(255,255,255,0.05)
    rgba(47, 211, 201, 0.45);
  animation: ringRotate 2.4s linear infinite;
}

.ring-two {
  inset: 15px;
  border-width: 2px;
  border-color:
    transparent
    rgba(255, 215, 70, 0.7)
    transparent
    rgba(110, 150, 255, 0.5);
  animation: ringRotateReverse 1.8s linear infinite;
}

.ring-three {
  inset: 31px;
  border-width: 1px;
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    inset 0 0 22px rgba(255,255,255,0.03),
    0 0 28px rgba(55, 105, 220, 0.15);
}

@keyframes ringRotate {
  to {
    transform: rotate(360deg);
  }
}

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

.loader-ball {
  position: relative;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff7a3 0%, #ffd43b 30%, #f3a800 72%, #cb7600 100%);
  box-shadow:
    0 0 18px rgba(255, 214, 65, 0.65),
    0 0 45px rgba(255, 164, 32, 0.32);
  animation: premiumBallBounce 1.15s cubic-bezier(.45,.05,.55,.95) infinite;
}

.loader-ball::before,
.loader-ball::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(134, 77, 0, 0.35);
}

.loader-ball::before {
  width: 21px;
  height: 32px;
  left: 8px;
  top: 3px;
  transform: rotate(38deg);
  border-left-color: transparent;
  border-bottom-color: transparent;
}

.loader-ball::after {
  width: 31px;
  height: 18px;
  left: 3px;
  top: 10px;
  transform: rotate(-28deg);
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.loader-trail {
  position: absolute;
  width: 50px;
  height: 12px;
  left: 49px;
  top: 67px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 198, 55, 0.28),
    transparent 72%
  );
  filter: blur(4px);
  animation: trailPulse 1.15s ease-in-out infinite;
}

@keyframes premiumBallBounce {
  0%,
  100% {
    transform: translateY(17px) scaleX(1.08) scaleY(0.92) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) scaleX(0.96) scaleY(1.04) rotate(180deg);
  }
}

@keyframes trailPulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scaleX(1.2);
  }

  50% {
    opacity: 0.12;
    transform: scaleX(0.65);
  }
}

.loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.loader-brand span {
  color: #8296c4;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 6px;
}

.loader-brand strong {
  margin-top: 6px;
  color: #ff7048;
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255, 104, 61, 0.22);
}

.loader-progress {
  width: min(100%, 270px);
  height: 7px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(113, 143, 209, 0.18);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
}

.loader-progress-bar {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #2fd3c9,
    #6a8cff,
    #ff7048,
    #ffd84a
  );
  background-size: 220% 100%;
  box-shadow: 0 0 14px rgba(73, 140, 255, 0.45);
  animation:
    loaderProgressMove 1.5s ease-in-out infinite,
    loaderGradientMove 1.8s linear infinite;
}

@keyframes loaderProgressMove {
  0% {
    width: 14%;
    transform: translateX(-110%);
  }

  50% {
    width: 46%;
  }

  100% {
    width: 14%;
    transform: translateX(750%);
  }
}

@keyframes loaderGradientMove {
  to {
    background-position: 220% 0;
  }
}

.loader-text {
  color: #9aabd1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  animation: loadingTextPulse 1.4s ease-in-out infinite;
}

@keyframes loadingTextPulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .premium-loader {
    padding: 22px 18px;
  }

  .loader-stage {
    width: 125px;
    height: 125px;
    margin-bottom: 20px;
  }

  .ring-two {
    inset: 13px;
  }

  .ring-three {
    inset: 27px;
  }

  .loader-brand strong {
    font-size: 1.2rem;
  }

  .loader-progress {
    width: min(100%, 235px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring-one,
  .ring-two,
  .loader-ball,
  .loader-trail,
  .loader-progress-bar,
  .loader-text {
    animation-duration: 3s;
  }
}

/* ---------- MENU ---------- */
#screen-menu { text-align: center; }
.menu-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, #1c274d 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, #0d3a2e 0%, transparent 55%),
    linear-gradient(180deg, #0b1020 0%, #0a0e1c 100%);
  z-index: -1;
}
.menu-content { max-width: 480px; animation: fadeUp 0.6s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.title span {
  display: block;
  font-size: 1.7rem;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}
.subtitle { color: var(--text-dim); margin-bottom: 32px; font-size: 1.05rem; }

.btn {
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 14px 32px;
  cursor: pointer;
  margin: 6px;
  transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8a5c);
  color: #14090a;
  box-shadow: 0 6px 24px rgba(255, 106, 61, 0.35);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 8px 28px rgba(255, 106, 61, 0.45); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--panel-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.btn-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.tour-progress-summary {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- PANEL ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  animation: fadeUp 0.4s ease;
}
.panel h2 { font-size: 1.7rem; margin-bottom: 20px; }
.how-list { text-align: left; list-style: none; margin-bottom: 24px; }
.how-list li {
  padding: 10px 0 10px 30px;
  position: relative;
  color: var(--text-dim);
  line-height: 1.45;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.how-list li::before {
  content: "🏓";
  position: absolute; left: 0; top: 9px;
  font-size: 0.9rem;
}
.how-list strong { color: var(--text); }

/* ---------- SETTINGS ---------- */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--text-dim);
  font-size: 0.92rem;
}
.setting-row input[type="range"] {
  width: 140px;
  accent-color: var(--accent);
}
.toggle {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span {
  position: absolute; inset: 0;
  background: var(--panel-border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle span::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::before { transform: translateX(20px); }

/* ---------- COUNTRY SELECT ---------- */
#screen-countries { justify-content: flex-start; padding-top: 20px; }
.topbar {
  width: 100%; max-width: 840px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.topbar h2 { font-size: 1.3rem; }
.country-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
    gap:16px;

    width:100%;
    max-width:840px;

    height:calc(100vh - 140px);
    max-height:700px;

    overflow-y:auto;
    overflow-x:hidden;

    padding-right:4px;
    padding-bottom:20px;

    scrollbar-width:none;
    -ms-overflow-style:none;
}

.country-grid::-webkit-scrollbar{
    display:none;
}
.country-card {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 18px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.2s ease;
  position: relative;
}
.country-card:active { transform: scale(0.96); }
.country-card.unlocked { border-color: var(--accent-2); }
.country-card.unlocked:hover { box-shadow: 0 8px 24px rgba(47, 211, 201, 0.12); }
.country-card.completed { border-color: var(--gold); }
.country-card.completed:hover { box-shadow: 0 8px 24px rgba(255, 201, 60, 0.12); }
.country-card.locked { opacity: 0.35; cursor: not-allowed; }
.country-flag { font-size: 2.4rem; margin-bottom: 8px; }
.country-name { font-weight: 700; font-size: 0.95rem; }
.country-stars { font-size: 0.75rem; color: var(--gold); margin-top: 3px; letter-spacing: 1px; }
.country-status { font-size: 0.72rem; color: var(--text-dim); margin-top: 4px; }
.country-card.completed .country-status { color: var(--gold); }
.country-progress-dots { display: flex; gap: 3px; justify-content: center; margin-top: 10px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--panel-border); }
.dot.done { background: var(--green); }

/* ---------- MATCH INTRO ---------- */
.intro-panel { max-width: 440px; }
.intro-country { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 1.5px; }
.vs-row { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 18px; }
.vs-card { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(135deg, #1e2a52, #101832);
  border: 2px solid var(--panel-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.opp-avatar { border-color: var(--accent); }
.vs-versus { font-weight: 800; color: var(--text-dim); font-size: 1.1rem; }
.vs-name { font-weight: 700; font-size: 0.95rem; }
.stars-row { margin-bottom: 10px; font-size: 1.3rem; }
.star { color: rgba(255,255,255,0.15); }
.star.filled { color: var(--gold); text-shadow: 0 0 8px rgba(255,201,60,0.3); }
.match-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 6px; }
.opp-style { font-size: 0.82rem; margin-bottom: 22px; color: var(--text-dim); }

/* ---------- GAME ---------- */
#screen-game { padding: 0; }
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060911;
}
#game-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  touch-action: none;
  display: block;
  border-radius: 0;
}
#hud {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  font-family: inherit;
  width: 100%;
  max-width: 580px;
  padding: 0 14px;
}
.scoreboard {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(180deg, rgba(18,24,46,0.92), rgba(10,14,28,0.88));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  width: 100%;
}
.sb-player {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px;
}
.sb-player-right { flex-direction: row-reverse; text-align: right; }
.sb-flag { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.sb-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-scores {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.sb-score {
  font-size: 1.6rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
  transition: transform 0.15s ease, color 0.15s ease;
}
.sb-score.pop { transform: scale(1.4); color: var(--gold); }
.sb-dash { color: var(--text-dim); font-weight: 700; }
.hud-mid {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  text-align: center;
  min-height: 26px;
}
.hud-rally {
  margin-top: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 1px;
}
#shot-feedback {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.4s ease;
  z-index: 10;
  letter-spacing: 2px;
}
#shot-feedback.show {
  opacity: 1;
  transform: translate(-50%, -60%);
}
.pause-btn {
  position: absolute;
  bottom: 18px;
  right: 18px;
  pointer-events: all;
}

/* ---------- RESULT ---------- */
.result-panel { max-width: 440px; }
.result-score {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.result-stats {
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  text-align: left;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { color: var(--text); font-weight: 700; }
#result-sub { color: var(--text-dim); margin-bottom: 24px; font-size: 0.95rem; }
#result-title.win { color: var(--green); }
#result-title.lose { color: var(--red); }

/* ---------- CHAMPION ---------- */
.champion-panel .trophy { font-size: 4.2rem; margin-bottom: 12px; animation: trophyBounce 1.5s ease-in-out infinite; }
@keyframes trophyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.champion-panel h2 { color: var(--gold); font-size: 1.9rem; }
.champion-panel p { color: var(--text-dim); margin-bottom: 22px; font-size: 0.95rem; }
.champion-stats {
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 320px;
}

@media (max-width: 520px) {
  .title { font-size: 2.2rem; }
  .title span { font-size: 1.35rem; }
  .panel { padding: 28px 20px; }
  .country-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .avatar { width: 64px; height: 64px; font-size: 1.8rem; }
  .vs-row { gap: 14px; }
  #shot-feedback { font-size: 1.6rem; }
}

/* Game HUD polish */
#screen-game #hud { top: 10px; max-width: 460px; padding: 0 10px; }
#screen-game .scoreboard { min-height: 54px; padding: 6px; border-radius: 14px; background: rgba(11,16,32,.82); }
#screen-game .sb-player { padding: 0 8px; gap: 6px; }
#screen-game .sb-flag { font-size: 1.1rem; }
#screen-game .sb-name { font-size: .75rem; }
#screen-game .sb-scores { padding: 4px 14px; gap: 6px; }
#screen-game .sb-score { font-size: 1.35rem; }
#screen-game .hud-mid { margin-top: 5px; font-size: .88rem; min-height: 20px; }
#screen-game .pause-btn { width: 40px; height: 40px; right: 12px; bottom: 12px; background: rgba(17,24,46,.85); }
@media (max-width: 480px) {
  #screen-game #hud { max-width: 96%; top: 6px; }
  #screen-game .scoreboard { min-height: 48px; }
  #screen-game .sb-name { font-size: .68rem; }
  #screen-game .sb-score { font-size: 1.15rem; }
}
/* =========================================================
   HOME SCREEN REPAIR + RESPONSIVE FIX
   Keep this as the LAST CSS in style.css
========================================================= */

#screen-menu {
  position: absolute;
  inset: 0;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px 16px;
  text-align: center;
  background: #080d1e;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#screen-menu.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-menu::-webkit-scrollbar {
  display: none;
}

/* Background */
#screen-menu .menu-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 91, 48, 0.2), transparent 30%),
    radial-gradient(circle at 15% 85%, rgba(30, 117, 255, 0.18), transparent 32%),
    radial-gradient(circle at 50% 35%, rgba(74, 100, 205, 0.18), transparent 40%),
    linear-gradient(145deg, #070b18, #0d1530 52%, #070b18);
}

#screen-menu .menu-grid {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 52px 52px;
}

/* Main content */
#screen-menu .premium-home {
  position: relative;
  z-index: 2;
  width: min(100%, 560px);
  margin: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Badge */
#screen-menu .home-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 112, 72, 0.32);
  border-radius: 999px;
  color: #ff9d7d;
  background: rgba(255, 100, 58, 0.09);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

#screen-menu .home-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6940;
  box-shadow: 0 0 10px #ff6940;
}

/* Logo */
#screen-menu .home-logo {
  width: 100%;
  margin: 0 0 12px;
}

#screen-menu .logo-top {
  margin-bottom: 7px;
  color: #8fa1cd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 7px;
}

#screen-menu .home-logo h1 {
  margin: 0;
  color: #f4f6ff;
  font-size: clamp(2.6rem, 8vw, 4.8rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -2px;
  text-shadow:
    0 8px 28px rgba(0,0,0,.5),
    0 0 40px rgba(77, 116, 220, .15);
}

#screen-menu .home-logo h1::after {
  content: "";
  display: block;
  width: 110px;
  height: 3px;
  margin: 14px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #ff7048, transparent);
}

/* Description */
#screen-menu .home-description {
  max-width: 480px;
  margin: 0 0 18px;
  color: #9eadd0;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Element icons — fixes vertical broken column */
#screen-menu .element-row {
  width: auto;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 9px;
  margin: 0 0 22px;
}

#screen-menu .element-icon {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid !important;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  color: #fff;
  background: rgba(21, 32, 65, .82);
  box-shadow:
    inset 0 1px rgba(255,255,255,.06),
    0 7px 18px rgba(0,0,0,.25);
  font-size: 1rem;
}

#screen-menu .element-icon.fire {
  color: #ff7048;
}

#screen-menu .element-icon.ice {
  color: #6edcff;
}

#screen-menu .element-icon.wind {
  color: #7af2c7;
}

#screen-menu .element-icon.lightning {
  color: #ffe15a;
}

#screen-menu .element-icon.shadow {
  color: #bd8dff;
}

/* Actions */
#screen-menu .home-actions {
  width: min(100%, 500px);
  display: block;
}

/* Play button — overrides global white button */
#screen-menu #btn-play.home-play-btn {
  width: 100%;
  min-height: 76px;
  margin: 0;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 18px;
  color: #210b05;
  background: linear-gradient(135deg, #ff5934, #ff8259 60%, #ffae78);
  box-shadow:
    0 17px 42px rgba(255, 78, 34, .32),
    inset 0 1px rgba(255,255,255,.5);
}

#screen-menu .home-play-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding-left: 2px;
  border-radius: 50%;
  color: white;
  background: rgba(84, 15, 4, .22);
}

#screen-menu .home-play-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#screen-menu .home-play-text small {
  margin-bottom: 3px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  opacity: .65;
}

#screen-menu .home-play-text strong {
  font-size: 1.12rem;
  font-weight: 900;
}

#screen-menu .home-play-arrow {
  font-size: 1.35rem;
}

/* Secondary buttons */
#screen-menu .home-secondary-actions {
  width: 100%;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 11px;
}

#screen-menu #btn-how.home-secondary-btn,
#screen-menu #btn-settings.home-secondary-btn {
  width: 100%;
  min-height: 55px;
  margin: 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(116, 146, 211, .3);
  border-radius: 15px;
  color: #eef2ff;
  background: linear-gradient(
    180deg,
    rgba(31, 45, 84, .83),
    rgba(15, 23, 49, .94)
  );
  box-shadow:
    inset 0 1px rgba(255,255,255,.05),
    0 9px 22px rgba(0,0,0,.22);
}

#screen-menu .secondary-icon {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ff8b67;
  background: rgba(255,106,61,.11);
}

/* Progress */
#screen-menu .home-progress-card {
  width: min(100%, 500px);
  margin: 20px 0 0;
  padding: 15px 17px;
  border: 1px solid rgba(104, 134, 198, .19);
  border-radius: 16px;
  background: rgba(12, 20, 43, .78);
  box-shadow:
    inset 0 1px rgba(255,255,255,.04),
    0 14px 31px rgba(0,0,0,.2);
}

#screen-menu .home-progress-header,
#screen-menu .home-progress-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#screen-menu .home-progress-header {
  margin-bottom: 10px;
  color: #768ab5;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: 1.2px;
}

#screen-menu .home-progress-header strong {
  color: #ff805d;
  font-size: .74rem;
}

#screen-menu .home-progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
}

#screen-menu .home-progress-fill {
  width: 5%;
  min-width: 10px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5935, #ffae72);
  box-shadow: 0 0 12px rgba(255, 91, 53, .48);
}

#screen-menu .home-progress-footer {
  margin-top: 10px;
  color: #99a9ce;
  font-size: .72rem;
}

#screen-menu #tour-progress-summary {
  margin: 0;
  color: inherit;
}

/* Footer */
#screen-menu .home-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  color: #576683;
  font-size: .62rem;
}

/* Hover only for real mouse devices */
@media (hover: hover) {
  #screen-menu #btn-play.home-play-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
  }

  #screen-menu .home-secondary-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(140, 174, 246, .55);
  }
}

/* Mobile */
@media (max-width: 600px) {
  #screen-menu {
    align-items: flex-start;
    padding: 16px 13px;
  }

  #screen-menu .premium-home {
    width: 100%;
    max-width: 430px;
    padding: 12px 0 20px;
  }

  #screen-menu .home-badge {
    margin-bottom: 12px;
    font-size: .52rem;
  }

  #screen-menu .logo-top {
    letter-spacing: 5px;
  }

  #screen-menu .home-logo h1 {
    font-size: clamp(2.3rem, 13vw, 3.5rem);
  }

  #screen-menu .home-description {
    max-width: 330px;
    font-size: .79rem;
  }

  #screen-menu .element-row {
    gap: 7px;
    margin-bottom: 18px;
  }

  #screen-menu .element-icon {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
    font-size: .88rem;
  }

  #screen-menu #btn-play.home-play-btn {
    min-height: 68px;
  }

  #screen-menu .home-secondary-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #screen-menu .home-progress-card {
    margin-top: 15px;
  }

  #screen-menu .home-footer {
    display: none;
  }
}

/* Short desktop and landscape screens */
@media (max-height: 700px) and (min-width: 601px) {
  #screen-menu {
    align-items: flex-start;
  }

  #screen-menu .premium-home {
    padding: 10px 0 18px;
  }

  #screen-menu .home-badge {
    margin-bottom: 9px;
  }

  #screen-menu .home-logo h1 {
    font-size: 3.4rem;
  }

  #screen-menu .home-description {
    margin-bottom: 10px;
  }

  #screen-menu .element-row {
    margin-bottom: 13px;
  }

  #screen-menu #btn-play.home-play-btn {
    min-height: 64px;
  }

  #screen-menu .home-progress-card {
    margin-top: 12px;
  }
}