/* Brand tab (mirrors the logo tab at the top of the game screens) */
.brand-tab {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .brand-tab {
    padding-inline: 32px;
  }
}

.brand-tab__inner {
  padding: 12px 26px 14px;
  background: #fff;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-tab__inner img {
  height: 44px;
  width: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:focus-visible,
.style-option:focus-visible,
.dropzone:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-coral {
  background: var(--coral);
  box-shadow: 0 10px 26px rgba(255, 70, 94, 0.35);
}

.btn-coral:hover:not(:disabled) {
  background: var(--coral-dark);
}

.btn-blue {
  background: var(--blue);
  box-shadow: 0 10px 26px rgba(52, 103, 255, 0.3);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.2rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  margin-top: 8px;
}

.hero__layout {
  max-width: 820px;
  margin-inline: auto;
}

.hero__copy {
  text-align: center;
}

.hero__greeting {
  margin: 0 0 4px;
  font-size: calc(1.09rem * 1.2);
  color: var(--text-muted);
}

.hero__kicker {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.25rem);
}

.hero__title-row {
  --hero-title-size: clamp(2.65rem, 11vw, 5rem);
  /* GIF has large transparent margins — scale so the character matches the title block */
  --hero-figure-height: calc(4.35 * var(--hero-title-size));
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  width: 100%;
  margin-top: 4px;
  overflow: visible;
}

.hero__title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: var(--hero-title-size);
  line-height: 1.05;
  font-weight: 400;
  text-align: center;
  background: linear-gradient(180deg, #fff3b8 0%, var(--gold) 55%, #f39a12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #8f4a06) drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.greeting__name {
  color: var(--cyan);
}

.hero__figure {
  position: absolute;
  bottom: 0;
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
  align-self: end;
  width: auto;
  max-width: none;
  height: var(--hero-figure-height);
  margin-bottom: 0;
  margin-inline-start: -0.12em;
  object-fit: contain;
  object-position: 100% 100%;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  user-select: none;
}

@media (max-width: 639px) {
  .hero__figure {
    display: none;
  }
}

@media (min-width: 640px) {
  .hero__title-row {
    --hero-title-size: clamp(3.25rem, 5.5vw, 5.25rem);
  }

  .hero__title {
    text-align: center;
  }
}

/* Package usage (secondary — bottom of share step) */
.game-meta {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.game-meta__summary {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.game-meta__summary [data-plays-count],
.game-meta__summary [data-games-remaining] {
  color: var(--text);
  font-weight: 400;
}

.game-meta__bar {
  max-width: 280px;
  margin-inline: auto;
}

.game-meta__hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.usage__track {
  height: 6px;
  overflow: hidden;
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
}

.usage__fill {
  height: 100%;
  width: 0;
  background: var(--ring-cyan);
  border-radius: inherit;
  transition: width 0.6s ease;
}

/* Panels */
.panel {
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.panel__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.step-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 6px 16px rgba(255, 70, 94, 0.35);
}

.panel__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.3;
}

.panel__desc {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .panel {
    padding: 22px 28px;
  }

  .panel__title {
    font-size: 1.4rem;
  }
}

/* Logo step */
.logo-step {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .logo-step {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 28px;
  }
}

.logo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 100%, rgba(14, 107, 162, 0.45), transparent 70%),
    var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.game-tab {
  width: min(280px, 82%);
  padding: 14px 18px 18px;
  background: linear-gradient(180deg, var(--tab), var(--tab-bottom));
  border-radius: 0 0 22px 22px;
}

.logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  padding: 8px;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 6px;
}

.logo-slot.has-logo {
  border-color: transparent;
}

.logo-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-slot__placeholder {
  text-align: center;
  line-height: 1.25;
}

.logo-slot__placeholder small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.logo-slot__placeholder span {
  font-size: 1.35rem;
}

