/* The top bar (the LIDDAT wordmark home and the site's nav) for a page that doesn't link /shared/liddat.css: Where
   sia?, whose own styles.css would clash with the rest of it. Its rules are liddat.css's, word for word (test/nav.test.js
   checks), so change them there and here together. */
/* liddat.css's a { color: inherit; }, for the top bar only */
:where(.topbar) a { color: inherit; }
/* ---------- top bar: the wordmark home and the sister tools ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.wordmark { font-family: var(--font); font-weight: 700; font-size: 26px; letter-spacing: -.5px; color: #fff; text-decoration: none; text-shadow: 0 3px 0 var(--ink); }
/* as tall as the level chip shared/xp.js puts beside it, so the top bar doesn't grow when it comes */
.topbar .wordmark { line-height: 50px; }
.wordmark span { color: var(--yellow); }
/* every tool and game, a row per group with its name first (shared/groups.js); a tool page shows it short (below) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs .grp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex-basis: 100%; }
.tabs .g { font-family: var(--font); font-weight: 700; font-size: 15px; color: #fff; text-shadow: 0 2px 0 var(--ink); margin-right: 2px; white-space: nowrap; }
.tabs.short:not(.all) .grp { display: contents; }
.tabs.short:not(.all) .g { display: none; }
.tabs a { font-family: var(--font); font-weight: 600; font-size: 15px; text-decoration: none; background: rgba(255,255,255,.85); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 14px; box-shadow: 0 3px 0 rgba(27,27,58,.2); }
.tabs a[aria-current] { background: var(--ink); color: #fff; }
/* A tool page's nav shows only this page, your last few tools and ＋ All tools (shared/ui.js marks them .on); until
   it has, this page and the popular ones (POPULAR in ui.js), so the row doesn't jump */
.tabs.short:not(.all) a:not([aria-current], .more, .on) { display: none; }
.tabs.short:not(.ready) a:is([href="/hawker/"], [href="/coe/"], [href="/cpf/"], [href="/days/"], [href="/bus/"], [href="/resale/"]) { display: revert; }
.tabs a.more { background: var(--yellow); }
/* ☆ beside this page's tab (shared/ui.js): ★ on a yellow chip once it's a favourite */
.tabs .star { font-family: var(--font); font-weight: 700; font-size: 17px; line-height: 1; color: var(--ink); background: rgba(255,255,255,.85); border: 3px solid var(--ink); border-radius: 999px; padding: 0 9px; min-width: 38px; min-height: 34px; flex: none; box-shadow: 0 3px 0 rgba(27,27,58,.2); cursor: pointer; margin-left: -4px; -webkit-tap-highlight-color: transparent; }
.tabs .star[aria-pressed="true"] { background: var(--yellow); }
.tabs .star:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
@media (hover: hover) { .tabs .star:hover { transform: translateY(-1px); } }
.tabs .star:active { transform: translateY(2px); box-shadow: none; }
/* what starring did, for a moment at the bottom of the screen (shared/favs.js note()) */
.fav-note { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 1000; width: max-content; max-width: calc(100% - 32px); margin: 0; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 1.3; text-align: center; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 14px; box-shadow: 0 5px 0 rgba(27,27,58,.25); transition: opacity .2s, transform .2s; }
.fav-note.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .fav-note { transition: none; } }
/* liddat.css's .btn, for the favourites dialog's two buttons */
dialog.fav-ask .btn { font-family: var(--font); font-weight: 600; font-size: 16px; border: 3px solid var(--ink); border-radius: 14px; background: var(--yellow); padding: 0 16px; cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
dialog.fav-ask .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
/* a star asks first (shared/favs.js confirmFav()), so a stray tap changes nothing */
dialog.fav-ask { width: min(360px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
dialog.fav-ask::backdrop { background: rgba(27, 27, 58, .55); }
dialog.fav-ask p { font-family: var(--font); font-weight: 600; font-size: 19px; line-height: 1.3; margin: 0 0 16px; }
dialog.fav-ask div { display: flex; gap: 10px; }
dialog.fav-ask .btn { flex: 1; min-height: 48px; }
dialog.fav-ask .no { background: #fff; }

@media (max-width: 520px) {
  .wordmark { font-size: 22px; }
  .tabs a { font-size: 14px; padding: 3px 11px; white-space: nowrap; position: relative; }
  .tabs a::after { content: ''; position: absolute; inset: -8px -7px; } /* past the 3px border: a 40px-tall tap target round each tab */
  /* the short nav in one row that scrolls sideways, bleeding to the screen's edges; all of it wraps, a row per group */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 32px); margin: -3px -16px 0; padding: 5px 16px 6px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.all, .tabs:not(.short) { flex-wrap: wrap; overflow-x: visible; row-gap: 10px; }
  .tabs .g { font-size: 14px; flex-basis: 100%; }
}
