/* The daily spread keeps the running total and its entry form on the same sheet. */
body[data-student-view="today"] {
  .journal {
    --journal-rule: color-mix(in srgb, var(--forest) 28%, var(--paper));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .home-window {
    height: 88px;
    padding: 3px;
    border: 1px solid #847966;
    border-radius: 3px;
    background: #d6c8ac;
    box-shadow: none;
  }
  .window-view {
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 71% 32%, var(--window-light) 0 6px, transparent 7px),
      radial-gradient(ellipse 49% 145% at 70% 100%, var(--sky-base) 10%, transparent 94%),
      linear-gradient(174deg, var(--sky-top) 8%, var(--sky-base) 98%);
  }
  .window-view::after {
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 32%, #383c35 32% calc(32% + 1px),
      #bcaf98 calc(32% + 1px) calc(32% + 3px), transparent calc(32% + 3px) 80%,
      #3a4036 80% calc(80% + 1px), #bcaf98 calc(80% + 1px) calc(80% + 3px), transparent calc(80% + 3px));
    box-shadow: inset 0 -2px 0 #4a4b40, inset 0 1px 3px #19292555;
  }
  .window-ridge {
    background: color-mix(in srgb, #335755 53%, var(--sky-base));
    clip-path: polygon(0 58%,6% 55%,10% 60%,18% 42%,22% 47%,27% 39%,32% 51%,
      41% 52%,47% 63%,55% 61%,61% 53%,66% 58%,71% 52%,79% 57%,87% 39%,
      90% 42%,93% 36%,100% 47%,100% 100%,0 100%);
  }
  .window-hills {
    background: color-mix(in srgb, #214940 80%, var(--sky-base));
    clip-path: polygon(0 70%,5% 67%,13% 76%,18% 75%,23% 80%,31% 73%,37% 74%,
      40% 69%,48% 65%,54% 72%,57% 73%,63% 78%,72% 77%,78% 69%,86% 71%,
      93% 62%,100% 66%,100% 100%,0 100%);
  }
  .window-campus {
    position: absolute;
    bottom: 3px;
    left: 9%;
    width: clamp(65px, 13%, 135px);
    height: 18px;
    background: repeating-linear-gradient(90deg, #314a43 0 5px, transparent 5px 8px) 0 0 / 100% 100%,
      repeating-linear-gradient(0deg, #314a43 0 4px, var(--sky-base) 4px 8px);
    border: 2px solid #314a43;
  }
  .window-campus::before {
    content: "";
    position: absolute;
    inset: -7px -5px auto;
    height: 7px;
    background: #283f3a;
    clip-path: polygon(7% 0, 90% 0, 100% 100%, 0 100%);
  }
  .window-campus i {
    position: absolute;
    bottom: 20px;
    left: 13%;
    width: 13px;
    height: 5px;
    background: #314a43;
  }
  .window-trees {
    position: absolute;
    right: 0;
    bottom: 0;
    width: clamp(65px, 12%, 130px);
    height: 44px;
    background: #293e37;
    clip-path: polygon(0 100%,9% 73%,14% 78%,18% 58%,23% 72%,29% 66%,34% 82%,
      43% 47%,47% 62%,51% 38%,58% 68%,67% 19%,73% 44%,80% 6%,86% 38%,93% 0,100% 30%,100% 100%);
  }
  .journal-dateline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 18px;
  }
  .journal-dateline h1 { font-family: var(--journal-display); font-weight: 700; }
  .journal-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; color: var(--muted); font-size: .85rem; }
  .journal-date time { color: var(--ink); font-weight: 650; }
  .journal-date span { font-size: .8em; }
  .home-season-badges { margin-left: auto; }
  .home-record {
    gap: 0;
    overflow: clip;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr);
    border-top: 3px solid var(--forest);
    border-bottom: 1px solid var(--journal-rule);
    background: var(--paper);
  }
  .home-record > .card, .home-ghost, [data-home-curling] { border: 0; border-radius: 0; box-shadow: none; }
  .home-record > .hero {
    color: var(--ink);
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    border-right: 1px solid var(--journal-rule);
    background: repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--forest) 9%, transparent) 27px 28px),
      color-mix(in srgb, var(--forest) 5%, var(--paper));
  }
  .home-record > .card { padding: clamp(20px, 3vw, 36px); }
  .hero h2 { color: var(--forest); font: 670 .92rem/1.45 system-ui,sans-serif; letter-spacing: .08em; }
  .hero .stats-feedback { color: var(--forest); }
  .hero .hero-number {
    margin: 6px 0 0;
    color: var(--deep);
    font-family: var(--journal-numbers, Georgia, "Hiragino Mincho ProN", serif);
    font-size: clamp(3.1rem, 6.2vw, 5.2rem);
    line-height: 1.12;
    letter-spacing: -.055em;
    font-weight: 500;
    font-variant-numeric: lining-nums tabular-nums;
  }
  .hero-number small { font: 620 .32em/1 system-ui, sans-serif; }
  .journal-record-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; }
  .journal-record-meta p { color: var(--muted); }
  .journal-record-meta .tag { margin: 0; background: var(--paper); color: var(--ink); border: 1px solid var(--journal-rule); }
  .home-record .add-form { margin-top: 15px; }
  .home-entry-actions .ghost { background: transparent; text-decoration: underline; text-underline-offset: .22em; }
  .stopwatch { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--journal-rule); }
  .stopwatch [data-action="stopwatch-start"] { color: var(--forest); background: transparent; border: 0; padding-inline: 0; gap: 9px; }
  .stopwatch [data-action="stopwatch-start"]::before {
    content: ""; width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 50%;
    background: linear-gradient(currentColor,currentColor) 50% 24%/1px 5px no-repeat;
    box-shadow: 0 -4px 0 -2.5px var(--forest);
  }
  .stopwatch-time { color: var(--deep); font: 500 2.5rem/1.3 var(--journal-numbers, Georgia, serif); font-variant-numeric: tabular-nums; }
  .home-extras {
    display: grid;
    gap: .75rem 1rem;
    min-width: 0;
    padding: clamp(.8rem, 2.5vw, 1.45rem);
    border-block-start: 2px solid #c6b68e;
    border-radius: 0 0 .6rem .6rem;
    background: #eee7d6;
  }
  .home-extras > h2 {
    margin: 0;
    color: #634e32;
    font-size: 1rem;
    letter-spacing: .05em;
  }
  .home-ghost { background: var(--paper); border-block: 1px solid var(--journal-rule); }
  .home-ghost .section-heading { align-items: flex-start; }
  .ghost-chart { gap: 0; padding: 0; }
  .ghost-day + .ghost-day { border-left: 1px solid color-mix(in srgb,var(--journal-rule) 54%,transparent); }
  .ghost-weekday { color: var(--muted); }
  .ghost-value { font-variant-numeric: tabular-nums; }
  .ghost-value-current a { min-height: 36px; align-items: center; text-decoration-thickness: 1px; }
  .ghost-day:has([aria-current="date"]) .ghost-weekday { color: var(--forest); text-decoration: underline 2px; text-underline-offset: 3px; }
  .ghost-total { border-top-style: dashed; }
  [data-home-curling] {
    border-block: 1px solid var(--journal-rule);
    padding-right: clamp(40px, 10vw, 110px);
    background: radial-gradient(circle at 106% 95%, #a74c43 0 22px,var(--paper) 23px 43px,#537789 44px 65px,transparent 66px),var(--paper);
  }
  [data-home-curling] .section-heading { justify-content: flex-start; gap: 10px 25px; }
  [data-batch-rows] > .add-fields { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
}
@media (min-width: 960px) {
  body[data-student-view="today"] {
    .home-extras { grid-template-columns: minmax(0, 2fr) minmax(215px, .85fr); align-items: start; }
    .home-extras > h2 { grid-column: 1 / -1; }
    [data-home-curling] { padding-right: clamp(18px,2vw,32px); }
    [data-home-curling] .section-heading { align-items: flex-start; flex-direction: column; }
  }
}
@media (max-width: 740px) {
  body[data-student-view="today"] {
    .journal { gap: 12px; }
    .journal-dateline { gap: 3px 12px; }
    .journal-date { font-size: .78rem; }
    .home-season-badges { flex-basis: 100%; }
    .home-record { grid-template-columns: minmax(0,1fr); }
    .home-record > .card { padding: 15px clamp(13px,3.5vw,23px); }
    .home-record > .hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--journal-rule); }
    .hero h2 { font-size: .86rem; }
    .hero .hero-number { grid-column: 2; grid-row: 1 / span 3; font-size: clamp(2.35rem, 9.7vw, 3.3rem); margin: 0; }
    .hero .journal-record-meta { grid-column: 1; font-size: .76rem; }
    .home-record .add-fields { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 9px; }
    .home-ghost { padding-inline: 8px; }
    .ghost-value { font-size: clamp(.63rem, 2.85vw, .77rem); }
    .ghost-legend { column-gap: 8px; }
    .home-entry-actions .button { min-height: 42px; }
    .home-entry-actions .ghost { padding-inline: 2px; font-size: .83rem; }
    .stopwatch .help { margin: 0; }
  }
}