.logo-stage__caption {
  margin: 16px 16px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.logo-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dropzone {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 16px;
  text-align: center;
  border: 2px dashed rgba(29, 188, 252, 0.45);
  border-radius: var(--radius-md);
  background: rgba(29, 188, 252, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
body.is-logo-uploading {
  overflow: hidden;
}

.dropzone.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.dropzone.is-dragover {
  border-color: var(--cyan);
  background: rgba(29, 188, 252, 0.1);
}

.dropzone__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--ring-cyan);
}

.dropzone__icon svg {
  width: 26px;
  height: 26px;
}

.dropzone__text {
  margin: 0;
  font-size: 1.1rem;
}

.dropzone__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.logo-status {
  min-height: 1.6em;
  margin: 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--text-muted);
}

.logo-status--success {
  color: var(--cyan);
}

.logo-status--error {
  color: var(--danger);
}

/* Style step */
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
  margin-inline: auto;
}

@media (min-width: 768px) {
  .style-grid {
    max-width: 640px;
    gap: 48px;
  }
}

.style-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0;
  color: var(--text);
  text-align: center;
  background: none;
  border: none;
  border-radius: 24px;
  cursor: pointer;
}

.phone {
  position: relative;
  width: 100%;
  padding: 5px;
  background: var(--surface-raised);
  border-radius: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.style-option:hover .phone {
  transform: translateY(-4px);
}

.style-option[aria-selected="true"] .phone {
  background: var(--ring-cyan);
  box-shadow: 0 0 40px rgba(29, 188, 252, 0.35);
}

.style-option[data-style-id="style-b"][aria-selected="true"] .phone {
  background: var(--ring-gold);
  box-shadow: 0 0 40px rgba(254, 199, 53, 0.3);
}

.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 21px;
}

.phone__screen > img {
  width: 100%;
  height: auto;
  transition: opacity 0.2s ease;
}

.style-option[aria-selected="false"] .phone__screen > img {
  opacity: 0.7;
}

/* Positioned over the dashed "your logo here" box baked into the preview images */
.phone__logo {
  position: absolute;
  top: 0.8%;
  left: 32.8%;
  width: 34.7%;
  height: 7.7%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2%;
  background: linear-gradient(180deg, var(--tab), #3f4560);
}

.phone__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.phone__check {
  position: absolute;
  top: -10px;
  inset-inline-start: -10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.phone__check svg {
  width: 20px;
  height: 20px;
}

.style-option[aria-selected="true"] .phone__check {
  display: flex;
}

.style-option__name {
  font-size: clamp(1rem, 3.4vw, 1.25rem);
  line-height: 1.3;
}

.style-option__state {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.style-option[aria-selected="true"] .style-option__state {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}

.style-option[data-style-id="style-b"][aria-selected="true"] .style-option__state {
  background: var(--gold);
  border-color: var(--gold);
}

/* Share step */
.share {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin-inline: auto;
}

.share-link {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.share-link input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  color: var(--text-muted);
  background: none;
  border: none;
  outline: none;
  direction: ltr;
  text-align: left;
}

.share-link .btn {
  padding: 10px 22px;
  font-size: 1rem;
  box-shadow: none;
}

/* Notice states */
.notice {
  max-width: 520px;
  margin: 48px auto 0;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.notice__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  padding: 4px;
  border-radius: 50%;
  background: var(--ring-cyan);
}

.notice--error .notice__icon {
  background: linear-gradient(160deg, #ff8a9a, var(--coral));
}

.notice__icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg);
}

.notice__icon svg {
  width: 40px;
  height: 40px;
}

.notice__title {
  margin: 0 0 10px;
  font-size: 1.7rem;
  font-weight: 400;
}

.notice__text {
  margin: 0;
  color: var(--text-muted);
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 96px 0;
  color: var(--text-muted);
}

.spinner {
  width: 60px;
  height: 60px;
  border: 5px solid var(--surface-raised);
  border-top-color: var(--cyan);
  border-inline-end-color: var(--violet);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-busy {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 5, 37, 0.72);
  backdrop-filter: blur(4px);
}

.page-busy__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 280px;
  padding: 28px 32px;
  border-radius: 20px;
  background: var(--surface-raised, rgba(30, 28, 68, 0.95));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.page-busy__text {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  padding: 12px 26px;
  background: var(--surface-raised);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
