/* ===========================================================
   Michael's German Casino — app shell
   Shared chrome: bottom nav, sheets, install prompt, mobile fit.
   Everything is namespaced .mgc-* so it never collides with
   the individual game stylesheets.
   =========================================================== */

:root{
  --mgc-gold:#d4af37;
  --mgc-gold-hi:#f3d675;
  --mgc-gold-dk:#8a6a1a;
  --mgc-cream:#f5eeda;
  --mgc-ink:#0c0b09;
  --mgc-ink-2:#14150f;
  --mgc-nav-h:62px;
  --mgc-safe-b:env(safe-area-inset-bottom, 0px);
  --mgc-nav-total:calc(var(--mgc-nav-h) + var(--mgc-safe-b));
  --mgc-ease:cubic-bezier(.2,.9,.3,1);
}

/* ---------- native-app feel ---------- */
html.mgc-shell{
  -webkit-text-size-adjust:100%;
  overscroll-behavior-y:none;          /* kill rubber-band / pull-to-refresh */
}
html.mgc-shell body{
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior-y:none;
  touch-action:manipulation;           /* removes the 300ms double-tap delay */
}
/* Let text inputs and any opted-in region stay selectable */
.mgc-selectable, .mgc-selectable *{-webkit-user-select:text; user-select:text;}

/* Make room for the fixed nav.
   Games run `height:100vh; overflow:hidden` on desktop and switch to
   `height:auto; min-height:100svh; overflow-y:auto` under 830px, so we
   handle both shapes. */
/* +18px so the raised centre disc never sits on top of a game control */
html.mgc-shell body{padding-bottom:calc(var(--mgc-nav-total) + 18px);}
@media (min-width:831px){
  html.mgc-shell body[data-mgc-fixed="1"]{
    height:calc(100dvh - var(--mgc-nav-total));
    padding-bottom:0;
  }
}

/* ---- game headers ----
   The game pages set their own !important sizes; at narrow widths the
   wordmark wrapped onto two lines and shoved the subtitle out of the bar. */
