/* index2.html only: the hero as a dashboard. Loaded after the other stylesheets.
   index.html does not load this file. */

.dash { padding-top: 20px; }
.dash-grid {
  display: grid; gap: 12px; text-align: left; align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hero" "life" "tick" "today" "video" "play";
}
.t-hero { grid-area: hero; text-align: center; }
.t-life { grid-area: life; }
.t-tick { grid-area: tick; }
.t-today { grid-area: today; }
.t-video { grid-area: video; }
.t-play { grid-area: play; }

/* Tablet: the hero on top, the four boxes as an even 2 x 2 block under it */
@media (min-width: 640px) {
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "hero hero" "life today" "tick video" "play play";
    grid-template-rows: auto 210px 210px auto;
  }
  .dash .corner { height: 0; min-height: 100%; overflow: hidden; }
}
/* Wide: face and name in the middle, one box in each corner, all four the same size.
   The middle column is kept wide enough for the quote to be drawn as pixels inside the canvas. */
@media (min-width: 1100px) {
  .dash { width: min(1240px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
  .dash-grid {
    grid-template-columns: minmax(165px, 1fr) minmax(0, 720px) minmax(165px, 1fr);
    grid-template-areas: "life hero today" "tick hero video" "play play play";
    grid-template-rows: minmax(200px, auto) minmax(200px, auto) auto;
  }
}

/* Boxes */
.tile { min-width: 0; }
.tile.px-box, .dash section.tile.px-box { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dash section.tile { padding-top: 0; padding-bottom: 0; }
.tile-h { margin: 0; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); font-weight: 700; line-height: 1.3; }
.tile-q { margin: 0; font-size: 0.95rem; line-height: 1.35; color: var(--ink); }
.tile-note { margin: 0; font-size: 0.68rem; color: var(--dim); line-height: 1.4; }

/* Face, name and quote: the same canvas as on index.html */
.dash #hero { height: 300px; }
@media (min-width: 640px) { .dash #hero { height: clamp(300px, 50vw, 400px); } }
@media (min-width: 1100px) { .dash #hero { height: 350px; } }
/* The plain quote card (used when the quote is not drawn in the canvas), a little smaller */
.dash .latest { margin-top: 4px; padding-top: 10px; padding-bottom: 6px; font-size: 12px; }
/* Quote in the canvas: date and READ link on one short line under it */
.dash .hero-stage.quote-wide .latest { font-size: 10px; line-height: 1.3; }
.dash .hero-stage.quote-wide .latest-label, .dash .hero-stage.quote-wide .latest-link { display: inline; margin: 0 4px; }
.dash .tagline { margin: 6px 0 12px; font-size: 0.9rem; }
.dash .hero-actions { gap: 12px; margin: 0; }

/* Your life */
.t-life .life-form { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.t-life .life-form input { width: 100%; min-width: 0; box-sizing: border-box; font-size: 1.15rem; text-align: center; padding: 6px 4px; }
.t-life .status { flex: none; color: var(--amber); font-size: 0.72rem; }
.t-life .status:empty { display: none; }

/* One running counter. main.js fills the strip and shows three; here only the first of them is shown. */
.dash .t-tick .live { max-width: none; margin: 0; min-width: 0; }
.t-tick .meter-compact { gap: 3px; }
.t-tick .readout { flex-wrap: wrap; gap: 2px 6px; }
.t-tick .readout canvas { max-width: 100%; height: auto !important; min-width: 0; }
.t-tick .live-grid { display: block; overflow: visible; padding: 0; }
.t-tick .live-grid > .meter:not([hidden]) ~ .meter { display: none !important; }
.t-tick .live-grid > .meter { padding: 0; background: none; clip-path: none; box-shadow: none; border: 0; }
.t-tick .live-controls { display: none; }
.t-tick .per-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.t-tick:has(details[open]) { overflow-y: auto; }
.t-tick:has(details[open]) .per-label { display: block; }

/* Today: the fact, a one-line source and READ MORE (which opens the whole note) */
.t-today { display: flex; }
.t-today #today-body { flex: 1; display: flex; min-width: 0; }
.t-today .today-card { max-width: none; width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-sizing: border-box; }
.t-today .today-meta { margin: 0; font-size: 0.68rem; gap: 6px; }
.t-today .today-meta .badge { font-size: 0.6rem; }
.t-today .today-fact { margin: 0; font-size: 0.8rem; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.t-today .today-source { font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.t-today .look-at, .t-today .editorial { display: none; }
.today-more { margin: auto 0 0; }
.today-more .btn { min-height: 28px; padding: 3px 10px; font-size: 0.68rem; }
.today-dlg { max-width: min(640px, calc(100vw - 32px)); }
.today-dlg .today-card { max-width: none; padding: 0; background: none; clip-path: none; box-shadow: none; border: 0; }

/* Videos: small 9:16 thumbnails that open the player */
.t-video .video-list { display: flex; gap: 8px; flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.t-video .video-list::-webkit-scrollbar { display: none; }
/* One video per slide: the poster on the left at the full height of the box, the text beside it */
.video-item { flex: 0 0 100%; display: flex; gap: 10px; min-width: 0; scroll-snap-align: start; }
.video-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.video-title { margin: 0; font-size: 0.72rem; line-height: 1.35; font-weight: 700; color: var(--ink); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.video-note { margin: 0; font-size: 0.62rem; line-height: 1.4; color: var(--dim); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-meta { margin: 0; font-size: 0.62rem; letter-spacing: 0.08em; color: var(--amber); }
.video-play { margin-top: auto; align-self: flex-start; min-height: 28px; padding: 3px 10px; font-size: 0.68rem; }
.video-thumb {
  position: relative; flex: none; height: 100%; min-height: 110px; aspect-ratio: 9 / 16; padding: 0; border: 2px solid var(--amber); cursor: pointer;
  background: #1e1710; color: var(--ink); font: inherit; overflow: hidden;
}
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-35%, -50%);
  border-left: 18px solid var(--amber); border-top: 11px solid transparent; border-bottom: 11px solid transparent;
  filter: drop-shadow(0 0 3px #000);
}
.video-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px; font-size: 0.55rem; line-height: 1.25; background: rgba(13, 11, 10, 0.8); text-align: center; z-index: 1; }
.video-thumb:hover { border-color: #ffc73d; }
.video-thumb:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (max-width: 639px) { .video-thumb { height: 160px; } }

/* Game shortcuts */
.t-play.px-box { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
.game-links { margin: 0; }
.game-links .chip { text-decoration: none; display: inline-flex; align-items: center; }

/* Meters: ten first, the rest behind a button */
.meter-grid.is-limited > .meter-extra { display: none; }
.meters-more { margin: 24px 0 0; text-align: center; }

/* Popups */
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.dlg-head h2 { margin: 0; font-size: 1.1rem; }
dialog.wide { width: 100%; max-width: min(980px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; }
dialog.wide.today-dlg { max-width: min(640px, calc(100vw - 32px)); }
dialog.wide .status { margin-top: 12px; }
dialog.video-dlg { width: fit-content; max-width: calc(100vw - 32px); max-height: calc(100dvh - 16px); overflow: auto; box-sizing: border-box; padding: 16px; }
.video-frame { height: min(70dvh, 640px); aspect-ratio: 9 / 16; max-width: 100%; margin: 0 auto 10px; background: #000; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 639px) {
  dialog.wide, dialog.wide.today-dlg { max-width: 100vw; width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-width: 0; padding: 16px; }
  .life-cards { grid-template-columns: 1fr; }
}

/* Your life popup: generation line, six cards, and the button that draws six others */
.life-gen { margin: 0 0 16px; color: var(--dim); font-size: 0.85rem; line-height: 1.5; }
.life-gen strong { color: var(--amber); letter-spacing: 0.06em; }
.life-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 0; }
dialog.wide .life-tools .status { margin: 0; }
