/* Layout and the few pieces only the app uses. Shared pieces live in components.css. */

a {
  color: var(--gold-hi);
}

.shell {
  min-height: 100dvh;
}

.screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--sp-5);
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) 104px;
  outline: none;
}

.screen-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.screen-head > div:first-child {
  flex: 1 1 14rem;
  min-width: 0;
}

.screen-head h1 {
  margin-top: 14px;
  font: 500 clamp(2.6rem, 11vw, 3.6rem) / 1 var(--font-display);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}

/* The line above a screen's title: small gold capitals over a gold rule, like the date line on a program. */
.screen-head .eyebrow {
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-gold);
}

h2 {
  font-size: 1.35rem;
}

.stack {
  display: grid;
  gap: var(--sp-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
  align-items: start;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--sp-4);
  align-items: start;
}

.tiles .wide {
  grid-column: 1 / -1;
}

.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

/* Navigation: words along the foot of the ice on phones (over a fade, so nothing collides with them), a list down the side on wide screens. */

.nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 12px env(safe-area-inset-bottom);
  background: #070e26;
  border-top: 1px solid var(--gold);
  pointer-events: none;
}

.nav-wrap .tabbar {
  width: min(100%, 520px);
  pointer-events: auto;
}

.tab {
  text-decoration: none;
}

.toast {
  bottom: calc(84px + env(safe-area-inset-bottom));
}

@media (min-width: 960px) {
  .shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
  }

  .nav-wrap {
    position: sticky;
    top: 16px;
    bottom: auto;
    display: block;
    padding: 28px 0 0 20px;
    background: none;
    border-top: 0;
  }

  .nav-wrap .tabbar {
    width: 100%;
    flex-direction: column;
    gap: 2px;
  }

  .tab {
    display: flex;
    justify-content: flex-start;
    min-height: 0;
    padding: 14px 16px 14px 20px;
    font-size: 0.84rem;
  }

  .tab[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--gold);
  }

  .screen {
    padding-bottom: 64px;
  }

  .toast {
    bottom: 28px;
  }
}

/* Home: the week's figure eight, the streak, the level, and what comes next. */

/* The poster: who is on tonight, in lights over the level. */

.stage-hero {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 250px;
  overflow: hidden;
  text-align: center;
}

.stage-hero__ghost {
  position: absolute;
  right: -26px;
  top: -24px;
  color: rgba(150, 200, 245, 0.11);
  font: 800 380px / 0.8 var(--font-display);
  pointer-events: none;
}

.stage-hero__pre {
  position: relative;
  margin-top: 30px;
  color: var(--gold);
  font: 400 1.25rem/1.2 var(--font-display);
}

.stage-hero h1 {
  position: relative;
  max-width: 100%;
  margin: 0;
  font: 500 8.4rem / 0.9 var(--font-display);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.4);
}

.stage-hero h1.is-l {
  font-size: 5.6rem;
}

.stage-hero h1.is-m {
  font-size: 4rem;
}

.stage-hero h1.is-s {
  font-size: 3rem;
  line-height: 1;
}

