/* ============================================================
   جام روپایی البرزروز — Mobile-First RTL UI
   ============================================================ */

:root {
  --purple: #6b21a8;
  --purple-light: #a855f7;
  --purple-bright: #c084fc;
  --purple-glow: rgba(168, 85, 247, 0.45);
  --green-dark: #14532d;
  --green-field: #16a34a;
  --green-bright: #22c55e;
  --white: #ffffff;
  --gold: #fbbf24;
  --accent-heading: #f0abfc;
  --navy: #1e1b4b;
  --glass: rgba(15, 23, 42, 0.82);
  --story-w: 1080;
  --story-h: 1920;
  --story-max: 480px;

  /* game over — مطابق mockup دیزاینر */
  --go-panel: rgba(106, 0, 90, 0.7);
  --go-panel-border: rgba(255, 255, 255, 0.38);
  --start-panel: rgba(128, 24, 108, 0.7);
  --btn-bg: rgb(145 0 124 / 92%);
  --btn-bg-active: rgb(125 0 108 / 92%);
  --start-btn-bg: var(--btn-bg);
  --lb-panel: rgba(106, 0, 90, 0.7);
  --lb-row-bg: rgba(62, 0, 58, 0.7);
  --lb-row-border: rgba(255, 255, 255, 0.32);
  --lb-panel-border: rgba(255, 255, 255, 0.28);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  background: #0a0812;
  color: var(--white);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen {
  display: none;
  position: fixed;
  overflow: hidden;
  width: min(100vw, var(--story-max), calc(100vh * var(--story-w) / var(--story-h)));
  height: min(100vh, calc(100vw * var(--story-h) / var(--story-w)), calc(var(--story-max) * var(--story-h) / var(--story-w)));
  max-width: var(--story-max);
  aspect-ratio: var(--story-w) / var(--story-h);
  margin: auto;
  inset: 0;
}
.screen.active { display: flex; }

/* ===== SHARED BACKGROUNDS ===== */
.screen-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.start-bg {
  background-color: #555;
  background-image: url('../images/ui/bg-start.png?v=20260711bg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

.start-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.04);
  pointer-events: none;
}

.lb-bg {
  background: url('../images/ui/leaderboard-bg.png') center top / cover no-repeat;
}

.tutorial-bg {
  background: url('../images/ui/bg-tutorial.png') center / cover no-repeat;
}

.tutorial-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.06);
  pointer-events: none;
}

.character-bg {
  background: url('../images/ui/bg-character.png') center / cover no-repeat;
}

.character-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.06);
  pointer-events: none;
}

.jersey-bg {
  background: url('../images/ui/bg-jersey.png') center / cover no-repeat;
}

.jersey-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, 0.06);
  pointer-events: none;
}

.brand-footer {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.brand-footer-logo {
  max-width: 180px;
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.brand-logo-purple {
  max-width: 210px;
  opacity: 1;
  filter: none;
  mix-blend-mode: screen;
}

.ltr { direction: ltr; text-align: left; }
.hidden { display: none !important; }

/* ===== MENU SCREENS (scroll-safe on mobile) ===== */
.menu-screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

.menu-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
}

.menu-scroll > .start-panel,
.menu-scroll > .tutorial-panel,
.menu-scroll > .character-panel,
.menu-scroll > .jersey-panel,
.menu-scroll > .go-panel {
  flex-shrink: 0;
  margin: auto;
}

.menu-scroll > .start-panel,
.menu-scroll > .tutorial-panel,
.menu-scroll > .character-panel,
.menu-scroll > .jersey-panel {
  width: 100%;
  max-width: 310px;
}

.menu-scroll > .go-panel {
  width: 100%;
  max-width: 272px;
}

.menu-footer {
  position: relative;
  flex-shrink: 0;
  bottom: auto;
  left: auto;
  right: auto;
  padding: 0.25rem 0 0.6rem;
}

.menu-footer .brand-logo-purple {
  max-width: min(180px, 44vw);
}

/* ===== START ===== */

#start-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

#start-screen .menu-scroll > .start-panel {
  margin: auto;
  max-width: 274px;
  transform: translateY(calc(0.2rem + 5px));
}

#start-screen .start-panel {
  padding: 0.92rem 0.88rem 0.68rem;
  border-radius: 24px;
}

#start-screen .start-title {
  font-size: 1.06rem;
  margin-bottom: 0.6rem;
}

