:root {
  background: #12042f;
  color-scheme: dark;
}

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

html {
  width: 100%;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #12042f;
  touch-action: manipulation;
}

body {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-y: hidden;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: #12042f;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@supports (height: 100dvh) {
  body {
    height: 100dvh;
    min-height: 100dvh;
  }
}

button,
input,
textarea,
select {
  font: inherit;
  max-width: 100%;
  touch-action: manipulation;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #12042f;
  z-index: 0;
}

body .grecaptcha-badge {
  z-index: -1 !important;
  pointer-events: none !important;
}

/* ===== SCREEN COMMON ===== */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow-x: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 451px) {
  body::before {
    background:
      linear-gradient(0deg, #1C003DB2, #1C003DB2),
      url('../images/bg_home.png') no-repeat center 80%;
    background-size: cover;
    transform: scale(1.08);
    filter: blur(13.28px);
  }

  .screen {
    left: 50%;
    width: min(100%, 450px);
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 80px rgba(0, 0, 0, 0.38);
  }

  #screen-intro {
    left: 0;
    width: 100%;
    transform: none;
    box-shadow: none;
  }
}

/* ===== SCREEN 1: INTRO VIDEO ===== */
#screen-intro {
  background: #000;
  z-index: 30;
}

#screen-intro video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  #screen-intro {
    position: fixed;
    overflow: hidden;
  }

  #screen-intro video {
    position: absolute;
    top: 0;
    left: 50%;
    width: calc(100% + 72px);
    height: calc(100% + 48px);
    max-width: none;
    transform: translateX(-50%);
    object-position: center top;
  }
}

#intro-skip-btn {
  position: absolute;
  bottom: 40px;
  right: 30px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 30px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.3s ease;
}

#intro-skip-btn:hover,
#intro-skip-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== PERMISSION OVERLAY ===== */
#screen-permission {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 25;
}

/* Back button */
.register-back,
.info-back,
.gift-back,
.permission-back,
.ranking-back,
.timeout-back,
#back-btn {
  position: absolute;
  top: 20px;
  left: 16px;
  display: flex;
  align-items: center;
  min-width: 84px;
  min-height: 32px;
  padding-right: 10px;
  background: url('../images/bg-back.png') no-repeat center center;
  background-size: 100% 100%;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  z-index: 29;
}

.permission-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 80px 30px 40px;
  text-align: center;
}

.permission-camera-icon {
  width: 140px;
  height: 128;
  object-fit: contain;
  margin-bottom: 18px;
}

.permission-line {
  width: 60%;
  max-width: 260px;
  height: auto;
  margin-bottom: 28px;
  opacity: 0.6;
}

.permission-divider {
  width: min(365px, calc(100vw - 10px));
  max-width: 365px;
  height: auto;
  margin-bottom: 20px;
  opacity: 0.8;
  pointer-events: none;
}

.permission-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #FFC52B;
  margin-bottom: 6px;
  text-align: center;
}

.permission-title-highlight {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #FFC52B;
  margin-bottom: 20px;
  text-align: center;
}

.permission-desc {
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 21px;
  text-align: center;
}

#permission-allow-btn {
  width: 80%;
  max-width: 300px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

#permission-allow-btn img {
  width: 100%;
  height: auto;
  display: block;
}

#permission-allow-btn:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

/* Permission denied / error state */
.permission-error {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 30px 40px;
}

.permission-error.show {
  display: flex;
}

.permission-error-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 24px;
  opacity: 0.5;
}

.permission-error-title {
  font-size: 20px;
  font-weight: 600;
  color: #ff6b6b;
  margin-bottom: 12px;
}

.permission-error-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 300px;
}

#permission-retry-btn {
  width: 70%;
  max-width: 260px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  margin-bottom: 16px;
  transition: transform 0.2s ease;
}

#permission-retry-btn img {
  width: 100%;
  height: auto;
  display: block;
}

#permission-retry-btn:active {
  transform: scale(0.96);
}

#permission-back-btn {
  padding: 10px 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
}

/* Loading state */
.permission-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 30px 40px;
}

.permission-loading.show {
  display: flex;
}

.permission-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #f0c040;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

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

.permission-loading-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

/* ===== SCREEN: ACCOUNT ===== */
#screen-account {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 28;
}

.account-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px 30px;
  text-align: center;
}

.account-logo {
  width: min(332px, calc(100vw - 48px));
  max-width: 332px;
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.account-divider-top {
  margin-bottom: 24px;
}

.account-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  margin-top: 26px;
}

