/* Tick Gaming site styles — ported 1:1 from the former Compose Theme.kt token
   values (light/dark palettes, Ember/Teal accents, Space Grotesk + IBM Plex
   Sans type scale) into plain CSS custom properties. */

:root {
  --ink: #14171F;
  --paper: #FAF7F2;
  --card: #FFFFFF;
  --slate: #6B7280;
  --border: #E7E4DD;
  --muted-label: #9A9488;
  --body-text: #4A4E58;
  --success: #1C9A5B;
  --danger: #D8331F;

  --ember: #FF5A36;
  --ember-hover: #E23F1D;
  --teal: #1FC8B0;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

html.dark {
  --ink: #F2EFE9;
  --paper: #14171F;
  --card: #1C212B;
  --slate: #9AA1AD;
  --border: #2A3040;
  --muted-label: #7E8694;
  --body-text: #C2C7D0;
  --success: #3DD68C;
  --danger: #FF6B52;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
}

body {
  font-family: var(--font-body);
  color: var(--body-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

h1 { font-size: 44px; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 28px; letter-spacing: -0.01em; line-height: 1.2; }
h3 { font-size: 18px; font-weight: 600; }

p { line-height: 1.6; margin: 0; }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted-label);
  text-transform: uppercase;
}

.wrap {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand:hover .brand-tick { color: var(--ember); }
.brand:hover .icon-mark .hand { animation: tick-spin 1.1s linear infinite; }

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.brand-tick { color: var(--ink); }
.brand-gaming { font-weight: 500; color: var(--slate); }

.icon-mark { display: block; }
.icon-mark rect { fill: var(--ink); }
.icon-mark .ring { stroke: var(--paper); opacity: 0.85; }
.icon-mark .hand, .icon-mark .dot { stroke: var(--ember); fill: var(--ember); }
/* The hand is a <line> from (60,60) to (84,32) — its own bounding box is a
   thin diagonal sliver, so the default transform-origin (that bbox's center)
   spins it around the wrong point. Pin it to the icon's actual center in
   viewBox units instead, matching the Compose original's `pivot = center`. */
.icon-mark .hand { transform-box: view-box; transform-origin: 60px 60px; }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-session {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.header-session:hover .header-name { color: var(--ember); }
.header-name { font-size: 14px; font-weight: 600; color: var(--ink); }

.no-username-pill {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: #E0201B;
  border: 1px solid #E0201B;
  border-radius: 6px;
  padding: 3px 8px;
  animation: no-username-flash 1.4s ease-in-out infinite;
}

.session-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 140px;
  padding: 6px;
  z-index: 20;
}

.header-session.open .session-menu { display: block; }

.session-menu button, .session-menu a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.session-menu button:hover, .session-menu a:hover { background: var(--paper); }

/* Footer */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted-label);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary { background: var(--ember); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--ember-hover); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); }

.btn-block { width: 100%; }
.btn-provider img, .btn-provider svg { width: 18px; height: 18px; }

/* Forms */

/* :not([hidden]) — same reasoning as strength-meter/name-history/spinner-wrap
   above: an unconditional `display` here would out-cascade the UA
   stylesheet's [hidden]{display:none} and defeat the sign-in/sign-up
   display-name field toggle. */
.field:not([hidden]) { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--slate);
}

.field input {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}

.field input:focus { outline: none; border-color: var(--ember); }

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

/* Auth card */

.auth-card { width: 100%; max-width: 460px; margin: 0 auto; }

/* .hero's align-items: center makes flex children shrink-wrap to content by
   default, so without this the auth card's `width: 100%` had no real parent
   width to resolve against — max-width was capping nothing. */
.hero [data-auth-slot] { align-self: stretch; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.tab.active { background: var(--ink); color: var(--paper); }

.auth-fields { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }

.auth-message { font-size: 13px; line-height: 1.5; margin-top: 14px; }
.auth-message.error { color: var(--ember-hover); }
.auth-message.info { color: var(--slate); }

.divider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.divider-row .line { flex: 1; height: 1px; background: var(--border); }
.divider-row span { font-size: 12px; color: var(--slate); }

.provider-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

/* :not([hidden]) rather than an unconditional `display` — a plain class rule
   here would out-cascade the UA stylesheet's [hidden]{display:none} (author
   origin always wins ties over UA origin) and defeat the hidden toggle. */
.strength-meter:not([hidden]) { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; }
.strength-track { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: width 150ms, background 150ms; }
.strength-label { font-size: 12px; color: var(--slate); }

/* Landing */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 96px 0 72px;
}