#start-screen .field {
  margin-bottom: 0.42rem;
}

#start-screen .field label {
  font-size: 0.74rem;
  margin-bottom: 0.18rem;
}

#start-screen .field input {
  padding: 0.48rem 0.62rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

#start-screen .start-share-btn {
  margin-top: 0.42rem;
}

#start-screen .start-share-feedback {
  margin-top: 0.2rem;
  font-size: 0.62rem;
}

.start-hero-ball {
  position: absolute;
  left: 50%;
  top: clamp(4.15rem, 12vh, 5.9rem);
  transform: translateX(-50%);
  z-index: 2;
  width: min(30vw, 118px);
  pointer-events: none;
}

.start-float-ball {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.42));
  animation: startBallFloat 4.2s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  will-change: transform;
}

@keyframes startBallFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-14px) scale(1.012);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-float-ball {
    animation: none;
  }
}

.start-panel {
  position: relative;
  z-index: 1;
  background: var(--start-panel);
  border-radius: 32px;
  padding: 1.65rem 1.25rem 1.35rem;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.start-title {
  font-size: 1.32rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.4rem;
  color: var(--white);
}

.start-share-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin-top: 0.55rem;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.start-share-btn:hover { opacity: 0.92; }
.start-share-btn:active { transform: scale(0.98); }

.start-share-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

.start-share-feedback {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
}

.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.share-sheet.hidden {
  display: none !important;
}

.share-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.share-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 310px;
  background: var(--start-panel);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px 20px 16px 16px;
  padding: 1rem 1rem 0.85rem;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.38);
}

.share-sheet-title {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--white);
}

.share-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.share-sheet-btn {
  width: 100%;
  padding: 0.72rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

.share-sheet-btn:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
}

.share-sheet-msg {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-heading);
}

#start-screen .lead-form { text-align: right; }

#start-screen .field {
  margin-bottom: 0.95rem;
}

#start-screen .field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--white);
}

#start-screen .field input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

#start-screen .field input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

#start-screen .field-error {
  color: #fecaca;
  font-size: 0.72rem;
  margin-top: 0.25rem;
}

.start-btn {
  width: 100%;
  padding: 0.78rem 1rem;
  margin-top: 0.55rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: var(--start-btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s, transform 0.15s;
}

.start-btn:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
}

.step-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.step-actions .start-btn {
  margin-top: 0;
}

.start-brand-footer {
  bottom: 1rem;
}
.field { margin-bottom: 0.85rem; }
.field label { display: block; font-size: 0.78rem; margin-bottom: 0.3rem; }
.field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(168,85,247,0.3);
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  color: var(--navy);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}
.field input:focus {
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.field-error { color: #fca5a5; font-size: 0.72rem; margin-top: 0.25rem; }

.btn-primary {
  width: 100%;
  padding: 0.95rem;
  margin-top: 0.35rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: var(--btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: none;
  min-height: 52px;
}
.btn-primary:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
}

.btn-secondary {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background: var(--btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  min-height: 48px;
}

.btn-secondary:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
}

.btn-ghost {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.4rem;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.best-record { margin-top: 1rem; font-size: 0.85rem; opacity: 0.9; }
.best-record strong { color: var(--gold); font-size: 1.1rem; }

/* ===== TUTORIAL ===== */
#tutorial-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.tutorial-panel {
  position: relative;
  z-index: 1;
  background: var(--start-panel);
  border-radius: 32px;
  padding: 1.55rem 1.15rem 1.25rem;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.tutorial-tag {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.45rem;
}

.tutorial-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--white);
}

.tutorial-steps {
  list-style: none;
  margin-bottom: 0.85rem;
}

.tutorial-steps li {
  display: block;
  text-align: right;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
  background: var(--lb-row-bg);
  border: 1px solid var(--lb-row-border);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.tutorial-steps strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 0.15rem;
  color: var(--accent-heading);
}

.tutorial-steps p {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.55;
}

.tutorial-tip {
  text-align: center;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.75rem;
}

#tutorial-screen .start-btn {
  margin-top: 0;
}

/* ===== CHARACTER SELECT ===== */
#character-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.character-panel {
  position: relative;
  z-index: 1;
  background: var(--start-panel);
  border-radius: 32px;
  padding: 1.45rem 1.1rem 1.2rem;
  text-align: center;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.character-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.45rem;
}