.account-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.account-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.account-btn:active {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.account-divider {
  width: min(365px, calc(100vw - 10px));
  max-width: none;
  height: auto;
  margin: 4px 0;
  opacity: 0.8;
  pointer-events: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* ===== SCREEN: REGISTER ===== */
#screen-register {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 28;
  justify-content: flex-start;
}

.back-arrow-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.register-back:active,
.info-back:active,
.gift-back:active,
.permission-back:active,
.ranking-back:active,
.timeout-back:active,
#back-btn:active {
  opacity: 0.6;
}

.register-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  padding: 60px 24px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.register-logo {
  width: min(332px, calc(100vw - 48px));
  max-width: 332px;
  height: auto;
  margin-bottom: 22px;
}

.register-card {
  width: min(100vw, 450px);
  max-width: min(100vw, 450px);
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  margin-left: 0;
  margin-right: 0;
  background: url('../images/bg_popup.png') no-repeat center center;
  background-size: 100% 100%;
  padding: 18px 16px 54px;
}

.register-card > *:not(.register-submit) {
  width: min(343px, calc(100vw - 32px));
  max-width: 343px;
  margin-left: auto;
  margin-right: auto;
}

.register-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 140%;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
  text-transform: capitalize;
}

.register-field {
  margin-bottom: 4px;
}

.register-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: 0;
  color: #A8A8A8;
  margin-bottom: 6px;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.register-input-wrap,
.info-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 54px;
  padding: 15px 18px;
  gap: 18.15px;
  background: url('../images/bg_input.png') no-repeat center center;
  background-size: 100% 100%;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.register-input,
.info-input {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  padding: 0;
  background: transparent;
  background-color: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
}

.register-input:-webkit-autofill,
.register-input:-webkit-autofill:hover,
.register-input:-webkit-autofill:focus,
.register-input:autofill,
.info-input:-webkit-autofill,
.info-input:-webkit-autofill:hover,
.info-input:-webkit-autofill:focus,
.info-input:autofill {
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff !important;
  border: 0 !important;
  outline: none !important;
  -webkit-box-shadow: 0 0 0 1000px #2b1050 inset !important;
  box-shadow: 0 0 0 1000px #2b1050 inset !important;
  background-color: #2b1050 !important;
  background-image: none !important;
  transition: background-color 9999s ease-out 0s, color 9999s ease-out 0s;
}

.register-input-wrap:has(.register-input:-webkit-autofill),
.info-input-wrap:has(.info-input:-webkit-autofill) {
  background-color: transparent;
}

.register-input-wrap:focus-within {
  filter: brightness(1.08);
}

.register-input-icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.register-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.register-toggle-password {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 6px;
  flex-shrink: 0;
}

.register-toggle-password-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.register-toggle-password:active {
  opacity: 0.6;
}

.register-error {
  display: block;
  font-size: 11px;
  color: #ff6b6b;
  min-height: 14px;
  margin-top: 6px;
  line-height: 1.3;
}

.register-input-wrap.has-error {
  filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.35));
}

.register-submit {
  display: block;
  width: min(365px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.register-submit img {
  width: 100%;
  height: auto;
  display: block;
}

.register-submit:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

.register-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.4);
}

.register-submit:disabled:active {
  transform: none;
}

/* ===== SCREEN: INFO (Member Info) ===== */
#screen-info {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 28;
  justify-content: flex-start;
}

.info-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  padding: 70px 24px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.info-icon {
  width: 144px;
  height: 80px;
  margin-bottom: 12px;
  object-fit: contain;
}

.info-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #FFC52B;
  margin-bottom: 30px;
  text-align: center;
  text-transform: capitalize;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.info-card {
  width: min(100vw, 450px);
  max-width: min(100vw, 450px);
  flex: 1 0 auto;
  margin-left: 0;
  margin-right: 0;
  background: url('../images/bg_popup.png') no-repeat center center;
  background-size: 100% 100%;
  border: 0;
  border-radius: 0;
  padding: 22px 20px 56px;
}

.info-card > *:not(.info-submit) {
  width: min(343px, calc(100vw - 32px));
  max-width: 343px;
  margin-left: auto;
  margin-right: auto;
}

.info-field {
  margin-bottom: 4px;
}

.info-field:last-of-type {
  margin-bottom: 0;
}

