/*!
 * MBG Who Am I? - the simpler home (0.9.8).
 * One calm column: a slim top bar, the card on the forehead with one big Play, "Choose the game",
 * "Explore more", the Top 20 and the intro film. Everything else lives in the ☰ Menu, reached from a
 * tab bar at the bottom (Home · Top 20 · Inbox · Menu) as in the phone apps people already know.
 * Builds on game.css, app.css and whoami.css; it uses their colours only, so every theme works.
 */

/* ------------------------------------------------------------- page --- */
.home.home2 {
  gap: 0; padding-top: 0;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
.home-main { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }

/* ------------------------------------------------------------ top bar --- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left))) calc(-1 * max(16px, env(safe-area-inset-right)));
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
}
.brandbtn { border: 0; background: none; padding: 0; color: var(--ink); text-align: start; font: inherit; cursor: pointer; }
.home2 .brandtext { display: flex; }
.home2 .appname { font-size: 17px; }
.home2 .tools { gap: 8px; }
.home2 .tools .ib { height: 40px; border-radius: 20px; }
.home2 .ib.ib-acc { width: 40px; }
@media (max-width: 340px) { .home2 .appby { display: none; } }

/* --------------------------------------------------------------- hero --- */
.hero.hero2 {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 20px 18px 18px; border-radius: 24px; border: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--mode) 16%, transparent), transparent 60%),
    var(--card);
  box-shadow: 0 1px 0 var(--line), 0 12px 32px -18px color-mix(in srgb, var(--mode) 60%, transparent);
}
.hero.hero2::before { display: none; }
.hero2 .hero-card { width: 82px; height: 108px; margin-bottom: 4px; }
.hero2 .fc-q { font-size: 40px; }
.hero2 .fc-mode { font-size: 18px; }
.hero2 h1 { margin: 0; font: 700 clamp(25px, 7.4vw, 32px)/1.1 var(--font-display); letter-spacing: -.01em; }
.hero-sub { margin: 0 0 4px; max-width: 34ch; color: var(--muted); font-size: .9em; line-height: 1.4; text-wrap: balance; }

.btn.playbig {
  width: 100%; min-height: 66px; border-radius: 18px; gap: 12px; padding: 8px 20px;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.playbig svg { width: 26px; height: 26px; }
.pb-t { display: grid; justify-items: start; gap: 2px; min-width: 0; }
.pb-main { font: 700 1.3em/1.1 var(--font-display); letter-spacing: .01em; }
.pb-sub { max-width: 100%; font-size: .74em; font-weight: 700; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-sub:empty { display: none; }
.btn.choosebtn { width: 100%; border-radius: 16px; border-width: 1.5px; }

/* ------------------------------------------------------- explore more --- */
.home2 .explore { border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.home2 .explore > summary { padding: 14px 16px; min-height: 56px; }
.home2 .ex-t { display: grid; gap: 2px; }
.home2 .ex-t span { color: var(--muted); font-size: .85em; }
@media (max-width: 460px) { .home2 .explore .modes { grid-template-columns: 1fr; } }
@media (max-width: 460px) {
  .home2 .modecard { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; text-align: start; }
  .home2 .modecard .mtiles { grid-row: span 2; }
}

/* ------------------------------------------------------------ the Top 20 --- */
.topcard { display: grid; gap: 12px; padding: 16px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.tc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 10px; }
.tc-ht { display: grid; gap: 2px; min-width: 0; flex: 1 1 14rem; }
.tc-ht h2 { margin: 0; font: 700 1.08em/1.2 var(--font-display); }
.tc-sub { margin: 0; color: var(--muted); font-size: .86em; line-height: 1.5; }
.tc-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: .9em; font-weight: 700; white-space: nowrap; }
.tc-badge:empty { display: none; }
.tc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tc-row { display: grid; grid-template-columns: 2em 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--surface); }
.tc-row.top1 { background: color-mix(in srgb, #ffd23f 26%, var(--surface)); }
.tc-row.top2 { background: color-mix(in srgb, #c0c8d0 26%, var(--surface)); }
.tc-row.top3 { background: color-mix(in srgb, #d08a4a 20%, var(--surface)); }
.tc-row.me { box-shadow: 0 0 0 2px var(--accent) inset; }
.tc-place { text-align: center; font-weight: 800; font-size: 1.15em; }
.tc-mid { display: grid; min-width: 0; line-height: 1.25; }
.tc-mid strong, .tc-mid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-mid span { color: var(--muted); font-size: .8em; }
.tc-val { font-size: 1.1em; }
.tc-empty { padding: 14px; border-radius: 14px; border: 1px dashed var(--line); color: var(--muted); text-align: center; font-size: .92em; }

.tc-me {
  display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)) auto; align-items: center; gap: 6px;
  width: 100%; padding: 10px 10px 10px 12px; border-radius: 16px; border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--card)); color: var(--ink); font: inherit; text-align: center;
}
.tc-me:active { transform: scale(.985); }
.me-who { display: grid; justify-items: center; gap: 2px; padding-inline-end: 4px; font-size: .8em; }
.me-n { display: grid; gap: 1px; min-width: 0; }
.me-n b { font-size: 1.05em; }
.me-n span { font-size: .68em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.chev { width: 18px; height: 18px; color: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.topcard .hofbtn { width: 100%; border-radius: 14px; }

/* ------------------------------------------------------ about + footer --- */
.home2 .aboutcard { border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
@media (max-width: 560px) {
  .home2 .aboutcard { grid-template-columns: 1fr; gap: 12px; }
  .home2 .about-media { width: 100%; }
  .home2 .about-media video, .home2 .about-media img { display: block; width: 100%; height: auto; }
  .home2 .about-play { left: 50%; right: auto; transform: translateX(-50%); bottom: 10px; padding: 7px 14px; font-size: .85em; }
}
.home2 .homefoot { padding: 4px 0 8px; font-size: .78em; }

/* ------------------------------------------------------------ tab bar --- */
.tabbar {
  position: fixed; z-index: 25; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(640px, 100%);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--card) 90%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--line);
}
@media (min-width: 641px) { .tabbar { bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding-bottom: 6px; } }
.tab {
  position: relative; display: grid; justify-items: center; gap: 3px; min-height: 54px; padding: 4px 2px 2px;
  border: 0; background: none; color: var(--muted); font: 700 11.5px/1.1 var(--font-body);
}
.tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab svg { width: 24px; height: 24px; padding: 4px 18px; box-sizing: content-box; border-radius: 999px; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: background .2s; }
.tab.on { color: var(--ink); }
.tab.on svg { background: var(--accent-soft); color: var(--accent); }
.tab:active svg { transform: scale(.94); }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; border-radius: 14px; }
.tab .badge-n { top: 0; inset-inline-end: calc(50% - 26px); box-shadow: 0 0 0 2px var(--card); }
.tab.bell.has svg { animation: bell 1.4s var(--ease) 1; transform-origin: 50% 10%; }

/* --------------------------------------------------------------- menu --- */
.dlg.drawer {
  display: none; flex-direction: column;
  position: fixed; inset: auto 0 0 0; margin: 0 auto;
  width: min(560px, 100%); max-width: 100%; height: min(92dvh, 900px); max-height: 92dvh;
  border-radius: 24px 24px 0 0; background: var(--bg);
}
.dlg.drawer[open] { display: flex; animation: drw-up .26s var(--ease); }
@keyframes drw-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 720px) {
  .dlg.drawer { inset: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 420px; border-radius: 24px 0 0 24px; }
  .dlg.drawer[open] { animation-name: drw-side; }
  @keyframes drw-side { from { transform: translateX(40px); opacity: 0; } }
}
.drw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 8px; }
.drw-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
@media (min-width: 720px) { .drw-head::before { display: none; } }
.drw-head h2:focus { outline: none; }
.drw-head h2 { margin: 0; font: 700 1.25em/1.2 var(--font-display); }
.drw-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px max(24px, env(safe-area-inset-bottom)); }

