/* Kerangka layar penuh untuk game arkade. Warna dasar dan tombol berasal dari ../ui.css. */
:root {
  color-scheme: light;
  --bg: #fff5e4; --surface: #fffdf8; --ink: #2a1f3d; --muted: #776a86; --line: #f0e1c8;
  --accent: #f2542d; --on-accent: #fff; --press: #c23a18;
  --font-display: "Fredoka", system-ui, sans-serif; --font-body: "Nunito", system-ui, sans-serif;
}
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); color: var(--ink); font: 600 15px/1.45 var(--font-body); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar { flex: none; }
.top-inner { max-width: 1240px; margin: 0 auto; padding-inline: 20px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { color: var(--ink); text-decoration: none; font: 700 20px var(--font-display); }
.brand-accent { color: var(--accent); }
.top-actions { display: flex; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); }
.play-area { flex: 1; min-height: 0; width: min(100%, 1240px); margin: 0 auto; padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 6px; }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 24px; background: #20163a; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 18px 40px -26px #2a1f3d; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.keys { flex: none; margin: 0; text-align: center; color: var(--muted); font-size: 12.5px; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; font: 700 11px var(--font-body); background: var(--surface); }

/* HUD */
.stage .hud { width: auto; margin: 0; min-height: 0; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: 12px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; color: #fff; text-shadow: 0 2px 0 #0005; }
.hud-left, .hud-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hud-right { justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: #1a133088; backdrop-filter: blur(4px); font: 700 15px var(--font-display); font-variant-numeric: tabular-nums; }
.score { font: 700 clamp(30px, 6vw, 44px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.coin-dot { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc23d 60%, #d9951a); box-shadow: inset 0 0 0 1.5px #d9951a; }
.pause { pointer-events: auto; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; background: #1a133088; color: #fff; backdrop-filter: blur(4px); }
.lives { display: inline-flex; gap: 2px; font-size: 17px; line-height: 1; }
.lives i { font-style: normal; color: #ff5d6c; transition: transform .25s, opacity .25s; }
.lives i.gone { opacity: .25; transform: scale(.7); filter: grayscale(1); }
.power { pointer-events: none; }
.combo { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); color: #ffd65c; font: 700 clamp(22px, 5vw, 34px) var(--font-display); text-shadow: 0 3px 0 #0006; pointer-events: none; }
.combo.bump { animation: bump .28s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bump { from { transform: translateX(-50%) scale(1.5); } }
.tip { position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%); max-width: 90%; width: max-content; padding: 8px 16px; border-radius: 16px; background: #1a1330cc; color: #fff; font: 600 clamp(14px, 2.4vw, 18px) var(--font-display); text-align: center; pointer-events: none; animation: tip-in .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tip-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.9); } }

/* Layar menu, jeda, selesai */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; color: #fff; background: linear-gradient(180deg, #1a133022, #1a1330aa); overflow-y: auto; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.logo { margin: 0; font: 700 clamp(44px, 11vw, 92px)/.95 var(--font-display); color: #fff; text-shadow: 0 5px 0 var(--accent), 0 12px 24px #0007; transform: rotate(-2deg); }
.logo span { color: var(--sun, #ffc23d); }
.tagline { margin: 0; max-width: 42ch; font-size: clamp(14px, 2vw, 17px); text-shadow: 0 1px 3px #0009; }
.play-button { min-width: 200px; min-height: 60px; border: 0; border-radius: 22px; background: #ffc23d; color: #2a1f3d; box-shadow: 0 6px 0 #d9951a, 0 16px 30px -10px #0009; font: 700 24px var(--font-display); transition: transform .08s, box-shadow .08s; touch-action: manipulation; animation: wiggle 2.4s ease-in-out infinite; }
.play-button:active { transform: translateY(6px); box-shadow: 0 0 0 #d9951a; }
@keyframes wiggle { 0%, 80%, 100% { rotate: 0deg; } 86% { rotate: -3deg; } 93% { rotate: 3deg; } }
.ghost { min-height: 42px; padding: 6px 18px; border: 2px solid #ffffff66; border-radius: 14px; background: #1a133055; color: #fff; font: 600 15px var(--font-display); touch-action: manipulation; }
.ghost:hover { background: #1a133099; }
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.skins { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 6px 4px; scrollbar-width: none; touch-action: pan-x; }
.skin { flex: none; width: 74px; padding: 6px 4px 5px; border: 2px solid #ffffff44; border-radius: 16px; background: #1a133077; color: #fff; font: 600 11.5px/1.15 var(--font-display); transition: transform .12s, border-color .12s; touch-action: manipulation; }
.skin canvas { position: static; display: block; width: 44px; height: 44px; margin: 0 auto 3px; }
.skin[aria-pressed="true"] { border-color: #ffc23d; background: #1a1330bb; transform: translateY(-2px); }
.skin .price { display: inline-flex; align-items: center; gap: 3px; opacity: .9; }
.skin .price .coin-dot { width: 10px; height: 10px; }
.skin.locked canvas { filter: grayscale(.8) brightness(.7); }
.final { margin: 0; font: 700 clamp(58px, 14vw, 104px)/1 var(--font-display); text-shadow: 0 5px 0 #0005; font-variant-numeric: tabular-nums; }
.kicker { margin: 0; font: 600 clamp(18px, 3vw, 26px) var(--font-display); }
.record { padding: 3px 14px; border-radius: 99px; background: #ffc23d; color: #2a1f3d; font: 700 15px var(--font-display); animation: bump2 .5s cubic-bezier(.2, 1.7, .4, 1) both; }
@keyframes bump2 { from { transform: scale(.2) rotate(-16deg); } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }

dialog { width: min(92vw, 440px); max-height: 85dvh; padding: 22px; border: 0; border-radius: 24px; color: var(--ink); background: var(--surface); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-heading h2 { margin: 0; font: 700 24px var(--font-display); }
.rules { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.55; }
.rules li + li { margin-top: 8px; }
.rules b { color: var(--ink); }

@media (max-width: 680px) {
  .play-area { padding: 0; }
  .stage { border-radius: 0; box-shadow: none; }
  .keys { display: none; }
  .tip { bottom: 22%; }
}
/* HP mendatar: sembunyikan kepala halaman agar arena selebar mungkin. */
@media (max-height: 480px) {
  .topbar { display: none; }
  .play-area { padding: 0; width: 100%; }
  .stage { border-radius: 0; }
  .keys { display: none; }
  .logo { font-size: 44px; }
  .screen { gap: 6px; padding: 8px; justify-content: flex-start; }
  .final { font-size: 52px; }
  .tagline { display: none; }
}
@media (hover: none) { .keys { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.danger { color: #fff; background: #e5342b; animation: danger .5s ease-in-out infinite alternate; }
@keyframes danger { to { background: #ff7a4d; } }
.skin canvas { width: 46px; height: 46px; }

/* ---------- menu ---------- */
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; width: 100%; justify-content: center; }
.mode-card { display: grid; gap: 5px; justify-items: start; padding: 14px 16px; border: 0; border-radius: 22px; text-align: left; color: #fff; box-shadow: 0 6px 0 var(--shade), 0 16px 26px -14px #000a; transition: transform .08s, box-shadow .08s; touch-action: manipulation; }
.mode-card:hover { transform: translateY(-2px); }
.mode-card:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--shade); }
.mode-card b { font: 700 clamp(19px, 3vw, 25px)/1.1 var(--font-display); }
.mode-card small { font-size: 13px; line-height: 1.3; opacity: .95; }
.mode-card.classic { --shade: #c98a12; background: linear-gradient(150deg, #ffc23d, #ff8a3d); color: #2a1f3d; }
.mode-card.adventure { --shade: #4b2196; background: linear-gradient(150deg, #9a68e6, #5b2fb5); }
.mode-card .pill { font-size: 13px; background: #1a133088; color: #fff; }
.logo { font-size: clamp(38px, 8vw, 72px); }
.shop-open { background: #1a133099; }

/* ---------- HUD tambahan ---------- */
.adv-hud { position: absolute; left: 14px; top: 62px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; color: #fff; }
.lives { display: inline-flex; gap: 2px; font-size: 16px; line-height: 1; }
.lives i { font-style: normal; color: #ff5d6c; transition: transform .25s, opacity .25s; }
.lives i.gone { opacity: .25; transform: scale(.7); filter: grayscale(1); }
.level-pill b { font: 700 14px var(--font-display); }
.xp { display: inline-block; width: 54px; height: 8px; border-radius: 4px; background: #ffffff33; overflow: hidden; }
.xp i { display: block; height: 100%; width: 0; background: #7fe3c4; transition: width .2s; }
.boss-bar { position: absolute; left: 50%; top: 108px; width: min(84%, 520px); transform: translateX(-50%); text-align: center; color: #fff; pointer-events: none; animation: boss-in .4s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes boss-in { from { transform: translate(-50%, -18px) scale(.9); opacity: 0; } }
.boss-bar span { font: 700 clamp(14px, 2.4vw, 18px) var(--font-display); text-shadow: 0 2px 0 #0007; }
.boss-track { height: 14px; margin-top: 2px; border-radius: 8px; background: #1a1330cc; box-shadow: 0 0 0 2px #fff; overflow: hidden; }
.boss-track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e5342b, #ff8a3d); transition: width .12s; }
.boss-bar.open .boss-track { box-shadow: 0 0 0 3px #ffe45c, 0 0 18px #ffe45c; animation: boss-open .35s ease-in-out infinite alternate; }
@keyframes boss-open { to { transform: scale(1.03); } }
.board-btn { position: absolute; right: 14px; bottom: 16px; width: 62px; height: 62px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 20px; background: #2f8fd6; color: #fff; overflow: hidden; box-shadow: 0 4px 0 #1f6aa6, 0 10px 20px -8px #000a; touch-action: manipulation; }
.board-btn svg { position: relative; width: 34px; height: 34px; fill: #fff; transform: rotate(35deg); }
.board-btn b { position: absolute; right: 6px; bottom: 2px; font: 700 17px var(--font-display); text-shadow: 0 1px 0 #0006; }
.board-btn:disabled { background: #6d6a80; box-shadow: 0 4px 0 #4b4768; }
.board-btn.active { background: #27c9e6; animation: board-pulse .6s ease-in-out infinite alternate; }
@keyframes board-pulse { to { transform: scale(1.06); } }
.board-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #ffffff44; }
.weapon-chip { display: none; position: absolute; left: 14px; bottom: 16px; width: 62px; height: 62px; border: 3px solid var(--rarity, #fff); border-radius: 20px; background: #1a1330cc; overflow: hidden; pointer-events: none; }
.weapon-chip canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.weapon-chip .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #0009; }
.weapon-chip.ready { box-shadow: 0 0 0 3px #ffe45c, 0 0 16px #ffe45c; }
.adv-hud:not([hidden]) ~ .weapon-chip { display: block; }

/* ---------- toko ---------- */
.screen.shop { justify-content: flex-start; background: #14132af2; padding: 14px; }
.shop-head { display: flex; align-items: center; gap: 10px; width: min(100%, 880px); }
.shop-head h2 { margin: 0 auto 0 0; font: 700 28px var(--font-display); color: #fff; }
.shop-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(100%, 880px); flex: none; }
.shop-tabs button { min-height: 44px; border: 2px solid #ffffff33; border-radius: 14px; background: transparent; color: #fff; font: 600 15px var(--font-display); touch-action: manipulation; }
.shop-tabs button[aria-selected="true"] { background: #ffc23d; border-color: #ffc23d; color: #2a1f3d; }
.shop-note { flex: none; margin: 0; min-height: 18px; font-size: 13px; color: #ffd65c; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; width: min(100%, 880px); flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; touch-action: pan-y; padding: 2px 2px 12px; }
.shop-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: #1f1e3d; box-shadow: inset 0 0 0 2px var(--rarity, #33325c); text-align: left; color: #fff; }
.shop-card.active { box-shadow: inset 0 0 0 3px #ffc23d; }
.shop-art { position: static; width: 64px; height: 64px; border-radius: 12px; background: #ffffff0f; }
.shop-card.locked .shop-art { filter: saturate(.75) brightness(.8); }
.shop-info { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.shop-info strong { font: 600 15px/1.15 var(--font-display); }
.shop-info small { font-size: 11.5px; line-height: 1.25; color: #c3c0dc; }
.perks { display: flex; flex-wrap: wrap; gap: 3px; }
.perks i { padding: 0 6px; border-radius: 99px; background: #ffffff1a; font: 700 10.5px var(--font-body); }
.rarity { padding: 0 7px; border-radius: 99px; color: #fff; font: 700 10px/1.6 var(--font-body); text-transform: uppercase; letter-spacing: .04em; }
.r-umum { background: #6d7486; }
.r-langka { background: #3b9dff; }
.r-epik { background: #b05cff; }
.r-legendaris { background: #e0921a; }
.r-limited { background: linear-gradient(90deg, #ff3d6e, #ff8a3d, #ff3d6e); background-size: 200% 100%; animation: limited-shine 1.6s linear infinite; }
@keyframes limited-shine { to { background-position: -200% 0; } }
.shop-action { min-width: 74px; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 12px; background: #ffffff1f; color: #fff; font: 600 13px var(--font-display); display: inline-flex; align-items: center; justify-content: center; gap: 4px; touch-action: manipulation; }
.shop-action.buy { background: #ffc23d; color: #2a1f3d; box-shadow: 0 3px 0 #d9951a; }
.shop-action:disabled { opacity: .65; }
.shop-action .coin-dot { width: 13px; height: 13px; }

/* ---------- peti hadiah ---------- */
.screen.loot { background: radial-gradient(circle at 50% 42%, #5b2fb5e0, #14132af5); }
.loot-gold { margin: 0; font: 700 clamp(26px, 5vw, 38px) var(--font-display); color: #ffd65c; text-shadow: 0 3px 0 #0006; }
.chest { position: relative; width: 150px; height: 120px; border: 0; background: none; touch-action: manipulation; animation: chest-idle 1s ease-in-out infinite; }
@keyframes chest-idle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-4px); } }
.chest.open { animation: none; }
.chest-body { position: absolute; left: 12px; right: 12px; bottom: 6px; height: 62px; border-radius: 8px 8px 12px 12px; background: linear-gradient(#b5651d, #8a4a14); box-shadow: inset 0 0 0 5px #ffc23d, 0 8px 0 #5a300c; }
.chest-lid { position: absolute; z-index: 2; left: 8px; right: 8px; top: 12px; height: 46px; border-radius: 40px 40px 8px 8px; background: linear-gradient(#d07a26, #a85d18); box-shadow: inset 0 0 0 5px #ffc23d; transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.chest.open .chest-lid { transform: perspective(300px) rotateX(70deg) translateY(-40px); }
.chest-glow { position: absolute; z-index: 1; left: 50%; bottom: 40px; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: #ffe45c; opacity: 0; box-shadow: 0 0 70px 50px #ffe45c; transition: opacity .3s; }
.chest.open .chest-glow { opacity: .85; }
.reward { display: grid; justify-items: center; gap: 4px; padding: 12px 22px; border-radius: 20px; background: #1f1e3dee; color: #fff; animation: bump2 .5s cubic-bezier(.2, 1.7, .4, 1) both; max-width: 92%; }
.reward strong { font: 700 20px var(--font-display); }
.reward small { font-size: 13px; color: #d6d3ec; text-align: center; }
.reward.limited { box-shadow: 0 0 0 3px #ff3d6e, 0 0 34px #ff3d6e; }
.reward .shop-art { background: none; }

@media (max-width: 680px) {
  .mode-cards { grid-template-columns: 1fr; max-width: 340px; }
  .mode-card { padding: 11px 14px; }
  .boss-bar { top: 104px; }
  .shop-grid { grid-template-columns: 1fr; }
  .board-btn, .weapon-chip { bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@media (max-height: 480px) {
  .mode-cards { grid-template-columns: repeat(2, minmax(0, 260px)); }
  .mode-card small { display: none; }
  .logo br { display: none; }
  .logo { font-size: 30px; }
  .screen.shop { padding: 8px; }
  .chest { transform: scale(.7); margin: -14px 0; }
  .boss-bar { top: 62px; }
}

@media (min-width: 681px) { .boss-bar { top: 12px; width: min(42%, 460px); } }
@media (max-height: 480px) { .boss-bar { top: 8px; width: 40%; } }

/* ---------- skill & boneka toko ---------- */
.skills-hud { position: absolute; left: 84px; bottom: 16px; display: flex; gap: 8px; }
.skill-btn { position: relative; width: 58px; height: 58px; padding: 0; border: 3px solid #fff; border-radius: 18px; background: var(--skill); overflow: hidden; box-shadow: 0 4px 0 #0005; touch-action: manipulation; color: #fff; }
.skill-btn canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.skill-btn.ready { animation: skill-ready 1.2s ease-in-out infinite; }
@keyframes skill-ready { 50% { box-shadow: 0 4px 0 #0005, 0 0 16px var(--skill); } }
.skill-btn:active { transform: translateY(3px); }
.skill-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #0a0618b8; }
.skill-num { position: absolute; inset: 0; display: grid; place-items: center; font: 700 20px var(--font-display); text-shadow: 0 2px 0 #000a; }
.shop-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.shop-tabs button { flex: 1 0 auto; min-width: 76px; padding-inline: 10px; }
.shop-doll { display: flex; align-items: center; gap: 10px; width: min(100%, 880px); flex: none; padding: 4px 10px; border-radius: 14px; background: #ffffff0f; }
.shop-doll canvas { position: static; width: 68px; height: 68px; flex: none; }
.doll-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.doll-stats i { padding: 1px 8px; border-radius: 99px; background: #ffffff1f; color: #fff; font: 700 11.5px var(--font-body); }
@media (max-width: 680px) {
  .skills-hud { left: 82px; bottom: calc(16px + env(safe-area-inset-bottom)); gap: 6px; }
  .skill-btn { width: 54px; height: 54px; }
}

/* ---------- gacha ---------- */
.gacha { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 880px); flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; color: #fff; padding-bottom: 12px; }
.gacha-note, .gacha-rates, .gacha-pity { margin: 0; font-size: 12.5px; color: #c9c5e8; max-width: 52ch; }
.gacha-pity { color: #ffd65c; font: 700 14px var(--font-display); }
.gacha-btn { min-width: 130px; min-height: 52px; font-size: 18px; animation: none; }
.gacha-btn.ten { background: #ff3d6e; color: #fff; box-shadow: 0 6px 0 #a81f43, 0 16px 30px -10px #000a; }
.gacha-btn:disabled { opacity: .45; }
.gacha-machine { position: relative; flex: none; width: 150px; height: 170px; }
.gm-dome { position: absolute; left: 15px; top: 0; width: 120px; height: 110px; border-radius: 60px 60px 16px 16px; background: linear-gradient(135deg, #ffffff55, #7fc8ff22); box-shadow: inset 0 0 0 4px #ffffff88; }
.gm-body { position: absolute; left: 6px; bottom: 0; width: 138px; height: 72px; border-radius: 14px; background: linear-gradient(#ff5a7a, #c52a52); box-shadow: 0 5px 0 #7c1a35; }
.gm-knob { position: absolute; z-index: 2; left: 58px; bottom: 26px; width: 34px; height: 34px; border-radius: 50%; background: #ffc23d; box-shadow: inset 0 0 0 4px #d9951a; }
.gm-knob::after { content: ""; position: absolute; left: 14px; top: 3px; width: 6px; height: 28px; border-radius: 3px; background: #7c5a12; }
.gm-slot { position: absolute; z-index: 2; left: 52px; bottom: 5px; width: 46px; height: 15px; border-radius: 6px; background: #3a1020; }
.gm-ball { position: absolute; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset -4px -4px 0 #0003, inset 0 15px 0 #ffffff55; }
.gm-ball.a { left: 32px; top: 60px; background: #2f8fd6; }
.gm-ball.b { left: 62px; top: 34px; background: #ffc23d; }
.gm-ball.c { left: 90px; top: 62px; background: #b05cff; }
.gm-ball.d { left: 60px; top: 70px; background: #ff3d6e; }
.gm-burst { position: absolute; inset: -40px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, #ffe45c, #ffe45c00 65%); pointer-events: none; }
.gacha-machine.spin .gm-knob::after { animation: knob 1.1s ease-in-out; }
.gacha-machine.spin .gm-knob { animation: knob 1.1s ease-in-out; }
@keyframes knob { to { transform: rotate(720deg); } }
.gacha-machine.spin .gm-ball { animation: ball-shake .22s linear 5; }
.gacha-machine.spin .gm-ball.b { animation-direction: reverse; }
@keyframes ball-shake { 25% { transform: translate(-12px, -14px); } 50% { transform: translate(10px, 8px); } 75% { transform: translate(14px, -10px); } }
.gacha-machine.spin { animation: machine 1.1s ease; }
@keyframes machine { 20%, 60% { transform: rotate(-3deg); } 40%, 80% { transform: rotate(3deg); } }
.gacha-machine.spin .gm-burst { animation: gm-burst 1.2s ease-out .85s both; }
.gacha-machine.spin[data-best="legendaris"] .gm-burst { background: radial-gradient(circle, #ffb02e, #ffb02e00 65%); }
.gacha-machine.spin[data-best="limited"] .gm-burst { background: radial-gradient(circle, #ff3d6e, #ff3d6e00 65%); }
@keyframes gm-burst { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.8); } }
.gacha-result { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; width: 100%; }
.gacha-card { animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes card-in { from { transform: translateY(14px) scale(.6); opacity: 0; } }
.gacha-face { display: grid; justify-items: center; gap: 3px; min-height: 138px; align-content: start; padding: 6px; border-radius: 14px; background: #1f1e3d; box-shadow: inset 0 0 0 2px var(--rarity); text-align: center; }
.gacha-face strong { font: 600 12.5px/1.15 var(--font-display); }
.gacha-face small { font-size: 10.5px; color: #c9c5e8; }
.gacha-face .shop-art { width: 56px; height: 56px; }
.r-card-limited .gacha-face { box-shadow: inset 0 0 0 3px #ff3d6e, 0 0 24px #ff3d6e; animation: limited-glow 1s ease-in-out infinite alternate; }
.r-card-legendaris .gacha-face { box-shadow: inset 0 0 0 3px #ffb02e, 0 0 16px #ffb02e80; }
@keyframes limited-glow { to { box-shadow: inset 0 0 0 3px #ffc23d, 0 0 34px #ffc23d; } }
.skills-hud .skill-btn { width: 62px; height: 62px; }
.gacha { overflow-x: hidden; }
.gacha-side { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; width: 100%; }
.gacha-side .actions { flex-wrap: nowrap; }
.gacha-result { scroll-margin: 8px; }
/* Layar mendatar: mesin di kiri, hasil di kanan agar langsung terlihat tanpa menggulir. */
@media (min-aspect-ratio: 1/1) {
  .gacha { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); align-items: start; column-gap: 14px; }
  .gacha-side { position: sticky; top: 0; }
  .gacha-result { align-self: start; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .gacha-machine { transform-origin: top center; width: 110px; height: 124px; zoom: .72; }
  .gacha-note { display: none; }
  .gacha-btn { min-width: 108px; min-height: 44px; font-size: 15px; }
}