.info-label {
  display: block;
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: 0;
  color: #A8A8A8;
  margin-bottom: 6px;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.info-label .info-required {
  color: #ff6b6b;
  margin-right: 2px;
}

.info-section-label {
  color: #fff;
  font-size: 16px;
  border-top: 1px solid #3F215C;
  padding-top: 26px;
  margin-bottom: 8px;
}

.info-input-wrap:focus-within {
  filter: brightness(1.08);
}

.info-input-icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.info-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.info-field.hidden {
  display: none;
}

.info-connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86%;
  min-height: 38px;
  margin: 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(255, 197, 43, 0.85);
  border-radius: 8px;
  background: linear-gradient(180deg, #FFC52B 0%, #F28A16 100%);
  color: #25083A;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #7A3C05, 0 8px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.info-connect-btn + .info-connect-btn,
.info-connect-hint + .info-connect-btn {
  margin-top: 8px;
}

.info-connect-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFC52B;
  border-color: rgba(255, 197, 43, 0.75);
  box-shadow: 0 3px 0 #43205F, 0 6px 10px rgba(0, 0, 0, 0.2);
}

.info-connect-btn.ghost {
  min-height: 32px;
  padding: 7px 12px;
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
  font-size: 11px;
}

.info-connect-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #7A3C05, 0 4px 10px rgba(0, 0, 0, 0.22);
}

.info-connect-btn:disabled {
  cursor: default;
  opacity: 1;
  filter: grayscale(0.15);
}

.info-connect-hint {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.info-connect-hint strong {
  font-weight: 400;
}

.info-connect-hint.telegram-hint {
  color: #fff;
}

.info-connect-hint.telegram-hint strong {
  margin-left: -6px;
  color: #FFC52B;
}

.telegram-connect-steps {
  margin-top: 18px;
}

.telegram-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 28px;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
}

.telegram-connect-steps > .telegram-step:first-child {
  margin-top: 0;
}

.telegram-step b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 999px;
  background: #6F23E8;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}

.telegram-step-connect::after,
.discord-step-connect::after,
.discord-step-server::after,
.telegram-hint .telegram-step:first-child::after {
  content: '';
  position: absolute;
  left: 10.5px;
  top: 20px;
  width: 0;
  height: 25px;
  border-left: 0.7px dashed rgba(255, 255, 255, 0.45);
  transform: translateX(-50%);
}

.telegram-step-connect {
  align-items: center;
}

