/* =============================================================================
   clickstar.css - the CLICKSTAR page's handset demo and features guide
   (clickstar-demo.js). Same look as the TOUCHSTAR and APPSTAR pages.
   Everything is scoped to .clickstar and the custom properties are --cs-*, so it
   can sit inside the site's page without touching the site's own styles.
   Light only, to sit on the site's white background. Fonts and headings
   (h1-h6) come from the site.
   ============================================================================= */
.clickstar {
  --cs-bg: #ffffff;
  --cs-panel: #f1f2f4;
  --cs-ink: #16181c; --cs-muted: #5d636d; --cs-line: #dfe2e6;
  --cs-accent: #e85a0c; --cs-accent-ink: #ffffff; --cs-accent-soft: #fde5d6;
  --cs-lcd-bg: #3a0000; --cs-lcd-ink: #ff2a1a;
}

/* ---------------------------------------------------------------- base */
.clickstar { background: var(--cs-bg); color: var(--cs-ink); text-align: left;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 18px; }
.clickstar *, .clickstar *::before, .clickstar *::after { box-sizing: border-box; }
.clickstar img { max-width: 100%; }
.clickstar .cs-wrap { max-width: 1200px; margin: 0 auto; display: grid; gap: 64px; }
.clickstar p { margin: 0; }
.clickstar section { display: grid; gap: 22px; scroll-margin-top: 16px; }
.clickstar .cs-intro { display: grid; gap: 6px; max-width: 70ch; }
.clickstar .cs-intro p { color: var(--cs-muted); }
.clickstar [hidden] { display: none !important; }

.clickstar .cs-btn { font-weight: 600; font-size: .95rem; font-family: inherit; color: var(--cs-ink); background: var(--cs-panel); border: 1px solid var(--cs-line);
  border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.clickstar .cs-btn:hover { border-color: var(--cs-accent); }
.clickstar .cs-btn[aria-pressed="true"] { background: var(--cs-accent-soft); border-color: var(--cs-accent); }
.clickstar .cs-seg { font-weight: 600; font-size: .86rem; font-family: inherit; color: var(--cs-ink); background: var(--cs-bg); border: 1px solid var(--cs-line);
  border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.clickstar .cs-seg[aria-pressed="true"] { background: var(--cs-accent); color: var(--cs-accent-ink); border-color: var(--cs-accent); }
.clickstar a:focus-visible, .clickstar button:focus-visible, .clickstar .card:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }

/* =============================================================================
   The handset picture. Used by the demo (live LCD + pressable keys) and the
   guide (numbered markers). Positions are % of the 410 x 769 picture.
   ============================================================================= */
.clickstar .cs-handset { position: relative; width: min(100%, 340px); margin: 0 auto; aspect-ratio: 410 / 769; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: none; }
.clickstar .cs-handset > img { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 14px 18px rgba(0,0,0,.28)); pointer-events: none; }
.clickstar .cs-guide .cs-handset { touch-action: auto; }

/* the live 16 x 2 display, laid over the picture's LCD */
.clickstar .cs-lcd canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 1.5px rgba(255,40,20,.55)); }
.clickstar .cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.clickstar .cs-lcd { position: absolute; left: 16.3%; top: 12.5%; width: 66.6%; height: 8.2%; background: var(--cs-lcd-bg); border-radius: 2px;
  display: grid; align-content: center; justify-items: center; overflow: hidden; container-type: inline-size; }
.clickstar .cs-lcd div { font-family: "Courier New", Courier, monospace; font-weight: 700; color: var(--cs-lcd-ink); white-space: pre; line-height: 1.12;
  font-size: 9.6cqw; letter-spacing: 0; text-shadow: 0 0 3px rgba(255,40,20,.55); }
.clickstar .cs-lcd u { text-decoration: none; border-bottom: 2px solid var(--cs-lcd-ink); animation: cs-blink 1s steps(1) infinite; }
.clickstar .cs-lcd .cg, .clickstar .cs-mini .cg { display: inline-block; width: 1ch; text-align: center; overflow: hidden; vertical-align: top; }
.clickstar .cs-lcd .blk, .clickstar .cs-mini .blk { background: var(--cs-lcd-ink); box-shadow: inset 0 0 0 1px var(--cs-lcd-bg); }
@keyframes cs-blink { 50% { border-bottom-color: transparent; } }
@supports not (container-type: inline-size) { .clickstar .cs-lcd div { font-size: 19px; } }

