/* The main menu (js/menu.js), before the game is built: saves, Multiplayer,
   Settings and Controls. The look is the Sticker Street kit's (css/kit/, --gd-* tokens). */

/* The main menu (js/menu.js): a page of its own, before the game's built:
   the logo, your three saves and Multiplayer, Settings, over the key art.
   (Challenge Mode's lobby, a screen of it, is in css/challenge.css.) */
body.menu #hud, body.menu #touch, body.menu #corner, body.menu #notify, body.menu #worldTip, body.menu #hint, body.menu #flashTip, body.menu #playBetter, body.menu #phoneWrap { display: none !important; }
#menu { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; overflow-y: auto; background: radial-gradient(ellipse 120% 100% at 50% 45%, rgba(10, 4, 14, 0) 40%, rgba(10, 4, 14, .45) 72%, rgba(10, 4, 14, .8) 100%), linear-gradient(180deg, rgba(232, 69, 47, .72) 0%, rgba(201, 50, 31, .55) 45%, rgba(40, 14, 40, .82) 100%), url(../assets/branding/key-art/delivery-car-1920x1080.jpg) 62% center / cover no-repeat, #c9321f; padding: max(14px, env(safe-area-inset-top, 0px)) 16px max(14px, env(safe-area-inset-bottom, 0px)); animation: toastIn .35s ease-out; }
#menu .mIn { width: min(520px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 8px 0; color: var(--gd-ink); font-family: var(--gd-font); }
#menu .mLogo { width: min(300px, 70vw); max-height: 24vh; object-fit: contain; height: auto; filter: drop-shadow(4px 4px 0 var(--gd-ink)); margin-bottom: 4px; }
@media (max-height: 520px) { #menu .mIn { gap: 10px; } #menu .mSlot { padding: 8px 12px; } #menu .mNum { width: 34px; height: 34px; } }
#menu .mSlots { width: 100%; display: flex; flex-direction: column; gap: 12px; }
#menu .mSlotWrap { position: relative; }
/* your saves: white stickers; the one you're on gets a mustard ring */
#menu .mSlot { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: var(--gd-ink); background: #fff; border: var(--gd-line) solid var(--gd-ink); border-radius: var(--gd-r-lg); padding: 10px 12px; box-shadow: 5px 5px 0 var(--gd-ink); cursor: pointer; transition: transform .08s, box-shadow .08s; }
#menu .mSlot:hover, #menu .mSlot.sel { transform: translate(-2px, -2px); box-shadow: 0 0 0 4px var(--gd-mustard), 5px 5px 0 4px var(--gd-ink); }
#menu .mSlot.empty { background: var(--gd-cream); border-style: dashed; box-shadow: none; }
#menu .mSlot.empty:hover, #menu .mSlot.empty.sel { box-shadow: 0 0 0 4px var(--gd-mustard); }
#menu .mSlot.open { flex-direction: column; align-items: stretch; cursor: default; }
#menu .mSlot.open:hover { transform: none; box-shadow: 5px 5px 0 var(--gd-ink); }
#menu .mNum { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font: 700 22px/1 var(--gd-font); color: #fff; background: var(--gd-red); border: var(--gd-line) solid var(--gd-ink); }
#menu .mInfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#menu .mWho { font: 700 16px/1.2 var(--gd-font); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#menu .mInfo small { font: 500 12px/1.35 var(--gd-font); color: var(--gd-mute); }
#menu .mWhen { opacity: .85; }
/* (Career or Free play: a tilted tag) */
#menu .mMode { font: 700 11px/1.4 var(--gd-font); font-style: normal; letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border: 2px solid var(--gd-ink); border-radius: var(--gd-r-xs); box-shadow: 2px 2px 0 var(--gd-ink); transform: rotate(-4deg); color: #fff; }
#menu .mMode.career { background: var(--gd-navy); }
#menu .mMode.free { background: var(--gd-green); color: var(--gd-ink); }
#menu .mGo { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--gd-red); border: var(--gd-line) solid var(--gd-ink); box-shadow: 2px 2px 0 var(--gd-ink); }
#menu .mDel { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: var(--gd-line) solid var(--gd-ink); display: grid; place-items: center; color: var(--gd-ink); background: #fff; box-shadow: 2px 2px 0 var(--gd-ink); cursor: pointer; }
#menu .mDel:hover, #menu .mDel.sel { background: var(--gd-ketchup); color: #fff; }
#menu .mDel.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mModes { display: grid; gap: 10px; margin-top: 8px; }
#menu .mModes.two { grid-template-columns: 1fr 1fr; }
/* the menu's buttons: stickers (white, or a flat color) that press into their shadow */
#menu .mBtn { --c: #fff; --t: var(--gd-ink); font: 700 14px/1.15 var(--gd-font); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; min-height: 46px; padding: 8px 14px; border-radius: var(--gd-r); border: var(--gd-line) solid var(--gd-ink); color: var(--t); background: var(--c); box-shadow: var(--gd-sh) var(--gd-sh) 0 var(--gd-ink); cursor: pointer; transition: transform .06s, box-shadow .06s; }
#menu .mBtn:hover { transform: translate(-1px, -1px); box-shadow: calc(var(--gd-sh) + 1px) calc(var(--gd-sh) + 1px) 0 var(--gd-ink); }
#menu .mBtn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--gd-ink); }
#menu .mBtn.small { min-height: 34px; padding: 5px 12px; font-size: 12px; border-radius: var(--gd-r-sm); box-shadow: var(--gd-sh-sm) var(--gd-sh-sm) 0 var(--gd-ink); }
#menu .mBtn.wide { width: 100%; }
#menu .mBtn.hot { --c: var(--gd-red); --t: #fff; font-size: 16px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .25); }
#menu .mBtn span { display: flex; flex-direction: column; flex: 1; gap: 3px; }
#menu .mBtn span b { font-size: 15px; }
#menu .mBtn span small { font-size: 11.5px; opacity: .85; font-weight: 600; text-transform: none; letter-spacing: 0; }
#menu .mBtn.career { --c: var(--gd-navy); --t: #fff; }
#menu .mBtn.free { --c: var(--gd-green); }
#menu .mBtn.danger { --c: var(--gd-ketchup); --t: #fff; }
#menu .mBtn.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mBtn svg { width: 24px; height: 24px; flex: none; }
#menu .mNote { margin: 4px 0 0; font: 500 13px/1.4 var(--gd-font); color: var(--gd-mute); }
#menu .mNote.big { font-size: 15px; color: var(--gd-ink); display: flex; gap: 10px; align-items: center; }
#menu .mLink { align-self: center; margin-top: 8px; font: 700 13px/1 var(--gd-font); color: var(--gd-ink); background: none; border: 0; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 10px; border-radius: 10px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
#menu .mLink.sel, #menu .mLink:hover { background: var(--gd-cream); }
#menu .mBottom { display: flex; gap: 12px; width: 100%; justify-content: center; margin-top: 6px; }
#menu .mBottom .mBtn { flex: 1; max-width: 220px; }
/* its panels: Settings, Controls, Multiplayer (a white sticker with a back button and its title) */
#menu .mPanel { width: 100%; background: #fff; color: var(--gd-ink); border: var(--gd-line) solid var(--gd-ink); border-radius: var(--gd-r-lg); padding: 14px; box-shadow: 6px 6px 0 var(--gd-ink); display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 40px); overflow-y: auto; box-sizing: border-box; }
#menu .mHead { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; }
#menu .mHead b { font: 700 20px/1 var(--gd-font); text-transform: uppercase; letter-spacing: .03em; }
#menu .mBack { width: 34px; height: 34px; border-radius: 9px; border: var(--gd-line) solid var(--gd-ink); display: grid; place-items: center; background: #fff; color: var(--gd-ink); box-shadow: 2px 2px 0 var(--gd-ink); cursor: pointer; padding: 0; }
#menu .mBack.sel, #menu .mBack:hover { background: var(--gd-cream); }
#menu .mBack.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mList { display: flex; flex-direction: column; }
#menu .mRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; min-height: 48px; border-bottom: 2px dashed rgba(27, 29, 36, .18); font: 700 14px/1.25 var(--gd-font); }
#menu .mRow:last-child { border-bottom: 0; }
#menu .mRow.col { flex-direction: column; align-items: stretch; gap: 8px; }
#menu .mRow small { font-weight: 500; font-size: 11.5px; color: var(--gd-mute); }
#menu .mRow .mBtn.small { --c: #fff; }
#menu .mVol { display: flex; align-items: center; gap: 10px; color: var(--gd-mute); }
#menu .mVol input { flex: 1; accent-color: var(--gd-pink); }
#menu .mVol input.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; border-radius: 6px; }
/* segmented choices: the one that's on is a mustard sticker */
#menu .mSeg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: #fff; border: var(--gd-line) solid var(--gd-ink); padding: 3px; border-radius: var(--gd-r); box-shadow: var(--gd-sh-sm) var(--gd-sh-sm) 0 var(--gd-ink); }
#menu .mSeg button { font: 700 12px/1.1 var(--gd-font); text-transform: uppercase; letter-spacing: .02em; border: 2px solid transparent; border-radius: 8px; padding: 7px 5px; background: none; color: var(--gd-mute); cursor: pointer; }
#menu .mSeg button.on { background: var(--gd-mustard); color: var(--gd-ink); border-color: var(--gd-ink); }
#menu .mSeg button.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mToggle { flex: none; width: 52px; height: 30px; border-radius: 15px; border: var(--gd-line) solid var(--gd-ink); background: #e8dcbf; position: relative; cursor: pointer; padding: 0; }
#menu .mToggle i { position: absolute; top: 50%; left: 2px; width: 21px; height: 21px; margin-top: -10.5px; border-radius: 50%; background: #fff; border: 2px solid var(--gd-ink); transition: left .15s; }
#menu .mToggle.on { background: var(--gd-green); }
#menu .mToggle.on i { left: calc(100% - 23px); }
#menu .mToggle.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mHelp { font-size: 14px; }
#menu .mHelp .help h4 { margin: 12px 0 6px; }
#menu .mHelp .hk { display: flex; align-items: center; gap: 5px; padding: 6px 0; flex-wrap: wrap; }
#menu .mHelp .hk em { font-style: normal; margin-left: 8px; color: var(--gd-ink); }
#menu .mJoin { display: flex; gap: 8px; }
/* text boxes: white with an ink outline; blue while you type */
#menu .mInput { font: 600 16px/1 var(--gd-font); height: 46px; padding: 0 14px; border-radius: var(--gd-r); border: var(--gd-line) solid var(--gd-ink); background: #fff; color: var(--gd-ink); box-shadow: inset 2px 2px 0 rgba(27, 29, 36, .08); min-width: 0; width: 100%; box-sizing: border-box; }
#menu .mInput.code { flex: 1; font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .35em; text-align: center; }
#menu .mInput:focus, #menu .mInput.sel { outline: none; border-color: var(--gd-blue); box-shadow: 3px 3px 0 var(--gd-blue); }
#menu .mLabel { margin: 6px 0 0; font: 700 12px/1.2 var(--gd-font); letter-spacing: .08em; text-transform: uppercase; color: var(--gd-ink); }
#menu .mSwatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
#menu .mSwatches button { aspect-ratio: 1; border-radius: 50%; border: var(--gd-line) solid var(--gd-ink); box-shadow: 2px 2px 0 var(--gd-ink); cursor: pointer; padding: 0; }
#menu .mSwatches button.on { outline: 3px solid var(--gd-ink); outline-offset: 3px; transform: translate(2px, 2px); box-shadow: none; }
#menu .mSwatches button.sel { outline: 3px dashed var(--gd-blue); outline-offset: 3px; box-shadow: none; }
#menu .mErr { margin: 0; padding: 9px 11px; border: 2px solid var(--gd-ketchup); border-radius: var(--gd-r-sm); background: #ffe9e4; color: var(--gd-ketchup); font: 600 13px/1.3 var(--gd-font); }
/* the fourth card under the saves: Multiplayer (purple) */
#menu .mNum.mp { background: var(--gd-purple); }
#menu .mNum.mp svg { width: 24px; height: 24px; }
#menu .mpCard .mGo { background: var(--gd-purple); }
/* the Multiplayer screen: Join with code on top, then Race it! and Challenge Mode
   side by side, the same size, their Host buttons on one row (a subgrid) */
#menu .mJoinCard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 2px solid var(--gd-ink); border-radius: var(--gd-r-md); background: var(--gd-cream); }
#menu .mJoinCard .mLabel { margin: 0; text-align: center; }
#menu .mJoinCard .mNote, #menu .mJoinCard .mErr { margin: 0; text-align: center; }
#menu .mMpModes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto auto; column-gap: 12px; }
#menu .mCard { grid-row: span 4; display: grid; grid-template-rows: subgrid; row-gap: 8px; padding: 12px; border: var(--gd-line) solid var(--gd-ink); border-radius: var(--gd-r-lg); background: #fff; box-shadow: 5px 5px 0 var(--gd-ink); min-width: 0; }
#menu .mcTitle { display: flex; align-items: center; gap: 10px; font: 700 16px/1.1 var(--gd-font); text-transform: uppercase; }
#menu .mcTitle i { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--gd-red); border: var(--gd-line) solid var(--gd-ink); box-shadow: 2px 2px 0 var(--gd-ink); }
#menu .mCard.chal .mcTitle i { background: var(--gd-purple); }
#menu .mcBlurb { margin: 0; font: 500 12.5px/1.35 var(--gd-font); color: #4a4f5c; }
#menu .mCard .mBtn { min-height: 50px; padding: 8px 10px; text-align: center; font-size: 15px; }
#menu .mCard .mBtn span { align-items: center; }
#menu .mBtn.chal { --c: var(--gd-purple); --t: #fff; }
#menu .mBtn.soon { --c: var(--gd-hatch); background: var(--gd-hatch); color: #8f8570; border-style: dashed; box-shadow: none; cursor: not-allowed; }
#menu .mBtn.soon span b { font-size: 14px; }
#menu .mpNote { text-align: center; }
/* a short landscape phone (812 x 375): the logo, the four cards and Settings fit without scrolling */
@media (max-height: 430px) {
  #menu { padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  #menu .mIn { gap: 8px; padding: 4px 0; }
  #menu .mLogo { max-height: 14vh; }
  #menu .mSlots { gap: 8px; }
  #menu .mSlot { padding: 6px 10px; }
  #menu .mNum { width: 30px; height: 30px; font-size: 17px; }
  #menu .mNum.mp svg { width: 20px; height: 20px; }
  #menu .mGo { width: 30px; height: 30px; }
  #menu .mWhen { display: none; }
  #menu .mcBlurb { display: none; }
  #menu .mpScreen { gap: 8px; }
  #menu .mJoinCard, #menu .mCard { padding: 8px 10px; }
  #menu .mCard .mBtn { min-height: 44px; }
}