.telegram-step-check {
  margin-left: 4px;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.telegram-connect-image-btn {
  display: block;
  width: 102.46px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.telegram-connect-image-btn img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.telegram-connect-image-btn:active:not(:disabled) {
  transform: scale(0.98);
  filter: brightness(1.08);
}

.telegram-connect-image-btn:disabled {
  cursor: default;
  opacity: 0.75;
}

.discord-connect-steps {
  margin-top: 18px;
}

.discord-connect-image-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.discord-connect-image-btn img {
  display: block;
  width: 102.46px;
  height: auto;
  flex: 0 0 102.46px;
  pointer-events: none;
}

.discord-connect-image-btn:active:not(:disabled),
.discord-server-link:active:not(:disabled) {
  transform: scale(0.99);
  box-shadow: none;
  filter: brightness(1.05);
}

.discord-connect-image-btn:disabled {
  cursor: default;
  opacity: 0.75;
}

.discord-server-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.discord-server-link span:not(.discord-step-check) {
  margin-left: 4px;
  color: #FFC52B;
}

.discord-step-check {
  margin-left: 4px;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.discord-hint {
  margin-top: 0;
}

.discord-hint .telegram-step:first-child::after {
  display: none;
}

.telegram-step.is-active {
  color: #fff;
}

.telegram-step.is-active b,
.telegram-step.is-done b {
  background: #6F23E8;
  color: #fff;
}

.telegram-step.is-done {
  color: #fff;
}

.info-connect-note {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 11px;
  line-height: 1.45;
}

.info-connect-btn.hidden,
.info-connect-note.hidden {
  display: none;
}

/* Channel tabs (Telegram / Discord) */
.info-channels {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.info-channel-btn {
  width: auto;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.info-channel-btn + .info-channel-btn {
  position: relative;
  margin-left: 48px;
}

.info-channel-btn + .info-channel-btn::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  width: 1px;
  height: 18px;
  background: #8C4DEA;
  transform: translate(-50%, -50%);
}

.info-channel-btn img {
  width: auto;
  height: 100%;
  display: block;
  opacity: 1;
}

.info-channel-btn:active {
  transform: scale(0.98);
}

.info-channel-btn:not(.inactive) {
  opacity: 1;
}

.info-channel-btn.inactive {
  opacity: 1;
}

.info-channel-btn.inactive img {
  opacity: 0.5;
}

.info-divider {
  display: block;
  width: min(365px, calc(100vw - 32px));
  max-width: 365px;
  height: auto;
  margin: 22px auto 14px;
  opacity: 0.8;
  pointer-events: none;
}

.info-submit {
  display: block;
  width: min(365px, calc(100vw - 32px));
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.info-submit img {
  width: 100%;
  height: auto;
  display: block;
}

.info-submit:active {
  transform: scale(0.98);
  filter: brightness(1.1);
}

.info-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.4);
}

.info-submit:disabled:active {
  transform: none;
}

.info-error {
  display: block;
  font-size: 11px;
  color: #ff6b6b;
  margin-top: 6px;
  min-height: 14px;
  line-height: 1.3;
}

.telegram-bind-error,
.discord-bind-error {
  width: 86%;
  margin: 0 auto;
  text-align: center;
  min-height: 18px;
}

.info-channel-status-error {
  width: 100%;
  margin-top: 8px;
  color: #ff6b6b;
  text-align: center;
  min-height: 18px;
  font-weight: 600;
}

.telegram-bind-error:empty,
.discord-bind-error:empty,
.info-channel-status-error:empty {
  display: none;
}

.info-input-wrap.has-error {
  filter: drop-shadow(0 0 6px rgba(255, 107, 107, 0.35));
}

/* ===== SCREEN 2: HOME ===== */
#screen-home {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 20;
  overflow: hidden;
}

.home-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 18px 30px 72px;
  overflow: hidden;
}

.home-username-badge {
  position: static;
  align-self: flex-start;
  margin-left: -14px;
  min-width: 120px;
  max-width: calc(100vw - 72px);
  height: 32px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: url('../images/bg-username.png') no-repeat center center;
  background-size: 100% 100%;
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-player-stats {
  position: static;
  align-self: flex-start;
  z-index: 2;
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding-left: 11px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  text-align: left;
  list-style-position: outside;
}

.home-player-stats li::marker {
  color: rgba(255, 255, 255, 0.88);
}

.home-player-stats span {
  color: #ffd73b;
  font-weight: 500;
}

.home-share-btn {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.home-share-btn:hover,
.home-share-btn:active {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.home-share-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.home-music-btn {
  position: absolute;
  top: 68px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: url('../images/bg-tiny-btn.png') no-repeat center center / 32px 32px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.home-music-btn:hover,
.home-music-btn:active {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.home-music-btn.is-muted::after {
  position: absolute;
  top: 7p0x;
  left: 15px;
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  content: '';
  transform: rotate(45deg);
  transform-origin: center;
}

.home-music-icon {
  display: block;
  width: 17.07px;
  height: 17.07px;
  object-fit: contain;
  pointer-events: none;
}

.home-share-toast {
  position: absolute;
  top: 100px;
  right: 18px;
  z-index: 3;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(18, 22, 35, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.home-share-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SCREEN: GAME GUIDE ===== */
#screen-guide {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 40;
  overflow: hidden;
}

.guide-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 14px 0 0;
  color: #fff;
  background: #10002e;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.guide-top,
.guide-stage {
  position: relative;
  z-index: 1;
}

.guide-top {
  margin: 0 14px;
  z-index: 3;
}

.guide-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}

.guide-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.guide-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.guide-progress-fill.done {
  width: 100%;
}

.guide-progress-fill.active {
  animation: guide-progress var(--guide-progress-duration, 4s) linear forwards;
}

.guide-progress-fill.active.is-paused {
  animation-play-state: paused;
}

.guide-header {
  display: grid;
  grid-template-columns: 64px 1fr 52px;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}

.guide-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
}

.guide-title {
  margin: 0;
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

.guide-close-btn {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.guide-close-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.guide-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.guide-image {
  display: block;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@keyframes guide-progress {
  from { width: 0; }
  to { width: 100%; }
}

@media (max-width: 450px) {
  .guide-header {
    grid-template-columns: 46px 1fr 42px;
    gap: 10px;
    margin-top: 18px;
  }

  .guide-image {
    width: 100vw;
  }

  .guide-close-btn {
    width: 42px;
    height: 42px;
  }
}

.home-header-img {
  width: auto;
  max-width: min(calc(100vw - 32px), 100%);
  height: min(175.5px, calc((100vw - 32px) * 0.46));
  margin-top: auto;
  margin-bottom: 24px;
}

.home-description {
  width: min(354px, calc(100vw - 32px));
  min-height: 35px;
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  margin-bottom: 32px;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 365px;
  margin-top: 20px;
}

.home-btn {
  display: block;
  width: min(365px, calc(100vw - 10px));
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.home-btn:hover,
.home-btn:active {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.home-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.home-divider {
  width: min(365px, calc(100vw - 10px));
  max-width: 365px;
  height: auto;
  margin: 4px 0;
  opacity: 0.8;
  pointer-events: none;
}

/* ===== Lottie goal animation overlay ===== */
#goal-animation-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
  display: none;
}

#goal-animation-container svg {
  width: 100% !important;
  height: 100% !important;
}

#referral-reward-animation-container {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  display: none;
  transform: scale(1.25);
  transform-origin: center;
}

#referral-reward-animation-container svg {
  width: 100% !important;
  height: 100% !important;
}

/* ===== POPUP: GIFT CLAIM CONFIRMATION ===== */
.gift-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gift-modal[hidden] {
  display: none !important;
}

.gift-modal:not(.show) {
  display: none !important;
}

.gift-modal.show {
  display: flex !important;
  animation: popup-fade-in 0.25s ease-out;
}

@keyframes popup-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gift-popup-card {
  position: relative;
  width: 100%;
  max-width: 352px;
  background: url('../images/bg_modal.png') no-repeat center center;
  background-size: 100% 100%;
  padding: 40px 16px;
  text-align: center;
  animation: popup-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popup-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.gift-popup-check {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 22px;
  filter: drop-shadow(0 6px 20px rgba(76, 217, 100, 0.4));
}

.gift-review-popup-icon {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 8px 24px rgba(255, 197, 43, 0.35));
}

.out-of-plays-popup-icon {
  width: 144px;
  height: 80px;
}

.gift-popup-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  color: #FFC52B;
  margin-bottom: 4px;
}

.gift-popup-subtitle {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  color: #FFC52B;
  margin-bottom: 20px;
}

.gift-popup-desc {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  letter-spacing: 0;
  text-align: center;
}

.gift-popup-desc b {
  color: #FFC52B;
  font-weight: 600;
}

.gift-popup-close {
  position: absolute;
  bottom: -56px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gift-popup-close:active {
  transform: translateX(-50%) scale(0.9);
}

.gift-popup-close img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.referral-reward-popup-card {
  max-width: min(90vw, 430px);
  padding: 58px 24px 72px;
}

.referral-reward-popup-icon {
  width: 144px;
  height: 80px;
  margin-bottom: 17px;
}

.referral-reward-popup-title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
}

.referral-reward-popup-subtitle {
  margin: 0 auto 24px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
}

.referral-reward-popup-desc {
  max-width: 420px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  line-height: 1.5;
}

.referral-reward-popup-desc b {
  color: #ffffff;
  font-weight: 500;
}

@media (max-width: 480px) {
  .referral-reward-popup-card {
    max-width: 92vw;
    padding: 44px 18px 58px;
  }
}

/* Gift item button with "received" state */
.gift-item-btn.received {
  background: rgba(76, 217, 100, 0.2);
  border: 1px solid rgba(76, 217, 100, 0.5);
  box-shadow: none;
  color: #fff;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
}

.gift-item-btn.received img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ===== SCREEN: GIFT / REWARDS ===== */
#screen-gift {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 22;
  justify-content: flex-start;
}

#screen-rules,
#screen-policy {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 22;
  justify-content: flex-start;
  overflow: hidden;
}

.gift-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: clamp(48px, 8vh, 70px) 20px clamp(16px, 3vh, 28px);
  overflow: hidden;
}

.gift-back.popup-open {
  opacity: 0;
  pointer-events: none;
}

.static-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 84px 24px 0;
  overflow: hidden;
  min-height: 0;
}

.static-content-logo {
  width: min(332px, calc(100vw - 48px));
  max-width: 332px;
  height: auto;
  margin-bottom: 36px;
}

.static-content-card {
  width: calc(100% + 48px);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  margin-left: -24px;
  margin-right: -24px;
  background: url('../images/bg_popup.png') no-repeat center center;
  background-size: 100% 100%;
  padding: 18px 16px 32px;
}

.static-content-card > * {
  width: min(343px, calc(100vw - 32px));
  max-width: 343px;
  margin-left: auto;
  margin-right: auto;
}

.static-content-title {
  color: #FFC52B;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: capitalize;
  margin-bottom: 16px;
}

.static-rich-content {
  flex: 1 1 auto;
  min-height: 0;
  width: min(343px, calc(100vw - 32px));
  max-width: 343px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0 16px;
  box-shadow: none;
}

.gift-trophy {
  width: 144px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}

.gift-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #FFC52B;
  margin-bottom: 8px;
  text-align: center;
}

