/* app.css — the Home Screen app's sheet (2026-11-27), ported from
   donutsmp.bet's css/app.css in this site's blue.

   The bottom bar was out for a while (hamburger only) and came back the same
   day beside the hamburger (his call: both). */

/* ── the phone bottom bar (back 2026-11-27, beside the hamburger) ──
   donutsmp.bet's: Players, Items, Home raised in the middle, Tools, Boards.
   z-index 197 keeps it under the drawer's backdrop (198) and the drawer. */
:root { --sab: env(safe-area-inset-bottom, 0px); }
html.app { --sab: calc(max(env(safe-area-inset-bottom, 0px), 20px) + 4px); }

.ds-bar { display: none; }
@media (max-width: 700px) {
  .ds-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 197;
    align-items: stretch; justify-content: space-around; gap: 0;
    height: calc(62px + var(--sab)); padding: 0 6px var(--sab);
    background: #10151f; border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 -10px 26px rgba(0,0,0,0.38);
    font-family: var(--font, 'Sora', sans-serif);
  }
  .ds-bar .dsb-ind {
    position: absolute; top: -1px; left: 0; width: 20px; height: 3px; border-radius: 0 0 3px 3px;
    background: #3b8bff; box-shadow: 0 0 10px rgba(59,139,255,0.65);
    transition: transform 0.38s cubic-bezier(0.4,0,0.2,1), opacity 0.2s; pointer-events: none;
  }
  .ds-bar .dsb-ind.off { opacity: 0; }
  .ds-bar .dsb-btn {
    flex: 1 1 0; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
    color: #66748f; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent; transition: color 0.2s;
  }
  .ds-bar .dsb-btn.lit { color: #fff; }
  .ds-bar .dsb-ico {
    width: 40px; height: 30px; display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  }
  .ds-bar .dsb-ico svg { width: 22px; height: 22px; display: block; }
  .ds-bar .dsb-lbl { line-height: 1; }
  .ds-bar .dsb-btn:active .dsb-ico { transform: scale(0.86); transition-duration: 0.08s; }
  .ds-bar .dsb-btn.lit:not(.dsb-home) .dsb-ico { transform: translateY(-1px); }

  /* Home: the raised disc, one soft edge, dimmer when another tab is lit */
  .ds-bar .dsb-home .dsb-ico {
    width: 54px; height: 54px; border-radius: 50%; margin-top: -26px; color: #fff;
    background: linear-gradient(160deg, #3b8bff 0%, #036fff 55%, #0157d0 100%);
    box-shadow: 0 6px 16px rgba(3,111,255,0.32);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, filter 0.25s;
  }
  .ds-bar .dsb-home .dsb-ico svg { width: 24px; height: 24px; }
  .ds-bar .dsb-home:not(.lit) .dsb-ico { filter: saturate(0.75) brightness(0.88); box-shadow: 0 4px 10px rgba(3,111,255,0.18); }
  .ds-bar .dsb-home.lit .dsb-ico { box-shadow: 0 8px 22px rgba(3,111,255,0.5); }
  .ds-bar .dsb-home:active .dsb-ico { transform: scale(0.9); }

  /* Every page ends clear of the bar. */
  body { padding-bottom: calc(62px + var(--sab)); }
}
@media (prefers-reduced-motion: reduce) {
  .ds-bar .dsb-ind, .ds-bar .dsb-ico { transition: none; }
}

/* ── the Add to Home Screen sheet (js/app.js) ──
   .bet's sheet with this site's blue where .bet has green (his call
   2026-11-27: "make it blue instead of green like the rest of the website").
   A bottom sheet on a phone, rising on the same curve. */
.a2-wrap { position: fixed; inset: 0; z-index: 10070; pointer-events: none; }
.a2-back { position: absolute; inset: 0; background: rgba(0,0,0,0.6); opacity: 0; transition: opacity .28s ease; }
.a2-wrap.on { pointer-events: auto; }
.a2-wrap.on .a2-back { opacity: 1; }
.a2-sheet {
  position: absolute; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--card-bg, #131926); border: 1px solid rgba(59,139,255,0.45); border-radius: 20px; overflow: hidden;
  padding: 22px 18px 14px; color: #fff; font-family: var(--font, 'Sora', sans-serif);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  transform: translateY(calc(100% + 24px)); transition: transform .34s cubic-bezier(.2,.8,.25,1);
}
.a2-wrap.on .a2-sheet { transform: none; }
.a2-line { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #0157d0, #3b8bff, #0157d0); }
.a2-x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); font-size: 12px; cursor: pointer; }
.a2-head { display: flex; align-items: center; gap: 14px; padding-right: 30px; margin-bottom: 16px; }
.a2-icon { width: 60px; height: 60px; flex: none; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.a2-t { font-family: var(--font-display, 'Sora', sans-serif); font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; white-space: nowrap; }
.a2-t .a2-blue { color: var(--blue, #036fff); }
.a2-s { margin-top: 5px; font-size: 14px; color: rgba(255,255,255,0.68); line-height: 1.4; }
.a2-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.a2-steps li { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); font-size: 14px; font-weight: 600; }
.a2-steps b { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); font-size: 12px; font-weight: 800; }
.a2-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: 0 2px; vertical-align: -6px; color: #4ea1ff; font-style: normal; }
.a2-ic svg { width: 20px; height: 20px; }
.a2-note { margin: 0 0 14px; font-size: 13.5px; color: rgba(255,255,255,0.7); line-height: 1.45; }
.a2-go { display: block; width: 100%; height: 50px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; font: 700 15px var(--font, 'Sora', sans-serif);
  background: linear-gradient(180deg, #3b8bff, #036fff 55%, #0157d0); box-shadow: 0 8px 24px rgba(3,111,255,0.28), inset 0 1px 0 rgba(255,255,255,0.22); }
.a2-go:active { transform: scale(.99); }
.a2-later { display: block; margin: 10px auto 0; border: 0; background: none; color: rgba(255,255,255,0.45); font: 700 12.5px var(--font, 'Sora', sans-serif); cursor: pointer; padding: 4px 8px; }
@media (prefers-reduced-motion: reduce) { .a2-sheet, .a2-back { transition: none; } }
@media (min-width: 881px) { .a2-sheet { left: auto; right: 24px; width: 380px; } }

/* .bet's mask icons: the PNG is a stencil, the glyph takes the tab's colour */
.ds-bar .dsb-mask {
  display: block; width: 22px; height: 22px; background-color: currentColor;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}

/* ── the chat on phones (2026-11-27), donutsmp.bet's slide-over panel ──
   The embed hides its panel below 1100px; on a phone it comes back as a panel
   from the right over a dimmed backdrop (js/mobile-chat.js). Two changes from
   .bet, his asks: it covers the bottom bar (bottom 0, z above the bar's 197),
   and it takes more of the screen (a 64px peek of the page since 2026-11-27 (44px was a touch too wide),
   which is still the place to tap to close). The home indicator strip is the
   panel's own padding, so the chat's input sits above it. */
@media (max-width: 700px) {
  .oxchat-panel {
    display: flex !important; flex-direction: column !important;
    overflow: visible !important;
    position: fixed !important; top: 0 !important; right: 0 !important; left: auto !important; bottom: 0 !important;
    height: auto !important; width: calc(100% - 64px) !important; max-width: none !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    transform: translateX(100%) !important;
    transition: transform 0.36s cubic-bezier(0.4,0,0.2,1) !important;
    z-index: 360 !important;
    border-left: 1px solid rgba(255,255,255,0.09) !important;
    box-shadow: -14px 0 44px rgba(0,0,0,0.55) !important;
    overscroll-behavior: contain !important;
  }
  /* closed: not drawn at all; open: drawn off screen, then slid in (oxchat-in) */
  html:not(.oxchat-open) .oxchat-panel { visibility: hidden; transition: transform 0.36s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0.36s !important; }
  html.oxchat-open:not(.oxchat-in) .oxchat-panel { visibility: visible !important; }
  html.oxchat-open.oxchat-in .oxchat-panel { transform: translateX(0) !important; }
  .oxchat-panel > * { min-width: 0 !important; width: 100% !important; }
  .oxchat-panel.dragging { transition: none !important; transform: translateX(var(--oxchat-drag, 0px)) !important; }
  .oxchat-panel.dragging.releasing { transition: transform 0.36s cubic-bezier(0.4,0,0.2,1) !important; }
  /* the embed's own desktop toggle stays hidden on phones; the bar's Chat tab opens it */
  .oxchat-toggle { display: none !important; }
  /* the embed pads the page for the panel on desktop; never on a phone */
  html.oxchat-open body { padding-right: 0 !important; }

  .oxchat-backdrop {
    position: fixed; inset: 0; z-index: 350;
    background: rgba(5,8,14,0.62); touch-action: none; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.36s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0.36s;
  }
  html.oxchat-open.oxchat-in .oxchat-backdrop { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.36s cubic-bezier(0.4,0,0.2,1), visibility 0s; }

  /* typing: the panel rises by the keyboard's height */
  html.chat-typing .oxchat-panel { bottom: var(--oxchat-kb, 0px) !important; padding-bottom: 0; }

  /* the grip on the panel's left edge, on <body> so the frame cannot eat it */
  .oxchat-handle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 50%; right: calc(100% - 64px); left: auto; transform: translateY(-50%);
    width: 26px; height: 96px; z-index: 361;
    opacity: 0; pointer-events: none; transition: opacity 0.12s ease;
    touch-action: none; cursor: grab;
  }
  html.oxchat-open .oxchat-handle { opacity: 1; pointer-events: auto; transition: opacity 0.22s ease 0.38s; }
  .oxchat-handle span { width: 5px; height: 54px; border-radius: 5px; background: rgba(255,255,255,0.5); box-shadow: 0 0 10px rgba(0,0,0,0.5); }
}
.oxchat-backdrop, .oxchat-handle { display: none; }
@media (max-width: 700px) { .oxchat-backdrop { display: block; } .oxchat-handle { display: flex; } }

/* HOME STAYS IN THE MIDDLE (2026-11-27, his call, after Boards left the bar).
   Six tabs: two before Home, three after. Home takes a fixed 64px and each
   half of the bar gets the same width: the two left tabs grow 3 parts each,
   the three right tabs 2 parts each (6 = 6), so Home sits on the bar's centre
   line exactly. A tab added or removed needs these weights redone. */
@media (max-width: 700px) {
  .ds-bar .dsb-btn { flex: 2 1 0; min-width: 0; }
  .ds-bar .dsb-btn[data-tab="players"],
  .ds-bar .dsb-btn[data-tab="items"] { flex: 3 1 0; }
  .ds-bar .dsb-btn.dsb-home { flex: 0 0 64px; }
}
