@media (min-width: 701px) {
  .login-card {
    width: 100%;
    max-width: 600px;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(0.75rem, 2.5vw, 1rem);
    padding-right: clamp(0.75rem, 2.5vw, 1rem);
  }
  .bundle-table-wrap {
    width: 100%;
    max-width: 600px;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(0.75rem, 2.5vw, 1rem);
    padding-right: clamp(0.75rem, 2.5vw, 1rem);
  }
  .medium-rectangle {
    width: 100%;
    max-width: 600px;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(0.75rem, 2.5vw, 1rem);
    padding-right: clamp(0.75rem, 2.5vw, 1rem);
  }
}
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

.background-static {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('background.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
}

/* Mobile & tablet fixes */
@media (max-width: 900px) {
  .background-static {
    background-attachment: scroll; /* FIX mobile bugs */
    height: calc(var(--vh, 1vh) * 100); /* Safe viewport height */
  }
}

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg-dark: #030711;
  --bg-card: rgba(3, 7, 17, 0.72);
  --bg-card-solid: #0c1427;
  --brand-emerald: #0fe0a6;
  --brand-blue: #3ec0ff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --border-soft: rgba(255, 255, 255, 0.16);
  --shadow-strong: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

/* Refined Voucher Modal */
.voucher-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  max-height: 100vh;
  overflow-y: auto;
}

.voucher-modal .voucher-card {
  margin-top: 4.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  pointer-events: auto;
  max-height: 90vh;
  overflow-y: auto;
}

.voucher-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-width: 320px;
  padding: 1.5rem 2rem;
  border-radius: 18px;
  background: #222c38;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}

.voucher-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 75% 20%, rgba(88, 160, 255, 0.25), transparent 55%);
  opacity: 0.65;
  z-index: 0;
}

.voucher-card > * {
  position: relative;
  z-index: 1;
}

.voucher-card__header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.voucher-card__title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.voucher-card__subtitle {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.voucher-card__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.8rem;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  margin-top: 0;
  padding: 0;
}

