/* 4 Princes — 4p-mobile-v1: the game pages fit the phone screen like an app. Used by every game page (Blastile,
   Crown Peaks, 3 Islands, the contest boards); behaviour in 4p-fit.js, which sets html.fp-fit on a phone-sized
   screen (under 900 px wide, or a touch screen under 600 px tall) and keeps --fp-vh at the VISIBLE height (the
   browser toolbars excluded; it follows them as they show and hide). Nothing here applies on a desktop.
     * The page is exactly one screen tall: no page scrolling, no pull-to-refresh, no bounce.
     * The header is compact (crown icon, coins, the game's own sound / help buttons, the menu) and not sticky.
     * The board area takes the height that is left; 4p-fit.js sizes the board to the smaller of its width and
       height, so the board, the score and the whole tray / stock are always on screen.
     * No text selection, no long-press callout, no double-tap zoom. */
html.fp-fit,html.fp-fit body{overscroll-behavior:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;touch-action:manipulation;
  -webkit-text-size-adjust:100%;text-size-adjust:100%}
html.fp-fit{height:100%;overflow:hidden}
html.fp-fit body{height:100vh;height:100dvh;height:var(--fp-vh,100dvh);min-height:0;overflow:hidden;display:flex;flex-direction:column;
  padding:env(safe-area-inset-top,0) env(safe-area-inset-right,0) env(safe-area-inset-bottom,0) env(safe-area-inset-left,0)}
