:root {
  color-scheme: light;
  --ink: #28223d;
  --muted: #615d72;
  --violet: #613bc1;
  --lilac: #c3adff;
  --cream: #fdfbf2;
  --mint: #cceee1;
  --brd: #302747;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bottom: max(18px, env(safe-area-inset-bottom));
  --top: max(18px, env(safe-area-inset-top));
  --edge: clamp(18px, 4.6vw, 72px);
  --rounded: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--rounded);
  color: var(--ink);
  background: #c7eadf;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid #712ade; outline-offset: 4px; }
button, a { -webkit-touch-callout: none; }
[hidden] { display: none !important; }
#app { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 72% 55%, #a2e5c7 10%, #d8f4e5 65%, #f7f8dd 100%); }
#app:fullscreen { width: 100%; height: 100%; }
#app:-webkit-full-screen { width: 100%; height: 100%; }
#scene, #lobby-tint { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { display: block; touch-action: none; }
#lobby-tint { pointer-events: none; background: linear-gradient(90deg, #f3f9e8 0%, #eff8e8 18%, #eef8e3ec 32%, #eaf6e16e 46%, transparent 61%), linear-gradient(0deg, #f2f8e7a1, transparent 16%); }
#app[data-mode="race"] #lobby-tint, #app[data-mode="race"] #header, #app[data-mode="race"] #hub { display: none; }
.glyph { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: middle; flex: none; overflow: visible; }
[data-icon] { display: inline-grid; flex: none; place-items: center; }
#header { position: absolute; z-index: 4; top: var(--top); left: max(var(--edge), env(safe-area-inset-left)); right: max(var(--edge), env(safe-area-inset-right)); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: inline-flex; align-items: center; padding: 0; gap: 11px; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 47px; height: 47px; border: 2px solid var(--brd); border-radius: 15px; box-shadow: 2px 3px 0 var(--brd); background: #c3adff; transform: rotate(-6deg); }
.brand-mark svg { width: 35px; height: 35px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.brand small { margin-top: 5px; font: 800 8px/1 system-ui, sans-serif; letter-spacing: .23em; color: #584677; }
.header-right { display: flex; gap: 8px; align-items: center; }
.wallet, .icon-button { height: 42px; border: 1.5px solid #37294c29; background: #fffdf4ed; border-radius: 13px; display: inline-flex; align-items: center; box-shadow: 0 3px 0 #2b284018; }
.wallet { padding: 0 13px 0 9px; gap: 7px; white-space: nowrap; font-size: 13px; }
.wallet strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.wallet-icon, .race-coin [data-icon] { color: #a87116; background: #fff0a4; border-radius: 8px; width: 24px; height: 24px; }
.currency-label { color: var(--muted); font-size: 11px; font-weight: 800; }
.icon-button { width: 44px; height: 44px; justify-content: center; font-size: 17px; }
.icon-button:hover { background: white; border-color: #746193; transform: translateY(-1px); }
#hub, #home { position: absolute; inset: 0; pointer-events: none; }
#hub button, #panel { pointer-events: auto; }
.hero { position: absolute; left: max(var(--edge), env(safe-area-inset-left)); top: 50%; transform: translateY(-57%); max-width: 51vw; }
.hero h1 { margin: 14px 0 19px; font-size: clamp(57px, 7.15vw, 110px); line-height: .99; font-weight: 1000; letter-spacing: -.09em; color: #292440; }
.hero h1 em { font-style: normal; color: #6742bd; text-shadow: 0 3px 0 #fdf8fe, 0 5px 0 #b8a3e886; }
.hero p { color: #46425a; margin: 0 0 25px; font-size: clamp(13px, 1.22vw, 17px); line-height: 1.8; font-weight: 600; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 900; line-height: 1.25; min-height: 45px; border: 1.7px solid var(--brd); border-radius: 13px; padding: 10px 17px; background: #ffdf78; box-shadow: 0 3px 0 var(--brd); transition: transform .12s, background .12s, box-shadow .12s; }
.primary:hover:not(:disabled), .secondary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 0 var(--brd); background: #ffeb9f; }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--brd); }
.primary:disabled, .secondary:disabled { background: #efebf2; color: #6f667b; border-color: #8e829e; box-shadow: 0 2px 0 #8e829e; }
.secondary { background: #fffdf7; }
.secondary:hover:not(:disabled) { background: #eee5ff; }
.hero-play { min-height: 61px; padding: 10px 14px; min-width: 250px; justify-content: flex-start; gap: 12px; font-size: 20px; border-radius: 16px; border-width: 2px; box-shadow: 0 5px 0 var(--brd); }
.hero-play [data-icon="play"] { width: 32px; height: 32px; background: #fff0b0; border-radius: 9px; }
.hero-play [data-icon="arrow"] { margin-left: auto; }
#home-course { padding-top: 13px; color: #555069; font-size: 12px; font-weight: 750; display: flex; gap: 7px; align-items: center; }
#home-course i, .hero-count i { height: 4px; width: 4px; border-radius: 50%; display: inline-block; background: currentColor; margin: 0 3px; opacity: .7; }
.hero-tag { position: absolute; bottom: max(111px, calc(var(--bottom) + 92px)); right: max(var(--edge), env(safe-area-inset-right)); display: flex; align-items: center; gap: 9px; padding: 7px 13px 7px 7px; border: 1px solid #594a7628; background: #fffdf3ef; border-radius: 12px; box-shadow: 0 4px 0 #32284321; transform: rotate(3deg); }
.hero-tag-icon { width: 33px; height: 33px; border-radius: 9px; background: #dfccff; color: #4b3184; }
.hero-tag small, .hero-tag strong { display: block; }
.hero-tag small { font-size: 9px; color: #756484; margin-bottom: 1px; font-weight: 800; }
.hero-tag strong { font-size: 13px; font-weight: 900; }
.hero-count { position: absolute; top: max(85px, calc(var(--top) + 61px)); right: max(var(--edge), env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; color: #3e3953; font-size: 11px; font-weight: 750; background: #fffff5ba; padding: 6px 9px; border: 1px solid #51446624; border-radius: 8px; }
.hero-count b { font-size: 13px; color: #583da0; }
.dock { position: absolute; z-index: 5; bottom: var(--bottom); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border: 1.5px solid #362a4948; border-radius: 18px; background: #fffdf3f0; box-shadow: 0 5px 0 #3b2a4829, 0 9px 30px #352d411b; }
.dock button { padding: 0 14px; min-height: 43px; border-radius: 11px; white-space: nowrap; display: flex; align-items: center; gap: 7px; border: 1px solid transparent; font-size: 13px; font-weight: 850; }
.dock button:hover { background: #f3ecfc; }
.dock button.active { color: #412783; border-color: #6b49b369; background: #dfceff; box-shadow: inset 0 -2px 0 #9c78e934; }
.dock .glyph { width: 19px; height: 19px; }
.save-label { position: absolute; left: max(var(--edge), env(safe-area-inset-left)); bottom: calc(var(--bottom) + 16px); font-size: 11px; font-weight: 750; color: #4a5360; display: inline-flex; align-items: center; gap: 5px; }
.save-label [data-icon] { color: #207d57; }

#panel { position: absolute; inset: max(80px, calc(var(--top) + 58px)) max(var(--edge), env(safe-area-inset-right)) calc(var(--bottom) + 72px) max(var(--edge), env(safe-area-inset-left)); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px 4px 10px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.section-heading h1 { font-size: clamp(30px, 4.5vw, 59px); letter-spacing: -.07em; line-height: 1; margin: 0; font-weight: 1000; }
.section-heading p { margin: 8px 0 0; color: #514761; font-size: 13px; line-height: 1.5; font-weight: 700; }
.record-count { display: flex; gap: 7px; align-items: center; background: #fffdf3; border: 1px solid #55416b3d; padding: 7px 11px; border-radius: 9px; font-weight: 900; font-size: 12px; flex: none; }
.record-count [data-icon] { color: #8a5a24; }
.worlds, .courses, .items { display: grid; gap: 12px; }
.worlds { grid-template-columns: repeat(5, minmax(110px, 1fr)); margin-bottom: 20px; }
.world-button { position: relative; min-width: 0; min-height: 108px; height: min(20vh, 165px); text-align: left; padding: 0; border: 1.5px solid #291c483e; border-radius: 16px; overflow: hidden; background: var(--tile-bg, #e5e5f4); box-shadow: 0 3px 0 #3b27432b; isolation: isolate; }
.world-button canvas { width: 100%; height: 100%; position: absolute; inset: 0; z-index: -2; object-fit: cover; }
.world-button::before { content: ""; position: absolute; z-index: -1; inset: 39% 0 0; background: linear-gradient(0deg, #27203ce9, #27203c44 64%, transparent); }
.world-button:hover, .world-button[aria-pressed="true"] { transform: translateY(-2px); border-color: #352447; box-shadow: 0 4px 0 #352447; }
.world-button[aria-pressed="true"]::after { content: ""; position: absolute; inset: 0; border: 2px solid #fff2c4; border-radius: 14px; pointer-events: none; }
.world-name { position: absolute; color: white; font-size: clamp(13px, 1.65vw, 21px); letter-spacing: -.035em; font-weight: 950; left: 10px; bottom: 9px; right: 10px; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.world-name small { font-weight: 800; font-size: 9px; opacity: .9; }
.world-highlight { font-size: 14px; font-weight: 900; color: #48395d; margin: 0 0 9px; display: flex; align-items: center; gap: 7px; }
.world-highlight i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; background: var(--w-accent); border: 1px solid #3c31565e; }
.courses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.course-card { display: flex; flex-direction: column; gap: 8px; padding: 13px; background: #fffdf4f8; border: 1px solid #57416743; border-radius: 15px; box-shadow: 0 3px 0 #3b274321; min-width: 0; }
.course-card.locked { background: #f5f2f6e6; }
.course-title { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.course-title h3 { margin: 0; font-weight: 950; font-size: clamp(14px, 1.6vw, 22px); letter-spacing: -.03em; }
.course-title [data-icon] { color: #7753ae; }
.course-card p { flex: 1; margin: 0; color: #625972; font-weight: 620; line-height: 1.6; font-size: 12px; }
.course-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; padding-top: 3px; }
.course-foot .primary, .course-foot .secondary { padding: 6px 10px; min-height: 34px; border-radius: 8px; font-size: 11px; border-width: 1px; box-shadow: 0 2px 0 var(--brd); }
.level-record { font-size: 11px; white-space: nowrap; font-weight: 830; color: #5c516a; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 3px; }
.medal-gold { color: #976211 !important; }
.medal-silver { color: #5d648a !important; }
.medal-bronze { color: #9c5936 !important; }
.filters { display: flex; gap: 6px; margin-bottom: 14px; }
.filters button { min-height: 35px; border: 1px solid #74628346; padding: 5px 12px; background: #fffdf3e9; border-radius: 9px; font-size: 12px; font-weight: 850; }
.filters button[aria-pressed="true"] { color: #462d87; background: #e5d6ff; border-color: #7956bf82; }
.items { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.item { display: flex; flex-direction: column; padding: 8px; border: 1px solid #57416740; border-radius: 14px; background: #fffdf7f5; box-shadow: 0 3px 0 #3b274325; min-width: 0; }
.item.equipped { border-color: #7451bd; box-shadow: 0 3px 0 #7451bd65; }
.item canvas, .power-art { width: 100%; aspect-ratio: 1.18; border-radius: 8px; display: block; }
.item h3 { margin: 8px 0 3px; font-size: 14px; font-weight: 950; }
.item p { flex: 1; margin: 0 0 8px; color: #625972; line-height: 1.45; font-size: 11px; }
.item .primary, .item .secondary { width: 100%; min-height: 33px; font-size: 11px; padding: 5px 3px; gap: 4px; border-width: 1px; border-radius: 8px; box-shadow: 0 2px 0 var(--brd); }
.item .secondary:disabled { color: #514091; border-color: #9580c4; box-shadow: 0 2px 0 #9580c4; background: #eae0fc; }
.items.powers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.power-art { display: grid; place-items: center; max-height: 118px; background: var(--power-bg); color: #332347; }
.power-art .glyph { width: 53px; height: 53px; filter: drop-shadow(2px 3px 0 #ffffffa8); }
.items.powers .item { padding: 10px; }
.items.powers .item p { font-size: 12px; }
.items.powers .item h3 { font-size: 17px; }
.bag-note { display: flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 780; border: 1px solid #4c416a32; color: #4e4966; background: #ffffff91; border-radius: 9px; padding: 8px 10px; width: fit-content; margin-top: 18px; }

#race { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
#race button, #joystick { pointer-events: auto; }
.race-top { position: absolute; top: var(--top); left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.race-card { min-height: 45px; display: flex; flex-direction: column; justify-content: center; border-radius: 13px; padding: 5px 13px; background: #fffdf4ed; border: 1px solid #2d244840; box-shadow: 0 3px 0 #29283c38; }
.race-place span { font-size: 10px; font-weight: 850; color: #62517e; }
.race-place strong { font-size: 15px; font-weight: 950; }
.race-numbers { margin-left: auto; flex-flow: row nowrap; align-items: center; gap: 12px; font-weight: 900; font-family: system-ui, sans-serif; }
#race-time { font-variant-numeric: tabular-nums; font-size: 17px; }
.race-coin { display: flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.race-pause { height: 45px; width: 45px; }
.race-progress { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: clamp(130px, 27vw, 370px); }
.meter { border: 1px solid #3027467c; height: 10px; border-radius: 6px; overflow: hidden; background: #fefbf3ac; box-shadow: 0 2px 0 #30274638; }
.meter i { display: block; width: 100%; height: 100%; transform-origin: left; transform: scaleX(0); background: #a17ceb; }
.checkpoints { display: flex; justify-content: center; margin-top: 6px; gap: 5px; }
.checkpoints i { display: inline-block; width: 7px; height: 7px; border: 1px solid #38294d9c; background: #fff6e7; border-radius: 2px; transform: rotate(45deg); }
.checkpoints i.passed { background: #f7cd59; }
#countdown { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); color: #ffe389; -webkit-text-stroke: 2px #33254d; text-shadow: 0 7px 0 #33254d; font: 1000 clamp(65px, 14vw, 180px)/1 var(--rounded); white-space: nowrap; }
.keyboard-guide { position: absolute; bottom: var(--bottom); left: 50%; transform: translateX(-50%); color: #302845; background: #fff9e8d9; border: 1px solid #30284539; border-radius: 10px; padding: 6px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
kbd { display: inline-block; padding: 1px 4px; margin: 0 2px 0 4px; box-shadow: 0 1px 0 #2c20474d; border: 1px solid #2c204755; border-radius: 4px; color: #3b2b60; background: #f9f3ff; font: 800 11px/1.35 var(--rounded); }
.joystick, .touch-actions { display: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.joystick { position: absolute; bottom: max(calc(var(--bottom) + 20px), 6vh); left: max(24px, env(safe-area-inset-left)); width: clamp(105px, 15vw, 166px); aspect-ratio: 1; border-radius: 50%; place-items: center; background: #3927523f; border: 2px solid #fff8; }
.joystick-ring { width: 74%; height: 74%; border: 1px dashed #fffd; border-radius: 50%; }
.stick { width: 52%; height: 52%; position: absolute; top: 50%; left: 50%; transform: translate(calc(-50% + var(--stick-x, 0px)), calc(-50% + var(--stick-y, 0px))); background: #fff6e4d9; border-radius: 50%; border: 2px solid #382a5d82; box-shadow: 0 4px 0 #34284d88; }
.touch-actions { position: absolute; bottom: max(calc(var(--bottom) + 15px), 5vh); right: max(19px, env(safe-area-inset-right)); align-items: end; gap: 9px; }
.touch-control { width: clamp(54px, 8vw, 84px); aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; background: #fdf6e5e8; border: 2px solid #4133549c; box-shadow: 0 4px 0 #413354aa; border-radius: 50%; font-size: clamp(19px, 3vw, 32px); touch-action: none; padding: 2px; }
.touch-control small { font-size: clamp(9px, 1.2vw, 12px); font-weight: 900; }
.touch-jump { width: clamp(70px, 10vw, 112px); margin-bottom: 18px; background: #ffe489f2; }
.touch-roll { margin-bottom: 1px; background: #dfcafff2; }
.touch-item { background: #c1f4e4ee; }
.touch-item.used, .touch-roll.cooling { opacity: .52; }
.touch-control:active { transform: translateY(3px); box-shadow: 0 1px 0 #433354aa; }
.ability-status { position: absolute; bottom: var(--bottom); right: max(18px, env(safe-area-inset-right)); font-size: 11px; font-weight: 850; padding: 4px 8px; background: #fff9e8d9; border-radius: 6px; border: 1px solid #2a224540; }

#dialog { padding: 0; width: min(91vw, 515px); max-height: 91dvh; overflow: auto; background: #fffdf3; color: var(--ink); border: 2px solid var(--brd); border-radius: 20px; box-shadow: 0 7px 0 var(--brd), 0 16px 70px #20173555; }
#dialog::backdrop { background: #27213c74; backdrop-filter: blur(5px); }
.dialog-content { position: relative; padding: 24px; }
.dialog-content h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 1000; letter-spacing: -.06em; margin: 0 45px 12px 0; }
.dialog-content p { font-size: 13px; line-height: 1.6; color: #564865; margin: 0 0 12px; font-weight: 640; }
.dialog-close { position: absolute; right: 14px; top: 14px; font-size: 17px; min-width: 36px; min-height: 36px; border: 1px solid #6045765e; border-radius: 9px; background: #f0e8fb; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dialog-actions button { flex: 1; white-space: nowrap; }
.help-table { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 14px 0; }
.help-row { padding: 7px 9px; border-radius: 8px; background: #eee6fa; display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12px; font-weight: 800; }
.help-row kbd { font-size: 10px; white-space: nowrap; }
.switch-row { min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #44336522; font-size: 13px; font-weight: 850; }
.switch-row input { appearance: none; width: 38px; height: 22px; border: 1px solid #523a84; border-radius: 13px; background: #ece6f6; position: relative; cursor: pointer; }
.switch-row input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #735c98; border-radius: 50%; transition: transform .15s; }
.switch-row input:checked { background: #c7aefb; }
.switch-row input:checked::after { transform: translateX(16px); background: #482c82; }
.switch-row input:focus-visible { outline: 2px solid #6a38b1; outline-offset: 3px; }
.sensitivity-row input { appearance: auto; width: min(35%, 148px); height: auto; margin-left: auto; accent-color: #7346bb; }
.sensitivity-row input::after { display: none; }
.sensitivity-row output { min-width: 42px; font-variant-numeric: tabular-nums; text-align: right; color: #5c398f; }
.settings-footer { border-top: 1px solid #44336522; margin-top: 6px; padding-top: 12px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.settings-footer .secondary { min-height: 32px; font-size: 11px; padding: 5px 8px; border-radius: 8px; box-shadow: 0 2px 0 var(--brd); }
.dialog-content .fullscreen-note { margin: 12px 0 0; color: #46317f; }
.result-medal { display: grid; place-items: center; width: 59px; height: 59px; border-radius: 17px; border: 2px solid #5d4438; background: #fff0aa; font-size: 30px; box-shadow: 0 3px 0 #5d4438; margin-bottom: 13px; transform: rotate(-7deg); }
.result-medal.medal-silver { background: #e7eafa; }
.result-medal.medal-bronze { background: #ffdcb4; }
.result-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.result-numbers div { display: flex; flex-flow: column; border-radius: 9px; border: 1px solid #4a315324; background: #f2eafc; padding: 8px; gap: 2px; }
.result-numbers small { font-size: 10px; font-weight: 800; color: #604e72; }
.result-numbers strong { font: 900 clamp(15px, 3.4vw, 24px)/1.2 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.result-reward { margin-top: 12px !important; font-size: 12px !important; }
#toast { z-index: 6; position: absolute; top: max(75px, calc(var(--top) + 52px)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); padding: 8px 13px; background: #2e2546f0; color: #fffdf4; border: 1px solid #fff5; border-radius: 9px; font-size: 12px; font-weight: 750; box-shadow: 0 4px 14px #271d4050; pointer-events: none; }
.boot-feedback, .boot-noscript { color: #4d5368; font-size: 12px; font-weight: 750; line-height: 1.35; }
.boot-feedback > :not([hidden]):not(:empty), .boot-noscript { display: inline-block; margin-top: 7px; }
#boot-reload { margin-inline-start: 6px; color: #56369e; text-underline-offset: 2px; pointer-events: auto; }
#app[data-boot="loading"] #boot-reload { visibility: hidden; animation: boot-reload-fallback 0s 5s forwards; }
@keyframes boot-reload-fallback { to { visibility: visible; } }
#app[data-boot="loading"] #play [data-icon="play"] .glyph { display: none; }
#app[data-boot="loading"] #play [data-icon="play"]::before { content: ''; width: 14px; height: 14px; border: 2px solid #7a61a3; border-right-color: transparent; border-radius: 50%; animation: boot-spin .8s linear infinite; }
@keyframes boot-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { #app[data-boot="loading"] #play [data-icon="play"]::before { animation: none; } }

@media (any-pointer: coarse) {
  .joystick { display: grid; }
  .touch-actions { display: flex; }
  .keyboard-guide { display: none; }
}
.touch-hud .joystick { display: grid; }
.touch-hud .touch-actions { display: flex; }
.touch-hud .keyboard-guide { display: none; }
@media (max-width: 850px) {
  .save-label { display: none; }
  .items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero h1 { font-size: clamp(50px, 8.2vw, 78px); }
}
@media (max-width: 580px) {
  #header { --edge: 12px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .brand { gap: 6px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 6.5px; }
  .header-right { gap: 4px; }
  .wallet, .icon-button { height: 35px; border-radius: 9px; }
  .icon-button { width: 33px; }
  .wallet { padding: 0 6px; gap: 3px; }
  .wallet strong { font-size: 12px; }
  .wallet-icon { width: 20px; height: 20px; }
  .currency-label, .hero-count, .hero-tag { display: none; }
  #lobby-tint { background: linear-gradient(90deg, #eef7e9ee, #ebf6e57f 64%, #eef7e91f); }
  .hero { max-width: 83vw; }
  .hero h1 { font-size: clamp(52px, 12vw, 70px); }
  .hero-play { min-width: 204px; min-height: 49px; font-size: 16px; }
  .hero-play [data-icon="play"] { width: 26px; height: 26px; }
  .hero-break { display: none; }
  .dock button { padding: 4px 8px; min-height: 38px; font-size: 10px; gap: 3px; }
  .dock .glyph { width: 14px; height: 14px; }
  .worlds { display: flex; overflow-x: auto; margin-bottom: 12px; padding: 4px 3px 6px; }
  .world-button { flex: 0 0 108px; height: 86px; min-height: 86px; }
  .courses { grid-template-columns: 1fr; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items.powers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .race-top { left: 8px; right: 8px; gap: 3px; }
  .race-card { min-height: 36px; padding: 2px 6px; border-radius: 8px; }
  .race-place strong, #race-time { font-size: 12px; }
  .race-numbers { gap: 4px; }
  .race-pause { height: 36px; }
  .race-coin { font-size: 9px; gap: 3px; }
  .race-coin [data-icon] { width: 17px; height: 17px; }
  .race-progress { top: 46px; }
  .ability-status { right: 8px; bottom: 6px; font-size: 9px; }
}
@media (max-height: 550px) and (min-width: 581px) {
  :root { --top: max(10px, env(safe-area-inset-top)); --bottom: max(10px, env(safe-area-inset-bottom)); }
  .hero { transform: translateY(-47%); }
  .hero h1 { font-size: min(8vw, 13vh); margin: 9px 0 11px; }
  .hero p { margin-bottom: 13px; }
  .hero-play { min-height: 43px; min-width: 195px; font-size: 15px; }
  .hero-play [data-icon="play"] { width: 26px; height: 26px; }
  .dock button { min-height: 34px; }
  #panel { top: max(65px, calc(var(--top) + 50px)); bottom: calc(var(--bottom) + 56px); }
  .section-heading { margin-bottom: 11px; }
}
@media (max-height: 400px) and (max-width: 580px) {
  :root { --top: max(7px, env(safe-area-inset-top)); --bottom: max(7px, env(safe-area-inset-bottom)); }
  .hero { top: 48%; transform: translateY(-40%); max-width: 94vw; }
  .hero h1 { font-size: clamp(23px, 8vw, 43px); margin: 7px 0 10px; }
  .hero h1 br, .hero p { display: none; }
  .hero-play { min-width: 140px; min-height: 35px; padding: 5px 8px; font-size: 12px; border-radius: 10px; }
  .hero-play [data-icon="play"] { width: 20px; height: 20px; }
  #home-course { padding-top: 9px; font-size: 10px; }
  .dock { border-radius: 11px; padding: 3px; gap: 1px; }
  .dock button { min-height: 31px; border-radius: 7px; padding-inline: 4px; font-size: 9px; }
  #panel { top: 50px; bottom: calc(var(--bottom) + 43px); }
  .joystick { bottom: 17px; width: 70px; left: 9px; }
  .touch-actions { bottom: 18px; right: 8px; gap: 3px; }
  .touch-control { width: 36px; min-width: 0; font-size: 17px; }
  .touch-jump { width: 48px; margin-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Rally club identity and menu layout. */
:root {
  --club-ink: #202239;
  --club-purple: #6744cf;
  --club-gold: #ffdf77;
  --club-paper: #fffcf2;
  --club-soft: #e9ddfb;
}
#lobby-tint {
  background: linear-gradient(90deg, #f9f8e9 0%, #f7f6e7 22%, #f6f3e5e8 34%, #f5f4e665 49%, transparent 66%),
    linear-gradient(0deg, #f4f3dfc2, #f8f9e750 14%, transparent 31%);
}
#app:is([data-tab="map"], [data-tab="challenges"], [data-tab="bag"]) #lobby-tint {
  background: linear-gradient(105deg, #f4f2e8fe 25%, #f3efe8f5 62%, #eee7f3d6);
}
#app[data-tab="wardrobe"] #lobby-tint {
  background: linear-gradient(90deg, #f8f4e8 8%, #f7f0e7f9 40%, #f6f0e6a6 53%, transparent 68%),
    linear-gradient(0deg, #eee4f4d9 0%, transparent 38%);
}
.brand-mark { transition: transform .2s cubic-bezier(.21,.9,.31,1.3); }
.brand:hover .brand-mark { transform: rotate(3deg) translateY(-1px); }
.brand strong { font-size: clamp(17px, 2vw, 25px); }
.brand small { font-size: 8px; }
.hero { top: 51%; transform: translateY(-55%); max-width: min(47vw, 680px); }
.hero h1 { font-size: clamp(60px, 8.45vw, 126px); line-height: .92; letter-spacing: -.075em; margin: 15px 0 22px; color: #231f3a; }
.hero h1 em { white-space: nowrap; color: #663cca; text-shadow: 0 2px 0 #fff9ec, 0 4px 0 #b4a0ed; }
.hero-actions { margin-top: 16px; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.hero-play { min-width: clamp(168px, 18vw, 248px); }
.hero-practice { display: inline-flex; align-items: center; gap: 5px; min-height: 45px; padding: 7px 13px; border-radius: 11px; background: #fff9efe0; border: 1px solid #39265072; box-shadow: 0 2px 0 #49305935; font-size: 13px; font-weight: 900; white-space: nowrap; }
.hero-practice:hover { background: #efe4ff; }
.hero-practice [data-icon] { color: var(--club-purple); }
#home-course { padding: 0; width: min(96%, 362px); }
.launch-card { display: flex; width: 100%; min-height: 63px; padding: 6px 11px 6px 6px; align-items: center; text-align: left; gap: 10px; border: 1px solid #49426842; border-radius: 13px; color: #392d54; background: #fffdf4da; box-shadow: 0 3px 0 #56427121; }
.launch-card:hover { background: #fffdf4; border-color: #796b99; }
.launch-card canvas { width: 72px; height: 49px; border-radius: 7px; object-fit: cover; }
.launch-name { display: flex; flex-direction: column; gap: 3px; }
.launch-name small { color: #63547a; font-weight: 800; font-size: 10px; }
.launch-name strong { color: #2d2346; font-size: 15px; font-weight: 950; white-space: nowrap; }
.launch-record { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.launch-record [data-icon] { color: #7a54b2; }
.hero-tag { background: #fffaf0f0; gap: 10px; bottom: max(98px, calc(var(--bottom) + 70px)); transform: none; min-height: 55px; text-align: left; }
.hero-tag:hover { border-color: #6e4b9a; transform: translateY(-2px); }
.hero-tag small { font-size: 10px; }
.hero-tag strong { font-size: 16px; }
.hero-tag [data-icon="arrow"] { color: #6f4ea6; margin-left: 6px; }
.hero-count { color: #30263e; min-height: 39px; background: #fffaf0df; padding: 6px 11px; gap: 7px; font-size: 12px; text-align: left; box-shadow: 0 3px 0 #3e315121; }
.hero-count:hover { background: var(--club-paper); border-color: #7559a7; }
.hero-count [data-icon] { color: #6342a9; }
.dock { border-radius: 17px; background: #26233cee; border-color: #8172a0a8; color: #f7f1ed; padding: 5px; gap: 2px; box-shadow: 0 5px 0 #24203b4f, 0 10px 28px #251a4c40; backdrop-filter: blur(10px); }
.dock button { position: relative; padding-inline: clamp(10px, 2vw, 24px); min-height: 48px; color: inherit; border-radius: 11px; }
.dock button .glyph { opacity: .85; }
.dock button:hover { background: #423455; }
.dock button.active { color: #251c39; border-color: #ffef9e; background: linear-gradient(145deg,#fff1a7,#ffd66d); box-shadow: inset 0 -3px 0 #d9932570; }
.dock button.active .glyph { opacity: 1; }
#claim-indicator { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #ff8f8a; top: 7px; right: 7px; border: 1px solid #731f65; }
.section-heading { align-items: center; }
.section-heading h1 { color: #28233c; }
.section-heading p { color: #5c536a; }
.record-count { border: 1px solid #77648669; }
.worlds { gap: 12px; }
.world-button { border-radius: 13px; height: clamp(112px, 19vh, 174px); }
.world-button canvas { object-fit: cover; }
.world-button[aria-pressed="true"]::after { border: 3px solid #fff1a4; border-radius: 11px; }
.world-name { left: 12px; bottom: 11px; right: 12px; }
.world-name small { padding: 2px 6px; background: #362b53b8; border: 1px solid #fff8; border-radius: 6px; }
.world-detail { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.world-detail .world-highlight { margin: 0; }
.world-detail button { min-height: 33px; }
.course-card { border-top: 3px solid var(--course-accent, #af8de3); min-height: 173px; }
.course-card.locked { border-top-color: #bdb3cd; }
.course-stars { display: flex; gap: 5px; flex-wrap: wrap; margin: 1px 0 2px; }
.course-stars span { background: #f1edf1; color: #655b70; border: 1px solid #57436638; display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 6px; font-weight: 850; font-size: 10px; }
.course-stars span.done { background: #ede1ff; border-color: #9059c457; color: #552f87; }
.course-foot .primary, .course-foot .secondary { min-height: 37px; }
.special-course { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px; margin-top: 15px; border-radius: 14px; border: 1px solid #8874a6; background: linear-gradient(100deg,#28233e,#42305e); color: #fdf5eb; box-shadow: 0 3px 0 #412a693b; }
.special-symbol { display: grid; place-items: center; background: #fadd83; color: #332549; border-radius: 11px; width: 43px; height: 43px; font-size: 20px; }
.special-kicker { color: #f9d583; font-weight: 850; font-size: 10px; }
.special-course h2 { font-size: 21px; margin: 2px 0 3px; }
.special-course p { margin: 0; font-size: 12px; line-height: 1.48; color: #ebdef9; }
.special-action { display: grid; justify-items: end; gap: 6px; font-size: 11px; font-weight: 850; }
.special-action .primary { color: var(--club-ink); white-space: nowrap; min-height: 35px; padding-inline: 9px; font-size: 12px; }

.wardrobe-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); min-height: min(55vh, 570px); gap: 20px; }
.wardrobe-shelf .items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wardrobe-layout .item { border-radius: 12px; padding: 0; overflow: hidden; }
.wardrobe-choice { width: 100%; display: grid; text-align: left; place-items: start; padding: 6px; gap: 5px; }
.wardrobe-choice:hover { background: #f0e7fb; }
.wardrobe-choice[aria-pressed="true"] { background: #eaddff; }
.wardrobe-choice:focus-visible { outline-offset: -3px; }
.wardrobe-choice canvas { width: 100%; height: auto; }
.wardrobe-choice strong { padding: 1px 2px 0; font-size: clamp(11px, 1.15vw, 15px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wardrobe-choice small { padding: 0 2px 3px; font-size: 10px; font-weight: 800; color: #594271; display: flex; align-items: center; gap: 3px; }
.wardrobe-choice .item-equipped { color: #37634f; }
.wardrobe-preview { align-self: end; position: relative; padding: 15px; background: #fffdf6ef; border: 1px solid #58427061; border-radius: 16px; box-shadow: 0 4px 0 #49305733, 0 12px 33px #4c315b18; }
.wardrobe-preview h2 { font-size: 23px; margin: 4px 0 5px; letter-spacing: -.04em; }
.wardrobe-preview p { margin: 0 0 13px; color: #645873; font-size: 13px; line-height: 1.45; }
.wardrobe-preview .category-label { color: #6846a3; font-size: 11px; font-weight: 900; display: inline-flex; align-items: center; gap: 4px; }
.wardrobe-preview button { width: 100%; }
.wardrobe-preview .owned-label { color: #3d6357; font-weight: 850; font-size: 12px; display: flex; align-items: center; gap: 5px; }
.wardrobe-reward { display: grid; gap: 7px; }
.wardrobe-reward .owned-label { color: #674c73; line-height: 1.36; }
.wardrobe-reward .owned-label [data-icon] { flex: none; }
.wardrobe-reward button { min-height: 44px; }
.item.equipped { box-shadow: 0 3px 0 #7451bd40; }
.items.powers { grid-template-columns: repeat(3,minmax(0,1fr)); max-width: 940px; }
.items.powers .item { padding: 13px; }
.items.powers .item h3 { margin-top: 13px; }
.power-art { min-height: 96px; }
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.goal-card { display: flex; flex-direction: column; gap: 9px; padding: 15px; background: #fffdf4; border: 1px solid #5b47734a; border-radius: 15px; box-shadow: 0 3px 0 #50316123; }
.goal-card.ready { background: linear-gradient(135deg, #fffad9, #fffdf1); border-color: #947040; box-shadow: 0 3px 0 #92764243; }
.goal-card h2 { margin: 0; font-size: clamp(16px, 2vw, 24px); line-height: 1.13; letter-spacing: -.035em; }
.goal-card p { margin: 0; min-height: 2.8em; color: #645974; font-size: 12px; line-height: 1.45; }
.goal-top { display: flex; align-items: center; gap: 9px; }
.goal-symbol { width: 34px; height: 34px; background: #e7d9ff; display: grid; place-items: center; border: 1px solid #7d5ca348; border-radius: 8px; color: #5c40a3; }
.goal-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 850; min-height: 35px; }
.goal-bottom .primary { min-height: 33px; padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.goal-reward, .collected { display: flex; align-items: center; gap: 3px; }
.goal-reward { color: #74500d; }
.collected { color: #396557; }
.goal-rail { background: #eee9ef; border: 1px solid #51407039; border-radius: 6px; height: 8px; overflow: hidden; }
.goal-rail i { display: block; height: 100%; background: #a083e0; }
.goal-card.ready .goal-rail i { background: #edba4c; }

.race-top { top: max(11px, env(safe-area-inset-top)); }
.race-card, .race-pause { background: #27243de8; border: 1px solid #e9dbff70; color: #fffdf4; box-shadow: 0 3px 0 #251e49aa; }
.race-card { min-height: 51px; }
.race-place span { color: #ddcbfd; }
.race-pause { width: 51px; height: 51px; }
.race-pause:hover { background: #503878; border-color: #f7daff; }
.race-clock { display: flex; flex-direction: column; }
#race-time { font-size: clamp(14px, 1.75vw, 24px); line-height: 1.1; }
#ghost-delta { color: #ffbdab; font-size: 10px; line-height: 1.25; text-align: center; }
#ghost-delta.ahead { color: #a2f9cf; }
#ghost-delta[data-ghost-finished] { color: #ffe9ba; }
.race-progress { top: 8px; }
.meter { background: #261e3dc4; height: 11px; border-color: #fffaf1b5; }
.meter i { background: linear-gradient(90deg,#e5baff,#ffe37b); box-shadow: inset 0 1px 0 #fff9; transition: transform .08s linear; }
.checkpoints { position: relative; height: 9px; }
.checkpoints i { position: absolute; left: var(--position); width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg); }
.checkpoints i.passed { background: #ffdb66; border-color: #2c214a; }
#countdown { font-size: clamp(66px, 17vw, 200px); text-shadow: 0 8px 0 #312047, 0 13px 34px #30204d81; }
#countdown .count-beat { display: block; animation: race-bump .29s cubic-bezier(.22,.75,.2,1.3) both; }
@keyframes race-bump { from { opacity: .7; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
#race-callout, #mission-hint { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; width: max-content; max-width: min(66vw, 410px); font-weight: 850; }
#race-callout { top: max(65px, calc(var(--top) + 48px)); color: #251f36; background: #ffeba1; border: 2px solid #453454; border-radius: 9px; box-shadow: 0 4px 0 #34284985; padding: 7px 13px; font-size: 13px; }
#race-callout[data-checkpoint] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  border-color: #4c405c;
  background: #fff5dc;
  font-variant-numeric: tabular-nums;
}
.checkpoint-comparison {
  padding: 2px 6px;
  border-radius: 4px;
  color: #493760;
  background: #ede3f4;
}
.checkpoint-comparison[data-pace="gain"] { color: #215a45; background: #dcf3dd; }
.checkpoint-comparison[data-pace="loss"] { color: #7b3642; background: #f9dcd8; }
#mission-hint { top: 15%; display: flex; align-items: center; gap: 8px; background: #28213ee8; color: #fefbf4; border: 1px solid #e5d2ffa1; box-shadow: 0 3px 0 #32254b74; border-radius: 9px; line-height: 1.25; padding: 7px 11px; font-size: 13px; }
#mission-hint [data-icon] { color: var(--club-gold); }
.ability-status { color: #fff9e8; background: #272338df; border-color: #fff5; }
.touch-roll { position: relative; isolation: isolate; }
.touch-roll::before { content: ""; position: absolute; opacity: 0; inset: -5px; border-radius: 50%; background: conic-gradient(#fff7ba calc(var(--cooldown, 0) * 1turn), #352e5277 0turn); z-index: -1; padding: 3px; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.touch-roll.cooling { opacity: .78; }
.touch-roll.cooling::before { opacity: 1; }
.dialog-content .result-summary { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px; }
.result-summary .result-medal { margin: 0; }
.result-reward { display: flex; align-items: center; gap: 5px; }
.result-objectives { margin-top: 11px; }
.result-objectives .course-stars { margin: 8px 0 0; }
.split-sheet { margin-top: 12px; padding: 8px; color: #40324f; background: #f3ebfa; border: 1px solid #b6a2cb80; border-radius: 9px; }
.split-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.split-head h3 { margin: 0; font-size: 13px; }
.split-reference, .split-label, .split-focus { font-size: 10px; font-weight: 800; }
.split-reference { color: #5d4d72; }
.split-sheet ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,83px),1fr)); gap: 5px; }
.split-sheet li { min-width: 0; display: flex; gap: 2px; flex-direction: column; padding: 6px; background: #fffaf2; border: 1px solid #6b4d821e; border-radius: 6px; }
.split-sheet li strong { font: 850 13px/1.35 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.split-delta { font-size: 10px; line-height: 1.25; font-weight: 850; font-variant-numeric: tabular-nums; }
.split-delta[data-pace="gain"], .split-sheet li[data-swing="gain"] .split-focus { color: #266450; }
.split-delta[data-pace="loss"], .split-sheet li[data-swing="loss"] .split-focus { color: #9c365d; }
.split-sheet li[data-swing="gain"] { border-color: #70a98f; background: #eaf7ed; }
.split-sheet li[data-swing="loss"] { border-color: #d58ba9; background: #fff1f4; }
.dialog-content .split-note { margin: 6px 0 0; color: #5d4d72; font-size: 11px; line-height: 1.4; }

#dialog:has(.race-finish-body) {
  width: min(780px, 94vw, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px)));
}
#dialog:has(.race-finish-body) .dialog-content { padding: clamp(14px, 2.7vw, 23px); }
.race-finish-body, .race-finish-overview, .race-finish-sectors { display: grid; align-content: start; min-width: 0; gap: 10px; }
.race-finish-body { gap: 15px; }
.race-finish-overview .result-summary { align-items: center; gap: 7px; }
.race-finish-overview .result-summary h2 { margin: 0 0 3px; font-size: clamp(23px, 3.25vw, 30px); line-height: 1.16; }
.race-finish-overview .result-summary p { margin: 0; font-size: 12px; line-height: 1.4; }
.race-finish-overview .result-medal { width: 43px; height: 43px; border-radius: 12px; font-size: 23px; }
.race-finish-overview .result-numbers {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 0; padding: 0 12px; border: 1px solid #b7a9c7; border-radius: 10px; background: #f4eef8;
}
.race-finish-overview .result-numbers div {
  flex-flow: row wrap; align-items: baseline; gap: 2px 6px; padding: 6px 0; border: 0; border-radius: 0; background: transparent;
}
.race-finish-overview .result-numbers div:first-child {
  grid-column: 1 / -1; justify-content: space-between; align-items: center; margin: -1px -13px 0; padding: 7px 13px;
  border-radius: 10px 10px 0 0; background: #3d304e; color: #fff9ee;
}
.race-finish-overview .result-numbers div:first-child small { font-size: 12px; color: #f4d982; }
.race-finish-overview .result-numbers div:first-child strong { font-size: clamp(24px, 3.35vw, 32px); letter-spacing: .01em; }
.race-finish-overview .result-numbers div:last-child { justify-content: end; }
.race-finish-overview .result-numbers strong { font-size: 15px; }
.race-finish-overview .result-numbers small { font-size: 11px; }
.race-finish-overview .result-objectives, .race-finish-overview .course-stars { margin: 0; }
.race-finish-overview .result-reward { margin: 0 !important; line-height: 1.4; }
.race-finish-overview .rival-result-band { margin: 0; }
.race-finish-overview .rival-result-band[data-pace="gain"] strong { color: #206545; }
.race-finish-overview .rival-result-band[data-pace="loss"] strong { color: #9b3654; }
.race-finish-overview .rival-result-band[data-pace="even"] strong { color: #5d536a; }
.race-finish-sectors .split-sheet { margin: 0; padding: 9px; border-color: #c7b9c9; background: #f3edf1; }
.race-finish-sectors .split-head { align-items: center; flex-wrap: wrap; }
.race-finish-sectors .split-head h3 { font-size: 15px; }
.race-finish-sectors .split-sheet ol { grid-template-columns: 1fr; gap: 4px; }
.race-finish-sectors .split-sheet li {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; grid-template-areas: "leg time delta";
  align-items: center; min-height: 32px; column-gap: 8px; row-gap: 0; padding: 4px 8px;
}
.race-finish-sectors li[data-swing] { grid-template-areas: "leg time delta" "focus time delta"; }
.race-finish-sectors li:not(:has(.split-delta)) { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "leg time"; }
.race-finish-sectors .split-label { grid-area: leg; font-size: 12px; }
.race-finish-sectors li strong { grid-area: time; }
.race-finish-sectors .split-delta { grid-area: delta; min-width: 64px; font-size: 11px; text-align: right; }
.race-finish-sectors .split-focus { grid-area: focus; }
#dialog:has(.race-finish-body) .dialog-actions { margin: 0; gap: 6px; }
#dialog:has(.race-finish-body) .dialog-actions button { min-width: 44px; min-height: 44px; padding: 6px 9px; font-size: 13px; }
#dialog:has(.race-finish-body) .result-activity-footer { margin: 0; padding: 0; border: 0; }
#dialog:has(.race-finish-body) .dialog-content { display: grid; align-items: end; gap: 12px; }
@media (min-width: 600px) {
  #dialog:has(.race-finish-body) .dialog-content { grid-template-columns: minmax(0, 1fr) auto; }
  .race-finish-body { grid-column: 1 / -1; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); }
}
@media (min-width: 600px) and (max-height: 440px) {
  #dialog:has(.race-finish-body) .dialog-content { padding: 10px 14px; gap: 10px; }
  .race-finish-body { gap: 12px; }
  .race-finish-overview, .race-finish-sectors { gap: 6px; }
  .race-finish-sectors .split-sheet { padding: 6px; }
  .race-finish-overview .result-summary h2 { font-size: 23px; }
}
@media (min-width: 600px) and (max-height: 320px) {
  #dialog:has(.race-finish-body) .dialog-content { padding: 7px 10px; gap: 7px; }
  .race-finish-overview { gap: 4px; }
  .race-finish-overview .result-summary h2 { font-size: 21px; }
  .race-finish-overview .result-medal { width: 34px; height: 34px; font-size: 19px; }
  .race-finish-overview .result-numbers div, .race-finish-overview .result-numbers div:first-child { padding-block: 3px; }
  .race-finish-overview .rival-result-band { padding: 3px 6px; }
}
.app-reduced *, .app-reduced *::before, .app-reduced *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

@media (max-width: 870px) {
  .hero { max-width: 58vw; }
  .hero h1 { font-size: clamp(57px, 10vw, 87px); }
  .wardrobe-layout { gap: 11px; grid-template-columns: minmax(0, 1.15fr) minmax(197px, .85fr); }
  .wardrobe-shelf .items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 560px) and (min-width: 581px) {
  .hero { transform: translateY(-48%); }
  .hero h1 { font-size: clamp(38px, 13vh, 75px); margin: 8px 0 10px; }
  .hero-actions { margin-top: 9px; }
  .launch-card { min-height: 42px; padding: 4px 8px 4px 4px; }
  .launch-card canvas { width: 54px; height: 35px; }
  .hero-practice { min-height: 37px; }
  .dock button { min-height: 38px; }
  .hero-tag { bottom: 78px; }
  .course-card { min-height: 142px; }
}
@media (max-width: 620px) {
  #lobby-tint { background: linear-gradient(90deg,#f7f6e9f1,#f7f6e98c 57%,#f7f6e91c),linear-gradient(0deg,#f7f6e9d2,transparent 23%); }
  #app[data-tab="wardrobe"] #lobby-tint { background: #f6f0e5db; }
  .hero { max-width: 87vw; }
  .hero h1 { font-size: clamp(51px, 12vw, 76px); }
  .hero-actions { gap: 7px; }
  .hero-practice { min-height: 39px; padding-inline: 9px; }
  .hero-count, .hero-tag { display: none; }
  .dock button { min-height: 40px; padding-inline: 7px; font-size: 10px; }
  .dock .glyph { width: 15px; height: 15px; }
  .wardrobe-layout { display: flex; flex-direction: column; min-height: 0; }
  .wardrobe-shelf .items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wardrobe-preview { width: 100%; padding: 11px; }
  .items.powers { grid-template-columns: 1fr; }
  .goal-card { padding: 10px; }
  .goal-symbol { width: 27px; height: 27px; }
  .goal-top { gap: 5px; }
  .goal-bottom { gap: 3px; font-size: 10px; }
  .goal-bottom .primary { padding-inline: 5px; font-size: 10px; }
  .special-course { grid-template-columns: 1fr auto; gap: 7px; }
  .special-symbol { display: none; }
  .special-course h2 { font-size: 17px; }
  .race-card, .race-pause { min-height: 37px; }
  .race-pause { width: 34px; height: 37px; }
  .race-progress { top: 44px; }
  #mission-hint { top: 68px; font-size: 10px; }
  #race-callout { top: auto; bottom: 34%; font-size: 11px; }
}
@media (max-height: 390px) and (max-width: 620px) {
  .hero { transform: translateY(-44%); }
  .hero h1 { font-size: clamp(26px, 8.5vw, 47px); margin: 3px 0 8px; }
  .hero-actions { margin-top: 8px; }
  .hero-practice { min-height: 32px; font-size: 11px; }
  .launch-card { min-height: 35px; padding: 3px 5px; }
  .launch-card canvas { width: 42px; height: 29px; }
  .launch-name { gap: 1px; }
  .launch-name strong { font-size: 11px; }
  .launch-name small, .launch-record { font-size: 8px; }
  .dock button { min-height: 29px; padding-inline: 5px; font-size: 9px; }
  .dock .glyph { width: 12px; height: 12px; }
}

/* Phones keep the HUD and controls inside the safe rectangle in either orientation. */
@media (orientation: landscape) and (max-height: 500px) and (min-aspect-ratio: 2/1),
       (orientation: portrait) and (max-width: 480px) {
  :root {
    --phone-left: max(12px, calc(var(--safe-left) + 8px));
    --phone-right: max(12px, calc(var(--safe-right) + 8px));
    --top: max(8px, calc(var(--safe-top) + 5px));
    --bottom: max(8px, calc(var(--safe-bottom) + 6px));
    --phone-header: 44px;
    --phone-dock: 54px;
  }
  #header, #panel, .race-top { left: var(--phone-left); right: var(--phone-right); }
  #header { min-height: var(--phone-header); }
  .brand { min-width: 0; min-height: 44px; }
  .brand strong { white-space: nowrap; }
  .header-right { flex-shrink: 0; gap: 4px; }
  .icon-button { width: 44px; height: 44px; }
  .wallet { height: 38px; }
  #panel {
    top: calc(var(--top) + var(--phone-header) + 7px);
    bottom: calc(var(--bottom) + var(--phone-dock) + 4px);
    padding: 3px 3px 12px;
    scrollbar-width: thin;
  }
  .dock {
    left: var(--phone-left);
    right: var(--phone-right);
    width: max-content;
    max-width: calc(100% - var(--phone-left) - var(--phone-right));
    margin-inline: auto;
    transform: none;
    padding: 3px;
  }
  .dock button { min-height: 44px; }
  .save-label { display: none; }
  .race-top { top: var(--top); }
  .race-card { min-width: 0; min-height: 44px; padding: 4px 9px; border-radius: 10px; }
  .race-place strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .race-pause { flex: none; }
  #race-time { font-size: 17px; white-space: nowrap; }
  .race-coin [data-icon] { width: 19px; height: 19px; }
  .joystick { left: var(--phone-left); }
  .touch-actions, .ability-status { right: var(--phone-right); }
  #dialog {
    inset: var(--top) var(--phone-right) var(--bottom) var(--phone-left);
    width: min(515px, calc(100% - var(--phone-left) - var(--phone-right)));
    max-height: calc(100dvh - var(--top) - var(--bottom) - 8px);
    overscroll-behavior: contain;
  }
  .dialog-close { min-width: 44px; min-height: 44px; }
  .settings-footer .secondary { min-height: 44px; }
  .course-foot button.primary, .course-foot button.secondary, .special-action .primary { min-height: 44px; }
}

@media (orientation: landscape) and (max-height: 500px) and (min-aspect-ratio: 2/1) {
  #home .hero {
    left: var(--phone-left);
    top: calc(var(--top) + var(--phone-header) + 8px);
    bottom: calc(var(--bottom) + var(--phone-dock) + 8px);
    max-width: min(48vw, 430px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    transform: none;
  }
  .hero h1 { font-size: clamp(32px, 12.6dvh, 61px); margin: 5px 0 9px; }
  .hero-actions { gap: 7px; margin-top: 9px; flex-wrap: nowrap; }
  .hero-play { min-height: 44px; min-width: 144px; padding: 6px 9px; gap: 7px; }
  .hero-practice { min-height: 44px; padding-inline: 8px; }
  .hero-count { right: var(--phone-right); top: calc(var(--top) + var(--phone-header) + 6px); }
  .hero-tag { right: var(--phone-right); bottom: calc(var(--bottom) + var(--phone-dock) + 4px); min-height: 44px; padding-block: 5px; }
  .dock button { padding: 3px clamp(8px, 1.65vw, 16px); font-size: 12px; }
  .section-heading { margin-bottom: 10px; }
  .section-heading h1 { font-size: clamp(26px, 8.5dvh, 42px); }
  .section-heading p { margin-top: 4px; font-size: 11px; }
  .worlds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; padding: 0; margin: 0 0 10px; overflow: visible; }
  .world-button { min-height: 70px; height: clamp(70px, 22dvh, 110px); }
  .world-name { bottom: 6px; left: 7px; right: 7px; }
  .courses { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .course-card { padding: 9px; }
  .items.powers { grid-template-columns: repeat(3, minmax(0,1fr)); }
  #app[data-tab="wardrobe"] #panel { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .wardrobe-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); min-height: 0; gap: 10px; }
  .wardrobe-shelf { min-height: 0; overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 4px 6px 0; }
  .wardrobe-shelf .filters { position: sticky; top: 0; z-index: 1; background: #f7f2e9; margin-bottom: 8px; }
  .wardrobe-shelf .filters button { min-height: 44px; }
  .wardrobe-shelf .items {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: clamp(78px, 11vw, 112px);
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
  }
  .wardrobe-shelf .item { scroll-snap-align: start; }
  .wardrobe-choice canvas { height: clamp(40px, 15dvh, 75px); object-fit: cover; }
  .wardrobe-preview { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 2px 7px; max-height: 100%; overflow: auto; width: auto; align-self: end; padding: 7px 9px; }
  .wardrobe-preview .category-label { display: none; }
  .wardrobe-preview h2 { grid-area: 1 / 1; font-size: 17px; margin: 0; }
  .wardrobe-preview p { grid-area: 2 / 1; font-size: 11px; margin: 0; }
  .wardrobe-preview > :is(button, .owned-label) { grid-area: 1 / 2 / span 2; }
  .wardrobe-preview button { width: auto; min-height: 44px; padding-inline: 8px; font-size: 11px; }
  .wardrobe-preview .wardrobe-reward { grid-area: 1 / 2 / span 2; width: min(19vw,148px); }
  .wardrobe-preview .wardrobe-reward .owned-label { font-size: 10px; }
  .race-top { display: grid; grid-template-columns: minmax(94px,1fr) minmax(80px,1.35fr) auto auto; gap: 7px; align-items: start; }
  .race-progress { position: static; transform: none; width: auto; min-width: 0; padding-top: 7px; }
  .race-numbers { gap: 7px; }
  #countdown { top: 42%; font-size: clamp(58px, 24dvh, 108px); }
  #mission-hint { top: calc(var(--top) + 51px); font-size: 11px; padding: 5px 8px; max-width: 68vw; }
  #race-callout { top: calc(var(--top) + 52px); bottom: auto; font-size: 11px; padding: 5px 8px; }
  #mission-hint:not([hidden]) + #race-callout { top: calc(var(--top) + 83px); }
  .joystick { width: clamp(82px, 25dvh, 111px); bottom: calc(var(--bottom) + 9px); }
  .touch-actions { bottom: calc(var(--bottom) + 26px); gap: 8px; }
  .touch-control { width: clamp(46px, 14.5dvh, 62px); font-size: clamp(18px, 6dvh, 25px); }
  .touch-jump { width: clamp(60px, 19.5dvh, 82px); margin-bottom: 9px; }
  .ability-status { font-size: 9px; padding: 2px 5px; }
  .dialog-content { padding: 15px 19px; }
  .dialog-content h2 { margin-bottom: 8px; }
  .dialog-actions { margin-top: 10px; }
}

@media (orientation: landscape) and (max-height: 355px) and (min-aspect-ratio: 2/1) {
  #home .hero { max-width: min(53vw, 390px); }
  .hero h1 { font-size: clamp(28px, 7vw, 40px); }
  .hero h1 br { display: none; }
  .hero h1 em { display: inline-block; }
}

@media (orientation: landscape) and (max-height: 320px) and (min-aspect-ratio: 2/1) {
  .hero h1 { font-size: clamp(26px, 6vw, 36px); margin: 0 0 6px; }
  .hero-actions { margin-top: 6px; }
}

@media (orientation: landscape) and (max-height: 275px) and (min-aspect-ratio: 2/1) {
  #home-course { display: none; }
}

@media (orientation: portrait) and (max-width: 480px) {
  .brand { gap: 6px; }
  .brand-mark { flex: none; }
  .brand strong { font-size: 15px; }
  .header-right .wallet { gap: 3px; padding-inline: 5px; }
  .brand > span:last-child { min-width: 0; }
  .brand :is(strong, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #lobby-tint {
    background: linear-gradient(0deg, #f8f6e9 11%, #f8f6e9f1 29%, #f8f6e94d 53%, transparent 67%),
      linear-gradient(180deg, #f8f6e9db, transparent 20%);
  }
  #home .hero { inset: auto var(--phone-right) calc(var(--bottom) + var(--phone-dock) + 18px) var(--phone-left); max-width: none; transform: none; }
  .hero h1 { font-size: clamp(37px, 11.6vw, 55px); margin-block: 8px 12px; }
  .hero h1 br { display: none; }
  .hero-play { min-height: 48px; min-width: 145px; }
  .hero-practice { min-height: 44px; }
  .dock { width: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dock button { padding: 3px 2px; flex-direction: column; justify-content: center; gap: 2px; font-size: clamp(9px, 2.7vw, 11px); }
  .worlds { display: flex; gap: 7px; }
  .world-button { flex: 0 0 106px; }
  .goal-grid { grid-template-columns: 1fr; }
  #app[data-tab="wardrobe"] #lobby-tint {
    background: linear-gradient(180deg,#f9f4e9f2 4%,#f9f4e98c 16%,transparent 26%),
      linear-gradient(0deg,#f9f4e9 21%,#f9f4e9f3 48%,transparent 68%);
  }
  #app[data-tab="wardrobe"] #panel { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .wardrobe-layout { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 8px; padding-top: clamp(110px, 23dvh, 207px); }
  .wardrobe-shelf { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 3px 6px 0; }
  .wardrobe-shelf .filters { position: sticky; top: 0; z-index: 1; background: #f7f2e9; margin-bottom: 7px; }
  .wardrobe-shelf .filters button { min-height: 44px; }
  .wardrobe-preview { padding: 8px 10px; }
  .wardrobe-preview h2 { font-size: 17px; margin: 2px 0; }
  .wardrobe-preview p { font-size: 11px; margin-bottom: 5px; }
  .race-top { gap: 5px; }
  .race-place { max-width: 42%; }
  .race-numbers { gap: 6px; }
  .race-progress { top: 49px; }
  #mission-hint { top: calc(var(--top) + 72px); max-width: 83vw; }
  #race-callout { top: calc(var(--top) + 72px); bottom: auto; max-width: 83vw; }
  #mission-hint:not([hidden]) + #race-callout { top: calc(var(--top) + 111px); }
  .joystick { width: clamp(75px, 26vw, 102px); bottom: calc(var(--bottom) + 17px); }
  .touch-actions { bottom: calc(var(--bottom) + 20px); gap: 6px; }
  .touch-control { width: clamp(44px, 12.5vw, 54px); }
  .touch-jump { width: clamp(58px, 17vw, 76px); margin-bottom: 10px; }
}

@media (orientation: portrait) and (max-width: 350px) {
  .brand small { display: none; }
  .race-place { max-width: 36%; }
  .race-card { padding-inline: 5px; }
}

/* Cloudtop Lantern Fair. */
.festival-ticket { flex: 0 0 64px; min-height: 48px; display: grid; place-items: center; color: #ffdb89; border-radius: 8px; background: radial-gradient(circle at 50% 75%, #a56677, #403b65 72%); }
.festival-ticket .glyph { width: 32px; height: 32px; filter: drop-shadow(0 0 6px #ffce68a0); }
.festival-only { display: none; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .festival-only { display: flex; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .race-only { display: none; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .keyboard-guide .festival-only { display: inline; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .race-place { border-color: #ffe1b57d; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .festival-stamps { margin-left: auto; flex-flow: row nowrap; align-items: center; gap: 7px; white-space: nowrap; }
.festival-stamps [data-icon] { color: #ffe092; }
.festival-stamps.complete { border-color: #ffe092; background: #443756; }
.festival-map-button { justify-content: center; align-items: center; min-width: 44px; min-height: 44px; color: #fff6e1; background: #282541e8; border-color: #e7caf076; }
.festival-map-button:hover { background: #503d65; border-color: #ffe5a3; }
.festival-overlay {
  position: absolute;
  top: max(76px, calc(var(--top) + 56px));
  left: max(18px, var(--safe-left));
  width: min(34vw, 385px);
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.festival-card { width: fit-content; max-width: 100%; min-width: 164px; padding: 7px 11px; color: #fff7e4; background: #25243ce8; border: 1px solid #d7c1ae91; border-radius: 11px; box-shadow: 0 3px 0 #27224190; }
.festival-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 11px; margin-bottom: 3px; }
#festival-task { font-size: 14px; color: #ffe4a1; font-weight: 950; }
#app[data-play="workshop"] #festival-task, #app[data-play="workshop"] .festival-stamps [data-icon] { color: #9fefdc; }
#festival-hint { display: block; font-size: 12px; line-height: 1.4; font-weight: 730; }
#festival-metric { color: #e0f7cf; font: 840 12px/1.2 system-ui,sans-serif; white-space: nowrap; }
#festival-metric.urgent { color: #ffb593; }
.festival-waypoint { display: inline-flex; gap: 3px; align-items: center; padding: 3px 8px; color: #f9e6ff; background: #463561f0; border: 1px solid #debbfb75; border-radius: 6px; font-weight: 850; font-size: 11px; white-space: nowrap; }
.festival-prompt { position: absolute; bottom: calc(var(--bottom) + 44px); left: 50%; transform: translateX(-50%); max-width: min(78vw, 350px); padding: 6px 11px 6px 6px; align-items: center; gap: 8px; border: 2px solid #553754; border-radius: 10px; color: #37243e; background: #fff0b8; box-shadow: 0 3px 0 #512c527b; font-size: 12px; }
#festival-input-label { min-width: 24px; padding: 3px 4px; text-align: center; color: #fff9e8; background: #674476; border-radius: 5px; font-size: 10px; font-weight: 900; white-space: nowrap; }
#app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) #race-callout { top: auto; bottom: calc(var(--bottom) + 92px); max-width: 84vw; }
#dialog:is([data-kind="adventure-guide"],[data-kind="adventure-map"],[data-kind="rescue-guide"],[data-kind="glide-guide"]) {
  width: min(92vw, 740px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px)));
}
.festival-guide { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 13px; align-items: start; }
.festival-guide canvas { display: block; width: 100%; height: auto; border: 1px solid #483b61; border-radius: 11px; }
.festival-places { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.festival-places article { min-width: 0; border: 1px solid #5b417532; border-top: 3px solid var(--place); border-radius: 8px; padding: 7px; background: #f4edf8; }
.place-title { display: flex; align-items: center; gap: 4px; color: #5b3f7d; }
.place-title h3 { margin: 0; font-size: 13px; color: #37294c; font-weight: 900; }
.festival-places article p { color: #61526e; margin: 4px 0 3px; font-size: 11px; line-height: 1.42; }
.place-record { margin-block: 3px; color: #4c5279; font-size: 10px; font-weight: 850; }
.place-pin { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; margin-top: 2px; padding: 4px 5px; color: #4d3670; border: 1px solid #6d4b9468; border-radius: 6px; font-size: 10px; font-weight: 850; background: #fff8ef; }
.place-pin:hover { background: #ffeeac; }

.map-toolbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 12px; }
.map-toolbar .filters { margin: 0; }
.map-toolbar button { min-height: 44px; }
.signature-races { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.signature-card { min-width: 0; overflow: hidden; border: 1px solid #8f819f68; border-radius: 12px; background: #fffaf0; box-shadow: 0 3px 0 #55436e2d; display: flex; flex-direction: column; }
.signature-art { position: relative; height: clamp(88px, 18dvh, 175px); overflow: hidden; border-bottom: 3px solid var(--course-accent); }
.signature-art canvas { width: 100%; height: 100%; object-fit: fill; }
.signature-art span { position: absolute; left: 7px; bottom: 6px; border-radius: 5px; display: flex; align-items: center; gap: 3px; padding: 3px 5px; background: #292541dc; color: #fff5df; font-size: 11px; font-weight: 850; }
.signature-body { flex: 1; display: flex; flex-direction: column; padding: 9px; }
.signature-body h3 { margin: 0 0 4px; font-size: clamp(15px,1.8vw,21px); }
.signature-body p { flex: 1; margin: 0 0 8px; color: #62536e; font-size: 12px; line-height: 1.42; }
.signature-body .course-foot button.primary { min-height: 44px; }

.ball-launch-card { background: #effaf1ef; border-color: #628e8280; }
.ball-launch-card:hover { background: #def2e7; border-color: #507f75; }
.ball-ticket { color: #ffe19f; background: radial-gradient(circle closest-side at 50% 74%,#508f84,#244d60 115%); }
.glide-launch-card { background: #edf9f7f2; border-color: #5b8b9780; }
.glide-launch-card:hover { background: #dcf1ed; border-color: #467b87; }
.glide-ticket { color: #ffdf9c; background: radial-gradient(circle closest-side at 48% 75%,#589798,#284962 115%); }
.journal-launch-card { background: #fbf0daf5; border-color: #a97d5c91; }
.journal-launch-card:hover { background: #fff3df; border-color: #805845; }
.journal-ticket { color: #ffe4a2; background: radial-gradient(ellipse at 50% 72%,#9f7558,#514260 80%); }
.journal-receipt { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 10px; margin-block: 9px; padding: 6px 8px; border: 1px solid #ac8657; border-radius: 8px; background: #fff0cc; color: #533c49; }
.journal-receipt > span { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 850; }
.journal-receipt button { min-height: 44px; padding: 5px 8px; font-size: 11px; }
.rescue-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-right: 53px; margin-bottom: 9px; }
.dialog-content .rescue-guide-head h2 { margin: 0 0 3px; }
.dialog-content .rescue-guide-head p { margin: 0; font-size: 11px; line-height: 1.45; }
.rescue-guide-head button { flex: none; min-height: 44px; padding: 6px 9px; font-size: 12px; }
.rescue-chart-layout { display: grid; grid-template-columns: minmax(0,1.17fr) minmax(0,1fr); gap: 11px; align-items: start; }
.rescue-chart-layout canvas { display: block; width: 100%; height: auto; border: 1px solid #234656; border-radius: 11px; }
.rescue-chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 6px; color: #435e62; font-size: 10px; }
.rescue-chart-legend b { white-space: nowrap; }
.rescue-destinations { display: grid; gap: 5px; }
.rescue-destinations article { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; min-width: 0; padding: 4px 6px; border: 1px solid #456d6e64; border-radius: 7px; background: #f0f1e7; }
.rescue-destinations h3 { display: flex; gap: 4px; align-items: center; margin: 0 0 2px; color: #26495d; font-size: 12px; }
.rescue-destinations h3 i { width: 8px; height: 8px; background: var(--spot); outline: 1px solid #26495d71; transform: rotate(45deg); }
.dialog-content .rescue-destinations p { margin: 0; color: #465763; font-size: 10px; line-height: 1.35; }
.rescue-destinations .place-pin { margin: 0; }
.rescue-destinations .place-pin[aria-pressed="true"] { background: #e1f3cd; border-color: #497554; color: #2d5c3c; }
#app[data-play="rescue"] .festival-card { background: #203746ed; border-color: #b7dfc28a; }
#app[data-play="rescue"] #festival-task, #app[data-play="rescue"] .festival-stamps [data-icon] { color: #bbf3d5; }
#app[data-play="rescue"] #festival-metric:not(.urgent) { color: #ffe3a2; }
#app[data-play="rescue"] .festival-waypoint { background: #274b53ec; }
#app[data-play="glide"] .festival-card { background: #1e3b4dee; border-color: #b3e7e096; }
#app[data-play="glide"] #festival-task, #app[data-play="glide"] .festival-stamps [data-icon] { color: #baf4ed; }
#app[data-play="glide"] #festival-metric { color: #ffe4a5; }
#app[data-play="glide"] .festival-waypoint { max-width: 100%; background: #204952f2; white-space: normal; }
#app[data-play="glide"] .keyboard-guide .glide-key { display: inline; }
#app[data-play="glide"] .keyboard-guide .festival-only { display: none; }
.keyboard-guide .glide-key { display: none; }
.glide-chart-layout .rescue-destinations h3 small { color: #395a65; font-size: 10px; font-weight: 700; }
.glide-chart-layout .place-pin { min-width: 44px; justify-content: center; }
.hero-play [data-icon="spark"] { width: 30px; height: 30px; background: #fff0b0; border-radius: 8px; }
.arena-feature { margin-top: 0; margin-bottom: 12px; background: linear-gradient(110deg,#282542,#423263 66%,#544681); }
.arena-only { display: none; }
#app[data-play="arena"] .arena-only { display: flex; }
#app[data-play="arena"] .race-only,
#app[data-play="arena"] #interact { display: none; }
.arena-round { position: absolute; left: 50%; top: 1px; width: clamp(110px, 27vw, 370px); transform: translateX(-50%); flex-direction: column; align-items: stretch; gap: 4px; color: #fff9e8; text-align: center; font-size: 11px; font-weight: 850; text-shadow: 0 1px 2px #272442; }
.arena-round .meter { height: 9px; }
.arena-round .meter i { transform-origin: left center; background: linear-gradient(90deg,#faab8e,#ffe17f,#a7f1e8); }
.arena-score { margin-left: auto; flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
.arena-score span { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.arena-score b { color: #fff2a9; font-variant-numeric: tabular-nums; }
.arena-score.quota-met #arena-charge { color: #a6f2c8; }
#arena-clock { color: #fff4cf; font: 900 clamp(16px,2vw,25px)/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
#arena-clock::after { content: '秒'; margin-left: 3px; font-size: 10px; }
.arena-coach { position: absolute; left: max(18px, var(--safe-left)); top: max(70px, calc(var(--top) + 52px)); gap: 3px; flex-direction: column; align-items: start; max-width: min(39vw,400px); padding: 8px 11px; border: 1px solid #dcd6fa91; border-radius: 10px; color: #fff7e2; background: #25233ee9; box-shadow: 0 3px 0 #251b39a0; }
.arena-coach strong { color: #ffe686; font-size: 13px; }
.arena-coach span { font-size: 11px; line-height: 1.34; }
.arena-coach[data-phase="warning"] { border-color: #ffb79d; background: #562f4de8; }
.arena-star-guide { position: absolute; top: 0; left: 0; z-index: 2; display: flex; align-items: center; gap: 5px; padding: 4px 8px 4px 4px; color: #fff4bd; background: #2c2648f5; border: 1px solid #ffe1a1; border-radius: 24px; box-shadow: 0 2px 0 #1d1939b5; white-space: nowrap; pointer-events: none; transform: translate3d(var(--guide-x,0px),var(--guide-y,0px),0) translate(-50%,-50%); }
.arena-guide-arrow { width: 23px; height: 23px; color: #372951; background: #ffde87; border-radius: 50%; }
.arena-guide-arrow .glyph { width: 16px; height: 16px; transform: rotate(var(--guide-angle,0deg)); }
.arena-star-guide b { font-size: 11px; font-variant-numeric: tabular-nums; }
#app[data-play="arena"] #race-callout { top: auto; bottom: calc(var(--bottom) + 42px); }
.arena-guide-keys { display: grid; gap: 7px; }
.arena-guide-keys > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 7px; padding: 7px; border-radius: 8px; background: #eee4fc; color: #3b2e55; }
.arena-guide-keys strong { font-size: 13px; }
.arena-guide-keys > div > span:last-child { grid-column: 2; font-size: 11px; line-height: 1.38; }
.ball-only { display: none; }
.ball-drill { display: none; }
#app[data-ball-training] #ball-score { display: none; }
#app[data-ball-dribble] #interact, #app[data-ball-dribble] .keyboard-guide .ball-only { display: none; }
#app[data-ball-training] .ball-drill { display: flex; min-width: 150px; min-height: 44px; padding: 5px 9px; justify-content: center; flex-direction: column; gap: 4px; color: #e9fff2; border: 1px solid #c2e5dc96; border-radius: 9px; background: #244852f2; }
.ball-drill > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#ball-drill-title { font-size: 12px; }
#ball-drill-progress { color: #ffdb8d; font: 850 11px/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.ball-drill .meter { height: 6px; }
.ball-drill .meter i { background: #ffd382; transform-origin: left center; }
#app[data-play="ball"] .ball-only { display: flex; }
#app[data-play="ball"] .race-only { display: none; }
#app[data-play="ball"] .keyboard-guide .ball-only { display: inline; }
#app[data-play="ball"] .race-top { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
#app[data-play="ball"] .race-place { justify-self: start; border-color: #cce5c18c; }
#app[data-play="ball"] .race-pause { justify-self: end; }
.ball-score { overflow: hidden; align-items: stretch; min-height: 48px; color: #f5fff5; border: 1px solid #daf2d385; border-radius: 11px; background: #203945f5; box-shadow: 0 3px 0 #2541487d; }
.ball-side { display: flex; padding: 5px 8px; gap: 5px; min-width: 80px; align-items: center; justify-content: space-between; color: var(--team); background: var(--side); }
.ball-side-gold { --team: #ffdf9e; --side: #5a493d; }
.ball-side-blue { --team: #b5e8ff; --side: #294d64; }
.ball-side span, #ball-period { font-size: 10px; font-weight: 850; white-space: nowrap; }
.ball-side b { font: 900 22px/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.ball-time { min-width: 55px; padding: 3px 6px; display: grid; place-content: center; text-align: center; }
#ball-clock { color: #f5f6dc; font: 900 18px/1.1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.ball-clock-readout span { margin-inline-start: 2px; color: #e1f0dc; font-size: 8px; font-weight: 800; }
#ball-period { color: #b7d6d2; }
.ball-score.urgent #ball-clock { color: #ffd18e; }
.ball-coach { position: absolute; top: calc(var(--top) + 59px); left: max(18px, var(--safe-left)); width: max-content; max-width: min(42vw,310px); padding: 6px 9px; flex-direction: column; gap: 3px; color: #f0f9dd; border: 1px solid #d3efc47b; border-radius: 9px; background: #213c47ed; }
#ball-cue { color: #ffe09d; font-size: 13px; }
#ball-hint { font-size: 11px; line-height: 1.3; }
.ball-coach[data-phase="goal"] { border-color: #ffe2a4; }
#app[data-play="ball"] #ball-radar { display: block; position: absolute; right: max(18px, var(--safe-right)); top: calc(var(--top) + 59px); width: clamp(80px,12vw,122px); height: auto; border: 1px solid #dbf7df7d; border-radius: 8px; box-shadow: 0 2px 0 #25495088; }
#app[data-play="ball"] .touch-item.shoot-ready { color: #4d3429; background: #ffde8df5; border-color: #7d5428; box-shadow: 0 3px 0 #573c3799, 0 0 0 3px #ffecb292; }
.ball-feature { margin: 0 0 10px; border-color: #57897b; background: linear-gradient(110deg,#254b56,#32615e); }
#dialog[data-kind="ball-guide"] { width: min(94vw,620px,calc(100% - var(--phone-left,0px) - var(--phone-right,0px))); }
.ball-match-intro { display: grid; grid-template-columns: minmax(118px,.6fr) minmax(0,1fr); align-items: center; gap: 10px; margin-bottom: 10px; }
.ball-match-intro b { color: #32524c; font-size: 14px; }
.dialog-content .ball-match-intro p { margin: 3px 0 0; font-size: 11px; line-height: 1.4; }
.ball-lineup { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 60px; padding: 6px 7px; color: #ffebba; border: 1px solid #376157; border-radius: 9px; background: repeating-linear-gradient(90deg,#32655e 0 20px,#2d5d58 20px 40px); }
.ball-lineup > span:first-child, .ball-lineup > span:last-child { display: grid; place-items: center; min-width: 32px; min-height: 36px; color: #3e3547; border-radius: 5px; background: #ffd88c; font-size: 11px; font-weight: 850; }
.ball-lineup span:last-child { color: #243d61; background: #9ed7ff; }
.ball-tier-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ball-training-quick { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; padding: 5px 7px; border: 1px solid #649a86; border-radius: 9px; background: #e2f5eb; }
.ball-training-quick > div { display: flex; flex-direction: column; gap: 2px; }
.ball-training-quick strong { color: #305951; font-size: 13px; }
.ball-training-quick span { color: #496759; font-size: 10px; font-weight: 750; }
.ball-training-quick button { min-height: 44px; flex: none; font-size: 12px; padding: 4px 9px; }
.ball-tier { padding: 8px; min-width: 0; border: 1px solid #6c8d857a; border-radius: 9px; background: #edf4ea; }
.ball-tier:last-child { border-color: #7d9ab9; background: #eef2f7; }
.ball-tier h3 { margin: 0 0 3px; color: #244a54; font-size: 16px; }
.ball-tier h3 span { color: #4f6c74; font-size: 10px; }
.dialog-content .ball-tier p { margin: 0 0 5px; font-size: 11px; line-height: 1.4; }
.ball-tier-record { color: #4c6371; font-size: 11px; font-weight: 850; }
.ball-tier-actions { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 7px; }
.ball-tier-actions small { color: #56674e; font-size: 10px; font-weight: 850; }
.ball-tier-actions button { flex: none; min-width: 49px; min-height: 44px; padding: 5px 7px; font-size: 12px; }
.ball-final-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 5px; background: #244653; color: #e9f4ed; border-radius: 9px; text-align: center; }
.ball-final-score div { display: flex; padding: 8px; gap: 5px; align-items: center; justify-content: space-between; border-radius: 6px; color: #fff1bd; background: #5e4f45; }
.ball-final-score div:last-child { color: #cce6ff; background: #33566f; }
.ball-final-score strong { font: 900 27px/1 system-ui,sans-serif; }
.graphics-row select { min-width: 92px; min-height: 44px; padding: 5px 7px; color: #3d2e55; border: 1px solid #9b87b5; border-radius: 8px; background: #fffaf2; font-size: 13px; font-weight: 800; }
#dialog[data-kind="arena-picker"] { width: min(93vw,760px,calc(100% - var(--phone-left,0px) - var(--phone-right,0px))); }
.arena-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding-right: 51px; margin-bottom: 9px; }
.dialog-content .arena-picker-head h2 { margin: 0 0 4px; }
.dialog-content .arena-preview-label { margin: 0; color: #65517e; font-size: 11px; line-height: 1.35; }
.arena-picker-rules { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 5px 8px; color: #543982; background: #f2eafa; border: 1px solid #b4a1cb; border-radius: 8px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.arena-picker-rules:hover { background: #e9dafb; }
.dialog-content .graphics-note { margin: 8px 0 0; color: #5c436f; }
.arena-stage-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.arena-stage { --lane: #baa5fa; --lane-light: #d2c2ff; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #75608f70; border-radius: 11px; background: #fffaf0; }
.arena-stage:nth-child(2) { --lane: #8fddea; --lane-light: #c4f3ff; }
.arena-stage:nth-child(3) { --lane: #9adabc; --lane-light: #c9f4d9; }
.arena-diagram { display: flex; align-items: center; justify-content: center; gap: clamp(4px,1vw,10px); min-height: 88px; padding: 6px; color: var(--lane-light); background: radial-gradient(ellipse at 50% 96%,#534075,#262446 75%); border-bottom: 2px solid var(--lane); }
.arena-mini-grid { display: grid; grid-template-columns: repeat(5,1fr); grid-template-rows: repeat(5,1fr); gap: 2px; flex: none; width: clamp(36px,7vw,58px); aspect-ratio: 1; }
.arena-mini-grid i { display: grid; place-items: center; min-width: 0; min-height: 0; border-radius: 1.5px; background: #31294e; border: 1px solid #bcb1f43b; }
.arena-mini-grid i.solid { background: var(--lane); border-color: var(--lane-light); }
.arena-mini-grid i.star { background: #ffe49c; border-color: #fff0c4; }
.arena-mini-grid i.star::after { content: ""; width: 44%; aspect-ratio: 1; background: #6e4676; transform: rotate(45deg); }
.arena-stage-info { flex: 1; padding: 7px 8px 3px; }
.arena-stage-info h3 { margin: 0 0 4px; font-size: clamp(15px,2vw,20px); color: #342649; }
.dialog-content .arena-stage-info p { margin: 0; font-size: 11px; line-height: 1.48; }
.arena-stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 5px 8px 8px; }
.arena-stage-footer span { color: #62517a; font-size: 10px; font-weight: 800; }
.arena-stage-footer button { flex: none; min-width: 47px; min-height: 44px; padding: 5px 8px; font-size: 12px; }
#dialog[data-kind="explore-picker"] { width: min(94vw,760px,calc(100% - var(--phone-left,0px) - var(--phone-right,0px))); }
.explore-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.explore-card { min-width: 0; padding: 8px; border-radius: 10px; border: 1px solid #705a8f63; background: #f7f2e8; }
.explore-card-art { height: 64px; display: flex; justify-content: space-between; align-items: flex-end; padding: 8px; border-radius: 7px; background: linear-gradient(120deg,#264357,#597e89); color: #beffe5; }
.explore-festival .explore-card-art { background: linear-gradient(120deg,#3c346c,#9d6885); color: #fff0bf; }
.explore-rescue .explore-card-art { background: linear-gradient(125deg,#234156,#4c8b78); color: #ffdf99; }
.explore-glide .explore-card-art { background: linear-gradient(125deg,#244a65,#549692); color: #d6fff5; }
.explore-card-art .glyph { width: 33px; height: 33px; }
.explore-card-art > span:last-child { font-size: 11px; font-weight: 850; }
.explore-card h3 { margin: 6px 0 3px; }
.explore-card p { font-size: 11px; line-height: 1.45; }
.explore-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.explore-actions button { min-height: 44px; padding: 6px 8px; font-size: 11px; }

@media (orientation: landscape) and (max-height: 500px) and (min-aspect-ratio: 2/1) {
  .festival-ticket { flex-basis: 48px; min-height: 34px; }
  .festival-ticket .glyph { width: 25px; height: 25px; }
  .hero-play [data-icon="spark"] { width: 24px; height: 24px; }
  .hero-actions .hero-practice { font-size: 11px; }
  .hero-actions { gap: 5px; }
  #app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) .race-top { grid-template-columns: minmax(90px,1fr) auto auto auto; }
  #app[data-play="rescue"] .race-place { justify-self: start; }
  #app[data-play="glide"] .race-place { justify-self: start; }
  .festival-overlay { left: var(--phone-left); top: calc(var(--top) + 51px); width: min(40vw, 310px); }
  .festival-card { padding: 5px 8px; border-radius: 8px; }
  #festival-task { font-size: 12px; }
  #festival-hint { font-size: 11px; }
  .festival-prompt { bottom: calc(var(--bottom) + 19px); max-width: min(48vw, 290px); }
  #app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) #race-callout { bottom: calc(var(--bottom) + 58px); }
  .signature-art { height: 80px; }
  #app[data-play="arena"] .race-top { grid-template-columns: minmax(92px,1fr) minmax(65px,1.3fr) auto auto; }
  #app[data-play="arena"] .race-place { justify-self: start; }
  .arena-round { position: static; width: auto; transform: none; padding-top: 4px; }
  .arena-coach { left: var(--phone-left); top: calc(var(--top) + 49px); padding: 5px 8px; }
  .arena-coach strong { font-size: 12px; }
  .arena-coach span { font-size: 10px; }
  .arena-diagram { min-height: 72px; }
  .arena-mini-grid { width: 46px; }
  .arena-stage-footer { padding-block: 4px 7px; }
  .ball-coach { top: calc(var(--top) + 51px); left: var(--phone-left); }
  .ball-score { min-height: 44px; }
  #dialog[data-kind="ball-guide"] .dialog-content { padding-block: 12px 15px; }
  .ball-match-intro { margin-bottom: 6px; }
  .ball-lineup { min-height: 49px; }
  #app[data-play="ball"] #ball-radar { right: var(--phone-right); top: calc(var(--top) + 51px); }
}
@media (max-width: 560px) {
  .festival-guide { grid-template-columns: 1fr; }
  .festival-guide canvas { max-height: 170px; object-fit: cover; object-position: center; }
  .signature-races { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .explore-actions { flex-direction: column; }
}
@media (orientation: portrait) and (max-width: 480px) {
  .hero-actions { gap: 5px; }
  .hero-actions .hero-practice { padding-inline: 5px; font-size: 11px; }
  .festival-overlay { left: 50%; transform: translateX(-50%); top: calc(var(--top) + 52px); width: min(86vw, 370px); align-items: center; }
  .festival-prompt { bottom: calc(var(--bottom) + 107px); }
  #app:is([data-play="festival"],[data-play="workshop"],[data-play="rescue"],[data-play="glide"],[data-play="tide"]) #race-callout { bottom: calc(var(--bottom) + 151px); }
  .explore-grid, .rescue-chart-layout { grid-template-columns: minmax(0,1fr); }
  .rescue-guide-head { flex-wrap: wrap; }
  .explore-card { display: grid; grid-template-columns: 82px minmax(0,1fr); column-gap: 8px; }
  .explore-card-art { grid-row: span 3; height: 100%; min-height: 76px; flex-direction: column; align-items: start; }
  .explore-actions { flex-flow: row wrap; }
  .arena-round { top: 49px; }
  .arena-coach { left: 50%; transform: translateX(-50%); top: calc(var(--top) + 78px); width: max-content; max-width: min(82vw,330px); align-items: center; text-align: center; }
  .arena-score { gap: 5px; }
  .arena-stage-grid { grid-template-columns: minmax(0,1fr); }
  .arena-stage { display: grid; grid-template-columns: 108px minmax(0,1fr); }
  .arena-diagram { grid-row: span 2; border-bottom: 0; border-right: 2px solid var(--lane); gap: 3px; }
  .arena-diagram > [data-icon] .glyph { width: 12px; }
  .arena-mini-grid { width: 34px; gap: 1px; }
  .arena-stage-info { padding-top: 7px; }
  .ball-side { min-width: 53px; gap: 3px; padding-inline: 4px; }
  .ball-side b { font-size: 18px; }
  .ball-time { min-width: 45px; padding-inline: 3px; }
  #ball-clock { font-size: 16px; }
  #ball-rival { max-width: 34px; overflow: hidden; text-overflow: ellipsis; }
  #app[data-play="ball"] .race-place { max-width: 100%; }
  .ball-coach { left: var(--phone-left); max-width: 72vw; top: calc(var(--top) + 52px); }
  #app[data-play="ball"] #ball-radar { right: auto; top: auto; left: 50%; bottom: calc(var(--bottom) + 112px); transform: translateX(-50%); }
  .ball-match-intro { grid-template-columns: 1fr; gap: 6px; }
  .ball-lineup { min-height: 46px; }
  .ball-tier-actions { align-items: end; }
}