.gift-subtitle {
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
  margin-bottom: clamp(10px, 2vh, 18px);
  max-width: 343px;
}

.gift-stats {
  margin-bottom: clamp(12px, 2vh, 22px);
}

.gift-result-stats,
.gift-stat,
.gift-stat-label,
.gift-stat-value,
.gift-divider,
.gift-action-buttons,
.gift-action-btn {
  /* Semantic gift-screen aliases. Visual rules are shared with timeout classes above. */
}

.gift-action-buttons.hidden {
  display: none;
}

.gift-home-buttons {
  display: none;
}

.gift-home-buttons.show {
  display: flex;
}

.gift-buttons {
  max-width: 365px;
}

/* Reward list */
.gift-list {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gift-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #fff;
}

.gift-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gift-item-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.gift-item-info {
  flex: 1;
  min-width: 0;
}

.gift-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}

.gift-item-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.gift-item-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, #ff9f43 0%, #f0c040 100%);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(240, 192, 64, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.gift-item-btn:active {
  transform: scale(0.95);
  filter: brightness(1.1);
}

.gift-item-btn:disabled {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
}

/* ===== SCREEN: RANKING / LEADERBOARD ===== */
#screen-ranking {
  background: url('../images/bg_top.png') no-repeat center top;
  background-size: cover;
  z-index: 22;
  justify-content: flex-start;
}

