/* CocoHub — underwater UI theme */
:root {
  --ocean-deep: #042535;
  --ocean-mid: #063d5c;
  --ocean-light: #2ec4b6;
  --sand: #fde68a;
  --sand-dark: #d4a574;
  --palm: #1b7a5c;
  --palm-light: #2ec4b6;
  --coconut: #78350f;
  --coconut-shell: #d4a574;
  --coral: #ff6b9d;
  --coral-bright: #ff8c42;
  --sunset: #fbbf24;
  --foam: rgba(220, 250, 255, 0.92);
  --bg: #021018;
  --surface: rgba(4, 37, 53, 0.78);
  --surface-strong: rgba(2, 16, 24, 0.88);
  --surface-card: rgba(255, 255, 255, 0.08);
  --border: rgba(120, 220, 255, 0.16);
  --text: #e8fbff;
  --text-soft: #94d4e8;
  --text-muted: #5eb8d4;
  --accent: #fbbf24;
  --accent-strong: #ff8c42;
  --accent-rgb: 251, 191, 36;
  --green: #4ade80;
  --red: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Nunito", system-ui, sans-serif;
  --font-display: "Pacifico", cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.is-dialog-open { overflow: hidden; }

.app-shell {
  position: relative;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* —— Layout chrome —— */
.topbar, .content, .bottom-nav, .mirror-domains-bar {
  position: relative;
  z-index: 2;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(2, 16, 24, 0.92), rgba(4, 37, 53, 0.75));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  overflow: visible;
  z-index: 30;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-lockup__logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 14px;
  animation: logo-bob 3s ease-in-out infinite;
  overflow: hidden;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.brand-lockup__logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
@keyframes logo-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.brand-lockup__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--sand);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.brand-lockup__tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.notifications-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-card);
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .notifications-bell:hover {
    transform: scale(1.08) rotate(-8deg);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.2);
  }
}
.notifications-bell:active { transform: scale(0.92); transition-duration: 0.08s; }
.notifications-bell__dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}
.balance-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.15));
  color: var(--text);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .balance-pill:hover {
    transform: translateY(-2px) scale(1.04);
    border-color: rgba(251, 191, 36, 0.75);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.28);
  }
  .balance-pill:hover .balance-plus { animation: btn-icon-wiggle 0.4s ease; }
}
.balance-pill:active { transform: scale(0.94); transition-duration: 0.08s; }
.balance-plus { color: var(--accent); font-size: 1.1rem; display: inline-block; }
.app-lang-switcher {
  position: relative;
  z-index: 40;
}

