/* Games and playground hubs (2026-11-18). Lists become card grids, filters
   become pill rows with counts, and selection is a neutral fill and weight;
   no accent borders or underlines mark the current choice. Loaded only by
   games/index.html and playground/index.html, before family.css. */

.hub-page {
  --hub-gap: 8px;
  --hub-icon-bg: color-mix(in srgb, var(--ink) 5%, var(--surface));
  --hub-hover: color-mix(in srgb, var(--ink) 3%, var(--surface));
}

/* Filter row: 32px pills inside 44px targets, a count beside each label. */
.hub-page .t-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 24px;
  padding-block: 6px;
  border-block: 1px solid var(--line);
}
.hub-page .t-filter .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  border: 6px solid transparent;
  border-inline-width: 0;
  border-radius: 999px;
  padding: 0 14px;
  background-clip: padding-box;
  background-color: transparent;
  color: var(--ink-2);
  font: 500 14px/1 var(--font-sans);
  transition: background-color var(--family-motion, 150ms ease), color var(--family-motion, 150ms ease);
}
.hub-page .t-filter .chip:hover { border-color: transparent; background-color: var(--family-hover); color: var(--ink); }
.hub-page .t-filter .chip[aria-pressed="true"] { background-color: var(--family-selected); color: var(--ink); font-weight: 600; }
.hub-page .chip-count { color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; font-weight: 400; }

/* Section headings sit close to their cards. */
.hub-page .t-sec { margin-top: 32px; }
.hub-page .t-sec-h { margin: 0; font-size: 18px; font-weight: 600; }