.ranking-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 68px 20px 20px;
  overflow: hidden;
}

.trophy {
  width: auto;
  max-width: 144px;
  height: auto;
  margin-top: 24px;
  margin-bottom: 8px;
}

.ranking-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #FFC52B;
  margin-bottom: 4px;
  text-align: center;
}

.ranking-subtitle {
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 24px;
  text-align: center;
}

/* --- Top 3 Podium --- */
.ranking-podium {
  position: relative;
  width: 100%;
  max-width: 368px;
  height: 260px;
  margin-bottom: -19px;
  flex-shrink: 0;
}

.podium-bg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: auto;
  z-index: 1;
}

.podium-spot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* Spread the 3 spots out horizontally so avatars don't overlap */
.podium-spot-first {
  left: 50%;
  transform: translateX(-50%);
  bottom: 136px;
}

.podium-spot-second {
  left: 8%;
  bottom: 108px;
}

.podium-spot-third {
  right: 8%;
  bottom: 96px;
}

.podium-medal {
  width: 34.72441101074219px;
  height: 49px;
  margin-bottom: 0px;
  object-fit: contain;
  position: relative;
  z-index: 3;
}

.podium-spot-first .podium-medal {
  width: 34.72441101074219px;
  height: 49px;
  margin-bottom: 0px;
}

.podium-spot-third .podium-medal,
.podium-spot-second .podium-medal {
  width: 28.546255111694336;
  height: 40;
  margin-bottom: 0px;
}

.podium-name {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  color: #fff;
  margin-top: 4px;
  margin-bottom: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-score {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0;
  text-align: center;
  color: #FFD124;
  text-shadow:
    -1px 0 7px #A68713,
    0 1px 3px rgba(0, 0, 0, 0.7);
}

.podium-spot-first .podium-score {
  font-size: 28px;
  color: #ffd93d;
}

/* --- Ranking List Card (rank 4+) --- */
.ranking-list-card {
  flex: 1;
  width: calc(100% + 40px);
  max-width: none;
  min-height: 0;
  margin-left: -20px;
  margin-right: -20px;
  background: url('../images/bg_popup.png') no-repeat center center;
  background-size: 100% 100%;
  border-radius: 0;
  padding: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.ranking-list {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

/* Custom scrollbar */
.ranking-list::-webkit-scrollbar {
  width: 5px;
}

.ranking-list::-webkit-scrollbar-track {
  background: transparent;
}

.ranking-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  color: #fff;
  flex-shrink: 0;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item-current {
  background: rgba(240, 192, 64, 0.12);
  border-bottom-color: rgba(240, 192, 64, 0.5);
  border-radius: 6px;
}

.ranking-item-rank {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  width: 24px;
  text-align: center;
}

.ranking-item-current .ranking-item-rank {
  color: #ffd93d;
}

.ranking-item-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.ranking-item-score {
  font-size: 15px;
  font-weight: 600;
  color: #ffd93d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ranking-ball-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ===== SCREEN: TIMEOUT / GAME OVER ===== */
#screen-timeout {
  background: url('../images/bg_home.png') no-repeat center center;
  background-size: cover;
  z-index: 22;
}

.timeout-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: clamp(48px, 8vh, 70px) 20px clamp(16px, 3vh, 28px);
  overflow: hidden;
}

.timeout-clock {
  width: clamp(64px, 14vh, 96px);
  height: auto;
  object-fit: contain;
  margin-bottom: clamp(6px, 1.5vh, 12px);
  flex-shrink: 0;
}

.timeout-title {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
  color: #FFC52B;
  margin-bottom: clamp(4px, 1vh, 8px);
  flex-shrink: 0;
}

.timeout-desc {
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: clamp(10px, 2vh, 18px);
  max-width: 290px;
  flex-shrink: 0;
}

/* Stats grid */
.timeout-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.5vh, 12px);
  width: 100%;
  max-width: 300px;
  margin-bottom: clamp(12px, 2vh, 22px);
  flex-shrink: 0;
}