.voucher-card__close:hover,
.voucher-card__close:focus {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.voucher-card__status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.voucher-status__icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.voucher-status__copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.voucher-status__label {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.voucher-status__primary {
  font-size: 1.1rem;
  font-weight: 600;
}

.voucher-status__secondary {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.voucher-status__group {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.voucher-card__usage {
  position: relative;
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(18, 47, 84, 0.75) 0%, rgba(14, 34, 68, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.voucher-section__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  display: block;
  margin-bottom: 0.5rem;
}

.voucher-usage__row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.voucher-usage__primary {
  font-size: 1.4rem;
  font-weight: 600;
}

.voucher-usage__percent {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.voucher-usage__secondary,
.voucher-usage__total {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.voucher-usage__secondary {
  display: none;
}

.voucher-usage__bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.voucher-usage__bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ca1ff 0%, #6c5ce7 45%, #ff6b81 100%);
  transition: width 0.4s ease;
}

.voucher-card__meta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.voucher-card__meta-grid {
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.voucher-meta__label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.55);
}

.voucher-meta__value {
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.86);
}

.voucher-card__footer {
  position: relative;
  display: flex;
  justify-content: center;
}

.voucher-card__action {
  min-width: 140px;
  padding: 0.75rem 2.75rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 15px 40px rgba(255, 120, 160, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  margin-top: 0;
}

.voucher-card__action:hover,
.voucher-card__action:focus {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(255, 120, 160, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body.portal {
  min-height: 100%;
}

body.portal {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 16px;
  color: #fff;
  background: var(--bg-dark);
  overflow-x: hidden;
}

.background-gallery {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  background-attachment: fixed;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.4s ease, transform 6s ease;
}

.gallery-slide.active {
  opacity: 1;
  transform: scale(1);
}

.gallery-vignette {
  background: none; /* Remove fading effect at the bottom */
}

.page-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  backdrop-filter: blur(18px);
  background: rgba(3, 7, 17, 0.55);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.eyebrow {
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.headline {
  font-size: 1.15rem;
  font-weight: 600;
}

.media-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap; /* Allow wrapping on narrow screens */
  background: rgba(10, 20, 30, 0.12); /* Even more transparent lounge background */
  border-radius: 18px;
  padding: 0.5rem 1.2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

@media (max-width: 540px) {
  .media-controls {
    justify-content: center; /* Center controls on small screens */
    gap: 0.5rem; /* Reduce gap for smaller screens */
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem; /* Adjust spacing for narrow layouts */
  }
}

.ghost-button {
  border: 1px solid var(--border-soft);
  background: transparent;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.ghost-button:hover {
  border-color: #fff;
}

.icon-sound {
  width: 1rem;
  height: 1rem;
  background: linear-gradient(135deg, var(--brand-emerald), var(--brand-blue));
  border-radius: 4px;
}

.now-playing {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.now-playing .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

#track-title {
  font-weight: 600;
}

.grid-layout {
  flex: 1;
  min-height: 0; /* REQUIRED for scroll containment */

  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.7fr;
  gap: 1.25rem;
}

.experience-panel {
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.experience-panel h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
}

.experience-panel .lede {
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.feature-list li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-emerald), var(--brand-blue));
}

.stats {
  display: flex;
  gap: 2rem;
}

.stat {
  font-size: 2.4rem;
  font-weight: 600;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slide-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  width: fit-content;
}

.slide-indicator .divider {
  width: 1.5rem;
  height: 1px;
  background: var(--border-soft);
}

/* --- Universal fit and responsive panels --- */
.login-card {
  width: min(94vw, 360px);
  max-height: calc(var(--vh, 1vh) * 100 - 2rem);
  overflow-y: auto;
  margin: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2.5rem;
}

.ads-panel,
.experience-panel {
  width: 100%;
  max-width: 600px;
  margin: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem;
  box-sizing: border-box;
}

/* --- Responsive adjustments --- */
@media (max-width: 900px) {
  .login-card,
  .ads-panel,
  .experience-panel {
    max-width: 100%;
    width: 100%;
    padding: clamp(1rem, 4vw, 1.5rem);
    margin: 0 auto;
    border-radius: 16px;
  }
}

@media (max-width: 540px) {
  .login-card,
  .ads-panel,
  .experience-panel {
    max-width: 100%;
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    margin: 0 auto;
  }
  .login-card {
    max-height: calc(var(--vh, 1vh) * 100 - 1.5rem);
    width: 94vw;
  }
}


.status-hint {
  min-height: 1.6rem;
  color: #ff857a;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input,
.control {
  width: 100%;
}

.input {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(3, 7, 17, 0.5);
  color: #fff;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.input:focus {
  border-color: var(--brand-emerald);
  outline: none;
}

/* (Removed duplicate .ads-panel and .experience-panel blocks above) */
.sms-code .code-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.button {
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-emerald), var(--brand-blue));
  color: #030711;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  width: 100%;
  transition: transform 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.help-text {
  color: var(--text-muted);
  text-align: center;
}

.legacy-auth {
  display: none !important;
}

.ads-panel {
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ads-frame,
.expanded-campaign {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 0 auto;
  padding: 0;
  border: none !important;
  border-radius: 12px;
  background: transparent !important;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  height: auto;
}

@media (max-width: 700px) {
  .ads-frame,
  .expanded-campaign {
    max-width: 100%;
    border-radius: 10px;
  }
}

.ad-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.22, 0.68, 0, 1);
  will-change: transform;
}

/* --- Ad card fit --- */
.ad-card {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  aspect-ratio: 16/9;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  border: none !important;
  box-shadow: none !important;
}
@media (max-width: 900px) {
  .ad-card {
    aspect-ratio: 16/9;
    height: auto;
    min-height: 180px;
    max-height: 60vw;
    border-radius: 14px;
  }
}
@media (max-width: 540px) {
  .ad-card {
    aspect-ratio: 16/9;
    height: auto;
    min-height: 120px;
    max-height: 44vw;
    border-radius: 12px;
    border: none !important;
    box-shadow: none !important;
  }
}

.ad-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 7, 17, 0.05), rgba(3, 7, 17, 0.85));
}

.ad-content,
.ad-cta {
  position: relative;
  z-index: 1;
}

.ad-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.ad-title {
  font-size: 0.8rem; /* Reduce font size for filenames */
  font-weight: 600;
  text-align: center; /* Center the filename at the bottom */
  position: absolute;
  bottom: 0;
  width: 100%;
}

.ad-body {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ad-cta a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 0.2rem;
}

.ads-meta {
  margin-top: 1.25rem !important;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.04em;
  background: none;
  padding: 0;
}

.ad-indicator {
  font-size: 1rem;
  letter-spacing: 0.3em;
}

/* Form auth modal (retains legacy structure) */
#form-auth-msg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 29;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  padding: 5% 0;
  color: #212121;
  font-size: 14px;
}

#form-auth-outer {
  width: min(860px, 90%);
  max-height: 90vh;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 40px 5%;
  position: relative;
}

#form-auth-inner {
  width: 100%;
  max-height: 70vh;
  overflow: auto;
}

