/**
 * Shared CSS for SDK integration files
 * Used by: iframe.html, shadow.html, iframe-nested.html
 */

:root {
  --bg-primary: #0a0a0a;

  --tps-bg: #171717;
  --tps-surface: #161922;
  --tps-surface-2: #1f232f;
  --tps-border: #20242f;
  --tps-divider: #1a1d26;
  --tps-text: #ffffff;
  --tps-text-dim: #b8bcc7;
  --tps-gold: #e7c574;
  --tps-gold-soft: rgba(231, 197, 116, 0.16);
  --tps-gold-border: rgba(231, 197, 116, 0.6);
}

body {
  background: var(--bg-primary);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#predict-placeholder {
  min-height: 100%;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.footer {
  background: var(--tps-bg);
  color: var(--tps-text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 0;
  border-top: 1px solid var(--tps-divider);
  height: auto;
  padding: 28px 28px 24px;
  gap: 28px;
  font-size: 14px;
  line-height: 1.4;
}
.footer svg { display: block; }
.footer button { font-family: inherit; }

.footer-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--tps-text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 4px 0;
}
.footer-readmore svg { width: 16px; height: 16px; }

.footer-heading {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tps-text);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.footer-contacts { display: flex; flex-direction: column; gap: 14px; }
.footer-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tps-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-contact-link svg { width: 18px; height: 18px; flex: none; }

.footer-socials {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-social-list { display: flex; justify-content: space-around; width: 100%; }
.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
}
.footer-social svg { width: 100%; height: 100%; display: block; }

.footer-affiliate {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 18px;
  background: linear-gradient(180deg, #171717 0%, #1c1c1c 100%);
  border: 1px solid var(--tps-border);
  border-radius: 8px;
  color: var(--tps-text-dim);
  text-decoration: none;
  font-size: 15px;
  width: 100%;
  max-width: 340px;
  justify-self: end;
}
.footer-affiliate:hover { border-color: var(--tps-gold-border); color: var(--tps-text); }
.footer-affiliate-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tps-gold);
  flex: none;
}
.footer-affiliate-icon svg { width: 32px; height: 32px; }

.footer-payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px 36px;
  color: #c8ccd2;
  filter: grayscale(1);
  opacity: 0.7;
}
.footer-payment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.footer-payment svg { height: 24px; width: auto; }
.footer-payment--text { font-style: italic; }

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.footer-col-heading {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tps-text);
}
.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col a {
  color: var(--tps-text);
  text-decoration: none;
  font-size: 14px;
}
.footer-col a:hover { color: var(--tps-gold); }

.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--tps-text-dim);
  opacity: 0.7;
}
.footer-trust > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
}
.footer-trust svg { height: 36px; width: auto; }

.footer-copy {
  text-align: center;
  font-size: 13px;
  color: var(--tps-text-dim);
}

@media (max-width: 980px) {
  .footer-top { grid-template-columns: 1fr; gap: 24px; }
  .footer-affiliate { justify-self: center; }
  .footer-socials { align-items: flex-start; text-align: left; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 480px) {
  .footer { padding: 20px 16px; gap: 22px; }
  .footer-payments { gap: 18px 22px; }
  .footer-links { gap: 18px; }
  .footer-col-list { gap: 10px; }
  .footer-trust { gap: 16px; }
}
.mobile-nav {
  display: none;
  z-index: 30;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 59px;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  background: var(--tps-bg);
  color: var(--tps-text);
  border-top: 1px solid var(--tps-divider);
  border-radius: 14px 14px 0 0;
  align-items: stretch;
  justify-content: space-around;
  gap: 4px;
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease-in-out;
}
.mobile-nav button { font-family: inherit; }
.mobile-nav svg { display: block; }
.mobile-nav-item,
.mobile-nav-cashier {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px 2px 2px;
  border: none;
  background: transparent;
  color: var(--tps-text);
  cursor: pointer;
  position: relative;
  min-width: 0;
}
.mobile-nav-item svg { width: 26px; height: 26px; }
.mobile-nav-item-label,
.mobile-nav-cashier-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.mobile-nav-item--active { color: var(--tps-gold); }
.mobile-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}
.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--tps-gold);
  color: #1a1208;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tps-bg);
  box-sizing: content-box;
  line-height: 1;
}
.mobile-nav-cashier-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f1d68a 0%, #c79a44 55%, #a17529 100%);
  color: #1a1208;
  margin-top: -22px;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mobile-nav-cashier-circle svg { width: 26px; height: 26px; }
.container {
  display: flex;
  align-items: stretch;
}

