body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid #343026; background: #15130ff5; backdrop-filter: blur(16px); }
.bar-inner { min-height: 72px; }
.topbar nav { gap: 14px; width: auto; }
.topbar .button { min-height: 38px; font-size: .8rem; box-shadow: none; }
.brand-mark { width: 44px; height: 44px; }
.brand-name { font-size: .85rem; }
.icon-button, .profile-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 50%; }
.icon-button { font-size: 1.35rem; border: 0; background: transparent; }
.profile-button { overflow: hidden; color: var(--accent); font-weight: 800; }
.profile-button img { width: 100%; height: 100%; object-fit: cover; }
.notification-dot { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.notification-dot[hidden] { display: none; }
.bottom-nav { position: fixed; z-index: 35; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 5px max(16px, calc((100vw - 640px)/2)) calc(5px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: #191710f5; backdrop-filter: blur(18px); }
.bottom-nav button { display: grid; justify-items: center; align-content: center; gap: 1px; min-height: 58px; padding: 4px; border: 0; border-radius: 10px; background: transparent; color: #b8b2a6; font-size: .74rem; }
.bottom-nav button.active { color: #ffc928; background: #ffc9280b; font-weight: 800; }
.tab-icon { font-size: 1.5rem; line-height: 1.3; }
.tab-heading { margin: 34px 0 24px; }
.tab-heading h1 { font-size: clamp(1.65rem, 3vw, 2.3rem); letter-spacing: -.05em; }
.tab-heading p { margin-top: 7px; color: var(--muted); font-size: .9rem; }
.browse-page { padding-bottom: 35px; }
.browse-page .case-grid, body[data-page-tab=records] .case-grid { gap: 30px 20px; }
.browse-page .case-card, body[data-page-tab=records] .case-card { background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.browse-page .cover, body[data-page-tab=records] .cover { min-height: 0; aspect-ratio: 16/10; border: 1px solid #3e372b; border-radius: 10px; }
.browse-page .card-body, body[data-page-tab=records] .card-body { position: relative; padding: 12px 0 0; }
.browse-page .card-body h3, body[data-page-tab=records] .card-body h3 { padding-right: 35px; font-size: 1.05rem; margin: 6px 0; }
.browse-page .card-body p, body[data-page-tab=records] .card-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .78rem; margin-bottom: 8px; }
.genre { background: transparent; border: 0; padding: 0; color: #d9b65d; font-weight: 500; }
.card-link { border: 0; padding: 5px 0; margin-top: 5px; min-height: 30px; font-size: .78rem; }
.save-button { position: absolute; top: 28px; right: 0; width: 34px; height: 34px; border: 0; background: transparent; color: #b8b2a6; font-size: 1.45rem; }
.save-button[aria-pressed=true] { color: var(--accent); }
.search-large { padding: 8px 16px; margin-bottom: 22px; border-radius: 12px; max-width: 720px; }
.search-large input { width: 100%; }
.browse-page .filters { max-height: none; overflow: visible; margin-bottom: 18px; }
.browse-page .chip { border-radius: 7px; }
.list-title { font-size: 1.2rem; margin: 30px 0 18px; }
.history-list, .friend-list { list-style: none; padding: 0; margin: 0; }
.history-list li, .friend-row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.history-list li>div, .friend-row>div:first-of-type { flex: 1; min-width: 0; }
.history-list small, .friend-row small { display: block; color: var(--muted); margin-top: 4px; font-size: .78rem; }
.friend-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffc92819; color: var(--accent); }
.friend-actions { display: flex; gap: 8px; }
.social-invite { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.social-invite form { margin: 0; }
.social-invite form>div { display: flex; gap: 8px; margin-top: 8px; }
.social-invite input { min-width: 0; width: 190px; }
.friend-code { display: inline-block; margin: 8px 12px 0 0; font-family: var(--mono); color: var(--accent); }
.account-page { text-align: center; max-width: 520px; margin: 45px auto; }
.account-page img { width: 150px; height: 150px; object-fit: contain; margin-bottom: 20px; }
.account-page p { color: var(--muted); margin: 14px 0 24px; }
.in-game .dock { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.in-game .sheet { z-index: 41; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.site-footer { border-color: var(--border); margin-top: 32px; }
@media(max-width:700px) {
  .bar-inner { flex-wrap: nowrap; padding-block: 9px; gap: 8px; }
  .brand-name { display: none; }
  .brand-mark { width: 42px; height: 42px; }
  .topbar nav { gap: 9px; }
  .topbar .button { padding-inline: 12px; }
  .tab-heading { margin-top: 24px; }
  .browse-page .case-grid, body[data-page-tab=records] .case-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 12px; }
  .card-body h3 { font-size: .95rem; }
  .social-invite { padding: 16px; }
  .social-invite form { width: 100%; }
  .social-invite input { flex: 1; width: 100px; }
  .friend-row { flex-wrap: wrap; }
  .in-game .sheet { bottom: calc(var(--dock-h) + 94px + env(safe-area-inset-bottom,0px)); }
}

.nav-drawing { display:block; width:25px; height:25px; flex-shrink:0; }
.icon-wash { fill:currentColor; fill-opacity:.09; stroke:none; }
.tab-icon { display:grid; place-items:center; width:48px; height:33px; border-radius:12px; transition:background .18s ease; }
.bottom-nav button { gap:3px; background:transparent; }
.bottom-nav button.active { background:transparent; }
.bottom-nav button.active .tab-icon { background:#ffc92818; }
.bottom-nav button.active .icon-wash { fill-opacity:.2; }
.topbar .button .nav-drawing { width:19px; height:19px; }
.icon-button,.profile-button { border:1px solid #ffffff0c; background:#ffffff04; color:#ded8ca; }
.icon-button:hover,.profile-button:hover { background:#ffc92812; color:var(--accent); }
#saved-button[aria-pressed=true] { color:var(--accent); background:#ffc92818; }
@media(max-width:360px) {
  .topbar nav { gap:5px; }
  .topbar .button { padding-inline:8px; font-size:.72rem; }
  .topbar .button .nav-drawing { display:none; }
  .topbar .icon-button,.topbar .profile-button { width:36px; height:36px; }
}
.profile-button .nav-drawing { width:27px; height:27px; }
@media(prefers-reduced-motion:reduce){.tab-icon{transition:none}}

.social-mark img { width:22px; height:22px; display:block; object-fit:contain; }
#email-fields[hidden] { display:none; }
.email-toggle { justify-content:space-between; min-height:46px; }
#account .social { min-height:48px; border-radius:9px; }
