/* Modular home: 12-column CSS grid of self-contained modules ("bento" tiles).
   Tiles size by span classes (w-* columns, h-* rows); grid-auto-flow: dense fills gaps,
   rows grow with content, and the grid collapses to 6 then 1 column. */
:root { --rivet: #4a4440; --hz-dark: #1a1714; }
:root[data-theme='light'] { --rivet: #cbbfb0; --hz-dark: #3a332c; }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); grid-auto-flow: row dense; gap: 14px; margin: 22px 0 8px; }
.w-3 { grid-column: span 3; } .w-4 { grid-column: span 4; } .w-5 { grid-column: span 5; } .w-6 { grid-column: span 6; }
.w-7 { grid-column: span 7; } .w-8 { grid-column: span 8; } .w-12 { grid-column: span 12; }
.h-2 { grid-row: span 2; } .h-3 { grid-row: span 3; }

/* tile = riveted sheet-metal panel */
.tile { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 16px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 11px), var(--panel); }
:root[data-theme='light'] .tile { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .025) 0 2px, transparent 2px 11px), var(--panel); }
.tile::after { content: ""; position: absolute; inset: 6px; pointer-events: none;
  background:
    radial-gradient(circle, var(--rivet) 2.2px, transparent 2.8px) 0 0 / 8px 8px no-repeat,
    radial-gradient(circle, var(--rivet) 2.2px, transparent 2.8px) 100% 0 / 8px 8px no-repeat,
    radial-gradient(circle, var(--rivet) 2.2px, transparent 2.8px) 0 100% / 8px 8px no-repeat,
    radial-gradient(circle, var(--rivet) 2.2px, transparent 2.8px) 100% 100% / 8px 8px no-repeat; }

