/* MACAU POCKET GP v0.8.0 — gameplay depth UI: perfect-start message, drift meter, combo chip, daily challenge card, style breakdown, 甩尾 touch button, weather twists. */

/* ---- perfect start / jump start message (under the big countdown) ---- */
#launchMsg{position:absolute;left:50%;top:63%;transform:translate(-50%,0);padding:8px 22px;border-radius:30px;font-size:26px;font-weight:950;font-style:italic;letter-spacing:1px;white-space:nowrap;pointer-events:none;opacity:0;background:var(--ink,#172c39);border:2px solid #ffffff55;will-change:transform,opacity}
#launchMsg.show{animation:launchPop 1.5s cubic-bezier(.2,1.4,.35,1) forwards}
#launchMsg.perfect{color:#7ee38c;border-color:#7ee38c;text-shadow:0 0 14px #7ee38c88}
#launchMsg.early{color:#ff8a7a;border-color:#ff8a7a;text-shadow:0 0 14px #ff5a4f88}
#launchMsg.late{color:#c9d6dc;font-size:18px}
@keyframes launchPop{0%{opacity:0;transform:translate(-50%,14px) scale(.7)}14%{opacity:1;transform:translate(-50%,0) scale(1.12)}26%{transform:translate(-50%,0) scale(1)}80%{opacity:1}100%{opacity:0;transform:translate(-50%,-8px) scale(1)}}
#app.reduce-motion #launchMsg.show{animation:cardFade 1.5s linear forwards}
@media(prefers-reduced-motion:reduce){#launchMsg.show{animation:cardFade 1.5s linear forwards}}
@media(max-height:550px) and (orientation:landscape){#launchMsg{top:66%;font-size:20px;padding:5px 16px}}

/* ---- drift meter (in the speed panel, same style as the slipstream bar) ---- */
#driftBox{margin-top:9px}
#driftBox .boost-label{margin:0 0 4px}
#driftBox .boost-label span:last-child{color:#d7e4ea;font-weight:800}
#driftBox[data-level="1"] .boost-label span:last-child{color:#5ec8ff}
#driftBox[data-level="2"] .boost-label span:last-child{color:#ffa53d}
#driftBox[data-level="3"] .boost-label span:last-child{color:#c77dff}
.drift-track{position:relative;height:8px;background:#172c3988;border-radius:5px;overflow:hidden}
.drift-track i{position:absolute;left:0;top:0;bottom:0;width:0;background:#d7e4ea;transition:width .06s,background .12s;box-shadow:0 0 10px currentColor}
.drift-track b{position:absolute;top:0;bottom:0;width:2px;background:#ffffffaa}
.drift-track .t1{left:15%}.drift-track .t2{left:40%}.drift-track .t3{left:80%}   /* = DRIFT.levels / DRIFT.maxCharge */
#driftBox[data-level="3"] .drift-track i{animation:slipPulse .3s ease-in-out infinite alternate}
#app.reduce-motion #driftBox[data-level="3"] .drift-track i{animation:none}   /* M8: no flashing bar with reduced motion (the colour + the star count still say level 3) */
@media(prefers-reduced-motion:reduce){#driftBox[data-level="3"] .drift-track i{animation:none}}
@media(max-width:600px) and (orientation:portrait){#driftBox{margin-top:6px}}

/* ---- combo chip (flows under the corner hint on the left) ---- */
.combo-chip{position:relative;margin-top:8px;width:max-content;min-width:104px;max-width:170px;padding:6px 12px 7px;border-radius:14px;background:#172c39dd;border:1.5px solid #ffd15c66;box-shadow:0 3px 0 #0c202a33;pointer-events:none;text-shadow:none}
.combo-chip.hidden{display:none}
.combo-chip .cc-top{display:flex;align-items:baseline;gap:10px}
#location .combo-chip #comboMult{font-size:22px;font-style:italic;font-weight:950;color:#ffd15c;line-height:1}
#location .combo-chip #comboScore{font-size:15px;font-weight:800;color:#fff;font-variant-numeric:tabular-nums;margin-left:auto}
.combo-chip .cc-bar{display:block;height:4px;margin-top:5px;background:#ffffff22;border-radius:3px;overflow:hidden}
.combo-chip .cc-bar u{display:block;height:100%;width:0;background:#ffd15c;transition:width .1s linear;text-decoration:none}
.combo-chip[data-mult="3"] #comboMult{color:#ffb347}.combo-chip[data-mult="4"] #comboMult{color:#ff8a65}.combo-chip[data-mult="5"] #comboMult{color:#ff6bd6;text-shadow:0 0 10px #ff6bd688}
.combo-chip.decay{opacity:.72}.combo-chip.decay .cc-bar u{background:#ff8a7a}
.combo-pop{position:absolute;left:0;top:100%;margin-top:4px;font-size:13px;font-weight:900;color:#ffe08a;white-space:nowrap;opacity:0;pointer-events:none;text-shadow:0 2px 6px #0d2533}
.combo-pop.pop{animation:comboPop 1.3s ease-out forwards}
@keyframes comboPop{0%{opacity:0;transform:translateY(-6px) scale(.8)}12%{opacity:1;transform:translateY(0) scale(1.08)}70%{opacity:1}100%{opacity:0;transform:translateY(8px)}}
#app.reduce-motion .combo-pop.pop{animation:cardFade 1.3s linear forwards}
@media(prefers-reduced-motion:reduce){.combo-pop.pop{animation:cardFade 1.3s linear forwards}}
@media(max-height:550px) and (orientation:landscape){.combo-chip{margin-top:5px;padding:4px 10px 5px;min-width:92px}#location .combo-chip #comboMult{font-size:18px}#location .combo-chip #comboScore{font-size:13px}.combo-pop{font-size:11px}}
@media(max-width:600px) and (orientation:portrait){.combo-chip{margin-top:6px;min-width:92px}}

/* ---- touch: 甩尾 button. DOM order is 剎車 | 甩尾 | 油門 | ⚡. With the (default) auto throttle the 油門 button does nothing and is hidden, so 甩尾 takes ITS place: 剎車 and ⚡ stay exactly where
   they were in v0.7 (the brake is the one you must never mis-tap), 甩尾 gets the width of the hidden 油門. Manual throttle shows all four, a bit smaller on phones (every button >= 48 px). ---- */
#touchControls .drive-btn.drift{width:62px;height:70px;background:#6a4fb8bb;color:#fff;font-size:13px;letter-spacing:1px}
#touchControls.auto .drive-btn.gas{display:none}
#touchControls.auto .drive-btn.drift{width:72px;height:84px}
#touchControls .drive-btn.drift.active{background:#c77dff;color:#172c39}
@media(max-width:600px) and (orientation:portrait){
  #touchControls .drive-btn.drift{width:58px;height:66px}
  #touchControls.auto .drive-btn.drift{width:62px;height:84px}
  #touchControls:not(.auto) .steer-controls .drive-btn{width:54px}
  #touchControls:not(.auto) .pedal-controls .drive-btn.brake{width:48px}
  #touchControls:not(.auto) .pedal-controls .drive-btn.drift{width:52px}
  #touchControls:not(.auto) .pedal-controls .drive-btn.gas{width:54px}
  #touchControls:not(.auto) .pedal-controls .drive-btn.turbo{width:52px}
  #touchControls:not(.auto) .steer-controls,#touchControls:not(.auto) .pedal-controls{gap:5px}
}
@media(max-height:550px) and (orientation:landscape){
  #touchControls .drive-btn.drift{width:62px;height:62px}
  #touchControls.auto .drive-btn.drift{width:68px;height:80px}
  #speedPanel{right:calc(max(14px,env(safe-area-inset-right)) + 262px)}
  #app.manual-throttle #speedPanel{right:calc(max(14px,env(safe-area-inset-right)) + 262px + 72px)}   /* manual throttle: the 油門 button is back, the speed panel moves one button further left */
}

/* ---- daily challenge card (menu) ---- */
.daily-card{margin:0 0 14px;padding:11px 14px 12px;border-radius:16px;background:linear-gradient(135deg,#2a2150dd,#173a4ddd);border:1.5px solid #c9b0ff77;box-shadow:0 4px 0 #0c202a33}
.daily-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.daily-head .eyebrow{margin:0;color:#d8c7ff}
.daily-head small{font-size:11px;color:#b9c9d0;font-weight:700}
.daily-line{margin:7px 0 2px;font-size:16px;font-weight:900;line-height:1.3;color:#fff}
.daily-desc{margin:0 0 7px;font-size:12px;line-height:1.5;color:#cfdde3}
.daily-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px;font-size:12px}
.daily-best{color:#bfeaff;font-weight:800}
.daily-badge{padding:3px 9px;border-radius:20px;background:#ffd15c22;border:1px solid #ffd15c88;color:#ffe8a8;font-weight:800;font-size:11px;white-space:nowrap}
.daily-badge.done{background:#7ee38c22;border-color:#7ee38c88;color:#a6f0b0}
.menu-card .daily-btn{margin-top:0;background:#c77dff2a;border-color:#c9b0ffaa;color:#f0e6ff}
.menu-card .daily-btn:hover{background:#c77dff44}
@media(max-width:600px) and (orientation:portrait){#menu #dailyCard{order:5;margin:0 0 12px}}
@media(max-height:800px) and (orientation:landscape){.daily-card{margin:0 0 9px;padding:8px 12px 9px}.daily-desc{display:none}.daily-line{margin:4px 0 5px;font-size:14px}.daily-foot{margin-bottom:6px}.menu-card .daily-btn{padding:8px 16px;margin-top:0}}

/* ---- results: style breakdown + daily result ---- */
.style-box{margin:10px 0 6px;padding:10px 14px 8px;border-radius:14px;background:#0d253388;border:1px solid #ffd15c55;text-align:left}
.style-box.hidden{display:none}
.style-head{display:flex;align-items:baseline;justify-content:space-between}
.style-head b{font-size:13px;letter-spacing:1px;color:#ffe8a8}
.style-head #styleScore{font-size:24px;font-weight:950;font-style:italic;color:#ffd15c;font-variant-numeric:tabular-nums}
.style-note{margin:2px 0 6px;font-size:10px;color:#a4c3cc}
.style-rows{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:3px 16px;font-size:12px}
.style-rows li{display:flex;justify-content:space-between;gap:8px;color:#e4eef1}
.style-rows li b{color:#fff;font-variant-numeric:tabular-nums}
.daily-result{margin:6px 0;padding:8px 12px;border-radius:12px;background:#c77dff22;border:1px solid #c9b0ff77;font-size:12px;line-height:1.5;color:#efe6ff}
.daily-result.hidden{display:none}
@media(max-height:550px) and (orientation:landscape){.style-box{padding:6px 12px 5px;margin:6px 0 4px}.style-head #styleScore{font-size:18px}.style-note{display:none}.style-rows{font-size:11px;gap:2px 14px}.daily-result{font-size:11px;padding:5px 10px}}

/* ---- daily weather twists (visual only; the physics twists are in skills.js). #twistFx sits right above the 3D canvas, below every HUD element ---- */
#twistFx{position:absolute;inset:0;pointer-events:none;display:none}
#app.twist-rain #twistFx,#app.twist-night #twistFx,#app.twist-fog #twistFx{display:block}
#app.twist-rain #twistFx{background:repeating-linear-gradient(104deg,#ffffff00 0 14px,#d8ecf855 14px 15px,#ffffff00 15px 38px);background-size:240px 240px;animation:rainFall .45s linear infinite;opacity:.55}
@keyframes rainFall{to{background-position:-60px 240px}}
#app.twist-night #twistFx{background:radial-gradient(ellipse at 50% 55%,#0a122600 35%,#0a1226aa 100%)}
#app.twist-fog #twistFx{background:linear-gradient(180deg,#e6ecefa0 0,#e6ecef55 45%,#e6ecef00 70%)}
#app.reduce-motion.twist-rain #twistFx{animation:none}
@media(prefers-reduced-motion:reduce){#app.twist-rain #twistFx{animation:none}}

/* ===== v0.9.0 handling modes (操控手感) ========================================================================= */
.handling-note.lab{color:#ffd15c}
/* mode row: 2x2 cards, name + one line */
.opt-mode{align-items:flex-start}.mode-seg{display:grid;grid-template-columns:1fr 1fr;gap:6px;flex:1}
.mode-seg button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;text-align:left;min-height:46px;padding:6px 10px}
.mode-seg button b{font-size:15px;font-weight:900;line-height:1.1}.mode-seg button small{font-size:11px;font-weight:600;line-height:1.25;opacity:.85}
/* first-run picker 「你係邊類玩家？」 */
#modePicker{z-index:45;align-items:center;justify-content:center;background:linear-gradient(110deg,#0d2533f4,#0d2533cc)}
#modePicker .mp-card:focus{outline:none}#modePicker .mp-card{width:min(460px,100%);max-height:100%;overflow:auto;padding:18px 18px 14px;border:1px solid #ffffff22;border-radius:20px;background:#172c39f6;box-shadow:0 15px 70px #06162299;pointer-events:auto}
#modePicker h2{margin:4px 0 6px;font-size:26px;font-weight:950;letter-spacing:1px}
#modePicker .mp-sub{margin:0 0 12px;font-size:13px;line-height:1.55;color:var(--muted)}
#modePicker .mp-answers{display:grid;gap:8px}
#modePicker .mp-ans{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:56px;padding:9px 14px;border-radius:14px;border:1px solid #ffffff30;background:#ffffff12;color:#fff;text-align:left;cursor:pointer;transition:background .15s,transform .15s}
#modePicker .mp-ans:hover,#modePicker .mp-ans:focus-visible{background:#ffffff26;outline:2px solid var(--yellow);outline-offset:1px}
#modePicker .mp-ans b{font-size:17px;font-weight:900}#modePicker .mp-ans small{font-size:12px;color:#cfe0e6;font-weight:600}
#modePicker .mp-badge{display:none;position:absolute;right:10px;top:9px;font-style:normal;font-size:11px;font-weight:900;padding:2px 8px;border-radius:999px;background:var(--yellow);color:var(--ink)}
#modePicker.returning .rec .mp-badge:not(.cur){display:inline-block}#modePicker.returning .cur .mp-badge.cur{display:inline-block;background:#ffffff26;color:#fff}
#modePicker.returning .mp-ans.cur{border-color:var(--yellow)}
#modePicker #mpSkip{display:block;margin:10px auto 0;min-height:44px;color:#fff;font-weight:800}
@media(max-height:460px){#modePicker{padding:8px 4vw}#modePicker .mp-card{padding:10px 14px 8px}#modePicker h2{font-size:20px;margin:0 0 2px}#modePicker .mp-sub{font-size:11px;margin-bottom:6px}#modePicker .mp-answers{grid-template-columns:1fr 1fr;gap:6px}#modePicker .mp-ans{min-height:44px;padding:5px 10px}#modePicker .mp-ans b{font-size:14px}#modePicker .mp-ans small{font-size:10px}#modePicker #mpSkip{margin-top:4px;min-height:36px}}
/* leaderboard mode tabs */
.lb-modes button{padding:6px 4px}
.grip-chip{display:inline-block;align-self:flex-start;width:fit-content;margin:0 6px 0 0;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:900;letter-spacing:.02em;background:#ffcf4a;color:#2a2108;box-shadow:0 2px 0 #9a7616;vertical-align:middle;animation:gripPulse .5s ease-in-out infinite alternate}
.grip-chip[data-m="under"]{background:#ff7a59;color:#2c0c05;box-shadow:0 2px 0 #9b3418}
.grip-chip[data-m="over"]{background:#b98cff;color:#1b0b33;box-shadow:0 2px 0 #5d3a9b}
.grip-chip[data-m="line"]{background:#5fe0a0;color:#06301c;box-shadow:0 2px 0 #1f8a57}
.grip-chip.hidden{display:none}
@keyframes gripPulse{from{transform:translateY(0)}to{transform:translateY(-1px)}}
@media(prefers-reduced-motion:reduce){.grip-chip{animation:none}}