/* pressable keys in the demo */
.clickstar .cs-key { position: absolute; padding: 0; border: 0; background: transparent; border-radius: 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: none; }
.clickstar .cs-key:hover { background: rgba(255,255,255,.08); }
.clickstar .cs-key.down { background: rgba(0,0,0,.38); box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.clickstar .cs-key.round { border-radius: 50%; }

/* =============================================================================
   LIVE DEMO
   ============================================================================= */
.clickstar .cs-bench { display: grid; gap: 18px; justify-items: center; }
.clickstar .cs-stage { display: flex; flex-wrap: wrap; gap: 28px 40px; justify-content: center; align-items: center; width: 100%; }
.clickstar .cs-stage .cs-handset { flex: 0 1 340px; margin: 0; }
.clickstar .cs-side { display: grid; gap: 14px; justify-items: center; width: min(100%, 260px); }
.clickstar .cs-under { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; }
.clickstar .cs-demofoot { display: grid; gap: 12px; width: 100%; max-width: 560px; justify-items: center; }
.clickstar .cs-small { color: var(--cs-muted); font-size: .9rem; text-align: center; }

/* the nunchuk thumbstick */
.clickstar .cs-pad { position: relative; width: 170px; height: 170px; border-radius: 50%; touch-action: none; cursor: grab;
  background: radial-gradient(circle at 50% 45%, #3a3d42, #1d1f22 70%); box-shadow: 0 10px 18px rgba(0,0,0,.28), inset 0 2px 4px rgba(255,255,255,.08); }
.clickstar .cs-pad::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.18); }
.clickstar .cs-pad i { position: absolute; color: #ff6a3d; font-style: normal; font-size: .8rem; line-height: 1; }
.clickstar .cs-pad i.n { top: 8px; left: 50%; transform: translateX(-50%); }
.clickstar .cs-pad i.s { bottom: 8px; left: 50%; transform: translateX(-50%) rotate(180deg); }
.clickstar .cs-pad i.w { left: 8px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.clickstar .cs-pad i.e { right: 8px; top: 50%; transform: translateY(-50%) rotate(90deg); }
.clickstar .cs-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5a5e65, #2a2c30 70%); box-shadow: 0 4px 8px rgba(0,0,0,.5); transition: transform .12s; pointer-events: none; }
.clickstar .cs-pad.drag { cursor: grabbing; }
.clickstar .cs-pad.drag .cs-knob { transition: none; }
.clickstar .cs-padlabel { font-weight: 600; font-size: .9rem; color: var(--cs-muted); text-align: center; }

/* the one-step-at-a-time tip above the demo */
.clickstar .cs-tip { width: 100%; max-width: 760px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; align-items: center;
  padding: 12px 18px; background: var(--cs-panel); border: 1px solid var(--cs-accent); border-radius: 14px; }
.clickstar .cs-dots { display: flex; gap: 6px; grid-row: span 2; }
.clickstar .cs-dots span { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  color: var(--cs-muted); background: var(--cs-bg); border: 1px solid var(--cs-line); transition: background .3s, color .3s, border-color .3s; }
.clickstar .cs-dots span.done { color: var(--cs-accent); border-color: var(--cs-accent); }
.clickstar .cs-dots span.now { background: var(--cs-accent); color: var(--cs-accent-ink); border-color: var(--cs-accent); }
.clickstar .cs-tip b { font-weight: 600; font-size: 1.1rem; letter-spacing: .02em; }
.clickstar .cs-tip b small { font-weight: 600; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cs-accent); margin-right: 8px; }
.clickstar .cs-tip p { color: var(--cs-muted); }
.clickstar .cs-tip.flash { animation: cs-flash .6s ease; }
@keyframes cs-flash { from { background: var(--cs-accent-soft); } to { background: var(--cs-panel); } }
@media (max-width: 560px) { .clickstar .cs-tip { grid-template-columns: minmax(0, 1fr); } .clickstar .cs-dots { grid-row: auto; } }

/* =============================================================================
   GUIDE: picture with numbered markers, linked both ways to the cards
   ============================================================================= */
.clickstar .split { display: grid; grid-template-columns: minmax(250px, 360px) minmax(0, 1fr); gap: 36px; align-items: start; }
.clickstar .stick { position: sticky; top: max(16px, env(safe-area-inset-top, 0px)); display: grid; gap: 12px; justify-items: center; }
@media (max-width: 820px) { .clickstar .split { grid-template-columns: minmax(0, 1fr); } .clickstar .stick { position: static; } }

.clickstar .spot { position: absolute; border: 2px solid transparent; border-radius: 8px; cursor: pointer; background: none; padding: 0;
  transition: border-color .2s, background .2s; }
.clickstar .spot b { position: absolute; left: -9px; top: -9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .72rem; background: var(--cs-accent); color: var(--cs-accent-ink); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.clickstar .spot:hover, .clickstar .spot.on { border-color: #ffb27d; background: rgba(255,122,46,.16); }
.clickstar .caption { color: var(--cs-muted); font-size: .88rem; text-align: center; max-width: 34ch; }

.clickstar .cards { display: grid; gap: 12px; min-width: 0; }
.clickstar .card { position: relative; display: grid; gap: 4px; padding: 16px 18px 16px 64px; background: var(--cs-panel);
  border: 1px solid var(--cs-line); border-radius: 14px; transition: border-color .2s, background .2s; }
.clickstar .card > .n { position: absolute; left: 18px; top: 14px; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; background: var(--cs-bg); color: var(--cs-muted); border: 1px solid var(--cs-line); }
.clickstar .card > .n i { font-size: .9rem; }
.clickstar .card.on { border-color: var(--cs-accent); }
.clickstar .card.on > .n { background: var(--cs-accent); color: var(--cs-accent-ink); border-color: var(--cs-accent); }
.clickstar .card p { color: var(--cs-muted); }
.clickstar .card[data-joy] { cursor: pointer; }
.clickstar .tbl { overflow-x: auto; }
.clickstar .keymap { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .92rem; }
.clickstar .keymap th, .clickstar .keymap td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--cs-line); }
.clickstar .keymap th { font-weight: 600; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cs-muted); }
.clickstar .keymap td:first-child { font-weight: 600; }

/* joystick picture */
.clickstar .cs-joy { position: relative; width: min(100%, 420px); aspect-ratio: 534 / 308; margin: 0 auto; }
.clickstar .cs-joy img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .25s; }