/* Registers become a grid of cards. */
.hub-page .t-register {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
  gap: var(--hub-gap);
  margin-top: 12px;
  border: 0;
  background: none;
}
.hub-page .t-register:empty { display: none; }
.hub-page .t-register > .t-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: background-color var(--family-motion, 150ms ease);
}
.hub-page .t-register > .t-row:first-child { border-top: 1px solid var(--line); }
.hub-page .t-register > .t-row[hidden],
.hub-page .t-register > .t-row.is-off { display: none; }
.hub-page a.t-row:hover { background: var(--hub-hover); }
.hub-page .t-row-body b { font-size: 16px; }
.hub-page .t-row-body p {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
  line-height: 1.45;
}
.hub-page .t-row-tag {
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

/* Topic icons in a quiet square. */
.hub-page .t-register > .t-row[data-topic] { grid-template-columns: 40px minmax(0, 1fr) auto; }
.hub-page .t-row[data-topic]::before {
  width: 40px;
  height: 40px;
  background: var(--hub-icon-bg) center / 22px 22px no-repeat;
  content: "";
}
.hub-page .t-row[data-topic="행정구역·지도"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d21' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='m3 6 6-2 6 2 6-2v14l-6 2-6-2-6 2Z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E"); }
.hub-page .t-row[data-topic="교통"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d21' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='5' y='3' width='14' height='14' rx='3'/%3E%3Cpath d='M5 11h14M9 21l1.5-4M15 21l-1.5-4'/%3E%3C/svg%3E"); }
.hub-page .t-row[data-topic="아파트·부동산"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d21' stroke-width='1.6'%3E%3Cpath d='M4 21V5h9v16M13 9h7v12M2 21h20M7 8h3M7 12h3M7 16h3M16 13h1M16 17h1'/%3E%3C/svg%3E"); }
.hub-page .t-row[data-topic="세계"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d21' stroke-width='1.6'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.4 2.6 3.6 5.4 3.6 8.5s-1.2 5.9-3.6 8.5c-2.4-2.6-3.6-5.4-3.6-8.5S9.6 6.1 12 3.5Z'/%3E%3C/svg%3E"); }
.hub-page .t-row[data-topic="역사·지명"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d21' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M5 4h11l3 3v13H5Z'/%3E%3Cpath d='M8 10h8M8 14h8M8 18h5'/%3E%3C/svg%3E"); }

/* Daily: one tile per game, the day's status at the foot of each tile. */
.hub-page .hub-daily .t-register { grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); }
.hub-page .hub-daily .t-register > .t-row {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 40px auto 1fr;
  align-items: start;
  gap: 12px;
  min-height: 168px;
  padding: 16px;
}
.hub-page .hub-daily .t-row-body .t-topic { display: none; }
.hub-page .hub-daily .t-row-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--hub-icon-bg);
  font-family: var(--font-sans);
}
.hub-page .hub-daily .t-row { position: relative; }

/* Today's challenge: a status row and one dark call to action. */
.hub-page .games-command { margin-top: 20px; border-color: var(--line); }
.hub-page .games-command a { min-height: 56px; padding: 0 20px; font-size: 15px; }
.hub-page .games-command a:hover { background: var(--hub-hover); }
.hub-page .games-command-primary strong { color: var(--ink); font-size: 13px; }
.hub-page .games-command .games-next {
  justify-content: space-between;
  border-top: 0;
  background: var(--ink);
  color: color-mix(in srgb, var(--paper) 80%, transparent);
  font-weight: 500;
}
.hub-page .games-command .games-next:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.hub-page .games-command .games-next strong { flex: 1; color: var(--paper); font-weight: 600; }
.hub-page .games-command .games-next::after { color: var(--paper); content: "→"; }

/* Playground projects: three cards with a drawn header. */
.hub-page .hub-projects .t-register { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.hub-page .hub-projects .t-register > .t-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 136px auto;
  align-items: start;
  gap: 0;
  padding: 0;
}
.hub-page .hub-projects .t-row::before {
  height: 136px;
  border-bottom: 1px solid var(--line);
  background: var(--hub-icon-bg) center / auto 104px no-repeat;
  content: "";
}
.hub-page .hub-projects .t-row:nth-child(1)::before { background-color: #eef3f8; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 110' fill='none'%3E%3Cpath d='M20 90 50 40l40 10 30-28 40 20 20 40-60 14Z' stroke='%239aa6b2' stroke-width='1.2'/%3E%3Ccircle cx='100' cy='58' r='18' stroke='%231f5ed6' stroke-width='1.6'/%3E%3Ccircle cx='100' cy='58' r='36' stroke='%231f5ed6' stroke-width='1.2' stroke-dasharray='3 4'/%3E%3Ccircle cx='100' cy='58' r='3' fill='%231f5ed6'/%3E%3C/svg%3E"); }
.hub-page .hub-projects .t-row:nth-child(2)::before { background-color: #f1f4ee; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 110' fill='none'%3E%3Cpath d='M20 96h160' stroke='%239aa6a0' stroke-width='1.2'/%3E%3Cpath d='M34 96V60h20v36M60 96V34h24v62M90 96V50h18v46M114 96V22h26v74M146 96V64h20v32' stroke='%23197a46' stroke-width='1.6'/%3E%3Cpath d='M66 46h4M74 46h4M66 58h4M74 58h4M120 34h4M130 34h4M120 48h4M130 48h4' stroke='%23197a46' stroke-width='1.4'/%3E%3C/svg%3E"); }
.hub-page .hub-projects .t-row:nth-child(3)::before { background-color: #f6f1e7; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 110' fill='none'%3E%3Cpath d='M30 86c20-6 26-30 46-34s28 18 48 10 22-36 46-40' stroke='%238a5a1e' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M60 92c10-14 30-16 40-30' stroke='%23b39a74' stroke-width='1.2' stroke-dasharray='3 4'/%3E%3Ccircle cx='30' cy='86' r='4' fill='%238a5a1e'/%3E%3Ccircle cx='170' cy='22' r='4' fill='%238a5a1e'/%3E%3C/svg%3E"); }
.hub-page .hub-projects .t-row-body { padding: 16px 18px 18px; }
.hub-page .hub-projects .t-row-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-sans);
}

/* The link to games is one quiet row, not a banner. */
.hub-page .pg-games-link { margin-top: 4px; }

@media (max-width: 720px) {
  .hub-page .t-register { grid-template-columns: minmax(0, 1fr); }
  .hub-page .hub-daily .t-register { display: flex; gap: var(--hub-gap); margin-inline: calc(var(--family-gutter, 16px) * -1); padding-inline: var(--family-gutter, 16px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hub-page .hub-daily .t-register::-webkit-scrollbar { display: none; }
  .hub-page .hub-daily .t-register > .t-row { flex: 0 0 156px; scroll-snap-align: start; }
  .hub-page .t-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .hub-page .t-filter::-webkit-scrollbar { display: none; }
  .hub-page .t-filter .chip { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-page .t-filter .chip, .hub-page .t-register > .t-row { transition: none; }
}
