/* UI 017.2.1 — Hero Menu Polish + Safari Swipe Lock
   Additive presentation layer over stable 017.1.
   Does not change Home geometry, dock placement, navigation or game state. */

html.i172-menu-open,
body.i172-menu-open{
  overscroll-behavior:none;
}

body.i13-home-open .i13-menu-sheet{
  background:
    radial-gradient(ellipse at 50% 74%,rgba(93,39,132,.17),transparent 44%),
    rgba(1,2,7,.68)!important;
  -webkit-backdrop-filter:blur(9px) saturate(1.06)!important;
  backdrop-filter:blur(9px) saturate(1.06)!important;
  overscroll-behavior:none;
  touch-action:none;
}

body.i13-home-open .i13-menu-card{
  position:relative;
  overflow:hidden;
  width:min(calc(100% - 8px),430px)!important;
  padding:10px 11px 12px!important;
  border:1px solid rgba(224,171,78,.72)!important;
  border-radius:3px!important;
  background:
    linear-gradient(180deg,rgba(255,231,176,.035),transparent 13%),
    radial-gradient(ellipse at 50% -8%,rgba(142,64,193,.22),transparent 51%),
    linear-gradient(180deg,rgba(18,15,29,.995),rgba(4,5,12,.998) 82%)!important;
  box-shadow:
    0 24px 72px rgba(0,0,0,.82),
    0 0 0 1px rgba(69,35,13,.72),
    inset 0 1px rgba(255,236,190,.08),
    inset 0 -30px 50px rgba(0,0,0,.26),
    inset 0 0 38px rgba(113,54,158,.08)!important;
  transform-origin:50% 100%;
  animation:i172-sheet-in .28s cubic-bezier(.18,.78,.24,1) both;
  overscroll-behavior:none;
}