@media (max-width:520px){
  /* the wordmark may shrink; the balance readout must never be pushed
     off the right edge */
  html.mgc-shell header > .brand{min-width:0; flex:1 1 auto; overflow:hidden;}
  html.mgc-shell header > .balance-box{flex:0 0 auto;}
  html.mgc-shell header .brand .t{min-width:0; overflow:hidden;}
  html.mgc-shell header .brand .t h1,
  html.mgc-shell .brand h1{
    font-size:13px !important; letter-spacing:.6px !important;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  html.mgc-shell header .brand .t .sub,
  html.mgc-shell header .brand .sub{
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
}
@media (max-width:359px){
  html.mgc-shell header .brand .t h1,
  html.mgc-shell .brand h1{font-size:11.5px !important;}
  html.mgc-shell header .brand img{height:30px !important;}
}

/* ===========================================================
   BOTTOM NAV
   =========================================================== */
.mgc-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:400;
  height:var(--mgc-nav-total);
  padding-bottom:var(--mgc-safe-b);
  display:grid; grid-template-columns:repeat(5,1fr); align-items:stretch;
  background:linear-gradient(180deg, rgba(20,21,15,.94) 0%, rgba(8,7,5,.985) 100%);
  -webkit-backdrop-filter:blur(18px) saturate(1.3);
  backdrop-filter:blur(18px) saturate(1.3);
  box-shadow:0 -10px 30px rgba(0,0,0,.6);
  font-family:Georgia,'Times New Roman',serif;
}
/* gold hairline with a warm bloom in the centre */
.mgc-nav::before{
  content:''; position:absolute; left:0; right:0; top:0; height:1px;
  background:linear-gradient(90deg,
    transparent 0%, rgba(212,175,55,.35) 18%,
    rgba(243,214,117,.85) 50%,
    rgba(212,175,55,.35) 82%, transparent 100%);
}

/* On a wide screen a full-bleed tab bar looks stranded — float it as a
   centred dock instead so it reads as a deliberate control, not a
   stretched phone component. */
@media (min-width:900px){
  .mgc-nav{
    left:50%; transform:translateX(-50%);
    right:auto; bottom:18px; width:min(560px, calc(100vw - 40px));
    height:var(--mgc-nav-h); padding-bottom:0;
    border:1px solid rgba(212,175,55,.28);
    border-radius:18px; overflow:visible;
    box-shadow:0 16px 44px rgba(0,0,0,.7), 0 0 30px rgba(212,175,55,.1);
  }
  .mgc-nav::before{left:14px; right:14px; border-radius:0 0 3px 3px;}
  html.mgc-shell body{padding-bottom:calc(var(--mgc-nav-h) + 34px);}
  html.mgc-shell body[data-mgc-fixed="1"]{
    height:calc(100dvh - var(--mgc-nav-h) - 34px);
    padding-bottom:0;
  }
  .mgc-install{bottom:calc(var(--mgc-nav-h) + 34px);}
}

.mgc-nav__item{
  position:relative; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:4px;
  background:none; border:0; padding:0; margin:0;
  color:#877e63;
  text-decoration:none; cursor:pointer;
  font:inherit; font-size:9.5px; letter-spacing:1.6px; text-transform:uppercase;
  transition:color .2s var(--mgc-ease), transform .12s var(--mgc-ease);
  -webkit-tap-highlight-color:transparent;
}
.mgc-nav__item svg{width:21px; height:21px; display:block; transition:transform .22s var(--mgc-ease);}
.mgc-nav__item:active{transform:scale(.9);}
.mgc-nav__item:hover{color:#b8a86e;}

.mgc-nav__item.is-active{color:var(--mgc-gold-hi);}
.mgc-nav__item.is-active svg{
  filter:drop-shadow(0 0 8px rgba(243,214,117,.55));
  transform:translateY(-1px);
}
/* active indicator pip riding the top hairline */
.mgc-nav__item.is-active::after{
  content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:26px; height:2px; border-radius:0 0 3px 3px;
  background:linear-gradient(90deg, transparent, var(--mgc-gold-hi), transparent);
  box-shadow:0 0 10px rgba(243,214,117,.8);
}
.mgc-nav__item:focus-visible{outline:2px solid var(--mgc-gold-hi); outline-offset:-3px; border-radius:8px;}

/* count bubble (favourites / recent) */
.mgc-nav__pip{
  position:absolute; top:7px; left:calc(50% + 9px);
  min-width:15px; height:15px; padding:0 4px; border-radius:8px;
  background:linear-gradient(180deg,#f3d675,#c9962b);
  color:#241a04; font-size:9px; font-weight:bold; letter-spacing:0;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 6px rgba(0,0,0,.6);
}

/* ---------- centre elevated action ---------- */
.mgc-nav__fab{
  position:relative; display:flex; flex-direction:column;
  align-items:center; justify-content:flex-end; gap:0;
  background:none; border:0; padding:0; cursor:pointer;
  font:inherit; font-size:9.5px; letter-spacing:1.6px; text-transform:uppercase;
  color:var(--mgc-gold-hi); text-decoration:none;
  /* aligns the label with the other items' labels:
     item box is centred (icon 21 + gap 4 + label ~11 = 36 in a 62 track) */
  padding-bottom:calc((var(--mgc-nav-h) - 36px) / 2);
  -webkit-tap-highlight-color:transparent;
}
.mgc-nav__fab .mgc-fab__disc{
  position:absolute; top:-24px; left:50%; transform:translateX(-50%);
  width:56px; height:56px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(circle at 50% 26%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 52%),
    linear-gradient(180deg,#f8e08b 0%, #e3b84e 34%, #c9962b 66%, #97711c 100%);
  border:1px solid #6e5312;
  box-shadow:
    0 8px 20px rgba(0,0,0,.7),
    0 0 26px rgba(212,175,55,.42),
    inset 0 1px 0 rgba(255,255,255,.6);
  transition:transform .18s var(--mgc-ease), box-shadow .18s;
}
.mgc-nav__fab .mgc-fab__disc svg{width:27px; height:27px; color:#241a04;}
.mgc-nav__fab:active .mgc-fab__disc{transform:translateX(-50%) scale(.92);}
.mgc-nav__fab:hover .mgc-fab__disc{
  box-shadow:0 10px 26px rgba(0,0,0,.75), 0 0 36px rgba(212,175,55,.6), inset 0 1px 0 rgba(255,255,255,.6);
}
/* slow halo so the centre action reads as the primary target */
.mgc-nav__fab .mgc-fab__disc::after{
  content:''; position:absolute; inset:-7px; border-radius:50%;
  border:1px solid rgba(212,175,55,.3);
  animation:mgcHalo 2.8s ease-in-out infinite;
}
@keyframes mgcHalo{
  0%,100%{transform:scale(1); opacity:.55;}
  50%{transform:scale(1.09); opacity:.12;}
}
@media (prefers-reduced-motion:reduce){
  .mgc-nav__fab .mgc-fab__disc::after{animation:none;}
}

/* ===========================================================
   BOTTOM SHEET
   =========================================================== */
.mgc-scrim{
  position:fixed; inset:0; z-index:500;
  background:rgba(3,3,2,.72);
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
  opacity:0; pointer-events:none; transition:opacity .28s var(--mgc-ease);
}
.mgc-scrim.is-open{opacity:1; pointer-events:auto;}

.mgc-sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:510;
  max-height:82dvh; display:flex; flex-direction:column;
  background:linear-gradient(180deg,#191a12 0%, #0b0c08 62%);
  border-top:1px solid var(--mgc-gold-dk);
  border-radius:20px 20px 0 0;
  box-shadow:0 -20px 60px rgba(0,0,0,.8);
  padding-bottom:var(--mgc-safe-b);
  transform:translateY(102%);
  transition:transform .34s var(--mgc-ease);
  font-family:Georgia,'Times New Roman',serif;
  color:var(--mgc-cream);
}
.mgc-sheet.is-open{transform:translateY(0);}
.mgc-sheet__grip{
  width:42px; height:4px; border-radius:3px; margin:10px auto 2px;
  background:rgba(212,175,55,.4); flex:0 0 auto;
}
.mgc-sheet__title{
  margin:6px 0 2px; text-align:center; flex:0 0 auto;
  font-size:17px; letter-spacing:3px; font-variant:small-caps;
  color:var(--mgc-gold-hi);
}
.mgc-sheet__sub{
  text-align:center; font-size:11px; letter-spacing:2.4px; text-transform:uppercase;
  color:#8a8265; margin-bottom:12px; flex:0 0 auto;
}
.mgc-sheet__body{overflow-y:auto; -webkit-overflow-scrolling:touch; padding:0 16px 18px; flex:1 1 auto;}

/* rows used by the More sheet */
.mgc-row{
  display:flex; align-items:center; gap:14px; width:100%;
  padding:14px 14px; margin-bottom:9px;
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  border:1px solid rgba(212,175,55,.2); border-radius:13px;
  color:var(--mgc-cream); text-decoration:none; text-align:left;
  font:inherit; font-size:14.5px; cursor:pointer;
  transition:border-color .18s, background .18s, transform .12s var(--mgc-ease);
}
.mgc-row:hover{border-color:rgba(212,175,55,.5); background:rgba(212,175,55,.09);}
.mgc-row:active{transform:scale(.985);}
.mgc-row svg{width:20px; height:20px; color:var(--mgc-gold); flex:0 0 auto;}
.mgc-row__t{flex:1 1 auto;}
.mgc-row__t small{display:block; font-size:11.5px; color:#948c70; margin-top:2px; letter-spacing:.3px;}
.mgc-row__chev{width:15px !important; height:15px !important; color:#6f684f !important;}

/* game switcher list inside a sheet */
.mgc-switch{display:grid; grid-template-columns:repeat(2,1fr); gap:10px;}
@media (min-width:560px){.mgc-switch{grid-template-columns:repeat(3,1fr);}}
.mgc-switch__item{
  position:relative; display:block; text-decoration:none; color:var(--mgc-cream);
  border:1px solid rgba(212,175,55,.24); border-radius:13px; overflow:hidden;
  background:#0a0b08; transition:border-color .18s, transform .12s var(--mgc-ease);
}
.mgc-switch__item:active{transform:scale(.97);}
.mgc-switch__item.is-current{border-color:var(--mgc-gold-hi); box-shadow:0 0 18px rgba(212,175,55,.3);}
.mgc-switch__item img{display:block; width:100%; aspect-ratio:16/10; object-fit:cover;}
.mgc-switch__cap{
  padding:8px 10px 10px;
  background:linear-gradient(180deg, rgba(10,11,8,.4), #0a0b08);
}
.mgc-switch__cap b{display:block; font-size:13.5px; font-variant:small-caps; letter-spacing:1.2px; color:var(--mgc-gold-hi); font-weight:normal;}
.mgc-switch__cap span{display:block; font-size:10.5px; color:#948c70; margin-top:1px;}
.mgc-switch__now{
  position:absolute; top:7px; right:7px; z-index:2;
  font-size:8.5px; letter-spacing:1.4px; text-transform:uppercase; font-weight:bold;
  color:#241a04; background:linear-gradient(180deg,#f3d675,#c9962b);
  padding:3px 7px; border-radius:9px;
}

/* empty state inside sheets */
.mgc-empty{
  text-align:center; padding:26px 18px 34px; color:#8a8265; font-size:13.5px; line-height:1.75;
}
.mgc-empty svg{width:36px; height:36px; color:rgba(212,175,55,.35); margin-bottom:10px;}

/* ===========================================================
   INSTALL PROMPT
   =========================================================== */
.mgc-install{
  position:fixed; left:10px; right:10px; z-index:520;
  bottom:calc(var(--mgc-nav-total) + 10px);
  display:flex; align-items:center; gap:13px;
  padding:13px 14px;
  background:linear-gradient(180deg,#1d1d14 0%, #0c0d08 100%);
  border:1px solid var(--mgc-gold-dk); border-radius:16px;
  box-shadow:0 16px 44px rgba(0,0,0,.75), 0 0 30px rgba(212,175,55,.14);
  font-family:Georgia,'Times New Roman',serif; color:var(--mgc-cream);
  transform:translateY(calc(100% + var(--mgc-nav-total) + 20px));
  opacity:0; pointer-events:none;
  transition:transform .45s var(--mgc-ease), opacity .35s;
}
.mgc-install.is-open{transform:translateY(0); opacity:1; pointer-events:auto;}
@media (min-width:600px){
  .mgc-install{left:auto; right:16px; width:390px;}
}
.mgc-install__icon{
  width:46px; height:46px; border-radius:11px; flex:0 0 auto;
  background:#000; border:1px solid rgba(212,175,55,.4);
  object-fit:cover;
  box-shadow:0 3px 10px rgba(0,0,0,.6);
}
.mgc-install__t{flex:1 1 auto; min-width:0;}
.mgc-install__t b{
  display:block; font-size:14.5px; font-weight:normal;
  font-variant:small-caps; letter-spacing:1.6px; color:var(--mgc-gold-hi);
}
.mgc-install__t span{display:block; font-size:11.5px; color:#a29a7c; line-height:1.5; margin-top:1px;}
.mgc-install__go{
  flex:0 0 auto; border:1px solid #6e5312; border-radius:10px; cursor:pointer;
  padding:10px 15px; font:inherit; font-size:12px; font-weight:bold;
  letter-spacing:1.6px; text-transform:uppercase; color:#241a04;
  background:linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 46%),
             linear-gradient(180deg,#f8e08b 0%, #e3b84e 36%, #c9962b 66%, #97711c 100%);
  box-shadow:0 4px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.55);
  transition:filter .15s, transform .12s var(--mgc-ease);
}
.mgc-install__go:active{transform:scale(.94);}
.mgc-install__go:hover{filter:brightness(1.08);}
.mgc-install__x{
  position:absolute; top:-9px; right:-6px;
  width:26px; height:26px; border-radius:50%; cursor:pointer;
  background:#1d1d14; border:1px solid var(--mgc-gold-dk); color:#a29a7c;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; line-height:1; padding:0;
  box-shadow:0 3px 9px rgba(0,0,0,.6);
}
.mgc-install__x:hover{color:var(--mgc-cream);}

/* iOS "Add to Home Screen" walkthrough inside a sheet */
.mgc-ios{padding:2px 4px 10px;}
.mgc-ios__step{
  display:flex; align-items:flex-start; gap:13px; padding:12px 4px;
  border-bottom:1px solid rgba(212,175,55,.14); font-size:14px; line-height:1.6;
}
.mgc-ios__step:last-child{border-bottom:0;}
.mgc-ios__n{
  flex:0 0 auto; width:25px; height:25px; border-radius:50%;
  background:linear-gradient(180deg,#f3d675,#c9962b); color:#241a04;
  font-size:12.5px; font-weight:bold; display:flex; align-items:center; justify-content:center;
}
.mgc-ios__step svg{width:18px; height:18px; color:var(--mgc-gold-hi); vertical-align:-3px; margin:0 2px;}

/* ===========================================================
   Small-screen tightening for the nav
   =========================================================== */
@media (max-width:359px){
  :root{--mgc-nav-h:57px;}
  .mgc-nav__item{font-size:8.5px; letter-spacing:1px;}
  .mgc-nav__item svg{width:19px; height:19px;}
  .mgc-nav__fab .mgc-fab__disc{width:50px; height:50px; top:-21px;}
  .mgc-nav__fab{font-size:8.5px; letter-spacing:1px;}
}
/* Landscape phones: vertical space is scarce — go slim and icon-forward */
@media (max-height:460px) and (orientation:landscape){
  :root{--mgc-nav-h:46px;}
  .mgc-nav__item{font-size:0; gap:0;}
  .mgc-nav__item svg{width:20px; height:20px;}
  .mgc-nav__fab{font-size:0; padding-bottom:0;}
  .mgc-nav__fab .mgc-fab__disc{width:44px; height:44px; top:-14px;}
  .mgc-nav__fab .mgc-fab__disc svg{width:22px; height:22px;}
  .mgc-nav__pip{top:3px;}
}