html.fp-fit input,html.fp-fit textarea,html.fp-fit .invite{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
html.fp-fit body>header.fpn{flex:none}
html.fp-fit body>.fpn-foot,html.fp-fit body>footer.fpf{display:none}

/* the compact header */
html.fp-fit .fpn.fpn-gamepage .fpn-bar{height:46px;padding:0 10px;gap:8px}
html.fp-fit .fpn.fpn-gamepage .fpn-brand b{display:none}
html.fp-fit .fpn.fpn-gamepage .fpn-brand svg{width:32px;height:32px}
html.fp-fit .fpn.fpn-gamepage .fpn-right{gap:6px}
html.fp-fit .fpn.fpn-gamepage .fpn-burger{width:38px;height:38px}
html.fp-fit .fpn.fpn-gamepage .fpn-coins{height:34px;font-size:14px}
html.fp-fit .fpn.fpn-gamepage .fpn-mob{max-height:calc(var(--fp-vh,100dvh) - 46px - env(safe-area-inset-top,0px))}
.fp-dock{display:flex;align-items:center;gap:4px}
.fp-dock>button{width:38px !important;height:38px !important;min-height:0 !important;padding:0 !important;margin:0 !important;flex:none;
  display:flex !important;align-items:center;justify-content:center;border-radius:10px !important;border:1px solid rgba(255,255,255,.16) !important;
  background:rgba(14,18,28,.5) !important;color:#E6EAF2 !important;font:800 18px/1 Outfit,system-ui,sans-serif !important;cursor:pointer}
.fp-dock>button svg{width:21px !important;height:21px !important}

/* the game column: the board area takes the height that is left */
html.fp-fit body>.app{flex:1 1 auto;min-height:0;width:100%;margin:0 auto;padding:6px 12px 8px;gap:8px;overflow:hidden}
html.fp-fit .app>*{flex:none}
html.fp-fit .app>.top:empty,html.fp-fit .app>.top.fp-emptied{display:none}
html.fp-fit .app>.stage,html.fp-fit .app>.fp-area{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center}
html.fp-fit .app>.stage>.board{width:var(--fp-side,100%);height:var(--fp-side,auto);max-width:100%;max-height:100%;flex:none}   /* frame, lines, cells: blastile-board.js */
html.fp-fit .scorebox .title{font-size:12px}
html.fp-fit .scorebox .score{font-size:40px;line-height:1}
html.fp-fit .scorebox .combo{top:6px}
html.fp-fit .fp-corner{position:absolute;left:0;top:4px;display:flex;align-items:center;gap:8px}
html.fp-fit .tray{height:clamp(84px,calc(var(--fp-vh,100dvh) * .15),118px)}
html.fp-fit .app>.hint{display:none}
html.fp-fit .app>.msg:empty{min-height:0}
/* Crown Peaks: the table in the height that is left (crown-peaks.js sizes the cards to it) */
html.fp-fit body.cp .scorebox .score{font-size:36px}
html.fp-fit body.cp .streak{font-size:14px;margin-top:0}
html.fp-fit body.cp .subtitle{font-size:11px}
html.fp-fit body.cp .controls .btn{min-height:40px;padding:8px 16px}
html.fp-fit body.cp .app>.msg{min-height:18px;font-size:13px}
/* 3 Islands: the canvas and its touch controls in the visible screen */
html.fp-fit #c{height:var(--fp-vh,100dvh)}
html.fp-fit #hud,html.fp-fit #touch{bottom:auto;height:var(--fp-vh,100dvh)}
html.fp-fit #stick{bottom:calc(18px + env(safe-area-inset-bottom,0px));left:calc(18px + env(safe-area-inset-left,0px))}
html.fp-fit #tb{bottom:calc(14px + env(safe-area-inset-bottom,0px));right:calc(14px + env(safe-area-inset-right,0px))}
/* 3 Islands start menu: the three fighters on one row, so "Play vs CPU" is on screen without scrolling */
html.fp-fit #menu{overflow-y:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom,0px)}
html.fp-fit #menu .mt{padding-top:6px}
html.fp-fit #menu .mt h1{font-size:32px}
html.fp-fit #menu .mb{padding:0 12px 10px;gap:8px}
html.fp-fit #pick{flex-wrap:nowrap;gap:6px;width:100%;max-width:560px}
html.fp-fit #pick .cc{flex:1 1 0;min-width:0;width:auto;padding:6px 4px;text-align:center}
html.fp-fit #pick .cc .t{flex-direction:column;gap:2px;justify-content:center}
html.fp-fit #pick .cc .t span{font-size:22px}
html.fp-fit #pick .cc b{font-size:16px}
html.fp-fit #pick .cc small,html.fp-fit #pick .cc p{display:none}
@media (max-height:760px){html.fp-fit #menu .mt .s{display:none}}
@media (max-height:480px){html.fp-fit #menu .mt h1{font-size:24px}html.fp-fit #menu .lbl2{display:none}}

/* landscape on a phone: Blastile and Crown Peaks ask politely to turn the phone upright */
.fp-turn{position:fixed;inset:0;z-index:500;display:none;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px;
  background:#141a26;color:#F2F4F8;font:600 18px/1.35 Outfit,system-ui,sans-serif;text-align:center}
.fp-turn svg{width:64px;height:64px;color:#F3D58E;animation:fpturn 2.4s ease-in-out infinite}
.fp-turn small{display:block;color:#A9B2C5;font-size:14px;font-weight:500;margin-top:4px}
@keyframes fpturn{0%,30%{transform:rotate(-90deg)}60%,100%{transform:rotate(0)}}
html.fp-landscape .fp-turn{display:flex}

/* "Play full-screen": a small hint after the second finished game (never in the installed app) */
.fp-a2hs{position:fixed;left:50%;bottom:calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:450;width:calc(100% - 24px);max-width:420px;
  display:flex;gap:12px;align-items:flex-start;padding:12px 8px 12px 12px;border-radius:16px;background:#232b3b;border:1px solid rgba(226,176,74,.55);
  box-shadow:0 18px 44px rgba(0,0,0,.55);color:#F2F4F8;font:500 14px/1.4 Outfit,system-ui,sans-serif;text-align:left;animation:fpup .3s ease-out}
.fp-a2hs img{width:40px;height:40px;border-radius:10px;flex:none}
.fp-a2hs b{display:block;font-size:15px;font-weight:800;color:#F3D58E;margin-bottom:2px}
.fp-a2hs p{margin:2px 0 0;color:#CBD3E2;font-size:13px}
.fp-a2hs p.fp-mine{color:#F2F4F8}
.fp-a2hs p b{display:inline;font-size:inherit;font-weight:700;color:#F2F4F8;margin:0}
.fp-a2hs .fp-inst{margin-top:8px;font:800 14px Outfit,system-ui,sans-serif;border:0;border-radius:10px;padding:8px 14px;background:#E2B04A;color:#1b2130;cursor:pointer}
.fp-a2hs .fp-x{flex:none;width:36px;height:36px;margin:-6px 0 0 auto;border:0;border-radius:9px;background:none;color:#A9B2C5;font-size:24px;line-height:1;cursor:pointer}
.fp-a2hs .fp-x:hover{background:rgba(255,255,255,.08);color:#fff}
@keyframes fpup{from{transform:translate(-50%,20px);opacity:0}}
@media (prefers-reduced-motion:reduce){.fp-turn svg,.fp-a2hs{animation:none}}

/* 4p-ui-v7: every result screen — "×" in the top-right corner and "All games" under "Play again" (4p-fit.js), the same in all games */
.fp-overx{position:absolute;right:10px;top:10px;z-index:5;width:38px;height:38px;padding:0;border-radius:50%;border:1px solid rgba(255,255,255,.22);
  background:rgba(14,18,28,.55);color:#E6EAF2;cursor:pointer;display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent}
.fp-overx svg{width:18px;height:18px}
.fp-overx:hover{background:rgba(255,255,255,.12);color:#fff;border-color:rgba(243,213,142,.6)}
.fp-overx:focus-visible,.fp-allgames:focus-visible{outline:2px solid #F3D58E;outline-offset:2px}
.fp-allgames{display:block;width:max-content;margin:12px auto 2px;padding:6px 10px;border-radius:8px;color:#F3D58E !important;font:700 15px/1.3 Outfit,system-ui,sans-serif;
  text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.fp-allgames:hover{background:rgba(243,213,142,.1)}
/* the "Play full-screen" hint inside a result card (4p-ui-v7): in the flow, under everything, never over a button */
.fp-a2hs.fp-a2hs-in{position:static;left:auto;bottom:auto;transform:none;width:auto;max-width:none;margin:16px 0 0;box-shadow:none;animation:none}
