/* cube-floor demo widget — everything scoped under .cf so it cannot leak into
   the surrounding Perslis page chrome. */

.cf {
  --cf-panel: #0e1218;
  --cf-panel2: #11161d;
  --cf-line: #223142;
  --cf-text: #c9d4e2;
  --cf-dim: #7d8fa3;
  --cf-accent: #82decf;
  --cf-accent2: #75b7ff;
  --cf-warn: #ff8a6a;
  --cf-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--cf-mono);
  color: var(--cf-text);
  text-align: left;
}

.cf * { box-sizing: border-box; }

/* ------------------------------------------------------------------- lanes */

.cf-race { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.cf-lane {
  background: linear-gradient(180deg, var(--cf-panel) 0%, var(--cf-panel2) 100%);
  border: 1px solid var(--cf-line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cf-lane.cf-accent { border-color: #2c5e54; }

.cf-lane h3 { margin: 0; font-size: .98rem; font-weight: 500; color: #eafff8; }
.cf-lane.cf-accent h3 { color: var(--cf-accent); }
.cf-sub { margin-top: 5px; color: var(--cf-dim); font-size: .72rem; }

.cf-scene {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  perspective: 1500px;
  margin: 6px 0 14px;
}
.cf-mount { transform-style: preserve-3d; }

.cf .cube {
  position: relative;
  width: 0; height: 0;
  transform-style: preserve-3d;
  transform: rotateX(-26deg) rotateY(-36deg);
}
.cf .cubie {
  position: absolute;
  width: var(--cubie); height: var(--cubie);
  margin: calc(var(--cubie) / -2) 0 0 calc(var(--cubie) / -2);
  transform-style: preserve-3d;
}
.cf .cubie.moving { z-index: 5; }
.cf .face { position: absolute; inset: 0; border-radius: 7px; background: #15181d; }
.cf .facepx { transform: rotateY(90deg)  translateZ(calc(var(--cubie) / 2)); }
.cf .facemx { transform: rotateY(-90deg) translateZ(calc(var(--cubie) / 2)); }
.cf .facepy { transform: rotateX(90deg)  translateZ(calc(var(--cubie) / 2)); }
.cf .facemy { transform: rotateX(-90deg) translateZ(calc(var(--cubie) / 2)); }
.cf .facepz { transform: translateZ(calc(var(--cubie) / 2)); }
.cf .facemz { transform: rotateY(180deg) translateZ(calc(var(--cubie) / 2)); }
.cf .cubie.impossible .face { animation: cf-pulse .5s ease-in-out 4; }
@keyframes cf-pulse {
  50% { box-shadow: inset 0 0 0 3px var(--cf-warn), 0 0 22px var(--cf-warn); }
}

.cf-bar { height: 5px; border-radius: 99px; background: #161c25; overflow: hidden; }
.cf-fill {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, #4a5568, #7a8ba1);
  transition: width .12s linear;
}
.cf-lane.cf-accent .cf-fill {
  background: linear-gradient(90deg, var(--cf-accent2), var(--cf-accent));
}

.cf-now { margin-top: 11px; font-size: .78rem; color: var(--cf-text); min-height: 18px; }
.cf-lane.cf-accent .cf-now { color: var(--cf-accent); }

.cf-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; flex: 1; }
.cf-steps li {
  display: grid; grid-template-columns: 16px 1fr auto; gap: 9px;
  align-items: baseline; font-size: .72rem; color: var(--cf-dim);
  padding: 5px 7px; border-radius: 7px; border: 1px solid transparent;
}
.cf-steps li.active { color: var(--cf-text); background: #131a23; border-color: var(--cf-line); }
.cf-steps li.done .mark { color: var(--cf-accent); }
.cf-steps li .mark { color: #3a4a5c; }

.cf-count {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--cf-line);
  font-size: 1.2rem; color: #eafff8;
}
.cf-lane.cf-accent .cf-count { color: var(--cf-accent); }
.cf-count small { font-size: .72rem; color: var(--cf-dim); display: block; margin-top: 4px; }

/* ---------------------------------------------------------------- controls */

.cf-controls {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 0; flex-wrap: wrap;
}
.cf-btn {
  font-family: var(--cf-mono); font-size: .76rem; color: var(--cf-text);
  background: #161d26; border: 1px solid var(--cf-line); border-radius: 8px;
  padding: 8px 14px; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.cf-btn:hover:not(:disabled) { background: #1d2733; border-color: #31435a; }
.cf-btn:disabled { opacity: .4; cursor: not-allowed; }
.cf-btn.go { color: #06110d; background: var(--cf-accent); border-color: var(--cf-accent); }
.cf-score { color: var(--cf-dim); font-size: .74rem; }
.cf-score b { color: var(--cf-accent); font-weight: 500; }

/* ------------------------------------------------------------------ tables */

.cf-table { width: 100%; border-collapse: collapse; font-size: .78rem; margin-top: .6rem; }
.cf-table th, .cf-table td {
  text-align: right; padding: 9px 12px; border-bottom: 1px solid #161d26;
}
.cf-table th:first-child, .cf-table td:first-child { text-align: left; color: var(--cf-dim); }
.cf-table thead th { color: var(--cf-dim); font-weight: 400; }
.cf-table thead th:last-child, .cf-table td:last-child { color: var(--cf-accent); }
.cf-table tr:last-child td { border-bottom: none; }

.cf-checks { margin-top: 14px; display: grid; gap: 6px; font-size: .76rem; }
.cf-checks div { color: var(--cf-dim); }
.cf-checks .ok { color: var(--cf-accent); }
.cf-checks .bad { color: var(--cf-warn); }
.cf code { color: var(--cf-dim); font-size: .74rem; }

@media (max-width: 860px) {
  .cf-race { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- single-cube (live) page */

.cf-single {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.cf-panel {
  background: linear-gradient(180deg, var(--cf-panel) 0%, var(--cf-panel2) 100%);
  border: 1px solid var(--cf-line);
  border-radius: 14px;
  padding: 20px;
  min-width: 0;
}
.cf-title { font-size: .98rem; color: #eafff8; }
.cf-titlesub {
  margin-top: 6px; color: var(--cf-dim); font-size: .72rem;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.cf-titlesub i { color: #3a4a5c; font-style: normal; }
.cf-rule { height: 1px; background: var(--cf-line); margin: 14px 0; }

.cf-moveline { display: flex; align-items: baseline; gap: 12px; min-height: 22px; margin-top: 10px; }
.cf-movetext { color: #dfe8f3; letter-spacing: .05em; flex: 1; word-break: break-word; font-size: .82rem; }
.cf-movetext b { color: var(--cf-accent); font-weight: 600; }
.cf-timing { color: var(--cf-dim); font-size: .7rem; white-space: nowrap; }

.cf-steps.cf-wide li { grid-template-columns: 16px 88px 1fr auto; }

.cf .dim { color: var(--cf-dim); }
.cf .ok { color: var(--cf-accent); }
.cf .bad { color: var(--cf-warn); }

.cf-verdict {
  margin-top: 16px; padding: 14px 15px; border-radius: 10px;
  border: 1px solid #4a2f26; background: #170f12;
  font-size: .76rem; line-height: 1.7;
}
.cf-verdict .head { color: var(--cf-warn); margin-bottom: 8px; }
.cf-verdict .why { color: var(--cf-dim); margin-top: 8px; }
.cf-verdict[hidden] { display: none !important; }

.cf-caption { color: var(--cf-dim); font-size: .74rem; text-align: center; margin-top: 12px; }

@media (max-width: 860px) {
  .cf-single { grid-template-columns: minmax(0, 1fr); }
}

/* The demo needs more room than the site's prose band: give the section that
   holds it a wider measure so the cubes render at a readable size. */
.peel-site .band.cf-band { max-width: 1340px; padding-left: 20px; padding-right: 20px; }
.peel-site .band.cf-band .cf { max-width: 1300px; margin-inline: auto; }
.cf h3 { font-family: var(--cf-mono); font-size: .95rem; font-weight: 500; color: #eafff8; margin: 34px 0 10px; }
.cf p { font-size: .82rem; line-height: 1.75; color: var(--cf-dim); margin: 10px 0 0; }
.cf p b { color: var(--cf-text); font-weight: 500; }

/* ============================================================================
   Presentation pass — glass. One material, used consistently: a translucent
   pane that picks up the page gradient behind it, a hairline edge, a single
   inset top highlight for the lit rim, and one deep soft shadow for lift.
   Nothing here changes behaviour; it is all surface.
   ========================================================================== */

.cf {
  --cf-glass: linear-gradient(162deg, rgba(255,255,255,.058) 0%, rgba(255,255,255,.016) 100%);
  --cf-edge: rgba(255,255,255,.09);
  --cf-rim: inset 0 1px 0 rgba(255,255,255,.075);
  --cf-lift: 0 30px 70px -24px rgba(0,0,0,.8);
}

.cf-lane,
.cf-card {
  background: var(--cf-glass);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  border: 1px solid var(--cf-edge);
  border-radius: 20px;
  box-shadow: var(--cf-rim), var(--cf-lift);
}

.cf-lane { padding: 26px 26px 24px; }

.cf-lane.cf-accent {
  border-color: rgba(130,222,207,.28);
  box-shadow: var(--cf-rim), var(--cf-lift),
              0 0 0 1px rgba(130,222,207,.07),
              0 0 60px -12px rgba(130,222,207,.22);
}

.cf-race { gap: 20px; }
.cf-lane h3 { font-size: 1.02rem; letter-spacing: .005em; }
.cf-sub { margin-top: 7px; font-size: .715rem; letter-spacing: .015em; }

/* the number is the hero of each lane — light weight, large, tight tracking */
.cf-count {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 2.15rem; font-weight: 300; letter-spacing: -.025em;
  line-height: 1.05;
}
.cf-count small {
  font-size: .705rem; font-weight: 400; letter-spacing: .02em;
  margin-top: 7px; opacity: .85;
}

.cf-bar { height: 4px; background: rgba(255,255,255,.07); }
.cf-steps li { padding: 6px 9px; }
.cf-steps li.active {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.09);
}

/* ------------------------------------------------------------ bottom cards */

.cf-cards { display: grid; gap: 20px; margin-top: 38px; }
.cf-card { padding: 30px 32px; }
.cf-card > h3:first-child { margin-top: 0; }
.cf-card h3 { font-size: 1rem; letter-spacing: .005em; margin-bottom: 4px; }

.cf-card-warn {
  border-color: rgba(255,138,106,.22);
  box-shadow: var(--cf-rim), var(--cf-lift), 0 0 60px -18px rgba(255,138,106,.16);
}

.cf-table { margin-top: 18px; font-size: .8rem; }
.cf-table th, .cf-table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.055);
}
.cf-table thead th {
  font-size: .705rem; letter-spacing: .09em; text-transform: uppercase;
  padding-bottom: 11px;
}
.cf-table tbody tr { transition: background .18s; }
.cf-table tbody tr:hover { background: rgba(255,255,255,.028); }
.cf-table td { font-variant-numeric: tabular-nums; }

.cf-checks {
  margin-top: 18px; padding: 16px 18px; border-radius: 13px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.055);
  font-size: .755rem; line-height: 1.85;
}
.cf-fine { font-size: .745rem; color: var(--cf-dim); margin-top: 16px; line-height: 1.75; }

/* ------------------------------------------------------------- controls */

.cf-controls { margin-top: 24px; gap: 12px; }
.cf-btn {
  border-radius: 11px; padding: 10px 18px; font-size: .78rem;
  background: rgba(255,255,255,.055); border-color: var(--cf-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.cf-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16);
}
.cf-btn.go {
  background: linear-gradient(180deg, #9bf0de, #6fd0bb);
  border-color: rgba(155,240,222,.5); color: #052018;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 24px -8px rgba(130,222,207,.5);
}
.cf-btn.go:hover:not(:disabled) { background: linear-gradient(180deg, #aff5e6, #7cdbc6); }
.cf-score { font-size: .765rem; letter-spacing: .01em; }

/* padding fix — rows were running into their own edges */
.cf-steps { margin-top: 18px; gap: 7px; }
.cf-steps li { padding: 9px 14px; gap: 12px; }
.cf-steps.cf-wide li { grid-template-columns: 18px 92px 1fr auto; }
.cf-lane { padding: 28px 28px 26px; }
.cf-card { padding: 32px 34px; }
.cf-checks { padding: 18px 20px; }

/* ------------------------------------------------- challenger chooser + board */

.cf-lanehead {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; justify-content: space-between;
}
.cf-select {
  font-family: var(--cf-mono); font-size: .78rem; color: var(--cf-text);
  background: rgba(255,255,255,.06); border: 1px solid var(--cf-edge);
  border-radius: 10px; padding: 7px 12px; cursor: pointer;
  min-width: 200px; max-width: 100%;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.cf-select:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); }
.cf-select:focus-visible { outline: 2px solid var(--cf-accent2); outline-offset: 2px; }
.cf-select option { background: #11161d; color: var(--cf-text); }

.cf-sub[data-sub] { min-height: 1.1em; margin-top: 9px; }

.cf-scramble { color: var(--cf-dim); font-size: .72rem; letter-spacing: .02em; }
.cf-scramble code { color: var(--cf-text); font-size: .72rem; }

.cf-board td:first-child { color: var(--cf-text); }
.cf-board td:nth-child(2) { font-size: .72rem; letter-spacing: .05em; }
.cf-board td:last-child, .cf-board td:nth-child(3) { color: var(--cf-dim); }
.cf-board tr.cf-us td { color: var(--cf-accent); }
.cf-board tr.cf-us td:first-child { color: var(--cf-accent); font-weight: 500; }
.cf-board .ok { color: var(--cf-accent); }
.cf-board .bad { color: var(--cf-warn); }
