/* Curling Stars Online — shared styles for /, /login and /account (and the hub's profile card).
   Dark ice-rink UI: near-black navy ground, ice-blue accents, brand crimson for the
   wordmark and the primary action. Phone-first: everything lays out at 360 px.
   Brand: crimson #e6263a, deep crimson #9c0f20, white (brand/README.md). */

:root {
  color-scheme: dark;
  --bg: #0a0e14;
  --bg-2: #0f151d;
  --surface: #131b25;
  --surface-2: #192330;
  --line: rgba(159, 216, 255, 0.14);
  --line-strong: rgba(159, 216, 255, 0.32);
  --text: #eef4f9;
  --muted: #9db0c2;
  --ice: #9fd8ff;
  --ice-strong: #5cc3ff;
  --ice-dim: rgba(159, 216, 255, 0.10);
  --crimson: #e6263a;
  --crimson-deep: #9c0f20;
  --white: #ffffff;
  --online: #46e08a;
  --danger: #ff6b7a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Bungee", "Impact", "Arial Black", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 50% -120px, rgba(92, 195, 255, 0.16), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(230, 38, 58, 0.08), transparent 70%);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
a { color: var(--ice); }
a:hover { color: var(--ice-strong); }
:focus-visible { outline: 3px solid var(--ice-strong); outline-offset: 2px; }
button, input { font: inherit; }

/* ---- header ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 980px; margin: 0 auto; padding: 14px 16px 6px;
}
.brand { display: block; flex: 1 1 200px; max-width: 340px; text-decoration: none; }
.brand svg { display: block; width: 100%; height: auto; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .wname { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.who .wname b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.who .wname span { color: var(--muted); font-size: 0.85rem; }
.who .link { font-size: 0.9rem; margin-left: 6px; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--surface-2); border: 1px solid var(--line-strong);
}
.avatar-fallback {
  display: inline-grid; place-items: center; color: var(--ice); font-weight: 700; font-size: 1rem;
}
.avatar.lg, .avatar-fallback.lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* ---- layout ---- */
.wrap { max-width: 980px; margin: 0 auto; padding: 8px 16px 48px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin: 0 0 16px;
}
.grid .card { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; margin: 0 0 10px; color: var(--white); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 6px; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.hint { font-size: 0.85rem; color: var(--muted); }
.lead { font-size: 1.05rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; text-align: center; }
.foot { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 24px 0 0; }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover { border-color: var(--ice); background: #1e2a38; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(180deg, #ff4a5c 0%, var(--crimson) 55%, var(--crimson-deep) 100%);
  border-color: var(--crimson-deep); color: var(--white);
}
.btn.primary:hover { background: linear-gradient(180deg, #ff6070 0%, var(--crimson) 55%, var(--crimson-deep) 100%); border-color: var(--crimson); color: var(--white); }
.btn.ice { background: linear-gradient(180deg, #b9e4ff, var(--ice-strong)); border-color: var(--ice-strong); color: #06202f; }
.btn.ice:hover { background: linear-gradient(180deg, #cdeeff, #78cdff); color: #06202f; }
.btn.big { font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: 0.04em; padding: 16px 28px; width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; font-weight: 500; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 107, 122, 0.5); color: var(--danger); }

.field { display: flex; gap: 8px; flex-wrap: wrap; }
label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
input[type="text"] {
  flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text);
}
input[type="text"]:focus { border-color: var(--ice); outline: none; box-shadow: 0 0 0 3px var(--ice-dim); }
input::placeholder { color: #6d8093; }

.msg { min-height: 1.4em; font-size: 0.9rem; margin: 8px 0 0; }
.msg.err, .error-text { color: var(--danger); }
.msg.ok { color: var(--online); }
.card.error { border-color: rgba(255, 107, 122, 0.5); }

/* ---- cards with a mood ---- */
.hero { text-align: center; padding: 28px 18px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.hero .btn { margin-top: 8px; }
.play { border-color: rgba(230, 38, 58, 0.45); background: linear-gradient(135deg, #1c1520 0%, var(--surface) 60%); }
.upgrade { border-color: var(--line-strong); background: linear-gradient(135deg, #10202c 0%, var(--surface) 65%); }
.price { font-family: var(--display); color: var(--ice); font-size: 1.3rem; letter-spacing: 0.02em; }
.banner { border-color: rgba(70, 224, 138, 0.5); background: linear-gradient(135deg, #0f2a1f, var(--surface) 70%); }
.danger-card { border-color: rgba(255, 107, 122, 0.35); }
.accent { border-color: var(--ice-strong); }

.highlight { border-color: var(--ice-strong); box-shadow: 0 0 0 4px var(--ice-dim), var(--shadow); animation: pulse 1.6s ease-in-out 2; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--ice-dim), var(--shadow); }
  50% { box-shadow: 0 0 0 12px rgba(159, 216, 255, 0.22), var(--shadow); }
}

/* ---- stats ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tile .v { font-family: var(--display); font-size: 1.3rem; color: var(--ice); margin-top: 2px; overflow-wrap: anywhere; }
.tile .s { font-size: 0.8rem; color: var(--muted); }
.h2h { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.h2h li { font-size: 0.9rem; }
.h2h b { color: var(--ice); font-weight: 600; }

/* ---- friends ---- */
.people { list-style: none; margin: 0; padding: 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.person:first-child { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #55657a; flex: none; box-shadow: 0 0 0 2px var(--surface); }
.dot.online { background: var(--online); box-shadow: 0 0 0 2px var(--surface), 0 0 10px var(--online); }
.pname { flex: 1 1 120px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pname b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phandle { color: var(--muted); font-size: 0.85rem; }
.pstatus { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.pstatus.online { color: var(--online); }
.pactions { display: flex; gap: 6px; margin-left: auto; }
.empty { color: var(--muted); padding: 8px 0; }
.chip { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; color: var(--ice); }

/* ---- login ---- */
.gsi-wrap { display: flex; justify-content: center; min-height: 44px; margin: 18px 0 10px; }
.loading { color: var(--muted); }
.loading::after { content: "…"; }

/* ---- account ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- hub layout + the profile card (index.html #profileCard, model by hero.js) ----
   Phone: the card sits above the hub content, ~240 px tall, centred. From 900 px the hub is
   two columns and the card is a sticky 300 px column on the right, ~480 px tall (about five
   inches at 96 dpi), never more than 60 % of the viewport. */
.hub { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.hub-main { min-width: 0; }
.pcard {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  height: 240px; padding: 10px 14px 14px; margin: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.hero-stage { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block;
  touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 0.5s ease;
}
.hero-canvas:active { cursor: grabbing; }
.hero-ready .hero-canvas { opacity: 1; }
.hero-ready .stone { display: none; }
/* the fallback / loading glyph: a granite stone with a crimson handle, pure CSS */
.stone {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; transform: translate(-50%, -50%);
  border-radius: 50%; border: 3px solid #b9c4d1;
  background: radial-gradient(circle at 36% 30%, #7c8694, #2a313c 72%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}
.stone::before {
  content: ""; position: absolute; left: 50%; top: -16px; width: 36px; height: 13px; transform: translateX(-50%);
  border-radius: 7px; background: linear-gradient(180deg, #ff4a5c, var(--crimson-deep)); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.stone::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.16); }
.hero-fallback .stone { opacity: 0.9; }
.hero-name { font-family: var(--display); font-size: 1.1rem; letter-spacing: 0.02em; color: var(--white); margin: 8px 0 0; max-width: 100%; overflow-wrap: anywhere; line-height: 1.2; }
.hero-email { font-size: 0.78rem; color: var(--muted); margin: 2px 0 0; max-width: 100%; overflow-wrap: anywhere; line-height: 1.3; }
.hero-star { font-family: var(--display); font-size: 1rem; letter-spacing: 0.05em; color: var(--ice); margin: 4px 0 0; }
.who .link.admin { color: var(--crimson); font-weight: 600; }

@media (min-width: 900px) {
  .hub { grid-template-columns: minmax(0, 1fr) 300px; }
  .hub-main { grid-column: 1; grid-row: 1; }
  .pcard {
    grid-column: 2; grid-row: 1; position: sticky; top: 12px;
    height: 480px; max-height: 60vh; padding: 12px 16px 18px;
  }
  .hero-name { font-size: 1.25rem; margin-top: 10px; }
  .hero-email { font-size: 0.82rem; }
  .hero-star { font-size: 1.1rem; margin-top: 6px; }
}

/* ---- small phones ---- */
@media (max-width: 420px) {
  .top { padding: 12px 12px 4px; }
  .wrap { padding: 6px 12px 40px; }
  .card { padding: 14px; }
  .btn.big { font-size: 1.1rem; padding: 14px 20px; }
  .who .wname b { max-width: 120px; }
  .pcard { height: 240px; padding: 8px 10px 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}

/* ---- motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .highlight { box-shadow: 0 0 0 4px var(--ice-dim), var(--shadow); }
}

/* ==========================================================================
   LANDING PAGE — the logged-OUT view of / (index.html #signin.landing).
   Everything here is scoped under .landing so it never touches the hub
   (#hub), the account page or the /login card. Dark theme only, phone-first.
   ========================================================================== */
.landing { display: block; margin: 0; }
.landing > * + * { margin-top: 40px; }
.landing .lp-h1 { font-family: var(--display); font-weight: 400; color: var(--white); letter-spacing: 0.01em; line-height: 1.06; margin: 0 0 14px; font-size: clamp(1.9rem, 6vw, 3rem); }
.landing .lp-h2 { font-family: var(--display); font-weight: 400; color: var(--white); letter-spacing: 0.02em; line-height: 1.12; margin: 0 0 8px; font-size: clamp(1.3rem, 4vw, 1.9rem); }
.landing h3 { font-family: var(--display); font-weight: 400; color: var(--white); text-transform: none; letter-spacing: 0.01em; font-size: 1.02rem; margin: 12px 0 6px; }
.landing p { margin: 0 0 12px; }
.landing p:last-child { margin-bottom: 0; }

/* ---- hero ---- */
.landing .lp-hero {
  display: grid; gap: 26px; align-items: center; grid-template-columns: minmax(0, 1fr);
  padding: 20px 20px 26px;
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(92, 195, 255, 0.14), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(230, 38, 58, 0.12), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
}
.landing .lp-kicker {
  display: inline-block; font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ice-strong); margin: 0 0 12px;
}
.landing .lp-lead { font-size: 1.08rem; color: var(--muted); max-width: 42ch; }
.landing .lp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.landing .lp-note { font-size: 0.85rem; color: var(--muted); }
.landing .btn.lp-ghost { background: transparent; border-color: var(--line-strong); }
.landing .btn.lp-ghost:hover { border-color: var(--ice); background: rgba(159, 216, 255, 0.08); }
.landing .lp-hero-media { margin: 0; }
.landing .lp-shot {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--line-strong);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
  background: var(--bg-2);
}
.landing .lp-hero-media .lp-shot { box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(159, 216, 255, 0.08); }

/* ---- what it is ---- */
.landing .lp-band { text-align: center; padding: 8px 6px; }
.landing .lp-band-lead { font-size: 1.05rem; color: var(--muted); max-width: 62ch; margin-left: auto; margin-right: auto; }

/* ---- features ---- */
.landing .lp-features {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.landing .lp-feat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.landing .lp-feat p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.landing .lp-ic {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  color: var(--ice-strong); background: var(--ice-dim); border: 1px solid var(--line-strong);
}
.landing .lp-ic svg { width: 24px; height: 24px; }
.landing .lp-soon { color: var(--ice); }

/* ---- screenshots ---- */
.landing .lp-shots { text-align: center; }
.landing .lp-shots > .lp-h2 { margin-bottom: 18px; }
.landing .lp-gallery {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  text-align: left;
}
.landing .lp-card { margin: 0; }
.landing .lp-card figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }

/* ---- pricing ---- */
.landing .lp-pricing { text-align: center; }
.landing .lp-pricing > .lp-h2 { margin-bottom: 18px; }
.landing .lp-plans {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: stretch; text-align: left; max-width: 720px; margin: 0 auto;
}
.landing .lp-plan {
  display: flex; flex-direction: column; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px;
}
.landing .lp-plan-featured {
  border-color: var(--crimson); box-shadow: 0 0 0 1px var(--crimson-deep), 0 16px 40px rgba(230, 38, 58, 0.14);
  background: linear-gradient(180deg, #1c1520 0%, var(--surface) 60%);
}
.landing .lp-badge {
  position: absolute; top: -12px; right: 18px; margin: 0;
  font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--white); background: linear-gradient(180deg, #ff4a5c, var(--crimson-deep));
  border-radius: 999px; padding: 5px 12px; box-shadow: var(--shadow);
}
.landing .lp-plan-name { font-family: var(--display); color: var(--white); font-size: 1.05rem; letter-spacing: 0.02em; margin: 0 0 8px; }
.landing .lp-price { margin: 0 0 2px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.landing .lp-amt { font-family: var(--display); color: var(--ice); font-size: 2rem; line-height: 1; }
.landing .lp-per { color: var(--muted); font-size: 0.9rem; }
.landing .lp-plan-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 14px; }
.landing .lp-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.landing .lp-list li { position: relative; padding-left: 26px; color: var(--text); font-size: 0.95rem; }
.landing .lp-list li::before {
  content: ""; position: absolute; left: 3px; top: 0.34em; width: 11px; height: 6px;
  border-left: 2px solid var(--ice-strong); border-bottom: 2px solid var(--ice-strong);
  transform: rotate(-45deg);
}
.landing .lp-plan-cta { margin-top: auto; width: 100%; }
.landing .lp-center { text-align: center; max-width: 52ch; margin-left: auto; margin-right: auto; margin-top: 16px; }

/* ---- footer ---- */
.landing .lp-footer { text-align: center; border-top: 1px solid var(--line); padding-top: 26px; }
.landing .lp-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 14px; }
.landing .lp-links a { color: var(--ice); text-decoration: none; font-size: 0.92rem; }
.landing .lp-links a:hover { color: var(--ice-strong); text-decoration: underline; }
.landing .lp-foot-line { color: var(--text); font-size: 0.92rem; margin: 0 0 6px; }
.landing .lp-foot-copy { color: var(--muted); font-size: 0.82rem; margin: 0; }

/* ---- wide hero from 760px ---- */
@media (min-width: 760px) {
  .landing > * + * { margin-top: 56px; }
  .landing .lp-hero { grid-template-columns: 1.05fr 1fr; gap: 34px; padding: 34px 34px 38px; }
  .landing .lp-hero-text { order: 1; }
  .landing .lp-hero-media { order: 2; }
}
