
.bg-ui .hidden { display: none !important; }
.bg-dim { position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 22, .32); }
.bg-pan {
  position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; height: 70vh; height: 70dvh;
  display: flex; flex-direction: column; padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-radius: 18px 18px 0 0; border-top: 1px solid var(--hn-gold, rgba(201, 162, 74, .85));
  background: var(--hn-panel, linear-gradient(180deg, #1b2540, #0f1729)); color: var(--hn-ink, #fbf1d6);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .35); font-family: var(--hn-sans, system-ui, sans-serif); word-break: keep-all; overflow-wrap: break-word;
}
.bg-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.bg-title { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 700; letter-spacing: .04em; color: #f1e4bb; font-family: var(--hn-serif, serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-lv { flex: 0 0 auto; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--hn-gold, #c9a24a); font-size: 13px; color: #f6e2a4; white-space: nowrap; }
.bg-lv:empty { display: none; }
.bg-x, .bg-back {
  flex: 0 0 auto; min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid rgba(201, 162, 74, .55);
  background: rgba(255, 255, 255, .06); color: var(--hn-ink, #fbf1d6); font-size: 20px; line-height: 1; cursor: pointer;
}
.bg-back { font-size: 14px; padding: 0 10px; }
.bg-keep { margin: 2px 0 6px; font-size: 12.5px; color: var(--hn-ink-soft, #c9bf9c); }
.bg-tabs { display: flex; gap: 6px; margin: 4px 0 8px; }
.bg-tabs button {
  flex: 1 1 0; min-height: 44px; border-radius: 12px; border: 1px solid rgba(201, 162, 74, .35); background: rgba(255, 255, 255, .04);
  color: var(--hn-ink-soft, #c9bf9c); font-size: 15px; font-weight: 600; cursor: pointer;
}
.bg-tabs button.on { color: #2a2008; background: linear-gradient(180deg, #f3dc95, #d9b45a); border-color: #e9cd7c; }
.bg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 2px 8px; }
.bg-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 0 8px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)); border: 1px solid rgba(201, 162, 74, .18);
}
.bg-row .hn-btn { flex: 0 0 auto; min-height: 44px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.bg-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bg-tx b { font-size: 15px; font-weight: 700; color: #fbf1d6; }
.bg-tx b em, .bg-sub em { font-style: normal; color: #f3d27a; font-weight: 600; margin-left: 2px; }
.bg-tx small { font-size: 12.5px; color: var(--hn-ink-soft, #c9bf9c); line-height: 1.4; }
.bg-tx small:empty { display: none; }
.bg-have { color: #d9e6c4 !important; }
.bg-sub { margin: 14px 2px 8px; font-size: 14px; font-weight: 700; color: #f1e4bb; letter-spacing: .03em; }
.bg-sub small { font-weight: 400; font-size: 12px; color: var(--hn-ink-soft, #c9bf9c); margin-left: 4px; }
.bg-stick { display: block; width: 100%; min-height: 46px; margin: 4px 0 2px; font-size: 15px; }
.bg-stick.dim { opacity: .5; }
.bg-empty, .bg-wait, .bg-note { margin: 6px 4px 10px; font-size: 13px; line-height: 1.5; color: var(--hn-ink-soft, #c9bf9c); }
.bg-wait { color: #f3d27a; }
.bg-note { font-size: 12px; opacity: .85; }
.bg-bar { display: block; height: 5px; margin-top: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bg-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #e9d18a, #f7e6b0); transition: width .4s; }


.bg-ic { position: relative; flex: 0 0 44px; width: 44px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.bg-ic-img img { width: 40px; height: 40px; object-fit: contain; }
.bg-ic svg { display: block; }
.bg-glass { fill: rgba(232, 242, 246, .35); stroke: rgba(255, 255, 255, .75); stroke-width: 1; }
.bg-cap { fill: #e0b440; }
.bg-milk { fill: #fbf9f0; }
.bg-b1 .bg-milk { fill: #f5e9c2; }
.bg-b2 .bg-milk { fill: #ebcf7e; }
.bg-b3 .bg-milk { fill: #d8a532; }
.bg-b4 .bg-milk { fill: #e8b52c; }
.bg-b4 { box-shadow: 0 0 0 1px #f3d27a, 0 0 12px rgba(243, 210, 122, .55); }
.bg-stk { position: absolute; left: 50%; top: 58%; width: 18px; height: 18px; transform: translate(-50%, -50%); border-radius: 50%; }


.bg-pickbox { padding: 6px 8px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.bg-pickbox .av5-pick { margin: 0; flex-wrap: wrap; row-gap: 8px; }
.bg-pickbox .tp-k { display: none; }
.bg-pickbox .av5-sx { min-height: 40px; border-radius: 10px; border: 1px solid rgba(201, 162, 74, .5); background: rgba(255, 255, 255, .06); color: #fbf1d6; cursor: pointer; }
.bg-pickbox .av5-sx.on { background: linear-gradient(180deg, #f3dc95, #d9b45a); color: #2a2008; }
.bg-pickbox .av5-cols { justify-content: flex-start; }
.bg-pickbox .av5-c { width: 30px; height: 30px; flex-basis: 30px; }
.bg-rand { margin-left: auto; }

.bg-pickbox .av5-rnd { min-height: 40px; border-radius: 10px; border: 1px solid rgba(201, 162, 74, .5); background: rgba(255, 255, 255, .06); color: #fbf1d6; cursor: pointer; }
.bg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bg-slot {
  min-height: 68px; padding: 6px 5px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  background: rgba(255, 255, 255, .04); border: 1px dashed rgba(201, 162, 74, .28);
}
.bg-slot.stat { border: 1px solid rgba(201, 162, 74, .6); }
.bg-slot.on { background: rgba(243, 210, 122, .12); }
.bg-sn { font-size: 12.5px; font-weight: 700; color: #f1e4bb; }
.bg-slot small { font-size: 11px; color: var(--hn-ink-soft, #c9bf9c); }
.bg-slot b { font-size: 12px; color: #fbf1d6; font-weight: 600; }
.bg-mini { min-height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid rgba(201, 162, 74, .55); background: rgba(255, 255, 255, .06); color: #fbf1d6; font-size: 12px; cursor: pointer; }
.bg-mini.gold { background: linear-gradient(180deg, #f3dc95, #d9b45a); color: #2a2008; }

.bg-lock { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border-radius: 9px; border: 1px dashed rgba(201, 162, 74, .45); color: #d8cfb8; font-size: 12px; }


.bg-msg {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; padding: 8px 10px; border-radius: 12px;
  background: rgba(255, 244, 210, .95); color: #4a3b12; font-size: 13.5px; line-height: 1.45;
}
.bg-msg span { flex: 1 1 160px; min-width: 0; }
.bg-msg .hn-btn { min-height: 44px; padding: 0 14px; }


.bg-arrow { position: fixed; z-index: 88; width: 0; height: 0; pointer-events: none; }
.bg-arrow i { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; background: rgba(176, 132, 36, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.bg-arrow i svg { display: block; }
.bg-arrow b {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, .92); color: #7a5a14; font-size: 12px; font-weight: 700;
}
.bg-toast, .bg-fill {
  position: fixed; z-index: 89; left: 50%; transform: translateX(-50%); max-width: min(92vw, 420px); padding: 8px 14px; border-radius: 12px;
  background: rgba(30, 34, 48, .9); color: #fff; font-size: 13px; text-align: center; word-break: keep-all; pointer-events: none;
}
.bg-toast { bottom: calc(190px + env(safe-area-inset-bottom)); }
.bg-fill { top: calc(max(8px, env(safe-area-inset-top)) + 54px); min-width: 220px; }
.bg-fill .bg-bar { height: 7px; margin-top: 6px; }
.bg-fill .bg-bar i { transition: none; background: linear-gradient(90deg, #7fd09a, #c8f0b4); }


@media (orientation: landscape) and (max-height: 520px) {
  .bg-pan { left: auto; top: 0; width: 45vw; min-width: 320px; height: auto; border-radius: 18px 0 0 18px; border-top: 0; border-left: 1px solid var(--hn-gold, #c9a24a);
    padding-top: max(6px, env(safe-area-inset-top)); }
  .bg-head { min-height: 40px; }
  .bg-tabs { margin: 2px 0 6px; }
  .bg-tabs button { min-height: 40px; }
  .bg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) and (min-height: 521px) {
  .bg-pan { left: auto; right: 12px; top: 60px; bottom: 12px; width: 380px; height: auto; border-radius: 16px; border: 1px solid var(--hn-gold, #c9a24a); }
  .bg-dim { background: rgba(8, 12, 22, .18); }
}
@media (max-width: 360px) {
  .bg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bg-row .hn-btn { padding: 0 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .bg-bar i { transition: none; } }
