body { margin: 0; background: #08141a; color: #F9F9FB; font: 500 14px/1.4 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
hb-game { position: relative; }
.limbo { width: 100%; max-width: 560px; margin: 0 auto; box-sizing: border-box; padding: 20px; display: grid; gap: 16px; }
.head { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: .12em; color: #28F3F3; }
.brand span { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #8F96A8; }
.hbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #0D2A38; background: rgba(9,102,125,0.15); color: #8F96A8; font: inherit; font-weight: 800; cursor: pointer; }
.hbtn:hover { color: #F9F9FB; border-color: #28F3F3; }
.history { display: flex; gap: 5px; flex-wrap: nowrap; overflow: hidden; min-height: 24px; }
.hpill { flex: none; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: #0b1f28; border: 1px solid #0D2A38; color: #8F96A8; }
.hpill.win { color: #58e879; border-color: rgba(88, 232, 121, .45); }
.hpill.lose { color: #FA2E5D; border-color: rgba(250, 46, 93, .4); }
.facts { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-size: 13px; color: #8F96A8; font-variant-numeric: tabular-nums; }
.facts b { color: #F9F9FB; font-weight: 700; font-size: 15px; }
.stage { background: #0b1f28; border: 1px solid #0D2A38; border-radius: 16px; padding: 22px 16px 16px; display: grid; gap: 6px; justify-items: center; }
.stage.win { border-color: #58e879; }
.stage.lose { border-color: #FA2E5D; }
.result { font-size: 64px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: #28F3F3; }
.result.win { color: #58e879; }
.result.lose { color: #FA2E5D; }
.status { font-size: 13px; color: #8F96A8; text-align: center; min-height: 18px; }
.resultline { font-size: 14px; font-weight: 800; letter-spacing: .04em; min-height: 19px; font-variant-numeric: tabular-nums; }
.resultline.win { color: #58e879; }
.resultline.lose { color: #FA2E5D; }
.pick { display: grid; gap: 10px; }
.target { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; }
.target input[type="range"] { width: 100%; accent-color: #28F3F3; }
.target output { color: #F9F9FB; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; background: #0b1f28; border: 1px solid #0D2A38; border-radius: 8px; padding: 7px 4px; font-size: 15px; }
.step { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #0D2A38; background: rgba(9,102,125,0.15); color: #F9F9FB; font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer; }
.step:hover { border-color: #28F3F3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 30px; padding: 0 12px; border: 1px solid #0D2A38; border-radius: 15px; background: rgba(9,102,125,0.15); color: #8F96A8; font: inherit; font-weight: 600; cursor: pointer; }
.chips button[aria-pressed="true"] { background: #0D2A38; color: #F9F9FB; border-color: #28F3F3; }

/* Rules overlay: same card family as the intro. */
.rules { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 14px; background: rgba(4, 8, 10, .72); }
.rules[hidden] { display: none; }
.rules-card { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid #1d5b74; background: linear-gradient(170deg, #0d2431, #08141a); box-shadow: 0 18px 60px rgba(0, 0, 0, .7), 0 0 26px rgba(40, 243, 243, .12); overflow: hidden; }
.rules-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px 10px; font-weight: 800; font-size: 17px; letter-spacing: .05em; color: #a5fbfb; }
.rules-x { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #1d4356; background: #08141a; color: #a5fbfb; font-size: 17px; line-height: 1; cursor: pointer; }
.rules-body { overflow-y: auto; padding: 0 16px 16px; color: #c9d6dd; font-size: 13.5px; line-height: 1.55; }
.rules-body h3 { margin: 12px 0 4px; font-size: 13px; font-weight: 800; letter-spacing: .08em; color: #28F3F3; text-transform: uppercase; }
.rules-body p { margin: 0 0 6px; }
.rules-foot { padding: 10px 16px 14px; }
.rules-intro { width: 100%; height: 38px; border-radius: 9px; border: 1px solid #1d4356; background: rgba(40, 243, 243, .08); color: #a5fbfb; font: 700 13.5px 'Figtree', system-ui, sans-serif; cursor: pointer; }

/* Intro popup: over the zone; the panel stays usable behind it. */
.intro { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 14px; background: rgba(4, 8, 10, .55); }
.intro[hidden] { display: none; }
.intro-card { position: relative; width: min(648px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 18px 18px 16px; border-radius: 16px; border: 1px solid #1d5b74; background: linear-gradient(170deg, #0d2431, #08141a); box-shadow: 0 18px 60px rgba(0, 0, 0, .7), 0 0 26px rgba(40, 243, 243, .12); color: #e6f4f7; }
.intro-logo { display: block; width: min(248px, 76%); height: auto; margin: 0 auto 12px; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5)); }
.intro-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #1d4356; background: #08141a; color: #a5fbfb; font-size: 17px; line-height: 1; cursor: pointer; }
.intro-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.intro-box { border: 1px solid #1d4356; border-radius: 12px; background: rgba(40, 243, 243, .05); padding: 12px 10px 11px; text-align: center; }
.intro-art { height: 88px; display: grid; place-items: center; margin-bottom: 9px; }
.intro-art svg { display: block; height: 100%; width: auto; max-width: 100%; }
.intro-box-t { font-size: 15px; font-weight: 800; letter-spacing: .03em; color: #28F3F3; margin-bottom: 4px; }
.intro-box-p { margin: 0; font-size: 12.5px; line-height: 1.5; font-weight: 600; color: #e6f4f7; }
.intro-check { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; color: #8fb6c2; margin-bottom: 12px; cursor: pointer; }
.intro-check input { width: 17px; height: 17px; accent-color: #28F3F3; }
.intro-go { display: block; width: min(320px, 100%); margin: 0 auto; height: 46px; border: 0; border-radius: 10px; background: #28F3F3; color: #041015; font-size: 15px; font-weight: 800; letter-spacing: .05em; cursor: pointer; }
.intro-fine { margin: 12px auto 0; max-width: 520px; font-size: 11px; line-height: 1.5; color: #5b7a86; text-align: center; }

@media (max-width: 900px) {
  .intro-boxes { grid-template-columns: 1fr; }
  .intro-art { height: 64px; }
}

@media (max-width: 699px) {
  .limbo { padding: 10px 12px; gap: 8px; }
  .brand { font-size: 17px; }
  .history { min-height: 22px; }
  .hpill { font-size: 11px; padding: 2px 7px; }
  .facts { gap: 8px; font-size: 12px; }
  .facts b { font-size: 13px; }
  .stage { padding: 10px 8px 8px; border-radius: 12px; }
  .result { font-size: 40px; }
  .status { font-size: 12px; min-height: 15px; }
  .resultline { font-size: 13px; min-height: 16px; }
  .pick { gap: 6px; }
  .step { width: 30px; height: 30px; }
  .target output { min-width: 56px; font-size: 13px; padding: 5px 2px; }
  .chips button { height: 26px; padding: 0 9px; font-size: 12px; }
  .intro { padding: 8px; }
  .intro-card { padding: 12px 13px 11px; }
  .intro-box { padding: 10px; }
  .intro-box-t { font-size: 14px; }
  .intro-box-p { font-size: 12px; }
}

/* Short frames (the 364×440 sandbox shape): squeeze the zone so the
   stage and controls stay in reach. */
@media (max-width: 699px) and (max-height: 500px) {
  .limbo { gap: 6px; padding: 8px 10px; }
  .brand { font-size: 15px; }
  .history { min-height: 0; }
  .hpill { font-size: 10px; padding: 1px 6px; }
  .stage { padding: 6px 8px; gap: 2px; }
  .result { font-size: 32px; }
  .status { display: none; }
  .intro-boxes { gap: 7px; margin-bottom: 9px; }
  .intro-box { padding: 8px; }
  .intro-art { height: 52px; margin-bottom: 6px; }
  .intro-box-p { line-height: 1.4; }
  .intro-go { height: 40px; }
  .intro-card { padding: 10px 12px 9px; }
  .intro-logo { width: min(160px, 58%); margin-bottom: 5px; }
  .intro-check { margin-bottom: 8px; }
  .intro-fine { display: none; }
}
