/* Design round 2: the front page, the header and menu, the queue and the private rating. Loaded last. */

/* ---------- header and menu ---------- */
.topnav .navtop[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.navmore > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.navmore > summary::-webkit-details-marker { display: none; }
.navmore > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.navmore[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.navmore-menu { width: min(460px, calc(100vw - 24px)); grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px; border-radius: 18px; }
.navgroup { display: grid; align-content: start; min-width: 0; }
.navgroup-title { padding: 6px 12px 2px; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.navmore-menu a, .navmore-menu .btn { display: flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  font-weight: 600; text-align: left; color: var(--ink); overflow-wrap: anywhere; }
.navmore-menu a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--primary); }
.navmore-menu .btn { justify-content: flex-start; font-size: 1rem; white-space: normal; line-height: 1.25; }
@media (max-width: 899px) { .topnav .navwide { display: none; } }
@media (max-width: 600px) {
  .site-header .topnav { flex-wrap: nowrap; }
  .topnav .navtop { display: none; }
  .navmore-menu a { display: flex; }
  .navmore { position: static; }
  .site-header { position: relative; }
  .navmore-menu { left: 12px; right: 12px; top: 100%; width: auto; max-height: calc(100dvh - 76px); }
  .navchat .navchat-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .navchat { padding-inline: 12px; }
}
@media (max-width: 360px) { .navmore-menu { grid-template-columns: 1fr; } }

/* ---------- the front page: a still scene behind the two columns ---------- */
.front-hero { position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 62%, var(--sky-2) 100%); }
.front-scene { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(250px, 34vw, 420px); z-index: -1; }
/* The sun and the moon sit in the sky above the art, clear of the two columns. */
.front-hero::before, .front-hero::after { content: ""; position: absolute; z-index: -1; top: 44px; right: max(28px, calc(50% - 668px));
  width: 84px; height: 84px; border-radius: 50%; }
.front-hero::before { display: var(--sun-display); background: var(--sun); }
.front-hero::after { display: var(--moon-display); width: 64px; height: 64px; box-shadow: inset -15px -7px 0 0 var(--sun); }
@media (max-width: 1259px) { .front-hero::before, .front-hero::after { content: none; } }
.front-hero .front-door { max-width: 1060px; padding-block: clamp(28px, 6vh, 60px) clamp(240px, 24vw, 292px); }
.front-hero .front-grid { align-items: start; gap: clamp(28px, 5vw, 64px); }
.front-copy { padding-top: clamp(0px, 3vh, 26px); }
.front-hero .front-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--ink); font-weight: 600; }
.front-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.front-status .dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.front-hero .join-panel { box-shadow: var(--shadow), 0 18px 48px rgba(13, 108, 133, .14); border-color: var(--line-2); }
.front-below { padding-top: 22px; display: grid; gap: 18px; }

/* ---------- ways to play ---------- */
.mode-picker { border: 0; padding: 0; margin: 0; min-width: 0; }
.mode-picker legend { padding: 0 0 8px; font-weight: 700; }
.mode-chips { display: flex; gap: 6px; }
.mode-chip { position: relative; display: block; cursor: pointer; min-width: 0; flex: 1 1 auto; }
.mode-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mode-face { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 7px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .9rem; text-align: center; white-space: nowrap;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.mode-face b { font-weight: 700; }
.mode-face .icon { width: 18px; height: 18px; }
.icon .dot { fill: currentColor; }
.mode-chip:hover .mode-face { border-color: var(--water-3); }
.mode-chip input:checked + .mode-face { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--ink); }
.mode-chip input:checked + .mode-face .icon { color: var(--primary); }
.mode-chip input:focus-visible + .mode-face { outline: 3px solid var(--focus); outline-offset: 2px; }
.mode-picker.big .mode-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode-picker.big .mode-face { white-space: normal; }
.mode-picker.big .mode-face { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
  justify-content: start; align-items: center; text-align: left; padding: 14px 16px; min-height: 84px; border-radius: 18px; }