body[data-student-view="curling"] {
  .curl-page { width: min(100%, 920px); }
  .curl-layout { gap: 20px clamp(18px, 3vw, 40px); grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
  .curl-play, .curl-skins { border: 0; border-block-start: 2px solid var(--forest); border-radius: 0; box-shadow: none; padding: clamp(16px, 2.2vw, 28px); }
  #curl-score { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; gap: 8px; }
  #curl-score strong { margin: 0; font: 600 1.75rem/1 Georgia, "Hiragino Mincho ProN", serif; color: var(--deep); }
  .curl-score-key { align-items: center; gap: 7px 12px; }
  .curl-score-key > span { display: inline-flex; align-items: center; gap: 4px; }
  .curl-score-key i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 1px solid #56675f; }
  .curl-score-key .inner-ring { background: #a84c42; }
  .curl-score-key .middle-ring { background: #fffaf0; }
  .curl-score-key .outer-ring { background: #72979d; }
  .curl-play [data-curl-status] { margin-top: 12px; color: var(--ink); font-size: .9rem; font-weight: 650; }
  .curl-steps li { text-align: start; border-bottom-width: 3px; padding-block: 8px; }
  .curl-steps li[aria-current="step"] { background: var(--lime); text-align: center; }
  .curl-actions .button, .curl-guide summary { min-height: 44px; }
  .curl-guide summary { align-content: center; }
  .curl-lock { min-width: 7em; letter-spacing: .04em; }
  .curl-board { border: 3px solid #56675f; border-radius: 4px; background: #e7efec; }
  .curl-skins { border-width: 1px; }
  .curl-choice { border-radius: 4px; }
}
@media (max-width: 650px) {
  body[data-student-view="curling"] {
    .curl-layout { grid-template-columns: minmax(0,1fr); gap: 14px; }
    .curl-play, .curl-skins { padding: 14px; }
    .curl-board { max-width: min(100%, max(230px, 44svh)); }
  }
}

.home-pet {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 23rem);
  align-items: end;
  column-gap: .75rem;
  row-gap: .55rem;
  padding-block: .9rem .8rem;
  border-color: var(--journal-rule);
  border-radius: 4px;
  box-shadow: none;
}

.home-pet .stick-stage {
  grid-area: 1 / 1;
  inline-size: 100%;
  block-size: 5.25rem;
  border-color: transparent;
}

.home-pet .stick-figure { transform: translateY(.5rem) scale(.91); }

.home-pet button.stick-stage:is(:hover, :focus-visible) {
  border-color: var(--journal-rule);
}

.home-pet-speech {
  --speech-edge: color-mix(in srgb, var(--ink) 24%, var(--paper));
  --speech-fill: color-mix(in srgb, var(--ink) 4%, var(--paper));
  position: relative;
  grid-area: 1 / 2;
  place-self: start;
  max-inline-size: 100%;
  margin: 0 0 1rem;
  padding: .55rem .75rem .5rem;
  border: 1px solid var(--speech-edge);
  border-radius: .72rem;
  background: var(--speech-fill);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.home-pet-speech::before {
  content: "";
  position: absolute;
  inset-block-end: 1.05rem;
  inset-inline-start: -.32rem;
  inline-size: .52rem;
  block-size: .52rem;
  border-block-end: 1px solid var(--speech-edge);
  border-inline-start: 1px solid var(--speech-edge);
  background: var(--speech-fill);
  transform: rotate(45deg);
}

.home-pet-speech blockquote {
  margin: 0;
  font-size: .9rem;
  line-height: 1.58;
  text-wrap: pretty;
  word-break: auto-phrase;
}

.home-pet-speech figcaption {
  margin-block-start: .2rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
  text-align: end;
}

.home-pet-controls {
  grid-area: 2 / 1 / 3 / -1;
  display: flex;
  flex-wrap: wrap;
  column-gap: .8rem;
  font-size: .82rem;
}

.home-pet-controls p { margin: 0; }

.stick-stage {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 8rem;
  block-size: 7rem;
  border: 1px solid currentColor;
  border-radius: 1rem;
  background: transparent;
  color: inherit;
}

button.stick-stage { cursor: pointer; }
button.stick-stage:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.stick-figure { position: relative; inline-size: 3px; block-size: 58px; color: #111; }
.stick-body { position: absolute; inset: 0; transform-origin: center 38px; }

.stick-head, .stick-spine, .stick-arm, .stick-leg, .stick-joint {
  position: absolute;
  inline-size: 3px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: top center;
}

.stick-head {
  top: 0;
  left: -6px;
  inline-size: 15px;
  block-size: 15px;
}

.stick-spine { top: 14px; block-size: 25px; }
.stick-arm { top: 20px; block-size: 10px; }
.stick-leg { top: 36px; block-size: 12px; }
.stick-joint { inset-inline-start: 0; }
.stick-arm .stick-joint { top: 9px; block-size: 9px; }
.stick-leg .stick-joint { top: 11px; block-size: 11px; }
.stick-arm.left { transform: rotate(24deg); }
.stick-arm.right { transform: rotate(-24deg); }
.stick-leg.left { transform: rotate(13deg); }
.stick-leg.right { transform: rotate(-13deg); }