.timeout-stat {
  background: url('../images/box.png') no-repeat center center;
  background-size: 100% 100%;
  padding: clamp(8px, 1.5vh, 12px) 10px;
  text-align: center;
}

.timeout-stat-label {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #fff;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-align: center;
}

.timeout-stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  text-shadow:
    -1px 0 7px #fff,
    0 1px 3px rgba(0, 0, 0, 0.7);
}

.timeout-stat-value.highlight {
  color: #FFD124;
  text-shadow:
    -1px 0 7px #A68713,
    0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Divider above buttons */
.timeout-divider {
  width: min(365px, calc(100vw - 10px));
  max-width: 365px;
  height: auto;
  margin-bottom: clamp(10px, 1.5vh, 16px);
  opacity: 0.8;
  pointer-events: none;
  flex-shrink: 0;
}

/* Buttons */
.timeout-buttons {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vh, 12px);
  width: 100%;
  max-width: 290px;
  flex-shrink: 0;
}

.timeout-btn {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.timeout-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.timeout-btn:active {
  transform: scale(0.97);
  filter: brightness(1.1);
}

/* ===== SCREEN 3: AR GAME ===== */
#screen-game {
  z-index: 5;
  pointer-events: none;
  justify-content: flex-start;
}

#screen-game.hidden .game-ui {
  display: none;
}

/* Camera video background */
#camera-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 4;
  display: none;
  background: #000;
}

.game-ui {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

/* Top bar - back button */
.game-top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  pointer-events: auto;
}

#back-btn {
  position: static;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

/* Goal post */
.game-goal {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  max-width: 340px;
  z-index: 16;
}

.game-goal img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

/* Goalkeeper */
.game-goalkeeper {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  max-width: 340px;
  height: 0;
  padding-bottom: 38%;  /* match goal aspect ratio */
  z-index: 16;
  pointer-events: none;
}

.gk-sprite {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  height: 70%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
  transition: left 0.05s linear;
}

/* GK running animation - subtle bounce while moving */
.gk-sprite.running {
  animation: gk-bounce 0.3s ease-in-out infinite;
}

@keyframes gk-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

/* GK dive animations */
.gk-sprite.dive-left {
  animation: gk-dive-left 0.4s ease-out forwards;
}

.gk-sprite.dive-right {
  animation: gk-dive-right 0.4s ease-out forwards;
}

@keyframes gk-dive-left {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-120%) translateY(-10px); }
}

@keyframes gk-dive-right {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(20%) translateY(-10px); }
}

/* GK reaction poses */
.gk-sprite.celebrate {
  animation: gk-celebrate 0.5s ease-out forwards;
}

@keyframes gk-celebrate {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1.1); }
}

.gk-sprite.sad {
  animation: gk-sad 0.5s ease-out forwards;
}

@keyframes gk-sad {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(-50%) translateY(5px); }
}

/* Aim arrow - shows when holding the ball */
.game-arrow {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  width: 4px;
  height: 180px;
  pointer-events: none;
  z-index: 17;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.game-arrow.active {
  opacity: 1;
}

.game-arrow-line {
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.1));
  border-radius: 2px;
}

.game-arrow-head {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid rgba(255, 255, 255, 0.9);
}

/* Aim indicator dots along the arrow */
.game-arrow-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.game-arrow-dot:nth-child(2) { bottom: 25%; width: 7px; height: 7px; }
.game-arrow-dot:nth-child(3) { bottom: 50%; width: 6px; height: 6px; }
.game-arrow-dot:nth-child(4) { bottom: 75%; width: 5px; height: 5px; opacity: 0.4; }