.hero p.lead {
  font-size: 18px;
  color: var(--slate);
  max-width: 520px;
  margin: 16px 0 32px;
}

.notice { font-size: 13px; color: var(--slate); margin-bottom: 16px; }

.welcome-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
  padding: 20px;
}

.welcome-card p { font-size: 13px; color: var(--slate); }

.products-section { padding: 56px 0 96px; }

.product-card {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--ink);
  border-radius: 16px;
  padding: 28px 32px;
}

.product-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

.product-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-body { flex: 1; }
.product-body h3 { color: var(--paper); font-size: 20px; font-family: var(--font-display); }
/* var(--paper) + opacity, not a hardcoded rgba() — the product card's
   background is var(--ink), which flips light in dark mode, so a color
   baked to the light "paper" hex stays near-invisible against it once the
   card itself flips light too. var(--paper) tracks the flip like the title
   above already does. */
.product-body p { color: var(--paper); opacity: 0.7; font-size: 14px; margin-top: 4px; }

/* Account page */

.account-page { padding: 72px 0 96px; display: flex; flex-direction: column; align-items: center; }

.account-layout {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 680px;
  margin-top: 28px;
  align-items: flex-start;
}

.settings-nav {
  width: 200px;
  flex-shrink: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: width 200ms;
}

.settings-nav.collapsed { width: 54px; }
.settings-nav.collapsed .nav-label { display: none; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--slate);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  text-align: left;
}

.nav-row svg { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke-width: 1.6; }
.nav-row.active { background: rgba(255, 90, 54, 0.12); color: var(--ember); }
.nav-row.active svg { stroke: var(--ember); }
.nav-row:not(.active) svg { stroke: var(--slate); }
.settings-nav.collapsed [data-nav-toggle] svg { transform: scaleX(-1); }

.nav-label { white-space: nowrap; }

.nav-divider { height: 1px; background: var(--border); margin: 6px 0; }

.account-content { flex: 1; min-width: 0; }

.settings-section { display: none; flex-direction: column; gap: 14px; }
.settings-section.active { display: flex; }

.settings-section h3 { font-size: 14px; }

.avatar-row { display: flex; align-items: center; gap: 16px; }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
}

.name-history:not([hidden]) { display: flex; flex-direction: column; gap: 2px; }
.name-history .label { font-size: 11px; font-weight: 600; color: var(--muted-label); }
.name-history .entry { font-size: 12px; color: var(--slate); }

.hr { height: 1px; background: var(--border); margin: 8px 0; }

.connection-rows { display: flex; flex-direction: column; gap: 14px; }
.connection-row { display: flex; align-items: center; gap: 12px; }
.connection-row img, .connection-row svg { width: 22px; height: 22px; flex-shrink: 0; }
.connection-body { flex: 1; }
.connection-body .provider-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.connection-body .provider-status { font-size: 12px; color: var(--slate); }

.status-line { font-size: 13px; line-height: 1.5; margin-top: 4px; }
.status-line.ok { color: var(--success); }
.status-line.error { color: var(--danger); animation: status-flash 330ms ease-in-out 2; }

.theme-picker { display: flex; gap: 4px; background: var(--paper); border: 1px solid var(--border); border-radius: 9px; padding: 3px; max-width: 320px; }
.theme-picker button { flex: 1; }

.helper-text { font-size: 13px; color: var(--slate); }

.spinner-wrap:not([hidden]) { display: flex; justify-content: center; padding: 32px 0; }

/* Splash / boot spinner (also reused on the account page load state) */

@keyframes tick-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes tick-ring {
  0% { stroke-dashoffset: 213.6; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -213.6; }
}
@keyframes no-username-flash {
  0%, 100% { background: #E0201B; color: #fff; }
  50% { background: #fff; color: #E0201B; }
}
@keyframes status-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.tick-spinner .ring { fill: none; stroke: var(--border); stroke-width: 6; stroke-dasharray: 213.6; animation: tick-ring 2.2s linear infinite; }
.tick-spinner .hand { stroke: var(--ember); stroke-width: 12; stroke-linecap: round; transform-box: view-box; transform-origin: 60px 60px; animation: tick-spin 2.2s linear infinite; }

@media (max-width: 640px) {
  h1 { font-size: 34px; }
  .hero { padding: 64px 0 48px; }
  .account-layout { flex-direction: column; }
  .settings-nav { width: 100% !important; flex-direction: row; overflow-x: auto; }
  .settings-nav .nav-label { display: none; }
  .product-card { flex-direction: column; text-align: center; }
}