.character-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--white);
}

.character-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.85rem;
}

.character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.4rem 0.65rem;
  min-width: 0;
  overflow: hidden;
  background: var(--lb-row-bg);
  border: 1px solid var(--lb-row-border);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.character-card:hover { background: rgba(72, 0, 68, 0.7); }

.character-card.selected {
  border-color: var(--gold);
  background: rgba(62, 0, 58, 0.7);
  box-shadow: 0 0 0 1px var(--gold);
}

.character-card strong { font-size: 0.78rem; font-weight: 700; }

.char-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 100px;
  border-radius: 8px;
  background: transparent;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}

#char-female .char-preview,
.character-card[data-character="female"] .char-preview {
  background: transparent;
  object-position: center top;
}

#btn-start-with-character:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ===== JERSEY SELECT ===== */
#jersey-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.jersey-panel {
  position: relative;
  z-index: 1;
  background: var(--start-panel);
  border-radius: 32px;
  padding: 1.65rem 1.25rem 1.35rem;
  text-align: center;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.jersey-tag {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0.45rem;
}

.jersey-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--white);
  text-align: center;
}

.jersey-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 1rem;
  text-align: center;
}

.jersey-form { text-align: right; }

.jersey-panel .field label {
  color: var(--white);
  font-size: 0.84rem;
}

.jersey-panel .field input {
  border: none;
  border-radius: 10px;
  background: var(--white);
  padding: 0.72rem 0.85rem;
}

.jersey-panel .field input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
  outline: none;
}

.jersey-panel .field-error { color: #fecaca; }

.jersey-input {
  font-size: 1.75rem !important;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.12em;
}

/* ===== GAME ===== */
#game-screen {
  flex-direction: column;
  background: #6b9e6b;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1;
}

.game-hud {
  position: absolute;
  top: 1.35rem;
  left: 0.65rem;
  right: 0.65rem;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0;
  pointer-events: none;
}

.hud-stage strong { color: var(--white); font-size: 1.15rem; }

/* مرحله جدید */
.stage-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 20;
  text-align: center;
  background: var(--go-panel);
  border: 1.5px solid var(--go-panel-border);
  border-radius: 20px;
  padding: 1.25rem 1.75rem;
  min-width: 220px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.stage-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.stage-banner-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.stage-banner strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}
.stage-banner small {
  font-size: 0.8rem;
  opacity: 0.85;
}

.hud-pill {
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  padding: 0.45rem 0.35rem 0.5rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(145, 0, 124, 0.38);
}
.hud-label { display: block; font-size: 0.58rem; opacity: 0.9; margin-bottom: 0.1rem; }
.hud-pill strong { font-size: 1.15rem; color: var(--white); font-weight: 700; }

.tap-hint, .dual-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 0.75rem;
  right: 0.75rem;
  transform: none;
  z-index: 10;
  background: var(--btn-bg);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: bold;
  border: 1px solid rgba(255,255,255,0.2);
  pointer-events: none;
  white-space: normal;
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(145, 0, 124, 0.35);
  color: var(--white);
}
.dual-hint { bottom: 5rem; background: var(--btn-bg); color: var(--white); }

.feedback-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}

.float-feedback {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--white);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.65),
    0 0 18px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.5);
  animation: floatUp 0.9s ease forwards;
  white-space: nowrap;
}
.float-feedback.perfect,
.float-feedback.early,
.float-feedback.late,
.float-feedback.wrong,
.float-feedback.combo {
  color: var(--white);
}

/* ===== COUNTDOWN ===== */
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 18, 0.55);
  pointer-events: none;
}
.countdown-overlay.hidden { display: none !important; }

.countdown-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 0 24px var(--purple-glow);
  animation: countdownPop 0.5s ease;
}
.countdown-img {
  width: min(140px, 35vw);
  height: auto;
  filter: drop-shadow(0 0 24px var(--purple-glow));
  animation: countdownPop 0.45s ease;
}
@keyframes countdownPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes floatUp {
  to { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1.15); }
}

.particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: particleFly 0.7s ease forwards;
}
@keyframes particleFly {
  to { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}

#game-screen.shake {
  animation: screenShake 0.35s ease;
}
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ===== OVERLAY SCREENS ===== */
#gameover-screen {
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  background: transparent;
}

.go-layout {
  position: relative;
  z-index: 1;
}