/* Power bar while holding */
.game-power-bar {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 3px;
  overflow: hidden;
  z-index: 17;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.game-power-bar.active {
  opacity: 1;
}

.game-power-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00ff88, #ffff00, #ff4444);
  border-radius: 3px;
  transition: width 0.05s linear;
}

/* Ball kick - animated via JS for dynamic target */
.game-ball.kicking {
  pointer-events: none;
}

.game-ball.kicking img {
  transition: none;
}

/* Goal flash feedback */
.game-goal-flash {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  max-width: 340px;
  height: 200px;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-goal-flash.show {
  opacity: 1;
}

.goal-text {
  font-size: 48px;
  font-weight: 600;
  color: #00ff88;
  text-shadow:
    0 0 20px rgba(0, 255, 136, 0.8),
    0 0 40px rgba(0, 255, 136, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 6px;
  text-transform: uppercase;
  animation: goal-pop 0.5s ease-out;
}

.miss-text {
  font-size: 40px;
  font-weight: 600;
  color: #ff4444;
  text-shadow:
    0 0 20px rgba(255, 68, 68, 0.8),
    0 0 40px rgba(255, 68, 68, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: goal-pop 0.5s ease-out;
}

@keyframes goal-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Bottom HUD */
.game-bottom-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0;
  pointer-events: none;
}

.hud-kick-count,
.hud-timer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}

.hud-kick-count {
  width: 38%;
  max-width: 160px;
  aspect-ratio: 3.5 / 1;
  background-image: url('../images/bg_kick_left.png');
}

.hud-timer {
  width: 38%;
  max-width: 160px;
  aspect-ratio: 3.5 / 1;
  background-image: url('../images/bg_time_right.png');
}

.hud-kick-inner,
.hud-timer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 8px;
}

.hud-kick-inner img.hud-ball-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hud-kick-inner .kick-text,
.hud-timer-inner .timer-text {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hud-timer-inner .timer-icon {
  font-size: 20px;
}

/* Ball - centered between the two bottom HUD panels */
.game-ball {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  z-index: 18;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.15s ease;
  align-self: center;
  margin-bottom: 8px;
  /* iOS: disable long-press callout menu & selection */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* iOS: disable image save dialog on long-press */
  -webkit-tap-highlight-color: transparent;
}

.game-ball:active {
  transform: scale(0.9);
}

.game-ball img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  /* iOS: prevent image long-press save */
  -webkit-touch-callout: none;
  pointer-events: none;
}

.home-links {
  display: flex;
  justify-content: space-between;
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: min(calc(100vw - 32px), 343px);
  transform: translateX(-50%);
}

.home-link-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #BFBFBF;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
}

.home-link-btn::before {
  content: '\2022';
  display: inline-block;
  color: #BFBFBF;
  font-size: 18px;
  line-height: 1;
}

.home-link-btn span {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.rich-content-card {
  width: min(92vw, 380px);
  max-height: 62vh;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: 18px;
  padding: 0;
  color: #B1B1B1;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}

.rich-content-card * {
  line-height: 1.4;
}

.rich-content-card h1,
.rich-content-card h2,
.rich-content-card h3,
.rich-content-card p,
.rich-content-card ul,
.rich-content-card ol {
  margin-top: 0;
}

.rich-content-card ul,
.rich-content-card ol {
  padding-left: 20px;
}

.rich-content-card h1,
.rich-content-card h2,
.rich-content-card h3,
.rich-content-card h4,
.rich-content-card h5,
.rich-content-card h6 {
  color: #fff;
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.rich-content-card h1 {
  font-size: 26px;
}

.rich-content-card h2 {
  font-size: 22px;
}

.rich-content-card h3 {
  font-size: 18px;
}

.rich-content-card h4 {
  font-size: 16px;
}

.rich-content-card h5,
.rich-content-card h6 {
  font-size: 14px;
}

.rich-content-card p,
.rich-content-card li,
.rich-content-card a,
.rich-content-card span,
.rich-content-card div {
  font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  vertical-align: middle;
  color: #B1B1B1;
}

.rich-content-card h1 > div,
.rich-content-card h2 > div,
.rich-content-card h3 > div,
.rich-content-card h4 > div,
.rich-content-card h5 > div,
.rich-content-card h6 > div {
  color: #B1B1B1;
}

.single-gift-item {
  align-items: center;
}