@media (max-width: 520px) {
  .topbar {
    gap: 6px;
    padding: 10px 10px;
    flex-wrap: nowrap;
  }

  .brand-lockup {
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-lockup__logo {
    width: 34px;
    height: 34px;
    font-size: 1.15rem;
    border-radius: 10px;
  }

  .brand-lockup__title {
    font-size: 1.08rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 30vw;
  }

  .topbar-actions {
    gap: 5px;
    flex: 0 0 auto;
  }

  .notifications-bell {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 0.96rem;
  }

  .balance-pill {
    gap: 3px;
    padding: 6px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .balance-plus {
    font-size: 0.95rem;
  }
}

.content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.panel { display: none; animation: panel-in 0.35s ease; }
.panel.is-active { display: block; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 16px;
  text-align: center;
}
.loading-screen.is-hidden { display: none; }
.seo-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 400;
  color: var(--sand);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.seo-hero__text {
  margin: 0;
  max-width: 28rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.loading-coconut { position: relative; width: 80px; height: 80px; }
.loading-coconut__shell { font-size: 3rem; display: block; animation: logo-bob 1.2s ease-in-out infinite; }
.loading-coconut__ring {
  position: absolute;
  inset: -8px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--ocean-light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Home */
.home-hero {
  text-align: center;
  margin-bottom: 20px;
  padding: 12px;
}
.home-hero__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--sand);
  margin: 0 0 8px;
}
.home-hero__text { margin: 0; color: var(--text-soft); font-size: 0.9rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.home-card {
  position: relative;
  border: none;
  border-radius: var(--radius);
  padding: 18px 14px;
  min-height: 110px;
  text-align: left;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.22s ease, filter 0.22s ease;
  animation: home-card-in 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.home-card:nth-child(1) { animation-delay: 0.04s; }
.home-card:nth-child(2) { animation-delay: 0.1s; }
.home-card:nth-child(3) { animation-delay: 0.16s; }
.home-card:nth-child(4) { animation-delay: 0.22s; }
.home-card:nth-child(5) { animation-delay: 0.28s; }
.home-card:nth-child(6) { animation-delay: 0.34s; }
.home-card:nth-child(7) { animation-delay: 0.4s; }
.home-card:nth-child(8) { animation-delay: 0.46s; }
@keyframes home-card-in {
  0% { opacity: 0; transform: translateY(26px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.home-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 0.6s ease;
  z-index: 1;
}
@media (hover: hover) {
  .home-card:not(.is-disabled):hover::before { left: 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .home-card { animation: none !important; }
  .home-card::before { display: none; }
}
.home-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.home-card__icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  display: inline-block;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform 0.25s cubic-bezier(0.34, 1.5, 0.64, 1);
}
@media (hover: hover) {
  .home-card:not(.is-disabled):hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
    filter: brightness(1.06);
  }
  .home-card:not(.is-disabled):hover .home-card__icon {
    transform: scale(1.15) rotate(-6deg);
    animation: btn-icon-wiggle 0.45s ease;
  }
  .home-card:not(.is-disabled):hover::after { opacity: 0.85; }
}
.home-card:active:not(.is-disabled) {
  transform: translateY(-1px) scale(0.96);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  transition-duration: 0.08s;
}
.home-card__title { font-size: 0.95rem; font-weight: 800; margin: 0; }
.home-card__hint { font-size: 0.72rem; opacity: 0.9; margin-top: 4px; }
.home-card--ocean { background: linear-gradient(145deg, #0ea5e9, #0369a1); }
.home-card--palm { background: linear-gradient(145deg, #2ec4b6, #0d9488); }
.home-card--coral { background: linear-gradient(145deg, #ff6b9d, #c026d3); }
.home-card--sand { background: linear-gradient(145deg, #fbbf24, #d97706); color: #422006; }
.home-card--violet { background: linear-gradient(145deg, #818cf8, #4f46e5); }
.home-card--crimson { background: linear-gradient(145deg, #38bdf8, #0284c7); }
.home-card--reef { background: linear-gradient(145deg, #22c55e, #15803d); }
.home-card.is-disabled { opacity: 0.45; pointer-events: none; }

/* Panels */
.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head--compact { justify-content: center; text-align: center; }
.panel-head--center .panel-head > div { text-align: center; }
.panel-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.panel-title { margin: 4px 0 0; font-size: 1.35rem; font-weight: 800; }
.back-button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  will-change: transform;
  -webkit-font-smoothing: antialiased;
}
}
.back-button__icon {
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.22s ease;
}
.back-button--round {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 12px;
}
.back-button--round span:not(.back-button__icon) { display: none; }
@media (hover: hover) {
  .back-button:hover {
    transform: translateX(-3px);
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 6px 18px rgba(34, 211, 238, 0.18);
    background: rgba(12, 74, 110, 0.55);
  }
  .back-button:hover .back-button__icon { transform: translateX(-4px); }
}
.back-button:active {
  transform: scale(0.93) translateX(-1px);
  transition-duration: 0.08s;
}

.section-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.section-card__title { font-weight: 800; margin-bottom: 8px; }
.section-card__text { font-size: 0.88rem; color: var(--text-soft); margin-bottom: 12px; }
.section-card a { color: var(--accent); font-weight: 700; text-decoration: none; }
.exchange-text { white-space: pre-line; }

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}
.primary-button {
  background: linear-gradient(135deg, var(--sunset), var(--coral));
  color: #422006;
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}
.secondary-button {
  background: var(--surface-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.primary-button--wide { width: 100%; }
.primary-button:disabled, .secondary-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
@media (hover: hover) {
  .primary-button:not(:disabled):hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 28px rgba(249, 115, 22, 0.5);
    filter: brightness(1.05);
  }
  .secondary-button:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }
}
.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active {
  transform: scale(0.96);
  transition-duration: 0.08s;
}

/* Catalog */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}
.category-tab {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
@media (hover: hover) {
  .category-tab:not(.is-active):hover {
    transform: translateY(-2px);
    border-color: rgba(34, 211, 238, 0.35);
  }
  .category-tab.is-active:hover { transform: translateY(-2px) scale(1.03); }
}
.category-tab:active { transform: scale(0.94); transition-duration: 0.08s; }
.category-tab.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.3), rgba(251, 191, 36, 0.2));
  border-color: var(--ocean-light);
  color: var(--foam);
}
.catalog-list { display: flex; flex-direction: column; gap: 10px; }
.product-card, .task-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  cursor: pointer;
  text-align: left;
  color: inherit;
  width: 100%;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .product-card:hover, .task-card:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  }
}
.product-card:active, .task-card:active { transform: scale(0.98); transition-duration: 0.08s; }
.product-card__media {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.product-card__body { flex: 1; min-width: 0; }
.product-card__name { font-weight: 800; margin-bottom: 4px; }
.product-card__desc { font-size: 0.82rem; color: var(--text-soft); margin-bottom: 8px; }
.product-card__price { font-weight: 800; color: var(--accent); }
.task-card__hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 0.95;
}
.product-detail {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.product-detail__media {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px solid var(--border);
}
.product-detail__price { font-size: 1.4rem; font-weight: 800; color: var(--accent); margin: 12px 0; }
.product-detail__meta { font-size: 0.84rem; color: var(--text-soft); margin-top: -6px; margin-bottom: 12px; }
.product-preview-carousel { position: relative; margin: 12px 0; }
.product-preview-carousel .product-detail__media { margin: 0; }
.product-preview-carousel__image {
  user-select: none;
  -webkit-user-drag: none;
  position: relative;
  z-index: 1;
}
.product-preview-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(2, 16, 24, 0.72);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}
.product-preview-carousel__nav[data-preview-prev] { left: 8px; }
.product-preview-carousel__nav[data-preview-next] { right: 8px; }
.product-preview-carousel__counter {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(2, 16, 24, 0.72);
  font-size: 0.75rem;
  color: var(--text-soft);
  z-index: 2;
  pointer-events: none;
}

/* Video */
.video-screen__intro { margin-bottom: 16px; text-align: center; }
.video-screen__title { font-weight: 800; font-size: 1.1rem; }
.video-screen__text { font-size: 0.85rem; color: var(--text-soft); margin-top: 6px; }
.video-screen #videoQuickWatchButton { margin-bottom: 12px; }
.video-category-list { display: flex; flex-direction: column; gap: 10px; }
.category-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(12, 74, 110, 0.8), rgba(22, 101, 52, 0.35));
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .category-chip:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  }
  .category-chip:hover span:last-child { animation: btn-icon-wiggle 0.45s ease; }
}
.category-chip:active { transform: scale(0.97); transition-duration: 0.08s; }
.category-chip__name { font-weight: 800; }
.category-chip__meta { font-size: 0.82rem; color: var(--accent); margin-top: 4px; }
.media-card {
  background: var(--surface-strong);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.media-card__frame {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}
.media-card__frame video {
  width: 100%;
  max-height: min(70dvh, 640px);
  height: auto;
  display: block;
  background: #000;
  object-fit: contain;
}
.video-placeholder {
  padding: 40px 20px;
  text-align: center;
}
.video-placeholder__icon { font-size: 3rem; margin-bottom: 12px; animation: logo-bob 2s ease-in-out infinite; }
.video-actions { display: flex; flex-direction: column; gap: 10px; }
.is-hidden { display: none !important; }

/* Casino */
.casino-card {
  background: linear-gradient(160deg, rgba(120, 53, 15, 0.5), rgba(8, 47, 73, 0.9));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  text-align: center;
}
.casino-reels {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.casino-reel {
  width: 64px;
  height: 80px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  background: var(--foam);
  color: var(--ocean-deep);
  border-radius: 12px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.1);
}
.casino-reel.is-spinning { animation: reel-shake 0.1s linear infinite; }
@keyframes reel-shake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.casino-bets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.casino-bet {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-card);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
@media (hover: hover) {
  .casino-bet:not(.is-active):hover {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.45);
  }
  .casino-bet.is-active:hover { transform: scale(1.05); }
}
.casino-bet:active { transform: scale(0.92); transition-duration: 0.08s; }
.casino-bet.is-active {
  border-color: var(--accent);
  background: rgba(251, 191, 36, 0.25);
}
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* Chat */
.panel--chat { padding: 0 !important; margin: -16px; }
.chat-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 140px);
  background: var(--surface-strong);
}
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-icon-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: var(--surface-card);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-peer { display: flex; align-items: center; gap: 10px; flex: 1; }
.chat-peer__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--palm-light), var(--ocean-mid));
  display: grid;
  place-items: center;
}
.chat-peer__name { font-weight: 800; font-size: 0.9rem; }
.chat-peer__status { font-size: 0.75rem; color: var(--text-muted); }
.chat-thread {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.chat-bubble--own {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--ocean-mid), var(--palm));
  border-bottom-right-radius: 4px;
}
.chat-bubble--peer {
  align-self: flex-start;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.chat-composer input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  color: var(--text);
  font-family: inherit;
}
.chat-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  color: #422006;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.2s ease;
}
@media (hover: hover) {
  .chat-send-btn:hover {
    transform: scale(1.1) rotate(8deg);
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.45);
  }
}
.chat-send-btn:active { transform: scale(0.9); transition-duration: 0.08s; }