#form-auth-close {
  display: inline-block;
  cursor: pointer;
  background: url(./img/ModalIconClose.png) no-repeat center center;
  width: 20px;
  height: 20px;
  position: absolute;
  right: 10px;
  top: 10px;
}

#form-auth-header > div {
  line-height: 28px;
  margin-bottom: 12px;
}

#form-auth-title {
  font-size: 18px;
  font-weight: bold;
}

#form-auth-footer {
  text-align: left;
}

#form-auth-submit {
  color: #ffffff;
  height: 40px;
  display: inline-block;
  padding: 0 24px;
  text-decoration: none;
  background-color: #0dc901;
  text-align: center;
  font-size: 16px;
  line-height: 40px;
  border-radius: 6px;
}

#form-auth-content {
  text-align: left;
}

#form-auth-content .card-container {
  font-size: 14px;
  margin-bottom: 18px;
  position: relative;
}

#form-auth-content .card-container .card-index {
  font-size: 14px;
  font-weight: bold;
  line-height: 28px;
  position: absolute;
  top: 0;
  left: 0;
}

#form-auth-content .card-container .card-item-outer {
  padding-left: 28px;
}

#form-auth-content .title {
  font-weight: bold;
  line-height: 28px;
  margin-bottom: 12px;
}

#form-auth-content .choice-outer {
  line-height: 28px;
}

#form-auth-content .choice-item {
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
}

#form-auth-content .choice-input {
  margin: 0;
  width: 17px;
  height: 17px;
  vertical-align: middle;
  outline: none;
}

#form-auth-content .choice-item .text {
  display: inline-block;
  margin-left: 8px;
}

#form-auth-content .combobox,
#form-auth-content .input {
  outline: none;
  color: #5e5e5e;
  width: 240px;
  height: 28px;
}

#form-auth-content .combobox {
  cursor: pointer;
}

#form-auth-content .input {
  box-sizing: border-box;
}

#form-auth-content .hidden {
  display: none !important;
}

#form-auth-content .others-outer {
  margin-top: 8px;
}

#form-auth-content .required-outer,
#form-auth-content .validate-outer {
  margin-top: 15px;
  color: #ff2954;
}

#form-auth-content .score-outer {
  display: inline-block;
}

#form-auth-content .score-icon {
  cursor: pointer;
  display: inline-block;
  width: 36px;
  height: 36px;
  margin-right: 12px;
  background: url("./img/starGrey.png") no-repeat;
}

#form-auth-content .score-icon.active {
  background: url("./img/star.png") no-repeat;
}

#form-auth-content .score-tip {
  color: #f7b500;
  text-align: center;
  margin-top: 10px;
}

#form-auth-content .score-comment {
  margin-top: 12px;
}

#form-auth-content .comment-icon-outer {
  cursor: pointer;
  display: inline-block;
  margin-bottom: 12px;
  color: #aeb4b7;
}

#form-auth-content .comment-icon-outer .icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  background: url("./img/Edit.png") no-repeat;
}

#form-auth-content .comment-area {
  display: none;
}

#form-auth-content .score-comment.active .comment-icon-outer {
  color: #00a870;
}

#form-auth-content .score-comment.active .icon {
  background: url("./img/EditActive.png") no-repeat;
}

#form-auth-content .score-comment.active .comment-area {
  display: block;
  border-color: #00a870;
  resize: none;
  width: 100%;
  height: 100px;
  outline: none;
}

#policy-note {
  color: #363e4d;
  margin-top: 12px;
  display: inline-block;
  line-height: 21px;
}

#policy-note-link {
  color: #363e4d;
  display: inline-block;
  line-height: 21px;
  margin-bottom: 12px;
}

#policy-note-link .link {
  color: #0069cb;
  text-decoration: underline;
  cursor: pointer;
}

#form-auth-outer.mobile {
  width: 90%;
  padding: 40px 5% 40px 10%;
}