/* === Header ============================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 12px 0 6px;
  background: var(--tps-bg);
  color: var(--tps-text);
  border-bottom: 1px solid var(--tps-divider);
  border-radius: 0;
}
.header svg { display: block; }
.header button { font-family: inherit; }
.header-collapse {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--tps-text);
  cursor: pointer;
  border-radius: 8px;
}
.header-collapse:hover { background: var(--tps-surface); }
.header-collapse svg { width: 20px; height: 20px; }

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tps-text);
  padding: 0 6px;
}
.header-logo-icon { width: 30px; height: 30px; color: var(--tps-gold); flex: none; }
.header-logo-text {
  font-weight: 800;
  font-size: 14px;
  line-height: 0.95;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.header-spacer { flex: 1; min-width: 0; }

/* Partner-side trigger for the widget's Theme Editor. Pill matches
   `.header-currency` proportions but uses the gold accent on hover so it reads
   as an admin / tooling affordance rather than a routine action. Hidden under
   the mobile breakpoint — the editor doesn't render on mobile anyway. */
.header-theme {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: var(--tps-surface);
  border: 1px solid var(--tps-border);
  border-radius: 999px;
  color: var(--tps-text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.header-theme:hover {
  background: var(--tps-gold-soft);
  border-color: var(--tps-gold-border);
  color: var(--tps-gold);
}
.header-theme svg { width: 16px; height: 16px; flex: none; }

.header-icon-btn {
  flex: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--tps-surface);
  border: 1px solid var(--tps-border);
  color: var(--tps-text);
  border-radius: 999px;
  cursor: pointer;
}
.header-icon-btn:hover { background: var(--tps-surface-2); }
.header-icon-btn svg { width: 18px; height: 18px; }

.header-currency {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 4px;
  background: var(--tps-surface);
  border: 1px solid var(--tps-border);
  border-radius: 999px;
  color: var(--tps-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.header-currency:hover { background: var(--tps-surface-2); }
.header-currency-flag { width: 26px; height: 26px; flex: none; display: inline-block; border-radius: 50%; overflow: hidden; }
.header-currency-flag svg { width: 100%; height: 100%; }
.header-currency-amount { letter-spacing: 0.01em; }
.header-currency-caret { width: 12px; height: 12px; color: var(--tps-text-dim); }

.header-cashier {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px 0 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #f1d68a 0%, #c79a44 55%, #a17529 100%);
  color: #1a1208;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.header-cashier:hover { filter: brightness(1.05); }
.header-cashier-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a1208;
  border-radius: 4px;
  color: var(--tps-gold);
  flex: none;
}
.header-cashier-icon svg { width: 14px; height: 14px; }

.header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--tps-gold);
  color: #1a1208;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--tps-bg);
  box-sizing: content-box;
  line-height: 1;
}

@media (max-width: 980px) {
  /* Theme editor itself only renders on tablet+ via the widget's `isMobile`
     gate (matches the partner's mobile-nav breakpoint), so the trigger is
     useless below that. */
  .header-theme { display: none; }
}
@media (max-width: 720px) {
  .header { gap: 8px; padding: 0 10px 0 4px; }
  .header-logo-text { font-size: 12px; }
  .header-cashier { padding: 0 12px 0 8px; letter-spacing: 0.08em; }
}
@media (max-width: 560px) {
  .header-cashier > span:not(.header-cashier-icon) { display: none; }
  .header-cashier { padding: 0; width: 38px; justify-content: center; gap: 0; }
}
@media (max-width: 480px) {
  .header-icon-btn--account { display: none; }
}
@media (max-width: 420px) {
  .header-collapse { display: none; }
  .header-currency { font-size: 12px; padding: 0 8px 0 3px; gap: 4px; }
}
@media (max-width: 360px) {
  .header-icon-btn--gift { display: none; }
}

/* === Sidebar ============================================================ */
.sidebar {
  position: sticky;
  top: 57px;
  align-self: flex-start;
  height: calc(100vh - 87px);
  width: 73px;
  min-width: 73px;
  margin: 0;
  padding: 14px 0 16px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--tps-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--tps-divider);
  scrollbar-width: thin;
  scrollbar-color: var(--tps-surface-2) transparent;
}
.sidebar svg { display: block; }
.sidebar button { font-family: inherit; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--tps-surface-2); border-radius: 2px; }

.sidebar-rank {
  position: relative;
  width: 46px; height: 52px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-rank-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sidebar-rank-num {
  position: relative;
  font-weight: 900;
  font-size: 18px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sidebar-divider {
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tps-border), transparent);
  flex: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
}
.sidebar-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sidebar-item:hover { background: rgba(255, 255, 255, 0.04); }
.sidebar-item svg { width: 24px; height: 24px; }
.sidebar-item--active {
  background: var(--tps-gold-soft);
  border-color: var(--tps-gold-border);
  color: var(--tps-gold);
}
.sidebar-item--gold { color: var(--tps-gold); }

.sidebar-spacer { flex: 1; min-height: 16px; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: none;
}
.sidebar-circle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  padding: 0;
  border: 1px solid var(--tps-border);
  border-radius: 50%;
  background: var(--tps-surface);
  color: var(--tps-text);
  cursor: pointer;
  overflow: hidden;
}
.sidebar-circle-btn:hover { background: var(--tps-surface-2); }
.sidebar-circle-btn svg { width: 16px; height: 16px; }
.sidebar-circle-btn--flag { padding: 0; border: 1px solid var(--tps-border); }
.sidebar-circle-btn--flag svg { width: 100%; height: 100%; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .mobile-nav { display: flex; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
