/* Days: a diary of rows, each with the day's strip, its flag and the viewer's result; a closed day opens its page.
   Asterfield rules as in app.css: one field colour, no shadows, rounded corners or transparency. */
.sheet[data-kind="days"] { --open: #133322; }
.days { display: block; }
.dmon { margin: 14px 0 6px; color: var(--ink-muted); }
.dmon:first-child, .sh-name + #dRows .dmon:first-child { margin-top: 2px; }

/* A row: the date, the strip, the place, the result. */
.dr { display: grid; grid-template-columns: 30px 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
      min-height: 72px; margin: 0 0 2px; padding: 8px 10px 8px 4px; text-align: start; background: var(--field-deep); }
button.dr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dr.best { box-shadow: inset 3px 0 0 var(--speed); }
html[dir="rtl"] .dr.best { box-shadow: inset -3px 0 0 var(--speed); }
.dr.open { background: var(--open); box-shadow: inset 0 0 0 1px var(--field-tint); }
.dr.busy { opacity: .6; }
.dr .d { text-align: center; }
.dr .d b { display: block; font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.dr .d i { display: block; font: 700 10px/1.2 var(--text); font-style: normal; letter-spacing: .08em; color: var(--ink-muted); text-transform: uppercase; }
.th { position: relative; display: block; width: 88px; height: 56px; overflow: hidden; background: var(--field-tint); }
.th .st { display: block; width: 100%; height: 100%; object-fit: cover; }
.th.ph { background: repeating-linear-gradient(135deg, var(--field-tint) 0 6px, var(--field) 6px 12px); }
/* An open day's puzzle: a photo as it is, a panorama by its middle, a quarter of the way round. */
.th.pz { background-size: cover; background-position: 50% 50%; }
.th.pz.pano { background-size: 400% auto; background-position: 50% 52%; }
.fl { position: absolute; inset-inline-start: 4px; bottom: 4px; display: block; width: 24px; height: 16px; box-shadow: 0 0 0 1.5px var(--field-deep); }
.fl.code { display: grid; place-items: center; background: var(--ink); color: var(--field-deep); font: 700 9px/1 var(--label); letter-spacing: .04em; }
.th .q { position: absolute; inset-inline-start: 4px; bottom: 4px; width: 24px; height: 16px; display: grid; place-items: center;
         background: var(--field-deep); font: 700 13px/1 var(--display); }
.dr.miss .th .st { filter: saturate(.3) brightness(.75); }
.dr .t { display: block; min-width: 0; }
.dr .t b { display: block; font: 700 21px/1.05 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr .t span, .dr .t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr .t span { font-size: 13px; color: var(--ink-soft); }
.dr .t span:empty { display: none; }
.dr .t small { font-size: 12px; color: var(--ink-muted); }
.dr .t small.live { color: var(--speed); }
.dr .r { display: block; min-width: 56px; text-align: end; }
.dr .r b { display: block; font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.dr .r span, .dr .r small { display: block; white-space: nowrap; }
.dr .r span { margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.dr .r .km { font-style: normal; }
.dr .r small { font-size: 12px; color: var(--ink-muted); }
.dr.best .r b, .dr .r .star { color: var(--speed); }
.dr .r .star { font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.dr.miss .r b { color: var(--ink-muted); }
.dr .play { display: inline-block; padding: 9px 12px; background: var(--ink); color: var(--field-deep); font: 700 12px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; }
.dmore { margin: 16px 0 8px; text-align: center; color: var(--ink-muted); }

/* A day's page: on a phone it takes the list's place. */
.dp { display: none; }
.days.at-day .dl { display: none; }
.days.at-day .dp { display: block; }
.hero2 { position: relative; height: 140px; margin: -4px calc(-16px - var(--safe-right)) 0 calc(-16px - var(--safe-left)); background: var(--field-tint) 50% 50% / cover no-repeat; }
.hero2.pano { background-size: 300% auto; background-position: 50% 52%; }
.hero2 .st { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--open) 4%, rgba(19, 51, 34, 0) 75%); }
.hero2 .in { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.hero2 .in .fl { position: static; width: 30px; height: 20px; box-shadow: 0 0 0 1.5px var(--open); }
.hero2 .in .fl.code { font-size: 11px; }
.hero2 .in b { font: 700 36px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero2 .in p { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); font-size: 13px; }
.hero2 .p360 { position: absolute; z-index: 1; top: 10px; inset-inline-end: 12px; padding: 7px 10px; background: var(--open); font: 700 12px/1 var(--label); letter-spacing: .08em; }
.dpi .attr { margin: 8px 0 0; font-size: 11px; color: var(--ink-muted); }
.dpi .fact { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); user-select: text; -webkit-user-select: text; }
.dps { display: grid; gap: 2px; margin-top: 12px; }
.you { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: end; padding: 12px; margin-bottom: 10px; background: var(--panel); color: var(--on-panel); }
.you b { font: 700 46px/.9 var(--display); font-variant-numeric: tabular-nums; }
.you p { margin: 0; font-size: 13px; }
.you p.k { font: 700 13px/1.2 var(--label); letter-spacing: .08em; text-transform: uppercase; }
.you.none { display: block; background: var(--field-deep); color: var(--ink-soft); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.tiles div { padding: 8px 6px; background: var(--field-deep); }
.tiles b { display: block; font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.15; color: var(--ink-muted); }
.axis { padding: 8px 10px 4px; background: var(--field-deep); }
/* The scale grows with the screen up to a size where its labels are still small print. */
.axis svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
html[dir="rtl"] .axis svg { direction: ltr; }
.axis .ax { stroke: var(--field-tint); stroke-width: 1; }
.axis .tk { fill: var(--ink-muted); font: 10px var(--text); }
.axis .o { fill: var(--ink-soft); }
.axis .me { fill: var(--speed); stroke: var(--field-deep); stroke-width: 1.5; }
.dmapbox { margin-top: 12px; }
.mapbtn { display: block; width: 100%; padding: 13px; border: 1px solid var(--field-tint); font: 700 13px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.dmap { display: none; position: relative; height: 300px; background: var(--field-deep); }
.dmap.on { display: block; }
.dmapgl { position: absolute; inset: 0; }
.dpt { margin-top: 14px; }
.dth { margin: 0 0 6px; color: var(--ink-muted); }
.rkl { list-style: none; margin: 0; padding: 0; }
.rkl li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 54px; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--field-tint); font-variant-numeric: tabular-nums; }
.rkl li.me { background: var(--ink); color: var(--field-deep); }
.rkl .n, .rkl b { font: 700 18px/1 var(--display); }
.rkl .n { text-align: end; }
.rkl b { text-align: end; }
.rkl .w { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The face before the name, as in every table; a site player's carries the site's mark in the corner. */
.rkl .w .rf { position: relative; display: inline-block; width: 20px; height: 20px; margin-block-start: -3px; margin-inline-end: 8px; vertical-align: middle; }
.rkl .w .rf .av { width: 20px; height: 20px; font-size: 11px; outline: 0; }
.rkl li.me .rf .av { background: var(--field); color: var(--ink); }
.rkl .w .rf .src { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 11px; height: 11px; }
.rkl .k { font-size: 13px; color: var(--ink-muted); }
.rkl li.me .k { color: var(--field-tint); }
.dnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.dnav button { padding: 10px 2px; font: 700 13px/1 var(--label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
/* The panorama over the page, as the game shows it. */
.dview { position: absolute; z-index: 2; inset: 0; background: var(--field-deep); }
.dview #dPano { position: absolute; inset: 0; }
.dview-x { position: absolute; z-index: 1; top: calc(10px + var(--safe-top)); inset-inline-end: calc(12px + var(--safe-end)); background: var(--field-deep); }

@media (max-width: 440px) {
  .dr { grid-template-columns: 26px 72px minmax(0, 1fr) auto; gap: 8px; padding-inline-end: 8px; }
  .th { width: 72px; height: 46px; }
  .dr .t b { font-size: 19px; }
  .dr .r { min-width: 0; }
  .tiles b { font-size: 20px; }
}
@media (max-width: 340px) {
  .dr { grid-template-columns: 64px minmax(0, 1fr) auto; padding-inline-start: 6px; }
  .dr .d { display: none; }
  .dr .r .km { display: none; }
  .th { width: 64px; height: 42px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A wide screen: the list with its own scroll on one side, the open day on the other. Above it the answers' map;
   below, the strip, its credit and fact beside the numbers and the table; the neighbouring days at the end. */
@media (min-width: 1024px) {
  .sheet[data-kind="days"] .sh-body { display: flex; overflow: hidden; padding-top: 0; padding-bottom: 0; }
  .days { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; width: 100%; min-height: 0; }
  .days .dl, .days.at-day .dl { display: block; min-height: 0; overflow-y: auto; padding: 4px 4px calc(24px + var(--safe-bottom)) 0; }
  .days .dp, .days.at-day .dp { display: grid; min-height: 0; overflow-y: auto; align-content: start;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "map map" "hero side" "info side" "info table" "nav nav";
    gap: 0 24px; padding: 4px 0 calc(24px + var(--safe-bottom)); }
  .dr { grid-template-columns: 26px 72px minmax(0, 1fr) auto; gap: 8px; padding-inline-end: 8px; }
  .th { width: 72px; height: 46px; }
  .dr .t b { font-size: 19px; }
  .dr .r { min-width: 0; }
  .dr .r .km { display: none; }
  .dr.on { box-shadow: inset 0 0 0 2px var(--ink); }
  .dr.on.best { box-shadow: inset 3px 0 0 var(--speed), inset 0 0 0 2px var(--ink); }
  html[dir="rtl"] .dr.on.best { box-shadow: inset -3px 0 0 var(--speed), inset 0 0 0 2px var(--ink); }
  .dmapbox { grid-area: map; margin: 0 0 16px; }
  .dmapbox .mapbtn { display: none; }
  .dmap { display: block; height: min(42vh, 420px); }
  .hero2 { grid-area: hero; margin: 0; height: 170px; }
  .dpi { grid-area: info; }
  .dps { grid-area: side; margin-top: 0; align-content: start; }
  .dpt { grid-area: table; margin-top: 16px; }
  .dnav { grid-area: nav; }
}
