:root{--bg:#070b17;--ink:#f7f8ff;--muted:#b4bfd4;--accent:#ffd95c;--purple:#8d62ff;--cyan:#5bdcff}*{box-sizing:border-box}html,body{margin:0}body{background:radial-gradient(circle at 12% 0,rgba(70,99,221,.28),transparent 34%),radial-gradient(circle at 92% 34%,rgba(151,68,222,.25),transparent 36%),linear-gradient(180deg,#080d1a,#050812);font-family:Pretendard,-apple-system,BlinkMacSystemFont,"Malgun Gothic",sans-serif;color:var(--ink)}
.bubble-page{width:min(1180px,100%);margin:auto;padding:34px 22px 70px}.bubble-title{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:20px;padding:24px 28px;border:1px solid rgba(255,255,255,.1);border-radius:24px;background:linear-gradient(115deg,rgba(25,36,67,.95),rgba(64,34,104,.82));box-shadow:inset 0 1px rgba(255,255,255,.1),0 20px 60px rgba(0,0,0,.28)}.bubble-title span{color:var(--accent);font-size:12px;font-weight:900;letter-spacing:.16em}.bubble-title h1{margin:5px 0 2px;font-size:46px;letter-spacing:-.055em;text-shadow:0 4px 18px rgba(0,0,0,.38)}.bubble-title h1 em{display:inline-block;padding:3px 10px;border-radius:12px;background:var(--accent);color:#171526;font-size:.43em;font-style:normal;vertical-align:middle;transform:rotate(-4deg)}.bubble-title p{margin:0;color:#d8e0f1;font-size:17px}.bubble-title>a{padding:12px 17px;border:1px solid rgba(255,255,255,.32);border-radius:13px;background:rgba(6,10,22,.38);color:#fff;text-decoration:none;font-weight:900}.bubble-game{overflow:hidden;border:1px solid rgba(157,173,255,.28);border-radius:30px;background:linear-gradient(180deg,rgba(24,34,56,.96),rgba(10,15,27,.99));box-shadow:0 35px 90px rgba(0,0,0,.48),inset 0 1px rgba(255,255,255,.11)}
.bubble-hud{display:grid;grid-template-columns:repeat(4,1fr) auto;gap:10px;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.1);background:linear-gradient(90deg,#121b31,#1b1837)}.bubble-hud>div{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;padding:9px 12px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(255,255,255,.045)}.bubble-hud small{color:var(--muted);font-weight:800;white-space:nowrap}.bubble-hud strong{color:#fff;font-size:20px;font-variant-numeric:tabular-nums;white-space:nowrap}.bubble-hud button{min-height:44px;padding:8px 15px;border:1px solid rgba(255,217,92,.55);border-radius:13px;background:linear-gradient(180deg,#293550,#172036);color:#fff;font-weight:900;box-shadow:0 5px 16px rgba(0,0,0,.25)}.bubble-hud button[aria-pressed="false"]{opacity:.72}.bubble-goal{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:12px 20px;background:linear-gradient(90deg,rgba(96,68,180,.18),rgba(44,92,170,.14));border-bottom:1px solid rgba(255,255,255,.08)}.bubble-goal span{padding:7px 12px;border-radius:999px;background:linear-gradient(180deg,#ffe77b,#ffc63f);box-shadow:0 3px 10px rgba(255,199,54,.24);color:#161d2b;font-size:12px;font-weight:900}.bubble-goal strong{font-size:15px}.bubble-stars{display:flex;gap:5px}.bubble-stars i{width:20px;height:20px;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%);background:#48536a;transition:.25s}.bubble-stars i.on{background:#ffd95c;filter:drop-shadow(0 0 7px rgba(255,217,92,.85))}.bubble-canvas-wrap{position:relative;width:min(720px,100%);aspect-ratio:3/4;margin:auto;background:#0c1322;box-shadow:inset 0 0 35px rgba(0,0,0,.45)}.bubble-canvas-wrap canvas{display:block;width:100%;height:100%;aspect-ratio:3/4;touch-action:none}
.bubble-message{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:rgba(5,9,17,.88);backdrop-filter:blur(7px);text-align:center;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s ease,visibility .22s ease}.bubble-message[hidden]{display:none}.bubble-message.show{display:flex!important;opacity:1;visibility:visible;pointer-events:auto}.bubble-message strong{font-size:38px}.bubble-message span{color:var(--muted)}.bubble-message button{min-width:180px;min-height:54px;margin-top:12px;border:0;border-radius:14px;background:var(--accent);color:#171d28;font-size:18px;font-weight:900}.bubble-help{display:flex;align-items:center;justify-content:center;gap:20px;padding:18px 20px;border-top:1px solid rgba(255,255,255,.1);color:#dce3f2}.bubble-help>b{color:var(--accent)}.bubble-help span{display:flex;align-items:center;gap:7px}.bubble-help i{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#34415a;color:#fff;font-size:12px;font-style:normal;font-weight:900}.bubble-notice{margin:0;padding:0 20px 20px;color:#7f8ba2;font-size:12px;text-align:center}
.bubble-fire{display:none;position:absolute;right:14px;bottom:13px;z-index:4;width:100px;height:62px;border:2px solid rgba(255,255,255,.95);border-radius:21px;background:linear-gradient(180deg,#ff7548,#db2f13);box-shadow:0 7px 0 #8e1b09,0 0 24px rgba(255,81,42,.42);color:#fff;font:900 18px Pretendard,sans-serif;touch-action:manipulation}.bubble-fire:before{content:"●";margin-right:7px;color:#ffe277}.bubble-fire:active{transform:translateY(5px);box-shadow:0 2px 0 #8e1b09}
@media(max-width:700px),(pointer:coarse){.bubble-fire{display:block}}
@media(max-width:700px){.bubble-page{padding:12px 6px 32px}.bubble-title{align-items:flex-start;margin-bottom:12px;padding:18px;border-radius:18px}.bubble-title h1{font-size:34px}.bubble-title p{font-size:14px}.bubble-title>a{padding:9px;font-size:12px}.bubble-game{border-radius:18px}.bubble-hud{grid-template-columns:repeat(2,1fr);padding:9px;gap:7px}.bubble-hud>div{justify-content:space-between;border-radius:10px;padding:8px}.bubble-hud small{font-size:11px}.bubble-hud strong{font-size:16px}.bubble-hud button{grid-column:1/-1;min-height:40px}.bubble-goal{grid-template-columns:auto 1fr;padding:10px;gap:8px}.bubble-goal strong{font-size:13px}.bubble-stars{grid-column:1/-1;justify-content:flex-end;margin-top:-4px}.bubble-help{display:grid;grid-template-columns:1fr;gap:9px;padding:16px 22px}.bubble-help>b{font-size:18px}}

/* Mobile viewport containment: canvas intrinsic size must not widen the page. */
html,body{max-width:100%;overflow-x:hidden}
.bubble-game,.bubble-canvas-wrap,.bubble-canvas-wrap canvas{min-width:0;max-width:100%}
@media(min-width:701px){
  .bubble-game{width:760px;max-width:100%;margin-inline:auto}
}
@media(max-width:700px){
  .bubble-page{width:100vw!important;max-width:100vw!important;margin-inline:0}
  .bubble-title{position:relative;display:block}
  .bubble-title h1{padding-right:58px}
  .bubble-title>a{position:absolute;top:13px;right:12px;padding:8px 10px;font-size:0}
  .bubble-title>a:after{content:"목록";font-size:12px}
  .bubble-game{width:100%;min-width:0}
  .bubble-hud{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bubble-goal{grid-template-columns:auto minmax(0,1fr)}
  .bubble-canvas-wrap{width:100%;max-width:100%;overflow:hidden}
  .bubble-canvas-wrap canvas{width:100%;max-width:100%}
  .bubble-fire{right:12px;bottom:14px;width:92px;height:58px;font-size:16px}
}

/* Foldables and tablets: keep the touch game at a comfortable phone-like scale. */
@media (min-width:480px) and (max-width:1100px){
  .bubble-page{width:min(410px,calc(100vw - 32px))!important;max-width:410px!important;margin-inline:auto!important}
  .bubble-title,.bubble-game{width:100%}
  .bubble-canvas-wrap{max-width:380px}
  .bubble-title{padding:17px 18px}
  .bubble-title h1{font-size:32px}
  .bubble-title p{font-size:13px}
}
@media (min-width:480px) and (max-width:1100px) and (max-height:900px){
  .bubble-page{width:min(350px,calc(100vw - 24px))!important;max-width:350px!important;padding-top:8px}
  .bubble-title{margin-bottom:8px;padding:12px 14px;border-radius:15px}
  .bubble-title h1{font-size:27px}.bubble-title p{display:none}
  .bubble-canvas-wrap{max-width:320px}
  .bubble-goal{padding-block:7px}
}

.bubble-hud{grid-template-columns:repeat(4,minmax(0,1fr)) auto auto auto}
.bubble-hud>div{flex-direction:column;gap:1px;padding:6px 8px;line-height:1.15}
.bubble-hud>div small{font-size:10px}.bubble-hud>div strong{max-width:100%;font-size:18px}
.bubble-hud>button{display:grid;place-items:center;width:48px;min-width:48px;padding:0;font-size:16px}
.bubble-hud .bubble-hud-toggle{position:relative;border-color:rgba(255,255,255,.3);border-radius:50%;background:linear-gradient(145deg,#34415d,#151d30);box-shadow:inset 0 1px 1px rgba(255,255,255,.16),0 5px 14px rgba(0,0,0,.3);line-height:1;transition:border-color .2s,background .2s,transform .2s}
.bubble-hud .bubble-hud-toggle:hover{border-color:#ffd95c;background:linear-gradient(145deg,#42516f,#1b263d);transform:translateY(-1px)}
.bubble-hud .bubble-focus-toggle[aria-pressed="true"]{border-color:#ffd95c;background:linear-gradient(180deg,#ffe16b,#eeb52d);color:#171d28;font-size:23px}
.bubble-hud .bubble-hud-toggle span{position:relative;width:18px;height:12px;transition:transform .28s ease}
.bubble-hud .bubble-hud-toggle span::before,.bubble-hud .bubble-hud-toggle span::after{content:'';position:absolute;top:4px;width:11px;height:3px;border-radius:3px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.35)}
.bubble-hud .bubble-hud-toggle span::before{left:0;transform:rotate(-40deg);transform-origin:right center}
.bubble-hud .bubble-hud-toggle span::after{right:0;transform:rotate(40deg);transform-origin:left center}
.bubble-hud.is-collapsed .bubble-hud-toggle span{transform:rotate(180deg)}
.bubble-hud.is-collapsed{grid-template-columns:1fr auto auto auto;padding-block:8px}
.bubble-hud.is-collapsed::before{content:'게임 정보';align-self:center;padding-left:4px;color:#aeb9cd;font-size:12px;font-weight:900;letter-spacing:.06em}
.bubble-hud.is-collapsed>div{display:none}
#bubbleNumberMode[aria-pressed="true"]{border-color:#8fdcff;background:linear-gradient(180deg,#315d81,#18334f);box-shadow:0 0 18px rgba(91,220,255,.25)}
@media(max-width:700px){
  .bubble-hud{grid-template-columns:repeat(2,minmax(0,1fr))}
  .bubble-hud button{grid-column:auto;width:100%;min-width:0;padding-inline:8px;font-size:15px}
  .bubble-hud .bubble-hud-toggle{grid-column:1/-1;justify-self:center;width:44px;height:44px;min-width:44px;padding:0;border-radius:50%}
  .bubble-hud.is-collapsed{grid-template-columns:repeat(4,42px);justify-content:center;gap:8px;padding:6px 8px}
  .bubble-hud.is-collapsed::before{display:none}
  .bubble-hud.is-collapsed button{width:42px;min-height:42px;padding:0}
  .bubble-hud.is-collapsed .bubble-hud-toggle{grid-column:auto;justify-self:auto;width:42px;height:42px;min-width:42px}
}

body.bubble-focus-open{overflow:hidden;background:#080d1c}.bubble-game.focus-mode{position:fixed;inset:0;z-index:100000;display:flex;flex-direction:column;width:100vw;height:100vh;height:100dvh;border:0;border-radius:0;background:radial-gradient(circle at 50% 45%,#172346 0,#080d1c 68%);box-shadow:none}.bubble-game.focus-mode .bubble-hud,.bubble-game.focus-mode .bubble-goal{flex:0 0 auto}.bubble-game.focus-mode .bubble-canvas-wrap{align-self:center;flex:1 1 0;width:auto;max-width:100%;height:0;min-height:0;aspect-ratio:9/14}.bubble-game.focus-mode .bubble-canvas-wrap canvas{display:block;width:100%;height:100%;object-fit:contain}.bubble-game.focus-mode .bubble-help,.bubble-game.focus-mode .bubble-notice{display:none}
@media(min-width:760px){
  .bubble-game.focus-mode .bubble-hud{grid-template-columns:repeat(4,minmax(105px,1fr)) repeat(4,48px);width:min(100%,1040px);margin:0 auto;padding:9px 14px;background:rgba(15,23,43,.96)}
  .bubble-game.focus-mode .bubble-hud>div{padding:6px 10px}.bubble-game.focus-mode .bubble-hud button{width:48px;min-width:48px;min-height:42px;padding:5px}
  .bubble-game.focus-mode .bubble-goal{width:min(100%,1040px);margin:0 auto;padding:8px 16px}
  .bubble-game.focus-mode .bubble-canvas-wrap{max-width:min(720px,calc(100vw - 24px))}
}
@media(max-width:759px){
  .bubble-game.focus-mode .bubble-hud{width:100%;padding-inline:6px}
  .bubble-game.focus-mode .bubble-hud.is-collapsed{grid-template-columns:44px;justify-content:center;width:100%;min-height:50px;padding:4px;gap:0}
  .bubble-game.focus-mode .bubble-hud.is-collapsed>button:not(.bubble-hud-toggle){display:none}
  .bubble-game.focus-mode .bubble-hud.is-collapsed .bubble-hud-toggle{display:grid;grid-column:auto!important;width:42px;min-width:42px;min-height:42px;padding:0}
  .bubble-game.focus-mode .bubble-goal{width:100%;padding:7px 9px}
  .bubble-game.focus-mode .bubble-goal span{padding:5px 8px;font-size:10px}
  .bubble-game.focus-mode .bubble-goal strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
  .bubble-game.focus-mode .bubble-stars i{width:16px;height:16px}
  .bubble-game.focus-mode .bubble-canvas-wrap{flex:1 1 auto;width:min(100vw,calc((100dvh - 100px)*9/14));max-width:100vw;height:auto;min-height:0;max-height:calc(100dvh - 100px);aspect-ratio:9/14}
  .bubble-game.focus-mode .bubble-canvas-wrap canvas{display:block;width:100%;height:100%;aspect-ratio:9/14}
}

.bubble-canvas-wrap,.bubble-canvas-wrap canvas{aspect-ratio:9/14}
.bubble-help{display:block;padding:0}
.bubble-help summary{display:none;list-style:none}
.bubble-help-content{align-items:center;justify-content:center;gap:20px;padding:18px 20px;color:#dce3f2}
.bubble-help-content>b{color:var(--accent)}.bubble-help-content span{display:flex;align-items:center;gap:7px}.bubble-help-content span i{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#34415a;color:#fff;font-size:12px;font-style:normal;font-weight:900}
@media(min-width:701px){.bubble-help-content{display:flex!important}}
@media(max-width:700px){
  .bubble-help{display:block;padding:0}
  .bubble-help summary{display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:14px 18px;border-top:1px solid rgba(255,255,255,.1);cursor:pointer;color:#fff;font-size:17px;font-weight:900}
  .bubble-help summary::-webkit-details-marker{display:none}.bubble-help summary i{color:var(--accent);font-size:22px;font-style:normal;transition:transform .2s}
  .bubble-help[open] summary i{transform:rotate(45deg)}
  .bubble-help:not([open]) .bubble-help-content{display:none}
  .bubble-help[open] .bubble-help-content{display:grid;grid-template-columns:1fr;gap:10px;padding:4px 18px 18px}
}