.mode-picker.big .mode-face .icon { grid-row: 1 / 3; width: 30px; height: 30px; }
.mode-picker.big .mode-face b { font-size: 1.05rem; align-self: end; }
.mode-picker.big .mode-face small { color: var(--ink-2); font-size: .85rem; line-height: 1.3; align-self: start; }
.mode-picker.big .mode-chip input:checked + .mode-face { box-shadow: inset 0 0 0 1px var(--primary); }
@media (max-width: 700px) { .mode-picker.big .mode-chips { grid-template-columns: 1fr; } .mode-picker.big .mode-face { min-height: 64px; } }

/* ---------- other ways in ---------- */
.front-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 1004px; width: 100%; margin-inline: auto; }
.front-tile { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border-radius: 18px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(14, 42, 59, .06); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.front-tile:hover { border-color: var(--water-3); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--primary);
  background: color-mix(in srgb, var(--water-2) 34%, var(--surface)); }
.tile-icon .icon { width: 22px; height: 22px; }
.tile-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
@media (max-width: 900px) { .front-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .front-hero .front-door { padding-block: 18px clamp(150px, 42vw, 210px); }
  .front-scene { height: clamp(170px, 48vw, 250px); }
  .front-scene .b-sun, .front-scene .b-moon, .front-scene .b-star { display: none; }
  .front-hero .front-grid { gap: 16px; }
  .front-hero .lede { max-width: none; }
  .front-below { padding-top: 14px; gap: 14px; }
  .front-tiles { gap: 8px; }
  .front-tile { min-height: 56px; padding: 8px 10px; gap: 10px; border-radius: 16px; font-size: .95rem; }
  .tile-icon { width: 36px; height: 36px; }
}
@media (max-width: 360px) { .mode-picker:not(.big) .mode-face .icon { display: none; } }

/* ---------- the queue ---------- */
.queue-panel { padding: 22px; gap: 14px; }
.queue-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-bottom: 8px; }
.queue-chairs { display: flex; gap: 10px; align-items: center; padding-bottom: 7px; }
.chair { width: 34px; height: 34px; border-radius: 12px 12px 8px 8px; border: 2px dashed var(--line); background: var(--surface-2); position: relative; }
.chair::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: -7px; height: 5px; border-radius: 3px; background: var(--line); }
.chair.taken { border-style: solid; border-color: var(--water-3); background: color-mix(in srgb, var(--water-2) 55%, var(--surface)); }
.chair.taken::after { background: var(--water-3); }
.chair.you { border-color: var(--primary); background: var(--primary); }
.chair.you::after { background: var(--primary); }
.r6-page .waiting-water { border-radius: 22px; overflow: hidden; }