.t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; position: relative; z-index: 1; }
.t-head h2 { margin: 0; font: 600 14px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.t-ico { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 9px; background: rgba(var(--heat), .16); color: var(--accent); }
.t-ico .ico { width: 18px; height: 18px; }
.ico-fill { width: 18px; height: 18px; fill: currentColor; stroke: none; flex: none; }
.t-more { margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.t-more:hover { color: var(--text); background: var(--panel2); }
.t-foot { margin-top: auto; padding-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.sub { font-size: 12px; color: var(--muted); }

/* ---------- hero ---------- */
.hero-t { padding: 30px 28px 24px; justify-content: center;
  background: radial-gradient(120% 140% at 100% 0%, rgba(var(--heat), .30), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 11px), var(--panel); }
.hazard { position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--soon) 0 12px, var(--hz-dark) 12px 24px); }
.hero-t .copy { position: relative; z-index: 1; max-width: 600px; }
.big-cd { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 10px; font: 700 clamp(46px, 6.4vw, 86px)/.95 var(--head); font-variant-numeric: tabular-nums; }
.big-cd .u { display: flex; flex-direction: column; align-items: center; min-width: 1.15em; }
.big-cd small { font: 600 11px var(--font); letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-top: 8px; }
.big-cd .sep { color: var(--accent); }
.hero-map { position: absolute; right: -36px; bottom: -48px; width: 360px; height: auto; opacity: .7; pointer-events: none; color: var(--muted); }
.hm-isl { fill: rgba(var(--heat), .10); stroke: var(--accent); stroke-width: 2; }
.hm-grid { stroke: currentColor; stroke-opacity: .28; stroke-width: .6; fill: none; }
.hm-road { fill: none; stroke: var(--soon); stroke-width: 2; stroke-dasharray: 6 5; opacity: .8; }
.hm-mon { fill: var(--panel2); stroke: currentColor; stroke-width: 1.4; }
.hm-rad { fill: var(--soon); }
.hm-ring { fill: none; stroke: var(--soon); stroke-width: 1.5; stroke-dasharray: 3 4; }

/* ---------- stat minis (2x2 inside one module) ---------- */
.stats-t { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 14px; }
.mini { position: relative; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; text-decoration: none; min-height: 118px; }
.mini:hover { border-color: var(--muted); }
.mini .t-ico { margin-bottom: auto; }
.mini b { font: 700 40px/1 var(--head); font-variant-numeric: tabular-nums; margin-top: 10px; }
.mini span:last-child { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mini.live b { color: var(--live); }
.mini.live .t-ico { background: rgba(76, 196, 106, .16); color: var(--live); }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76, 196, 106, .6); } 70% { box-shadow: 0 0 0 9px rgba(76, 196, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 196, 106, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- server rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
.rows li { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .tm { font: 700 18px var(--head); color: var(--soon); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .tm.ago { color: var(--live); font-size: 15px; }
.rows .nm { min-width: 0; }
.rows .c-name { font-size: 15px; }
.popbar { width: 96px; text-align: right; }
.popbar span { font-size: 12px; color: var(--muted); }
.popbar i { display: block; height: 6px; margin-top: 4px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.popbar i b { display: block; height: 100%; border-radius: 3px; background: var(--live); }

/* ---------- next 7 days bars ---------- */
.week7 { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; position: relative; z-index: 1; }
.wbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; text-decoration: none; padding: 6px 0 2px; border-radius: 10px; }
.wbar:hover { background: var(--panel2); }
.wbar .n { font: 700 17px var(--head); }
.wbar .col { width: 70%; max-width: 54px; min-height: 6px; border-radius: 8px 8px 3px 3px; background: rgba(var(--heat), .45); }
.wbar:hover .col, .wbar.today .col { background: var(--accent); }
.wbar.forced .col { background: repeating-linear-gradient(-45deg, var(--soon) 0 8px, var(--hz-dark) 8px 16px); }
.wbar .d { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.wbar .d small { display: block; text-align: center; font-size: 11px; letter-spacing: 0; }
.wbar.today .d { color: var(--accent); font-weight: 700; }

/* ---------- region bars + playstyle pills ---------- */
.hbars { display: flex; flex-direction: column; gap: 7px; position: relative; z-index: 1; }
.hbar { display: grid; grid-template-columns: 30px minmax(0, 1fr) 28px; gap: 10px; align-items: center; padding: 2px 4px; font-size: 13px; font-weight: 600; background: none; border: 0; border-radius: 6px; text-align: left; }
.hbar:hover { background: var(--panel2); }
.hbar .track { height: 9px; border-radius: 5px; background: var(--panel2); overflow: hidden; }
.hbar .track b { display: block; height: 100%; border-radius: 5px; background: rgba(var(--heat), .75); }
.hbar:hover .track b { background: var(--accent); }
.hbar .v { text-align: right; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.pill { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; }
.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- checklist, spotlight, roadmap, empty states ---------- */
.check { list-style: none; margin: 0; padding: 0; position: relative; z-index: 1; }
.check label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.progress { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.progress i { flex: 1; height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.progress i b { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.spot-name { margin: 0 0 6px; font: 700 24px/1.1 var(--head); letter-spacing: .02em; position: relative; z-index: 1; }
.road { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.road li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.road li .t-ico { width: 28px; height: 28px; }
.road small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.soonpill { margin-left: auto; flex: none; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--soon); border: 1px solid rgba(240, 164, 49, .5); border-radius: 999px; padding: 2px 8px; }
.empty-sm { text-align: center; color: var(--muted); padding: 14px 8px; font-size: 14px; margin: auto 0; position: relative; z-index: 1; }
.empty-sm .ico { width: 34px; height: 34px; color: var(--soon); display: block; margin: 0 auto 8px; }
.empty-sm b { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- responsive: 12 -> 6 -> 1 columns ---------- */
@media (max-width: 1020px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .w-3, .w-4, .w-5 { grid-column: span 3; }
  .w-6, .w-7, .w-8, .w-12 { grid-column: span 6; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
  .bento > * { grid-column: 1 / -1; grid-row: auto; }
  .hero-t { padding: 26px 18px 20px; }
  .hero-map { width: 230px; opacity: .35; }
  .mini { min-height: 104px; }
  .mini b { font-size: 32px; }
  .rows li { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; }
  .popbar { width: 70px; }
  .week7 { gap: 4px; min-height: 160px; }
}

/* keep the decorative island clear of the hero copy */
.hero-map { right: -70px; bottom: -60px; opacity: .5; }
.hero-t .copy { max-width: 70%; }
@media (max-width: 640px) { .hero-t .copy { max-width: none; } }