.go-panel {
  min-height: 430px;
  padding: 2rem 1.2rem 1.45rem;
  background: var(--go-panel);
  border: 1.5px solid var(--go-panel-border);
  border-radius: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.42);
  animation: cardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.go-digital-title {
  margin-bottom: 1.5rem;
  line-height: 0.82;
}

.go-digital-line {
  display: block;
  font-family: 'Orbitron', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-size: 2.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--white);
  text-transform: uppercase;
}

.go-score-badge {
  width: 98px;
  height: 98px;
  margin: 0 auto 1.15rem;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.go-score-badge span {
  font-family: 'Orbitron', 'Vazirmatn', sans-serif;
  font-size: 2.35rem;
  font-weight: 900;
  color: var(--go-panel);
  line-height: 1;
}

.go-message {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  padding: 0 0.25rem;
}

.go-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  margin-top: auto;
}

.go-btn {
  width: 100%;
  padding: 0.78rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  background: var(--btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.go-btn:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
  border-color: var(--white);
}

.go-share-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin-top: 0.15rem;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.go-share-btn:hover { opacity: 0.92; }

.go-share-btn:active {
  transform: scale(0.98);
}

.go-share-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
}

#leaderboard-screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  background: #0a0812;
  overflow: hidden;
}

.lb-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.75rem 1.5rem 1.5rem;
  overflow: hidden;
}

.lb-panel {
  width: 100%;
  max-width: 318px;
  margin-top: 0;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--lb-panel);
  border: 1px solid var(--lb-panel-border);
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 12px 40px rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  animation: cardIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.lb-title {
  flex-shrink: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.1rem;
  letter-spacing: 0;
}

.leaderboard-list {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  background: var(--lb-row-bg);
  border: 1px solid var(--lb-row-border);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  font-size: 0.8rem;
  color: var(--white);
}

.leaderboard-list li.lb-empty-msg {
  justify-content: center;
  text-align: center;
}

.leaderboard-list li.lb-empty-msg .lb-name {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.92;
}

.leaderboard-list .lb-rank {
  flex-shrink: 0;
  min-width: 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
}

.leaderboard-list .lb-name {
  flex: 1;
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-list .lb-score {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--white);
}

.lb-play-again {
  display: block;
  flex-shrink: 0;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  min-height: 40px;
  transition: background 0.2s, transform 0.15s;
}
.lb-play-again:active {
  transform: scale(0.98);
  background: var(--btn-bg-active);
}

.overlay-card {
  width: 100%;
  max-width: 380px;
  background: var(--glass);
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  animation: cardIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 380px) {
  .game-hud { gap: 0.3rem; }
  .menu-scroll { padding-inline: 0.75rem; }
}

@media (max-height: 700px) {
  .menu-scroll {
    align-items: flex-start;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  #start-screen .menu-scroll > .start-panel {
    transform: translateY(0);
    max-width: 262px;
  }

  #start-screen .start-panel {
    padding: 0.82rem 0.78rem 0.62rem;
  }

  #start-screen .start-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  #start-screen .field {
    margin-bottom: 0.38rem;
  }

  .start-hero-ball {
    top: clamp(3.65rem, 10vh, 5.15rem);
    width: min(28vw, 102px);
  }

  .start-panel,
  .tutorial-panel,
  .character-panel,
  .jersey-panel {
    padding-top: 1.15rem;
    padding-bottom: 1rem;
  }

  .start-title { font-size: 1.18rem; margin-bottom: 1rem; }
  .start-share-btn { margin-top: 0.45rem; }
  .character-sub,
  .jersey-sub,
  .tutorial-tip { margin-bottom: 0.65rem; }
  .character-grid { margin-bottom: 0.6rem; }
  .char-preview { min-height: 88px; }
  .tutorial-steps li { padding: 0.55rem 0.65rem; margin-bottom: 0.35rem; }
  .menu-footer .brand-logo-purple { max-width: 140px; }
}

@media (max-height: 620px) {
  .char-preview { min-height: 76px; }
  .character-title,
  .tutorial-title,
  .jersey-title { font-size: 1.02rem; }
  .step-actions { gap: 0.45rem; }
  .start-btn { min-height: 40px; padding: 0.68rem 0.85rem; font-size: 0.82rem; }
}

@media (min-width: 768px) {
  body { background: #050508; }
}