.drw-profile { display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.drw-who { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; }
.drw-who-t { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.drw-who-t strong { font-size: 1.1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drw-who-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.drw-who-btns .btn { flex: 1 1 8rem; }

.drw-sec { margin: 20px 6px 8px; font-size: .78em; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.drw-sec:empty { margin-top: 14px; }
.drw-group { display: grid; border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.drw-row {
  display: flex; align-items: center; gap: 12px; min-height: 58px; width: 100%; padding: 9px 12px 9px 12px;
  border: 0; background: none; color: var(--ink); font: inherit; text-align: start; text-decoration: none; cursor: pointer;
}
.drw-row + .drw-row { box-shadow: 0 -1px 0 var(--line); }
.drw-row:active { background: var(--surface); }
@media (hover: hover) { .drw-row:hover { background: var(--surface); } }
.drw-row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.drw-row.here { cursor: default; }
.drw-ic {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: color-mix(in srgb, var(--tone, var(--muted)) 16%, var(--card)); color: var(--tone, var(--ink));
  font-size: 18px; line-height: 1; font-weight: 700;
}
.drw-ic[data-tone="who"] { --tone: var(--who); }
.drw-ic[data-tone="what"] { --tone: var(--what); }
.drw-ic[data-tone="where"] { --tone: var(--where); }
.drw-ic[data-tone="when"] { --tone: var(--when); }
.drw-t { display: grid; gap: 1px; flex: 1; min-width: 0; line-height: 1.3; }
.drw-t strong { font-weight: 700; }
.drw-t span { color: var(--muted); font-size: .82em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.drw-t span[hidden] { display: none; }
.drw-end { display: flex; align-items: center; gap: 6px; flex: none; }
.drw-row .ib-sound { width: 44px; height: 36px; border-radius: 18px; font-size: 18px; }
.drw-row.danger { color: var(--no); justify-content: center; }
.drw-row.danger .drw-ic { background: color-mix(in srgb, var(--no) 14%, var(--card)); color: var(--no); }
.drw-row.danger .drw-t { flex: 0 1 auto; }
.drw-hint { margin: -2px 6px 8px; color: var(--muted); font-size: .84em; }
.drw-foot { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: .76em; }

/* ------------------------------------------------ free access (administrator) --- */
.fa-form { display: grid; gap: 8px; margin: 6px 0 4px; }
.fa-l { display: grid; gap: 4px; font-weight: 700; font-size: .9em; }
.fa-in { min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; }
.fa-in:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.fa-seg .seg-btn { font-size: .85em; }
.fa-msg { min-height: 1.2em; margin: 0; }
.fa-h { margin: 16px 0 6px; font-size: 1em; }
.fa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fa-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.fa-row.off { opacity: .6; }
.fa-t { display: grid; flex: 1; min-width: 0; }
.fa-t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