/* ---------- the private rating ---------- */
.rating-panel { grid-column: 1 / -1; padding: 22px; gap: 16px; }
.rating-panel h2 { display: flex; align-items: center; gap: 8px; }
.rating-panel h2 .icon { color: var(--primary); }
.rating-panel h3 { font-size: 1rem; }
.rating-panel h3:focus { outline: none; }
.rating-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rating-card { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); min-width: 0; }
.rating-card.empty { background: transparent; border-style: dashed; }
.rating-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rating-head h4 { margin: 0; font-size: .95rem; }
.rating-number { font-family: var(--f-display); font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rating-range { font-family: var(--f-body); font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.rating-gauge { display: block; width: 100%; height: auto; }
.rating-gauge .g-track { fill: var(--line); }
.rating-gauge .g-mid { fill: var(--ink-2); opacity: .55; }
.rating-gauge .g-range { fill: var(--water-3); opacity: .45; }
.rating-gauge .g-dot { fill: var(--primary); stroke: var(--surface); stroke-width: 1.5; }
.rating-roles, .rating-pairs { display: grid; gap: 4px; margin-top: 4px; font-size: .88rem; }
.rating-roles li { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) 2.6em; gap: 8px; align-items: center; }
.rating-roles meter { width: 100%; height: 8px; border-radius: 4px; background: var(--line); border: 0; }
.rating-roles meter::-webkit-meter-bar { background: var(--line); border: 0; border-radius: 4px; height: 8px; }
.rating-roles meter::-webkit-meter-optimum-value { background: var(--primary); border-radius: 4px; }
.rating-roles meter::-moz-meter-bar { background: var(--primary); border-radius: 4px; }
.rating-roles b, .rating-pairs b { font-variant-numeric: tabular-nums; text-align: right; }
.rating-pairs li { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.rating-number.fresh { font-size: 1.5rem; }
.rating-trend { display: block; width: 100%; height: auto; }
.rating-trend .t-line { fill: none; stroke: var(--water-3); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rating-trend .t-dot { fill: var(--primary); }
.rating-pairs-box { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.rating-luck { padding: 10px 14px; border-radius: 14px; background: var(--pass); color: var(--pass-ink); font-weight: 600; }
.rating-luck.quiet { padding: 0; background: none; color: var(--ink-2); font-weight: 400; font-size: .875rem; }
.rating-why > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--ink-2); font-size: .9rem; }
.rating-confirm { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }

/* ---------- the wiki index: sections of cards ---------- */
.wiki-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.wiki-jump[hidden] { display: none; }
.wiki-jump .btn { min-height: 40px; padding: 0 14px; font-size: .9rem; }
.wiki-index { gap: 22px; }
.wiki-sec { scroll-margin-top: 12px; }
.wiki-sec:focus { outline: none; }
.wiki-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.wiki-sec h2 .count { font-family: var(--f-body); font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.wiki-suit { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--card); border: 1px solid var(--card-edge);
  font-family: var(--f-suit); font-size: 1.05rem; line-height: 1; }
.wiki-suit.s-S { color: var(--suit-s); } .wiki-suit.s-H { color: var(--suit-h); } .wiki-suit.s-D { color: var(--suit-d); } .wiki-suit.s-C { color: var(--suit-c); }
.wiki-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; margin-top: 10px; }
.wiki-list li { padding: 0; border-bottom: 0; display: grid; }
.wiki-list a.wiki-card { display: grid; align-content: start; gap: 4px; min-height: 0; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 400; transition: border-color .15s ease, transform .15s ease; }
.wiki-list a.wiki-card:hover { border-color: var(--water-3); transform: translateY(-1px); }
.wiki-card b { color: var(--primary); font-weight: 700; line-height: 1.25; }
.wiki-card span { font-size: .875rem; line-height: 1.4; }

/* ---------- the daily board ---------- */
.daily-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.daily-head .stack { gap: 4px; flex: 1 1 200px; }
.compass { display: grid; grid-template-columns: 26px 44px 26px; grid-template-rows: 26px 44px 26px; gap: 3px; flex: none; font-weight: 750; font-size: .8rem; }
.cp { display: grid; place-items: center; border-radius: 8px; background: var(--pass); color: var(--pass-ink); position: relative; }
.cp.vul { background: var(--vul); color: var(--on-vul); }
.cp-n { grid-column: 2; grid-row: 1; } .cp-s { grid-column: 2; grid-row: 3; } .cp-w { grid-column: 1; grid-row: 2; } .cp-e { grid-column: 3; grid-row: 2; }
.compass::before { content: ""; grid-column: 2; grid-row: 2; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.cp.dealer::after { content: "D"; position: absolute; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: .62rem;
  background: var(--sun); color: var(--sun-ink); box-shadow: 0 0 0 2px var(--page); }
.cp-n.dealer::after { top: -9px; right: -9px; } .cp-s.dealer::after { bottom: -9px; right: -9px; }
.cp-w.dealer::after { top: -9px; left: -9px; } .cp-e.dealer::after { top: -9px; right: -9px; }

@media (prefers-reduced-motion: reduce) { .wiki-list a.wiki-card { transition: none; } .wiki-list a.wiki-card:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .front-tile, .mode-face, .navmore > summary::after { transition: none; } .front-tile:hover { transform: none; } }
:root[data-motion="reduced"] .front-tile:hover { transform: none; }

/* ---------- small pages ---------- */
.page:has(> .panel.login) { max-width: 600px; }
.panel.login { max-width: none; padding: 22px; }

/* ---------- keyboard: straight to the page ---------- */
.skip { position: absolute; left: 12px; top: -60px; z-index: 200; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--primary);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.skip:focus { top: 8px; }