#form-auth-outer.mobile .card-item-outer {
  padding-left: 0;
}

#form-auth-outer.mobile .card-item-outer .title {
  margin-left: 15px;
}

#form-auth-outer.mobile .card-item-outer .combobox,
#form-auth-outer.mobile .card-item-outer .input,
#form-auth-outer.mobile .card-item-outer .score-outer,
#form-auth-outer.mobile #form-auth-submit {
  width: 90%;
}

#form-auth-outer.mobile .card-item-outer .score-wrapper {
  display: flex;
  margin-right: 0;
  justify-content: space-between;
}

#form-auth-outer.mobile .card-item-outer .score-wrapper .score-icon {
  margin-right: 0;
}

#form-auth-outer.mobile #form-auth-submit {
  padding: 0;
}

@media (max-width: 1200px) {
  .grid-layout {
    grid-template-columns: repeat(2, 1fr);
  }

  .ads-panel {
    min-height: 400px;
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding-top: 1.5rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .experience-panel,
  .login-card,
  .ads-panel {
    padding: 1.75rem;
  }

  .sms-input {
    grid-template-columns: auto 1fr;
  }
}


/* FINAL universal fit fix */
.login-card {
  width: min(94vw, 360px);
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  margin: auto;
}

/* Small phones */
@media (max-width: 540px) {
  .login-card {
    width: 94vw;
    max-height: calc(100svh - 1.5rem);
    padding: 1rem;
  }
}

/* === PATCH: Mobile auto-fit within background === */

/* 1) Background & page shell use SAFE viewport units (svh/svw) */
.background-static {
  width: 100svw;
  height: 100svh;
  background-attachment: scroll; /* avoid iOS fixed-attachment bugs */
}

.page-shell {
  min-height: 100svh;            /* match background height */
  overflow: clip;                 /* prevent outer page scroll on mobile */
  padding: clamp(1rem, 4vw, 2.5rem)
           clamp(1rem, 4vw, 4rem)
           clamp(1.25rem, 5vw, 3rem);
  gap: clamp(0.75rem, 2.5vw, 2rem);
}

/* Fallback for browsers that don't support svh/svw */
@supports not (height: 100svh) {
  .background-static { width: 100vw; height: calc(var(--vh, 1vh) * 100); }
  .page-shell       { min-height: calc(var(--vh, 1vh) * 100); }
}

/* 2) Panels auto-fit inside background and scroll internally if needed */
.login-card,
.ads-panel,
.experience-panel {
  width: min(94svw, 600px);
  max-height: calc(100svh - 2rem);
  overflow: auto;
  margin: auto;
  padding: clamp(1rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  gap: 1.25rem;
  box-sizing: border-box;
}

@media (max-width: 540px) {
  .login-card,
  .ads-panel,
  .experience-panel {
    width: 94svw;
    max-height: calc(100svh - 1.25rem);
    padding: 1rem;
    border-radius: 14px;
    gap: 1rem;
  }
}

/* 3) Grid collapses cleanly & spacing tightens on small screens */
@media (max-width: 1200px) {
  .grid-layout { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .grid-layout { grid-template-columns: 1fr; gap: 1rem; }
  .top-bar     { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* 4) Headings scale down slightly to prevent overflow */
.experience-panel h1 {
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  line-height: 1.18;
}

/* 5) Ads/media respect the viewport and aspect ratios */
.ads-frame,
.expanded-campaign {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-card {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 60svh;
  border-radius: 16px;
}

@media (max-width: 540px) {
  .ad-card { max-height: 44svh; border-radius: 12px; }
}

/* Media always scales down within containers */
img,
video { max-width: 100%; height: auto; }

/* 6) Small font & line-length tweaks to reduce vertical bloat */
body.portal { font-size: clamp(14px, 1.8vw, 16px); }
.experience-panel .lede,
.feature-list li,
.help-text { max-width: 68ch; }

/* === PATCH: Bundles table (matches portal style & auto-fits on mobile) === */

.bundle-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(0.75rem, 2.5vw, 1rem);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(3, 7, 17, 0.45);              /* translucent card */
  backdrop-filter: blur(12px);
}

.bundle-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-inline: 0.25rem;
}

.bundle-title {
  font-size: clamp(1rem, 2.8vw, 1.1rem);
  font-weight: 600;
}

.bundle-scroll {
  /* Keeps the table inside the login card; scrolls internally if tall */
  max-height: clamp(220px, 40svh, 420px);
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

/* Table base */
.bundle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  line-height: 1.35;
  background: transparent;
}

/* Sticky header with subtle backdrop */
.bundle-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  background:
    linear-gradient(135deg, rgba(15, 224, 166, 0.18), rgba(62, 192, 255, 0.18)),
    rgba(3, 7, 17, 0.65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

/* Body cells */
.bundle-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* Zebra & hover */
.bundle-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.04);
}

.bundle-table tbody tr:hover td {
  background: rgba(62, 192, 255, 0.10);
  color: #fff;
}

/* Compact spacing on very small screens */
@media (max-width: 540px) {
  .bundle-table-wrap { border-radius: 12px; padding: 0.75rem; }
  .bundle-scroll     { max-height: clamp(200px, 44svh, 360px); border-radius: 10px; }
  .bundle-table thead th { padding: 0.5rem 0.6rem; }
  .bundle-table tbody td { padding: 0.45rem 0.6rem; }
}

/* Optional: subtle left accent to echo your gradient borders */
.bundle-table-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  /* glow edge on the left side only */
  box-shadow: -2px 0 0 rgba(62,192,255,0.25);
}

.audio-btn-min {
  padding: 0.4rem 0.7rem;
  font-size: 1.1em;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-btn-min:hover {
  border-color: var(--brand-emerald);
  background: rgba(15, 224, 166, 0.98) !important;
  color: #030711;
}

.audio-btn-group {
  margin-bottom: 0.25rem;
}

/* Ensure scrollable panels also use smooth scrolling */
.login-card,
.ads-panel,
.experience-panel {
  scroll-behavior: smooth;
}

/* Remove internal scroll from bundle table */
.bundle-scroll-no-scroll {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

/* Ensure medium-rectangle is always below bundle table with clear margin */
.medium-rectangle {
  width: 100%;
  max-width: 480px;
  height: 320px;
  margin: 32px auto 0 auto;
  border: 1px solid #ccc;
  overflow: hidden;
  position: relative;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  z-index: 1;
  clear: both;
}

@media (max-width: 700px) {
  .medium-rectangle {
    max-width: 100%;
    height: 180px;
  }
}

@media (min-width: 1101px) {
  .main-center-group > .medium-rectangle {
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
  }
}

.login-card {
  padding: 0; /* Remove padding to expand image frame */
  justify-content: space-between; /* Ensure content stretches to fill the card */
  background-color: #000; /* Enhance light and view quality */
  filter: brightness(1.2); /* Increase brightness */
}

/* Styles for the 300x250 Medium Rectangle component */
.medium-rectangle {
  width: 100%;
  max-width: 480px;
  height: 350px;
  margin: 32px auto 16px auto;
  border: 1px solid #ccc;
  overflow: hidden;
  position: relative;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  z-index: 1;
  clear: both;
}

@media (max-width: 700px) {
  .medium-rectangle {
    max-width: 100%;
    height: 220px;
  }
}

@media (min-width: 1101px) {
  .main-center-group > .medium-rectangle {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
  }
}

/* Restore login-card and main-center-group layout */
.login-card {
  width: min(94svw, 600px);
  max-width: 600px;
  margin: 0 auto 2rem auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px #0002;
  padding: clamp(1rem, 4vw, 2.5rem);
  z-index: 2;
}

.main-center-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  flex: 1 1 480px;
  min-width: 340px;
  max-width: 600px;
}

.bundle-table-wrap {
  margin-top: 2.5rem;
}

.medium-rectangle {
  margin-top: 2.5rem;
}

@media (max-width: 600px) {
  .voucher-modal {
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }

  .voucher-card {
    width: 90%;
    max-width: 320px;
    padding: 1rem;
    font-size: 0.85rem;
  }

  .voucher-card__title {
    font-size: 1rem;
  }

  .voucher-card__subtitle {
    font-size: 0.9rem;
  }

  .voucher-card__status,
  .voucher-card__usage,
  .voucher-card__meta {
    margin-bottom: 0.75rem;
  }

  .voucher-usage__row {
    font-size: 0.85rem;
  }

  .voucher-usage__bar {
    height: 6px;
  }

  .voucher-card__meta-grid {
    gap: 0.25rem;
  }
}