/* Referral & profile */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat-card__value { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.stat-card__label { font-size: 0.75rem; color: var(--text-soft); margin-top: 4px; }
.referral-link {
  word-break: break-all;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.profile-avatar-wrap { margin-bottom: 12px; }
.profile-avatar-fallback {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sand), var(--coconut-shell));
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--coconut);
}
.profile-card__name { font-size: 1.2rem; font-weight: 800; }
.profile-card__username { color: var(--text-muted); font-size: 0.9rem; }
.profile-menu { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  will-change: transform;
  contain: layout style paint;
  -webkit-font-smoothing: antialiased;
}
@media (hover: hover) {
  .menu-item:hover {
    transform: translateX(6px);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: rgba(12, 74, 110, 0.45);
  }
}
.menu-item:active { transform: scale(0.97) translateX(2px); transition-duration: 0.08s; }

/* Topup */
.topup-promo-button { margin-top: 10px; }
.promo-card { margin-top: 4px; }
.promo-input {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(2, 16, 24, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.promo-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.18);
}
.pack-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.pack-card {
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
@media (hover: hover) {
  .pack-card:not(.is-active):hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.4);
  }
  .pack-card.is-active:hover { transform: scale(1.04); }
}
.pack-card:active { transform: scale(0.94); transition-duration: 0.08s; }
.pack-card.is-active { border-color: var(--accent); background: rgba(251, 191, 36, 0.15); }
.pack-card__amount { font-size: 1.2rem; font-weight: 800; }
.amount-input { display: block; margin-bottom: 14px; }
.amount-input__field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
}
.amount-input__field input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}
.payment-method {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .payment-method:hover {
    transform: translateX(4px);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  }
}
.payment-method:active { transform: scale(0.98); transition-duration: 0.08s; }
.payment-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.clone-bots-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.clone-bots-title { margin: 0 0 6px; font-size: 1.1rem; }
.clone-bots-subtitle { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-soft); }
.clone-bots-hint {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.video-soon {
  text-align: center;
  padding: 28px 18px;
}
.video-soon .video-placeholder__icon {
  margin-bottom: 10px;
}
.clone-bots-create-btn {
  width: 100%;
  padding: 14px;
  border: 2px dashed rgba(251, 191, 36, 0.5);
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.08);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
@media (hover: hover) {
  .clone-bots-create-btn:hover {
    transform: translateY(-2px);
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.75);
  }
}
.clone-bots-create-btn:active { transform: scale(0.97); transition-duration: 0.08s; }
.clone-bots-create-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.clone-bot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 10px;
  background: var(--surface-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(2, 16, 24, 0.96), rgba(4, 37, 53, 0.85));
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.bottom-nav.is-hidden { display: none; }
.nav-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  position: relative;
  z-index: 1;
  transition: transform 0.22s cubic-bezier(0.34, 1.5, 0.64, 1), color 0.2s ease;
}
@media (hover: hover) {
  .nav-button:hover {
    transform: translateY(-4px);
    color: var(--text-soft);
  }
  .nav-button:hover .nav-icon { animation: btn-icon-wiggle 0.45s ease; }
  .nav-button.is-active:hover { color: var(--accent); }
}
.nav-button:active { transform: scale(0.9) translateY(0); transition-duration: 0.08s; }
.nav-button.is-active { color: var(--accent); }
.nav-icon {
  font-size: 1.35rem;
  display: inline-block;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform 0.2s ease;
}