.stage-hero__sub {
  position: relative;
  margin-top: 10px;
  color: var(--gold);
  font: 600 0.8rem/1.3 var(--font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* The ticket: your next ice, with a stub to tear off. */

.ticket {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
  transition: transform 0.4s var(--spring);
}

.ticket:hover {
  transform: translateY(-2px);
}

.ticket:active {
  transform: scale(0.98);
}

.ticket__main,
.ticket__stub {
  background: var(--paper);
}

.ticket__main {
  display: grid;
  gap: 2px;
  padding: 16px 22px 14px;
  border-radius: 16px 16px 0 0;
  -webkit-mask: radial-gradient(circle 13px at 0 100%, #0000 97%, #000), radial-gradient(circle 13px at 100% 100%, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle 13px at 0 100%, #0000 97%, #000), radial-gradient(circle 13px at 100% 100%, #0000 97%, #000);
  mask-composite: intersect;
}

.ticket__main small,
.ticket__stub small {
  color: #c4382a;
  font: 700 0.72rem/1.2 var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ticket__main b {
  font: 700 2.7rem/0.98 var(--font-display);
}

.ticket__main > span {
  color: #3b4a6b;
  font-size: 1.02rem;
}

.ticket__stub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 12px 22px 14px;
  border-radius: 0 0 16px 16px;
  background-image: linear-gradient(90deg, rgba(20, 33, 63, 0.4) 50%, transparent 0);
  background-size: 12px 2px;
  background-repeat: repeat-x;
  background-position: 14px 0;
  -webkit-mask: radial-gradient(circle 13px at 0 0, #0000 97%, #000), radial-gradient(circle 13px at 100% 0, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle 13px at 0 0, #0000 97%, #000), radial-gradient(circle 13px at 100% 0, #0000 97%, #000);
  mask-composite: intersect;
}

.ticket__stub small {
  color: #5a6786;
}

.ticket__stub b {
  display: block;
  font: 700 1.9rem/1 var(--font-display);
}

.barcode {
  width: 140px;
  height: 36px;
  background: repeating-linear-gradient(90deg, #14213f 0 2px, transparent 2px 4px, #14213f 4px 5px, transparent 5px 9px, #14213f 9px 12px, transparent 12px 14px);
}

/* The program sheet: what you are skating, with your last rating and your goal. */

.protocol {
  padding: 16px 18px 12px;
  border-radius: 6px;
  background: #ecebe4;
  color: #17181c;
}

.protocol__hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: 6px;
  border-bottom: 3px solid #17181c;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.protocol__hdr b {
  font-size: 0.88rem;
  letter-spacing: 0.24em;
}

.protocol table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.protocol th {
  padding: 8px 4px 4px;
  color: #5a5d66;
  font: 700 0.68rem/1.2 var(--font-ui);
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
}

.protocol th:nth-child(n + 3),
.protocol td.n {
  text-align: right;
}

.protocol td {
  padding: 9px 4px;
  border-top: 1px solid rgba(23, 24, 28, 0.3);
  line-height: 1.3;
}

.protocol td:first-child {
  width: 2.4em;
  color: #7a1d37;
  font: 700 1rem/1.3 var(--font-display);
}

.protocol td.n {
  width: 3em;
  font: 700 1.2rem/1.3 var(--font-display);
}

.protocol tr.hot td {
  background: rgba(217, 56, 44, 0.09);
}

.protocol__more,
.protocol__foot {
  margin-top: 6px;
  color: #5a5d66;
  font-size: 0.92rem;
}

.protocol__link {
  padding: 0;
  border: 0;
  background: none;
  color: #17181c;
  font: 600 0.92rem/1.3 var(--font-ui);
  text-decoration: underline;
  text-decoration-color: #d9382c;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.home__go {
  justify-self: center;
  width: min(100%, 320px);
  justify-content: space-between;
}

.home__go .ic {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

/* The week's stubs: a ticket stub for each day, cream for a day you skated. */

.stubs {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  margin-top: 4px;
}

.stubs .st {
  display: grid;
  place-items: center;
  width: 42px;
  height: 50px;
  border-radius: 5px;
  background: var(--cream);
  color: #4a0f21;
  font: 700 1.05rem/1 var(--font-display);
  -webkit-mask: radial-gradient(circle 5px at 0 50%, #0000 97%, #000), radial-gradient(circle 5px at 100% 50%, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask: radial-gradient(circle 5px at 0 50%, #0000 97%, #000), radial-gradient(circle 5px at 100% 50%, #0000 97%, #000);
  mask-composite: intersect;
}

.stubs .st.is-off {
  border: 1.5px dashed rgba(14, 35, 71, 0.4);
  background: none;
  color: rgba(14, 35, 71, 0.55);
  font: 600 0.78rem/1 var(--font-ui);
  -webkit-mask: none;
  mask: none;
}

.stubs .st.is-today {
  box-shadow: 0 0 0 2px var(--gold-hi);
}

/* Backstage: flap tiles for blades and level, like a departures board. */

.backstage {
  display: grid;
  gap: var(--sp-3);
}

.fl small {
  display: block;
  margin-bottom: 5px;
  color: rgba(14, 35, 71, 0.62);
  font: 700 0.72rem/1.2 var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.flaps {
  display: flex;
  gap: 2px;
}

.f {
  display: grid;
  place-items: center;
  width: 17px;
  height: 32px;
  border-radius: 3px;
  background: linear-gradient(#26282f 49%, #0e0f13 50%, #1d1f25 51%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--cream);
  font: 600 17px / 1 var(--font-ui);
  text-transform: uppercase;
}

.f--gap {
  width: 9px;
  background: none;
  box-shadow: none;
}

.f--hi {
  color: #f0b43c;
}


.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
}

.home__hero,
.home__rest {
  display: grid;
  align-content: start;
  gap: var(--sp-5);
  min-width: 0;
}

.home__sub {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 1.1rem;
}

@media (min-width: 960px) {
  .home {
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }

  .home__hero {
    position: sticky;
    top: 20px;
  }
}

.home__eight {
  display: grid;
  gap: var(--sp-3);
  justify-items: center;
  text-align: center;
}

.home__eight .cp-label {
  justify-self: stretch;
}

.home__caption {
  max-width: 30ch;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.home__caption.is-whole {
  color: #ffe3a0;
}

/* The figure eight: gold is traced, dotted is still to come, and a spark rides at the blade. It is the main button on Home. */

.eight {
  display: block;
  width: 100%;
  max-width: 440px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.45s var(--spring);
  -webkit-tap-highlight-color: transparent;
}

.eight:hover {
  transform: scale(1.015);
}

.eight:active {
  transform: scale(0.97);
}

.eight__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.eight__guide {
  fill: none;
  stroke: rgba(236, 248, 255, 0.42);
  stroke-width: 1.6;
  stroke-dasharray: 1.5 7;
  stroke-linecap: round;
}

.eight__done .e {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.e--glow {
  stroke: rgba(160, 225, 255, 0.22);
  stroke-width: 7;
}

.e--echo1 {
  stroke: rgba(255, 255, 255, 0.36);
  stroke-width: 1;
  transform: translate(-2.4px, -1.6px);
}

.e--echo2 {
  stroke: rgba(255, 255, 255, 0.46);
  stroke-width: 1;
  transform: translate(2px, -2.2px);
}

.e--main {
  stroke: #ffe9b8;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 5px rgba(255, 214, 130, 0.9));
}

.eight__star {
  fill: #fff;
  filter: drop-shadow(0 0 7px #ffd98a);
}

.eight__tiny {
  fill: rgba(236, 248, 255, 0.88);
  font: 600 11px var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eight__big {
  fill: #fff;
  font: 700 25px var(--font-display);
}

.eight__go {
  fill: #ffe3a0;
  font: 700 14px var(--font-ui);
  letter-spacing: 0.1em;
}

.eight__dim {
  opacity: 0.6;
}

.eight:focus-visible {
  outline-offset: 6px;
  border-radius: 24px;
}

.eight__svg.is-tracing .e {
  animation: eight-trace 1.4s cubic-bezier(0.3, 0.7, 0.2, 1) both;
}

.eight__svg.is-tracing .eight__star {
  animation-fill-mode: backwards;
}

@keyframes eight-trace {
  from {
    stroke-dasharray: 0 1000;
  }
}

/* The streak: a little gold eight for each week in a row. */

.streak {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-weight: 500;
}

.streak__eights {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ic--eight {
  width: 30px;
  height: 17px;
  overflow: visible;
  stroke-width: 1.9;
}

.ic--eight.is-done {
  color: var(--sun);
  filter: drop-shadow(0 0 5px rgba(255, 200, 110, 0.7));
}

.ic--eight.is-ghost {
  color: rgba(236, 248, 255, 0.45);
  stroke-dasharray: 1.5 3.5;
}

/* Tiles end in a quiet gold link, not a big button. */

.tile > .btn--glass.btn--small {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--sun);
  font-weight: 600;
}

.tile > .btn--glass.btn--small::after {
  content: "\2192";
  font-weight: 500;
}

.tile > .btn--glass.btn--small:hover {
  background: none;
  filter: brightness(1.15);
}

/* Level, what comes next, and blades: three lines on the ice. */

.lines {
  display: grid;
  gap: var(--sp-2);
  border-top: 1px solid var(--rule);
}

.line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 14px 0 4px;
}

.line__val {
  text-align: right;
}

.line__val .num {
  font-size: 1.5rem;
}

.line--btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px var(--sp-3);
  align-items: center;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.line--btn .eyebrow {
  grid-column: 1;
}

.line__name {
  grid-column: 1;
  font-weight: 500;
  line-height: 1.3;
}

.line__go {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--sun);
}

.line__go .ic {
  width: 22px;
  height: 22px;
}


.nudge {
  display: grid;
  gap: var(--sp-2);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: var(--sp-3);
}

/* A time in a number cell: 10 hrs 48 mins, the units small beside the numbers. */
.tn {
  white-space: nowrap;
}

.tn small {
  margin: 0 0.12em 0 0.14em;
  font: 500 0.42em/1 var(--font-ui);
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.stat-n {
  font-size: 1.9rem;
  line-height: 1.1;
}

.xp-top {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.xp-big {
  font-size: 1.9rem;
}

.mini--big {
  flex-wrap: wrap;
}

.mini--big .skate {
  width: 38px;
  height: 28px;
}

/* Lists, plans, and rows you can tap */

.row--pick {
  flex-wrap: wrap;
  cursor: pointer;
  border-radius: 0;
}

/* On a narrow screen the skates and chips drop under the name instead of squeezing it. */
.row--pick .grow {
  flex: 1 1 160px;
}

.row--pick .mini,
.row--pick .chip--tag {
  margin-left: auto;
}

.row--pick:hover {
  background: rgba(255, 255, 255, 0.06);
}

.row--pick .tick {
  pointer-events: none;
}

.row--pick[aria-checked="true"] .tick {
  background: linear-gradient(180deg, #ffffff, var(--ice));
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.08);
}

.row--pick[aria-checked="true"] .tick .ic {
  opacity: 1;
}

.row .chip {
  flex: none;
}

.chip--tag {
  padding: 2px 10px;
  font-size: 0.78rem;
  cursor: default;
  box-shadow: none;
}

.chip--discard {
  justify-self: start;
  border-color: rgba(255, 170, 160, 0.6);
  color: #ffc4bb;
}

.chip:disabled,
.btn:disabled,
.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plan-grid,
.skate-grid {
  display: grid;
  gap: var(--sp-4);
}

@media (min-width: 960px) {
  .plan-grid,
  .skate-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
  }

  .plan-summary {
    position: sticky;
    top: 16px;
  }
}

.plan-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
  min-width: 0;
}

/* Long skill names wrap inside the plan instead of pushing it off a narrow phone. */
@media (max-width: 959px) {
  .plan-grid,
  .skate-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plan-item .grow,
.queue-btn .grow {
  min-width: 0;
  overflow-wrap: break-word;
}

/* Stars on the paper of the plan: dark outlines and a deeper gold, so they show on the light paper. */
.plan-summary .mini .star {
  stroke: #8d8676;
}

.plan-summary .mini .star.on {
  fill: #c98a1c;
  stroke: #c98a1c;
}

.queue-btn {
  min-width: 0;
}

.plan-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 4px;
  border-top: 1px solid var(--glass-edge-soft);
}

.plan-item:first-child {
  border-top: 0;
}

.plan-item .grow {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  line-height: 1.3;
}

.plan-n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.82rem;
  font-weight: 600;
}

.plan-tools {
  display: flex;
  gap: 4px;
}

.queue-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 8px 6px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.plan-item.is-current {
  background: rgba(166, 241, 255, 0.12);
  border-radius: var(--r-md);
}

.browse-list {
  max-height: min(40vh, 360px);
  overflow: auto;
}

/* Your plan is a program sheet: paper, with ink. */

.plan-summary.card {
  padding: 16px 18px;
  border: 0;
  border-radius: 6px;
  background: #ecebe4;
  color: #17181c;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.plan-summary h2 {
  font: 700 1.3rem/1.2 var(--font-display);
}

.plan-summary .dim,
.plan-summary .note {
  color: #4a4d56;
}

.plan-summary .chip--on {
  border-color: #17181c;
  background: none;
  color: #17181c;
}

.plan-summary .plan-item {
  border-top-color: rgba(23, 24, 28, 0.25);
}

.plan-summary .plan-n {
  background: rgba(23, 24, 28, 0.1);
  color: #7a1d37;
  font: 700 0.9rem/1 var(--font-display);
}

.plan-summary .plan-item.is-current {
  background: rgba(217, 56, 44, 0.09);
}

.plan-summary .icon-btn {
  border-color: rgba(23, 24, 28, 0.4);
  color: #17181c;
}

.plan-summary .icon-btn:hover {
  background: rgba(23, 24, 28, 0.08);
}

.plan-summary .btn {
  --bg1: #17181c;
  --bg2: #17181c;
  --fg: #ecebe4;
}

.plan-summary .btn--glass {
  --fg: #17181c;
  border-color: #17181c;
  background: none;
  color: #17181c;
}

.plan-summary .bar {
  background: rgba(23, 24, 28, 0.15);
}

.plan-summary .status--warn {
  color: #b0302a;
}

/* Skate screen */

.timer-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.timer {
  font: 500 2.7rem/1.05 var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.timer-side {
  margin-left: auto;
  text-align: right;
}

.skill-card {
  display: grid;
  gap: var(--sp-2);
}

.skill-title {
  font: 500 clamp(1.7rem, 6.4vw, 2.3rem) / 1.15 var(--font-display);
}

.rating {
  flex-wrap: wrap;
}

.rating-label {
  margin-top: var(--sp-2);
  min-height: 1.6em;
  color: var(--text-dim);
  font-weight: 500;
}

.pip.miss {
  border-color: var(--coral);
}

.note-box summary {
  padding: var(--sp-2) 0;
  color: var(--text-dim);
  font-weight: 500;
  cursor: pointer;
}

.note-input {
  width: 100%;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.idle-card {
  display: grid;
  gap: var(--sp-3);
}

/* Progress */

.wkchart {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
  height: 160px;
}

.wk {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.wk i {
  align-self: end;
  justify-self: center;
  width: min(100%, 44px);
  height: var(--h);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--ice-bright), var(--ice));
}

.wk i.today {
  background: linear-gradient(180deg, #ffeab0, #f5a742);
  box-shadow: 0 0 12px rgba(255, 190, 100, 0.6);
}

.wk i.none {
  opacity: 0.3;
}

.sess-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sess-head .grow {
  flex: 1;
}

.sess-body {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.spark {
  width: 100%;
  max-width: 320px;
}

/* Forms, sheets, and lists on the Profile screen */

.choices {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.done {
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  text-align: center;
}

.sheet__title--small {
  font: 800 1.8rem / 1.1 var(--font-display);
}

.sources {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 480px) {
  .xp-top {
    flex-wrap: wrap;
  }

  .two-fields {
    grid-template-columns: 1fr;
  }
}

/* Never let one wide child (a long select option, a row of chips) stretch a whole column past the screen. */

.screen > *,
.stack > *,
.grid-2 > *,
.tiles > *,
.plan-grid > *,
.skate-grid > * {
  min-width: 0;
}

.stack,
.plan-grid,
.skate-grid {
  grid-template-columns: minmax(0, 1fr);
}

.field {
  min-width: 0;
}

.input {
  max-width: 100%;
}

select.input {
  width: 100%;
  text-overflow: ellipsis;
}

@media (min-width: 960px) {
  .plan-grid,
  .skate-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

/* The Help card on Profile (it starts the guided tour) */

.help-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.help-card .grow {
  flex: 1 1 260px;
  min-width: 0;
}

/* The button is a long sentence: on the narrowest phones it wraps instead of running off the screen. */
.help-card .btn {
  max-width: 100%;
  padding-block: 10px;
  white-space: normal;
  text-align: center;
}

/* Ice times (screens/ice.js): the week of sessions from all your rinks. Each rink has its own small color, shown as a dot and a
   strip on the card. A starred session gets a gold edge. */

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--rk, var(--ice));
}

.chip .dot {
  margin-right: 2px;
}

.weekbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.weekbar__label {
  display: grid;
  flex: 1 1 150px;
  min-width: 0;
  text-align: center;
}

.weekbar__label strong {
  font-size: 1.1rem;
}

.ice-filters {
  display: grid;
  gap: var(--sp-3);
}

.ice-filters .seg {
  justify-self: start;
}

.ice-week {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 720px) {
  .ice-week {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

/* The week gets a wider page than other screens, and all seven days sit side by side only when there is really room for them. */
[data-route="ice"] .screen {
  max-width: 1320px;
}

@media (min-width: 1700px) {
  .ice-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--sp-2);
  }
}

.ice-day {
  display: grid;
  align-content: start;
  gap: var(--sp-2);
  min-width: 0;
}

.ice-day__head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  padding: 0 4px;
  font: 600 1rem/1.2 var(--font-ui);
}

.ice-day__head .num {
  font-size: 1.75rem;
  line-height: 1;
}

.ice-day.is-today .ice-day__head > span:first-child {
  color: var(--sun);
}

.ice-none {
  padding: 0 4px;
  font-size: 0.9rem;
}

@media (max-width: 719px) {
  .ice-day.is-empty {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
  }
}

.ice-card {
  position: relative;
  display: grid;
  border: 1px solid var(--rule);
  border-left: 5px solid var(--rk, var(--ice));
  border-radius: var(--r-md);
  background: rgba(4, 14, 36, 0.5);
}

.ice-card.is-pick {
  border-color: rgba(255, 217, 138, 0.85);
  border-left-color: var(--rk, var(--ice));
  background: linear-gradient(rgba(255, 217, 138, 0.12), rgba(255, 217, 138, 0.12)), linear-gradient(var(--glass-tint), var(--glass-tint));
}

.ice-card__main {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  padding: 12px 52px 12px 12px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ice-time {
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ice-rink {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.92rem;
  overflow-wrap: break-word;
}

.ice-note {
  font-size: 0.88rem;
  overflow-wrap: break-word;
}

.ice-card__main .chip {
  margin-top: 4px;
  cursor: inherit;
}

.ice-star {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}

.ice-star .ic {
  width: 24px;
  height: 24px;
}

.ice-star[aria-pressed="true"] {
  color: var(--sun);
}

.ice-clash {
  margin: 0;
  padding: 0 12px 10px;
  color: #ffb4a8;
  font-size: 0.88rem;
}

.slot-link {
  margin-top: var(--sp-3);
}

.two-fields .input {
  width: 100%;
  min-width: 0;
}

/* Six tabs on a phone: a little tighter, and tighter again on the smallest ones so the words never touch */
@media (max-width: 420px) {
  .tab {
    padding: 10px 1px 6px;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
  }
}

@media (max-width: 350px) {
  .tab {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }
}

/* Form sheets (rinks, sessions, calendar import): Save and Cancel stay at the bottom of the sheet while the form scrolls under them. */
.sheet--form .sheet__foot {
  position: sticky;
  bottom: 0;
  margin: 0 calc(-1 * var(--sp-5)) calc(-1 * var(--sp-5));
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  background: linear-gradient(rgba(6, 20, 48, 0), rgba(6, 20, 48, 0.97) 28%);
}

.ice-filters .seg button {
  padding: 8px 14px;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .ice-filters .seg button {
    padding: 8px 10px;
    font-size: 0.92rem;
  }
}

.ice-card.is-over {
  opacity: 0.6;
}

.ice-stale {
  color: #ffd98a;
  font-size: 0.88rem;
}

.ice-rinkrow {
  flex-wrap: wrap;
}

.ice-rinkrow .grow {
  min-width: 160px;
}

.howto {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0 0 0 1.1em;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Badges (js/badges.js): gold medals for what you have earned, dashed ghosts for what you have not. */

.medal {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 244, 205, 0.95);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fff4c9, #ffd98a 42%, #f5a742);
  color: #4a2f00;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 6px rgba(120, 70, 0, 0.35), 0 6px 14px rgba(0, 8, 34, 0.4);
}

.medal .ic {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.medal--locked {
  border: 1.5px dashed var(--glass-edge);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-faint);
  box-shadow: none;
}

.medal--xl {
  width: 124px;
  height: 124px;
}

.medal--xl .ic {
  width: 56px;
  height: 56px;
}

.cele .medal--pop {
  animation: badge-in 1s var(--spring-soft) both;
}

.cele .cluster {
  position: relative;
  justify-content: center;
}

.medals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.medals .medal {
  width: 44px;
  height: 44px;
}

.medals .medal .ic {
  width: 20px;
  height: 20px;
}

.trophies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--sp-3);
}

.trophy {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: var(--sp-3) var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.trophy:hover {
  background: rgba(255, 255, 255, 0.07);
}

.trophy__name {
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.trophy__sub {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.trophy:not(.is-earned) .trophy__name {
  color: var(--text-dim);
  font-weight: 500;
}

.trophy__bar {
  width: 70%;
  height: 5px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}

.trophy__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ice), var(--sun));
}

.row--btn {
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.badge-sheet {
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  text-align: center;
}

/* Four tabs on Progress (Overview, Badges, Skills, Sessions) have to fit on a small phone. */
.seg {
  max-width: 100%;
}

@media (max-width: 420px) {
  .seg button {
    padding: 8px 11px;
  }
}

@media (max-width: 340px) {
  .seg button {
    padding: 8px 6px;
    font-size: 0.9rem;
  }
}

/* Friends (js/friends.js): the board, your card, and the sheets. */

.rank {
  display: inline-block;
  min-width: 1.6ch;
  font-size: 1.4rem;
  text-align: center;
}

.friend-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.row--you .avatar,
.row--you .rank {
  color: var(--sun);
}

/* Progress has five tabs now; on a small phone they scroll sideways instead of squeezing. */
.seg--scroll {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.seg--scroll::-webkit-scrollbar {
  display: none;
}

.seg--scroll button {
  flex: none;
  scroll-snap-align: center;
}

/* Test readiness (js/testprep.js): a ring for each part, and the last few ratings of each skill as little squares. */

.rings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-5);
}

.ring-box {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.ring {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--sun) calc(var(--v, 0) * 1%), var(--track) 0);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: rgba(5, 18, 44, 0.96);
}

.ring b {
  position: relative;
  font: 600 1.15rem/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
}

.pips--mini {
  gap: 3px;
  margin: 0;
}

.pips--mini .pip {
  width: 11px;
  height: 11px;
  border-radius: 4px;
}

/* A row that is done but is not a checkbox (an earned skating skill) looks like a ticked one. */
.row--pick .tick[data-on="true"] {
  background: linear-gradient(180deg, #ffffff, var(--ice));
  border-color: rgba(255, 255, 255, 0.8);
}

.row--pick .tick[data-on="true"] .ic {
  opacity: 1;
}

.split > .chip {
  flex: none;
  white-space: nowrap;
}

/* The practice calendar (js/calendar.js) */

.cal,
.cal-nav {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

.cal {
  display: grid;
  gap: 4px;
}

.cal-head,
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-head span {
  color: var(--text-faint);
  font-size: 0.82rem;
  text-align: center;
}

.cal-week {
  padding: 2px 0;
  border-radius: 999px;
}

.cal-week.is-streak {
  background: linear-gradient(90deg, rgba(255, 217, 138, 0.2), rgba(255, 217, 138, 0.04));
}

.cal-day,
.cal-empty {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-dim);
  font: 500 0.98rem/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
}

button.cal-day {
  cursor: pointer;
}

.cal-day.has {
  background: radial-gradient(circle at 32% 26%, #fff4c9, #ffd98a 45%, #f5a742);
  color: #4a2f00;
  font-weight: 600;
}

.cal-day.today {
  outline: 2px solid var(--ice-bright);
  outline-offset: 1px;
}

.cal-plan {
  position: absolute;
  bottom: 14%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--ice-bright);
  box-shadow: 0 0 0 1.5px rgba(6, 22, 65, 0.6);
}

/* Goals and coach homework on the Plan screen */

.goal-row,
.hw-row {
  flex-wrap: wrap;
}

.goal-row .grow,
.hw-row .grow {
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: break-word;
}

.hw-row .tick {
  position: relative;
}

.hw-row .tick::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.hw-row.is-done .grow {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

/* A green dot at the top of a calendar day marks off-ice work */
.cal-off {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #7ee2a8;
  box-shadow: 0 0 0 1.5px rgba(6, 22, 65, 0.6);
}

/* Your color (js/looks.js): a swatch is an avatar in that color, with its name, and what unlocks it when it is still locked. */

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--sp-2);
}

.swatch {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  min-width: 0;
  padding: var(--sp-3) var(--sp-2);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.swatch .avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.swatch[aria-pressed="true"] {
  border-color: var(--ice-bright);
  background: rgba(255, 255, 255, 0.08);
}

.swatch__name {
  font-weight: 600;
}

.swatch__lock {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.2;
}

.swatch.is-locked .avatar {
  opacity: 0.4;
  filter: grayscale(0.6);
}

.swatch.is-locked .swatch__name {
  color: var(--text-dim);
  font-weight: 500;
}

/* The narrowest phones: long skill names may break inside a word, and the plan's small buttons get a little smaller, so nothing runs
   off the screen. */
@media (max-width: 400px) {
  .plan-item .grow,
  .queue-btn .grow {
    overflow-wrap: anywhere;
  }

  .plan-item {
    gap: var(--sp-2);
  }

  .plan-tools .icon-btn--sm {
    width: 34px;
    height: 34px;
  }
}