body.i13-home-open .i13-menu-card::before{
  content:"";
  position:absolute;
  inset:5px;
  z-index:0;
  pointer-events:none;
  opacity:.68;
  background:
    linear-gradient(#f0c974,#f0c974) left top/32px 1px no-repeat,
    linear-gradient(#f0c974,#f0c974) left top/1px 20px no-repeat,
    linear-gradient(#f0c974,#f0c974) right top/32px 1px no-repeat,
    linear-gradient(#f0c974,#f0c974) right top/1px 20px no-repeat,
    linear-gradient(#8e6427,#8e6427) left bottom/25px 1px no-repeat,
    linear-gradient(#8e6427,#8e6427) right bottom/25px 1px no-repeat;
}

body.i13-home-open .i172-menu-handle{
  position:relative;
  z-index:3;
  width:48px;
  height:13px;
  margin:-2px auto 2px;
  display:grid;
  place-items:center;
  touch-action:none!important;
  -webkit-user-select:none;
  user-select:none;
}
body.i13-home-open .i172-menu-handle::before{
  content:"";
  width:31px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(198,147,62,.12),#d9af61,rgba(198,147,62,.12));
  box-shadow:0 0 7px rgba(219,161,70,.13);
}

body.i13-home-open .i13-menu-head{
  position:relative;
  z-index:2;
  min-height:51px;
  padding:2px 3px 9px!important;
  border-bottom:1px solid rgba(205,151,61,.3)!important;
  touch-action:none!important;
  -webkit-user-select:none;
  user-select:none;
}
body.i13-home-open .i13-menu-head::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(238,190,94,.42),transparent);
}
body.i13-home-open .i172-menu-title-wrap{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
}
body.i13-home-open .i13-menu-head b{
  color:#ffe5bb!important;
  font:700 19px/1 Georgia,"Times New Roman",serif!important;
  letter-spacing:.015em;
  text-shadow:0 2px 9px #000,0 0 14px rgba(220,155,82,.1);
}
body.i13-home-open .i172-menu-kicker{
  color:#9f8a73;
  font:700 7.5px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:.2em;
  text-transform:uppercase;
}

body.i13-home-open .i13-menu-close{
  position:relative;
  z-index:3;
  width:36px!important;
  height:36px!important;
  flex:0 0 36px;
  border-color:rgba(211,158,69,.48)!important;
  color:#e3c795!important;
  background:
    radial-gradient(circle at 50% 30%,rgba(126,65,160,.18),transparent 60%),
    #080810!important;
  box-shadow:inset 0 0 12px rgba(126,62,171,.08),0 3px 12px rgba(0,0,0,.35);
  transition:transform .14s ease,filter .14s ease,border-color .14s ease;
  touch-action:manipulation!important;
}
body.i13-home-open .i13-menu-close:active{
  transform:scale(.92);
  filter:brightness(1.18);
  border-color:rgba(235,185,92,.76)!important;
}

body.i13-home-open .i13-menu-grid{
  position:relative;
  z-index:2;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  margin-top:10px!important;
}
body.i13-home-open .i13-menu-grid button{
  position:relative;
  overflow:hidden;
  min-width:0;
  min-height:70px!important;
  padding:9px 9px 8px 48px!important;
  display:flex!important;
  flex-direction:column;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:3px;
  border:1px solid rgba(188,137,55,.32)!important;
  border-radius:2px;
  color:#ead9bf!important;
  background:
    linear-gradient(105deg,rgba(87,42,119,.15),transparent 48%),
    linear-gradient(180deg,rgba(31,25,43,.88),rgba(7,8,16,.97))!important;
  box-shadow:
    inset 0 1px rgba(255,233,183,.045),
    inset 0 -13px 20px rgba(0,0,0,.22),
    0 3px 12px rgba(0,0,0,.2);
  text-align:left!important;
  transition:transform .13s ease,border-color .13s ease,filter .13s ease,box-shadow .13s ease;
  -webkit-tap-highlight-color:transparent;
  touch-action:manipulation!important;
}
body.i13-home-open .i13-menu-grid button::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(110deg,transparent 0 38%,rgba(255,223,156,.045) 49%,transparent 60%);
  transform:translateX(-60%);
  opacity:0;
  transition:transform .24s ease,opacity .2s ease;
}
body.i13-home-open .i13-menu-grid button:active{
  transform:scale(.975);
  filter:brightness(1.13);
  border-color:rgba(225,171,76,.68)!important;
  box-shadow:inset 0 0 18px rgba(139,63,187,.12),0 2px 8px rgba(0,0,0,.26);
}
body.i13-home-open .i13-menu-grid button:active::before{
  transform:translateX(55%);
  opacity:1;
}

body.i13-home-open .i13-menu-grid .i13-icon{
  position:absolute;
  left:14px;
  top:50%;
  width:25px!important;
  height:25px!important;
  margin:0!important;
  transform:translateY(-50%);
  color:#f0c565!important;
  filter:drop-shadow(0 0 6px rgba(226,164,67,.15));
}
body.i13-home-open .i172-menu-label{
  max-width:100%;
  color:#f0dfc8;
  font:600 11px/1.05 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  white-space:nowrap;
}
body.i13-home-open .i172-menu-desc{
  max-width:100%;
  overflow:hidden;
  color:#91877e;
  font:500 7.5px/1.15 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  white-space:nowrap;
  text-overflow:ellipsis;
}
body.i13-home-open .i172-menu-badge{
  position:absolute;
  z-index:4;
  top:6px;
  right:7px;
  min-width:18px;
  height:17px;
  padding:0 5px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(238,190,91,.66);
  border-radius:999px;
  color:#ffe9b7;
  background:linear-gradient(180deg,#642682,#30113f);
  box-shadow:0 0 8px rgba(168,66,210,.28),inset 0 1px rgba(255,255,255,.08);
  font:800 7px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:.025em;
  white-space:nowrap;
}
body.i13-home-open .i172-menu-badge.is-gold{
  color:#251507;
  border-color:#f4d487;
  background:linear-gradient(180deg,#ffe29a,#bc812a);
  box-shadow:0 0 9px rgba(239,181,77,.3),inset 0 1px rgba(255,255,255,.28);
}

body.i13-home-open .i13-menu-card.i172-dragging{
  transition:none!important;
  animation:none!important;
  will-change:transform,opacity;
}

@keyframes i172-sheet-in{
  from{opacity:.2;transform:translateY(18px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

@media(max-width:350px){
  body.i13-home-open .i13-menu-grid{gap:6px!important}
  body.i13-home-open .i13-menu-grid button{
    min-height:66px!important;
    padding-left:43px!important;
    padding-right:6px!important;
  }
  body.i13-home-open .i13-menu-grid .i13-icon{left:11px;width:23px!important;height:23px!important}
  body.i13-home-open .i172-menu-label{font-size:10px}
  body.i13-home-open .i172-menu-desc{font-size:7px}
}

@media(prefers-reduced-motion:reduce){
  body.i13-home-open .i13-menu-card{animation:none!important}
  body.i13-home-open .i13-menu-grid button,
  body.i13-home-open .i13-menu-close{transition:none!important}
}