.btn-emoji,
.menu-item,
.notifications-bell__icon,
.video-placeholder__icon {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.nav-label { font-size: 0.68rem; font-weight: 700; }
.nav-indicator {
  position: absolute;
  bottom: 6px;
  height: 3px;
  width: 48px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ocean-light), var(--accent));
  transition: left 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.mirror-domains-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 0.78rem;
  overflow: hidden;
}
.mirror-domains-bar__track { display: flex; gap: 16px; animation: marquee 20s linear infinite; white-space: nowrap; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.mirror-domains-bar__copy {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: transform 0.18s ease, background 0.18s ease;
}
@media (hover: hover) {
  .mirror-domains-bar__copy:hover {
    transform: scale(1.12);
    background: rgba(251, 191, 36, 0.12);
  }
}
.mirror-domains-bar__copy:active { transform: scale(0.9); }

@keyframes btn-icon-wiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-10deg) scale(1.12); }
  75% { transform: rotate(10deg) scale(1.12); }
}

.toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: 90%;
  padding: 12px 20px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }

.task-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(2, 16, 24, 0.66);
  backdrop-filter: blur(6px);
}
.task-dialog__card {
  width: min(560px, 100%);
  max-height: min(78dvh, 720px);
  overflow: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.task-dialog__title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.task-dialog__text {
  white-space: pre-wrap;
  line-height: 1.45;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.task-dialog__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.is-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

@media (min-width: 521px) {
  .app-shell { box-shadow: 0 0 60px rgba(0,0,0,0.4); }
}

/* ===== Desktop Layout (same UX, larger spacing) ===== */
@media (min-width: 768px) {
  :root {
    --spacing-base: 20px;
  }

  .app-shell {
    max-width: 980px;
    min-height: 100dvh;
    margin: 0 auto;
    border-left: 1px solid rgba(120, 220, 255, 0.1);
    border-right: 1px solid rgba(120, 220, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  }

  .topbar {
    padding: 14px 22px;
  }

  .content {
    padding: 22px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .brand-lockup__title { font-size: 1.55rem; }
  .home-hero__title { font-size: 1.75rem; }
  .panel-title { font-size: 1.55rem; }

  .home-card,
  .product-card,
  .task-card {
    padding: 18px;
  }

  .menu-item {
    padding: 16px 18px;
    font-size: 0.95rem;
  }

  .category-tab {
    padding: 10px 16px;
    font-size: 0.92rem;
  }

  .pack-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .payment-methods-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}

@media (min-width: 1100px) {
  .app-shell {
    max-width: 1120px;
  }

  .content {
    padding: 26px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .pack-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .media-card__frame video {
    max-height: min(64dvh, 560px);
  }
}

