/* ch211 (boss plan A, one shared door): the "go duobao" pill in the top-right cluster; hidden unless a round is open (entry_visible from /api/duobao/config). */
.dbx-sw { cursor: pointer; flex: none; font-size: 13px; font-weight: 700; line-height: 1.4; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(90, 169, 255, 0.55); color: #5aa9ff; text-decoration: none; white-space: nowrap; }
.dbx-sw:active { background: rgba(90, 169, 255, 0.18); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #070b18; color: #e8eeff; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
body { min-height: 100vh; }
button { font-family: inherit; cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .45; filter: grayscale(.6); }
.app { max-width: 420px; margin: 0 auto; padding: 12px 12px 20px; min-height: 100vh;
  /* iOS notch / home indicator (viewport-fit=cover): keep open button, multiplier row and nav clear of system bars */
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  padding-left: calc(12px + env(safe-area-inset-left));
  padding-right: calc(12px + env(safe-area-inset-right)); }

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.title { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #fff; text-shadow: 0 0 8px #2f8cff; }
.top-right { display: flex; align-items: center; }
.points { background: #111a36; border: 1px solid #23408a; border-radius: 16px; padding: 4px 10px; font-size: 13px; color: #9fc4ff; }
.points b { color: #4cc9ff; font-size: 16px; margin-left: 4px; }
.mute { background: #111a36; border: 1px solid #23408a; border-radius: 50%; width: 32px; height: 32px; font-size: 15px; color: #fff; }

.notice { display: flex; align-items: center; background: #0f1730; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #cfe0ff; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice .tag { background: #2f8cff; color: #fff; border-radius: 4px; padding: 1px 6px; flex: none; font-weight: 700; }
.notice .txt { overflow: hidden; text-overflow: ellipsis; }
.feed { height: 22px; overflow: hidden; position: relative; font-size: 12px; color: #7fb2ff; margin-bottom: 8px; }
.feed-track { position: absolute; white-space: nowrap; left: 100%; animation: feed 22s linear infinite; }
.feed-track span { margin-right: 36px; }
@keyframes feed { from { transform: translateX(0); } to { transform: translateX(-100%) translateX(-420px); } }

.board { position: relative; padding: 14px; border-radius: 18px; background: #0c1430; border: 2px solid #1d3a80; }
.dots { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #1b3a7a; }
.dot.a { animation: blinkA 1s steps(1) infinite; }
.dot.b { animation: blinkB 1s steps(1) infinite; }
.board.running .dot.a, .board.running .dot.b { animation-duration: .25s; }
@keyframes blinkA { 0% { background: #4cc9ff; box-shadow: 0 0 6px #4cc9ff; } 50% { background: #1b3a7a; box-shadow: none; } }
@keyframes blinkB { 0% { background: #1b3a7a; box-shadow: none; } 50% { background: #4cc9ff; box-shadow: 0 0 6px #4cc9ff; } }
/* ch268 (boss phone 368px: "grid cells stick out past the marquee, to the right, cells look too big"):
   with plain 1fr the automatic minimum (min-width:auto, amplified by aspect-ratio cross-size transfer in
   Chromium) floors every track at 103.17px > the 99px available -> grid scrollWidth 326 vs clientWidth 313,
   right column overran the board frame. minmax(0,1fr) + min-width:0 pin equal shrinking tracks;
   measured: tracks 98.86px, scrollWidth==clientWidth, all cells fit, no text clipped, no font-size touched.
   ch270 (boss phone 368x798: "middle open-box cell is too long, sticking out"): same story on the other axis —
   the center cell's content (label+value+button ≈ 103.17px min height) floored row 2 at 103.17px while the
   aspect-ratio squares refused to stretch, so the open cell hung 4.31px below its neighbours (bottom 343.17
   vs 338.86). Fix: rows are pinned equal too (minmax(0,1fr)) and the grid itself is square (aspect-ratio 1/1),
   while the center content is slimmed (padding 6→4, value line-height 1.1→1, button padding 6/4→5/3) to fit
   the 98.86px square; overflow:hidden on cells is the last-resort guard so content can never push a cell out
   of the formation again. Measured after: rows 98.8571x3, every cell 98.86x98.86, center bottom==338.86. */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); aspect-ratio: 1 / 1; gap: 8px; }
.cell { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 1 / 1; background: #131e42; border: 2px solid #22397a; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px; transition: border-color .08s, box-shadow .08s, background .08s; }
@supports not (aspect-ratio: 1 / 1) { .cell { height: 112px; } }
.cell .emo { font-size: 30px; line-height: 1.1; }
.cell .nm { font-size: 11px; line-height: 1.25; color: #dbe6ff; margin-top: 3px; max-height: 2.6em; overflow: hidden; }
.cell.idle { border-color: #2f5fc4; box-shadow: 0 0 8px rgba(47,140,255,.35); }
.cell.lit { border-color: #4cc9ff; background: #1a3a7c; box-shadow: 0 0 16px #4cc9ff, inset 0 0 10px rgba(76,201,255,.5); }
.cell.hit { border-color: #fff; background: #2f8cff; box-shadow: 0 0 22px #4cc9ff; animation: hit .5s ease-in-out 3; }
@keyframes hit { 50% { transform: scale(1.06); } }
.center { background: #0a2a66; border-color: #2f8cff; padding: 4px; justify-content: space-between; }
.center .pk-l { font-size: 11px; color: #9fc4ff; }
.center .pk-v { font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 0 10px #4cc9ff; line-height: 1; }
.open-btn { width: 100%; border-radius: 10px; background: #2f8cff; color: #fff; font-size: 16px; font-weight: 800; padding: 5px 0 3px; box-shadow: 0 3px 0 #1b5bc2; }
.open-btn small { display: block; font-size: 10px; font-weight: 400; opacity: .9; }
.open-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1b5bc2; }

.modes { display: flex; margin-top: 12px; }
.mode { flex: 1; background: #111a36; color: #9fc4ff; border: 1px solid #23408a; border-radius: 10px; padding: 9px 0; font-size: 15px; font-weight: 700; }
.mode.on { background: #2f8cff; color: #fff; border-color: #4cc9ff; box-shadow: 0 0 10px rgba(76,201,255,.5); }
.free-btn { width: 100%; margin-top: 10px; background: #12a37a; color: #fff; border-radius: 10px; padding: 10px 0; font-size: 15px; font-weight: 700; }
.cons { margin-top: 12px; }
.cons-l { font-size: 12px; color: #9fc4ff; margin-bottom: 4px; display: flex; justify-content: space-between; }
.bar { height: 10px; background: #111a36; border-radius: 6px; overflow: hidden; border: 1px solid #23408a; }
.bar i { display: block; height: 100%; background: #4cc9ff; width: 0; transition: width .4s; }
.nav { display: flex; margin-top: 14px; }
.nav button { flex: 1; background: #111a36; color: #cfe0ff; border: 1px solid #23408a; border-radius: 10px; padding: 10px 0; font-size: 13px; }

.mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(3,6,16,.78); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet { width: 100%; max-width: 396px; max-height: 86vh; overflow: auto; background: #0f1730; border: 1px solid #2f5fc4; border-radius: 14px; padding: 14px; }
.sheet h3 { margin: 0 0 10px; font-size: 16px; color: #fff; }
.sheet .x { float: right; background: transparent; color: #9fc4ff; font-size: 13px; }
table.prob { width: 100%; border-collapse: collapse; font-size: 12px; }
table.prob th, table.prob td { border-bottom: 1px solid #1f2e5c; padding: 6px 4px; text-align: left; vertical-align: top; }
table.prob th { color: #9fc4ff; font-weight: 600; white-space: nowrap; }
table.prob td:first-child { white-space: nowrap; }
table.prob td.p { color: #4cc9ff; font-weight: 700; white-space: nowrap; }
.total { text-align: right; font-size: 12px; color: #9fc4ff; margin: 6px 0 10px; }
.rules { padding-left: 18px; margin: 0; font-size: 12px; line-height: 1.7; color: #cfe0ff; }
details.probdet { margin-top: 12px; border: 1px solid #1f2e5c; border-radius: 10px; padding: 2px 10px; }
details.probdet > summary { cursor: pointer; list-style: none; font-size: 13px; color: #9fc4ff; padding: 8px 0; }
details.probdet > summary::-webkit-details-marker { display: none; }
details.probdet[open] > summary { border-bottom: 1px solid #1f2e5c; margin-bottom: 6px; }
.tabs { display: flex; margin-bottom: 10px; }
.tabs button { flex: 1; background: #111a36; color: #9fc4ff; border-radius: 8px; padding: 7px 0; font-size: 13px; }
.tabs button.on { background: #2f8cff; color: #fff; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #1f2e5c; font-size: 12px; }
.row .l { flex: 1; }
.row .t { color: #6f86b8; font-size: 11px; }
.row .s { color: #4cc9ff; white-space: nowrap; }
.small-btn { background: #2f8cff; color: #fff; border-radius: 6px; padding: 5px 10px; font-size: 12px; }
.empty { text-align: center; color: #6f86b8; padding: 20px 0; font-size: 13px; }
.res-item { display: flex; align-items: center; padding: 7px 0; border-bottom: 1px solid #1f2e5c; font-size: 13px; }
.res-item .e { font-size: 22px; }
.res-total { margin-top: 10px; font-weight: 800; color: #4cc9ff; text-align: center; }
.res-bonus { margin-top: 6px; color: #7ff0c8; text-align: center; font-size: 12px; }
.primary { width: 100%; margin-top: 12px; background: #2f8cff; color: #fff; border-radius: 10px; padding: 11px 0; font-size: 15px; font-weight: 700; }
.form label { display: block; font-size: 12px; color: #9fc4ff; margin: 8px 0 4px; }
.form input, .form textarea { width: 100%; background: #0a1124; border: 1px solid #2f5fc4; border-radius: 8px; color: #fff; padding: 9px; font-size: 14px; font-family: inherit; }
.skip { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40; background: rgba(17,26,54,.92); color: #fff; border: 1px solid #4cc9ff; border-radius: 18px; padding: 7px 16px; font-size: 13px; }

.celebrate { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 60; background: radial-gradient(circle at 50% 40%, #1c4fb8 0%, #070b18 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.celebrate .big { font-size: 96px; animation: pop .7s ease-out; }
.celebrate .c-t { font-size: 20px; color: #9fd8ff; margin-top: 8px; }
.celebrate .c-n { font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 0 14px #4cc9ff; margin: 6px 0 20px; }
.celebrate .primary { max-width: 260px; }
.celebrate .ghost { margin-top: 10px; background: transparent; color: #9fc4ff; font-size: 13px; }
.confetti { position: absolute; top: -40px; font-size: 22px; animation: fall linear forwards; }
@keyframes pop { 0% { transform: scale(.2); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(10,20,50,.95); color: #fff; border: 1px solid #4cc9ff; padding: 10px 18px; border-radius: 10px; font-size: 15px; z-index: 90; display: none; }
.toast.show { display: block; }
.login { text-align: center; }
.login p { color: #9fc4ff; font-size: 13px; }
.daily { font-size: 11px; color: #6f86b8; text-align: right; margin-top: 4px; }

/* iOS 14.0-14.4 lacks flex gap: use margins */
.top-right > * + * { margin-left: 8px; }
.notice .tag { margin-right: 6px; }
.modes > * + *, .nav > * + * { margin-left: 8px; }
.tabs > * + * { margin-left: 6px; }
.row > * + * { margin-left: 8px; }
.res-item .e { margin-right: 10px; }

.celebrate { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.link-dead { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.ld-msg { font-size: 17px; line-height: 1.7; color: #e8eeff; background: #0f1730; border: 1px solid #2f5fc4; border-radius: 14px; padding: 22px 18px; max-width: 320px; }
/* ch209 feed polish: fade both ends; pause on hover; idle fallback centered with a softer color */
.feed { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.feed:hover .feed-track { animation-play-state: paused; }
.feed-track.static { animation: none; left: 0; right: 0; text-align: center; color: #6d89b8; }