/* phone screenshot in a guide step */
.clickstar .cs-shot { justify-self: end; width: 150px; height: auto; border-radius: 16px; border: 6px solid #141517; box-shadow: 0 8px 14px rgba(0,0,0,.2); }
.clickstar .cs-steps > li:has(.cs-shot) { align-items: start; }
@media (max-width: 640px) { .clickstar .cs-shot { justify-self: start; width: 180px; } }

/* settings-menu guides: tabs, then numbered steps, each with the LCD it shows */
.clickstar .opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.clickstar .cs-guides { display: grid; gap: 18px; }
.clickstar .cs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: cs; }
.clickstar .cs-steps > li { counter-increment: cs; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 8px 22px; align-items: center;
  padding: 16px 18px 16px 64px; background: var(--cs-panel); border: 1px solid var(--cs-line); border-radius: 14px; }
.clickstar .cs-steps > li::before { content: counter(cs); position: absolute; left: 18px; top: 14px; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; background: var(--cs-bg); color: var(--cs-muted); border: 1px solid var(--cs-line); }
.clickstar .cs-steps h3 { margin: 0 0 4px; }
.clickstar .cs-steps p { color: var(--cs-muted); }
.clickstar .cs-steps p + p { margin-top: 6px; }
@media (max-width: 640px) { .clickstar .cs-steps > li { grid-template-columns: minmax(0, 1fr); } }

/* a small LCD showing what CLICKSTAR displays at that step */
.clickstar .cs-mini { justify-self: end; width: 210px; padding: 9px 10px; border-radius: 6px; background: #111214; box-shadow: inset 0 0 0 3px #26282c; }
.clickstar .cs-mini span { display: block; font-family: "Courier New", Courier, monospace; font-weight: 700; font-size: 15px; line-height: 1.2; white-space: pre;
  color: var(--cs-lcd-ink); background: var(--cs-lcd-bg); padding: 0 4px; text-shadow: 0 0 3px rgba(255,40,20,.5); overflow: hidden; }
.clickstar .cs-mini canvas { display: block; width: 100%; aspect-ratio: 99 / 21; background: var(--cs-lcd-bg); filter: drop-shadow(0 0 1.5px rgba(255,40,20,.5)); }
.clickstar .cs-mini.drawn span { display: none; }
@media (max-width: 640px) { .clickstar .cs-mini { justify-self: start; } }

.clickstar .k { display: inline-block; font-weight: 700; font-size: .82rem; letter-spacing: .03em; padding: 1px 7px; border-radius: 6px;
  background: #222428; color: #fff; vertical-align: 1px; white-space: nowrap; }

.clickstar .good { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.clickstar .good div { background: var(--cs-panel); border: 1px solid var(--cs-line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.clickstar .good p { color: var(--cs-muted); }

@media (prefers-reduced-motion: reduce) {
  .clickstar .cs-tip.flash { animation: none; }
  .clickstar .cs-lcd u { animation: none; }
}

/* the APPSTAR phone demo, inside the Phone apps guide */
.clickstar .appstar { padding: 0; background: none; display: grid; gap: 18px; justify-items: center; }
.clickstar .appstar > .split { width: 100%; grid-template-columns: 330px minmax(0, 1fr); gap: 32px; }
.clickstar .appstar .stick { gap: 14px; min-width: 0; width: 100%; }
.clickstar .appstar .stick .as-phone { width: 100%; max-width: 330px; min-width: 0; }
.clickstar .appstar .as-addr { min-width: 0; max-width: 100%; }
.clickstar .appstar > .split > div { min-width: 0; }
@media (max-width: 900px) {
  .clickstar .appstar > .split { grid-template-columns: minmax(0, 1fr); }
  .clickstar .appstar .stick { position: static; }
  .clickstar .appstar .stick .as-phone { max-width: 340px; }
}
.clickstar .appstar [data-mode] > .cs-steps { margin-top: 12px; }
.clickstar .cs-left { text-align: left; }
/* steps beside the phone: put the little display under the text when the column is narrow */
.clickstar .appstar > .split > div[data-mode] { container-type: inline-size; }
@container (max-width: 560px) {
  .clickstar .appstar .cs-steps > li { grid-template-columns: minmax(0, 1fr); }
  .clickstar .appstar .cs-mini { justify-self: start; }
}
