/* GRIDFALL (/gridfall/): full-screen 3D stage + DOM HUD */
.gf { background: #0c0626; }
.gf [hidden] { display: none !important; }
.gf-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(12, 6, 38, .9); border-bottom: 1px solid var(--line); }
.gf-top__brand { display: inline-flex; align-items: center; gap: 8px; }
.gf-top__title { font-size: 18px; letter-spacing: .08em; flex: 1; }
.gf-top__title small { font-size: 11px; color: #1a0a4e; background: #ffcd50; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; letter-spacing: .04em; }
.gf-icon { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: #fff; font-size: 17px; cursor: pointer; }

.gf-stage { position: relative; height: calc(100svh - 55px); min-height: 420px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #140a3a; }
.gf-stage:fullscreen { height: 100vh; }
.gf-stage canvas { display: block; width: 100%; height: 100%; }
.gf-stage.is-hurt { box-shadow: inset 0 0 120px rgba(255, 40, 40, .65); }
.gf-stage.is-slow canvas { filter: saturate(.55) hue-rotate(-15deg) brightness(1.1); }
.gf-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gf-num { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 2px 0 #1a0a4e, 0 0 8px rgba(0, 0, 0, .6); white-space: nowrap; will-change: transform; }
.gf-num.is-big { font-size: 30px; color: #ffd76a; }
.gf-num.is-burn { font-size: 15px; color: #ffa04a; }
.gf-num.is-perfect { font-size: 26px; color: #7ef7ff; letter-spacing: .06em; }
.gf-banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -10px) scale(.9); opacity: 0; pointer-events: none; text-align: center; transition: opacity .2s, transform .25s; }
.gf-banner.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.gf-banner b { display: block; font-size: clamp(30px, 6vw, 64px); letter-spacing: .06em; color: #fff; text-shadow: 0 5px 0 #1a0a4e, 0 0 30px rgba(255, 180, 80, .7); }
.gf-banner small { display: block; font-size: clamp(14px, 2vw, 18px); font-weight: 800; color: #ffd76a; margin-top: 4px; text-shadow: 0 2px 0 #1a0a4e; }

.gf-hud { position: absolute; inset: 0; pointer-events: none; font-weight: 800; }
.gf-hud__tl { position: absolute; left: 14px; top: 12px; width: min(300px, 46vw); display: grid; gap: 5px; }
.gf-hp { position: relative; height: 20px; border-radius: 999px; background: rgba(0, 0, 0, .5); overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
.gf-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #36d27a, #a6f27a); transition: width .2s; }
.gf-hp span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; text-shadow: 0 1px 2px #000; }
.gf-evo { height: 7px; border-radius: 999px; background: rgba(0, 0, 0, .5); overflow: hidden; }
.gf-evo i { display: block; height: 100%; background: linear-gradient(90deg, #b48cff, #ffd76a); transition: width .25s; }
.gf-hud__tl small { font-size: 12px; color: #e6defe; text-shadow: 0 1px 2px #000; }
.gf-dash { font-size: 15px; color: #7ef7ff; letter-spacing: 2px; text-shadow: 0 1px 2px #000; }
.gf-hud__tr { position: absolute; right: 14px; top: 12px; display: grid; justify-items: end; }
.gf-hud__tr b { font-size: 26px; text-shadow: 0 2px 0 #1a0a4e; }
.gf-style { font-size: 34px; font-style: italic; line-height: 1; color: #cfc3ff; text-shadow: 0 3px 0 #1a0a4e; }
.gf-style.s2 { color: #7ef7ff; } .gf-style.s3 { color: #ffd76a; } .gf-style.s4 { color: #ff7a3d; font-size: 42px; }
.gf-hud__tc { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); text-align: center; width: min(520px, 60vw); }
.gf-hud__tc > span { font-size: 14px; letter-spacing: .08em; text-shadow: 0 2px 0 #1a0a4e; }
.gf-bossbar small { font-size: 13px; letter-spacing: .14em; color: #ffb84a; }
.gf-bossbar__hp { height: 14px; border-radius: 999px; background: rgba(0, 0, 0, .55); overflow: hidden; margin-top: 3px; box-shadow: inset 0 0 0 2px rgba(255, 184, 74, .5); }
.gf-bossbar__hp i { display: block; height: 100%; background: linear-gradient(90deg, #ff3a1a, #ffb84a); transition: width .15s; }
.gf-bossbar__st { height: 5px; border-radius: 999px; background: rgba(0, 0, 0, .5); overflow: hidden; margin-top: 3px; }
.gf-bossbar__st i { display: block; height: 100%; background: #fff; }
.gf-hud__br { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 12px; align-items: flex-end; }
.gf-skill, .gf-super { display: grid; place-items: center; border-radius: 50%; color: #fff; text-shadow: 0 1px 2px #000;
  background: conic-gradient(rgba(126, 247, 255, .9) calc(var(--k, 0) * 360deg), rgba(0, 0, 0, .45) 0); }
.gf-skill { width: 46px; height: 46px; font-size: 16px; opacity: .6; }
.gf-skill.is-ready { opacity: 1; box-shadow: 0 0 14px rgba(126, 247, 255, .7); }
.gf-super { width: 72px; height: 72px; font-size: 20px; line-height: 1; background: conic-gradient(rgba(255, 205, 80, .95) calc(var(--k, 0) * 360deg), rgba(0, 0, 0, .45) 0); }
.gf-super small { font-size: 9px; letter-spacing: .1em; }
.gf-super.is-ready { box-shadow: 0 0 24px rgba(255, 205, 80, .9); animation: gf-pulse 1s infinite; }
@keyframes gf-pulse { 50% { transform: scale(1.08); } }

.gf-touch { display: none; }
@media (pointer: coarse) {
  .gf-hud__br { display: none; }
  .gf-touch { position: absolute; right: 12px; bottom: 14px; display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); gap: 8px; }
  .gf-tbtn { border-radius: 50%; border: 0; color: #fff; font-size: 24px; font-weight: 900; background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); touch-action: none; }
  .gf-tbtn.is-on { background: rgba(255, 205, 80, .55); }
  .gf-tbtn--atk { grid-column: 2 / 4; grid-row: 2 / 4; border-radius: 50%; font-size: 40px; background: rgba(255, 90, 70, .45); }
  .gf-tbtn--dash { grid-column: 1; grid-row: 3; background: rgba(90, 160, 255, .4); }
  .gf-tbtn--jump { grid-column: 1; grid-row: 2; }
  .gf-tbtn--skill { grid-column: 2; grid-row: 1; background: rgba(126, 247, 255, .3); }
  .gf-tbtn--super { grid-column: 3; grid-row: 1; background: rgba(255, 205, 80, .4); }
}
.gf-stick { position: absolute; width: 100px; height: 100px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .06); pointer-events: none; }
.gf-stick i { position: absolute; left: 30px; top: 30px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .5); }

.gf-layer { position: absolute; inset: 0; display: grid; align-content: safe center; justify-items: center; gap: 12px; text-align: center; padding: 20px; background: radial-gradient(60% 60% at 50% 40%, rgba(40, 20, 110, .55), rgba(8, 4, 30, .85)); overflow-y: auto; }
.gf-layer--dim { background: rgba(8, 4, 30, .8); font-size: 22px; font-weight: 900; }
.gf-layer > * { max-width: 100%; }
.gf-kicker { font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: #ffcd50; font-size: 13px; }
.gf-layer h1 { font-size: clamp(48px, 10vw, 110px); line-height: .9; letter-spacing: .04em; text-shadow: 0 6px 0 #1a0a4e, 0 0 50px rgba(255, 120, 60, .5); }
.gf-layer h1 span { color: #ff7a3d; }
.gf-tag { font-size: clamp(16px, 2.4vw, 22px); font-weight: 900; }
.gf-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; width: min(900px, 100%); margin-top: 8px; }
@media (max-width: 640px) { .gf-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gf-card { display: grid; justify-items: center; gap: 2px; padding: 10px 6px 12px; border-radius: 20px; border: 2px solid rgba(180, 150, 255, .35); color: #fff; font: inherit; cursor: pointer;
  background: radial-gradient(70% 60% at 50% 35%, var(--c, rgba(122, 76, 240, .5)), transparent 75%), rgba(20, 8, 60, .7); transition: transform .15s, border-color .15s; }
.gf-card:hover, .gf-card:focus-visible { transform: translateY(-5px) scale(1.03); border-color: #ffcd50; }
.gf-card img { width: 100%; max-width: 130px; height: auto; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)); }
.gf-card b { font-size: 16px; }
.gf-card small { font-size: 11.5px; color: #d9cfff; }
.gf-card--fire { --c: rgba(255, 110, 60, .55); } .gf-card--water { --c: rgba(60, 160, 255, .55); } .gf-card--leaf { --c: rgba(90, 200, 100, .5); } .gf-card--volt { --c: rgba(255, 210, 60, .5); } .gf-card--cosmic { --c: rgba(170, 110, 255, .6); }
.gf-keys { font-size: 13px; color: #cfc3ff; max-width: 760px; }
.gf-keys b { color: #fff; }

.gf-boons { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 20px; background: rgba(8, 4, 30, .55); }
.gf-boons h3 { font-size: 28px; text-shadow: 0 3px 0 #1a0a4e; }
.gf-boons__row { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; }
@media (max-width: 640px) { .gf-boons__row { grid-template-columns: 1fr; width: 100%; max-width: 360px; } }
.gf-boon { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: 18px; border: 2px solid rgba(255, 205, 80, .6); background: rgba(30, 12, 80, .9); color: #fff; font: inherit; cursor: pointer; }
.gf-boon:hover { background: rgba(70, 30, 140, .95); transform: translateY(-3px); }
.gf-boon b { font-size: 18px; color: #ffd76a; }
.gf-boon small { font-size: 14px; color: #e6defe; }
.gf-results h2 { font-size: clamp(28px, 5vw, 44px); }
.gf-res__score { font-size: clamp(40px, 8vw, 64px); font-weight: 900; color: #ffcd50; line-height: 1; }
.gf-res__stats { color: #e6defe; font-size: 15px; font-weight: 700; }
.gf-results pre { white-space: pre-wrap; text-align: left; background: rgba(0, 0, 0, .35); border-radius: 12px; padding: 10px 14px; font: 600 13px/1.5 ui-monospace, Menlo, Consolas, monospace; max-width: 560px; }
.gf-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.gf-info { padding: 40px 16px 60px; }
.gf-info h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 14px; }
.gf-info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.gf-info__grid p { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; font-size: 15px; color: #e6defe; }
.gf-info__grid b { color: #ffcd50; }
@media (max-width: 640px) {
  .gf-top { padding: 6px 10px; gap: 8px; }
  .gf-top__brand img + img { display: none; }
  .gf-top__title { font-size: 15px; }
  .gf-stage { height: calc(100svh - 51px); }
  .gf-hud__tc { top: 70px; width: 90vw; }
  .gf-hud__tl { width: 55vw; }
  .gf-hud__tr b { font-size: 20px; }
  .gf-style { font-size: 26px; }
}
.gf-stage:not(.is-playing) .gf-hud, .gf-stage:not(.is-playing) .gf-touch { display: none; }
