/* FoxHunt3D 4.5.2 — fullscreen 2D bonus games */
.bonus-entry-button { flex: 1 1 220px; }
.start-primary-actions { margin-top: 12px; align-items: stretch; }
.start-primary-actions > button { flex: 1 1 240px; min-height: 44px; }

.bonus-overlay {
  z-index: 46;
  overflow: hidden;
  overscroll-behavior: contain;
}
.bonus-card {
  width: min(1320px, calc(100vw - 20px));
  height: min(844px, calc(100dvh - 20px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    linear-gradient(145deg, rgba(5,18,29,.985), rgba(5,14,23,.965)),
    url("assets/v640/branding/foxhunt3d-launch-screen.webp") center / cover no-repeat;
}
.bonus-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: rgba(3,13,22,.86);
}
.bonus-header h2 { margin: 3px 0 5px; font-size: clamp(27px, 3vw, 40px); }
.bonus-header p { margin: 0; max-width: 900px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.bonus-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  color: white;
  background: rgba(255,255,255,.07);
  font-size: 28px;
  cursor: pointer;
}
.bonus-balance-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.13);
  background: rgba(3,13,22,.72);
}
.bonus-balance-bar span {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bonus-balance-bar strong { display: block; margin-top: 2px; color: var(--gold); font-size: 17px; }

.bonus-hub,
.bonus-game-panel {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.bonus-hub {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  background: rgba(1,9,16,.68);
}
.bonus-game-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 170px auto auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(15,40,57,.86), rgba(5,22,34,.9));
  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}
.bonus-game-card h3 { margin: 3px 0 7px; font-size: 25px; }
.bonus-game-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 12px; }
.bonus-game-card > button { width: 100%; }
.bonus-game-art {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background:
    radial-gradient(circle at 78% 22%, #fff0a3 0 7%, transparent 7.3%),
    linear-gradient(#69c6eb 0 58%, #6aa650 58% 100%);
}
.bonus-game-art::before,
.bonus-game-art::after { content: ""; position: absolute; }
.slingshot-card .bonus-game-art::before {
  right: 15%; bottom: 18%; width: 105px; height: 70px;
  border: 9px solid #945a2f; border-bottom: 0;
}
.mini-sling { position: absolute; left: 16%; bottom: 12%; color: #6c3d25; font: 800 86px/1 sans-serif; transform: scaleX(.6); }
.mini-bird { position: absolute; left: 22%; bottom: 31%; width: 48px; height: 30px; color: transparent; font-size: 0; background: linear-gradient(135deg,#845cff,#438cff 55%,#65e6ff); clip-path: polygon(0 48%, 35% 34%, 18% 0, 58% 28%, 100% 50%, 58% 72%, 18% 100%, 35% 66%); filter: drop-shadow(0 0 8px rgba(101,230,255,.46)); }
.mini-pig { position: absolute; right: 23%; bottom: 17%; width: 48px; height: 30px; border-radius: 48% 58% 45% 48%; background: linear-gradient(145deg,#65e6ff,#3266d5 62%,#222f70); color: transparent; font-size: 0; transform: skewX(-7deg); box-shadow: 0 0 13px rgba(101,230,255,.34); }
.mini-pig::before { content: ""; position: absolute; right: -9px; top: -9px; width: 27px; height: 25px; background: #438cff; clip-path: polygon(0 38%, 14% 0, 38% 28%, 74% 0, 100% 52%, 78% 100%, 18% 92%); }
.mini-pig::after { content: ""; position: absolute; left: -19px; top: 7px; width: 25px; height: 16px; border-radius: 70% 15% 70% 20%; background: #5abfff; transform: rotate(28deg); }
.platform-card .bonus-game-art::before {
  left: 40%; bottom: 28%; width: 42%; height: 16px; background: #9d663a; box-shadow: 0 0 0 4px rgba(80,45,25,.25);
}
.platform-card .bonus-game-art::after {
  right: 13%; bottom: 20%; width: 52px; height: 38px; border-radius: 48% 58% 42% 48%;
  background: linear-gradient(145deg,#65e6ff,#3266d5 65%,#202c69);
  clip-path: polygon(0 30%, 18% 0, 35% 27%, 70% 10%, 100% 40%, 88% 78%, 55% 100%, 12% 84%);
}
.mini-runner { position: absolute; left: 16%; bottom: 18%; color: #28496c; font-size: 78px; }
.mini-coin { position: absolute; left: 60%; bottom: 42%; width: 24px; height: 24px; color: #ffd166; font-size: 45px; line-height: 10px; }
.mini-platform { position: absolute; left: 38%; bottom: 27%; width: 45%; height: 15px; }
.bonus-progress-summary {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(5,19,30,.76);
}
.bonus-progress-summary h3 { margin: 0 0 11px; }
.bonus-progress-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.bonus-progress-card { padding: 10px; border-radius: 10px; background: rgba(255,255,255,.055); }
.bonus-progress-card span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.bonus-progress-card strong { display: block; margin-top: 3px; color: var(--gold); font-size: 19px; }

.bonus-game-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(1,9,16,.82);
}
.bonus-game-panel.hidden { display: none !important; }
.bonus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.13);
  background: rgba(3,13,22,.88);
}
.bonus-toolbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bonus-toolbar-title strong { font-size: 16px; white-space: nowrap; }
.bonus-toolbar-title label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.bonus-toolbar select { min-width: 170px; padding: 7px 9px; }
.bonus-toolbar .button-row { justify-content: flex-end; }
.bonus-toolbar button { padding: 7px 10px; font-size: 10px; }
.bonus-canvas-wrap {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #07131d;
}
.bonus-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: contain;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: #6bc9ec;
}
#slingshotCanvas { cursor: grab; }
#slingshotCanvas.is-dragging { cursor: grabbing; }
.bonus-status {
  min-height: 36px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: var(--muted);
  background: rgba(3,13,22,.9);
  font-size: 10px;
  line-height: 1.45;
}

.platform-touch-controls {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px;
  pointer-events: none;
}
.platform-touch-left,
.platform-touch-right { display: flex; gap: 8px; pointer-events: auto; }
.platform-touch-controls button {
  min-width: 64px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 13px;
  color: white;
  background: rgba(3,14,24,.58);
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 2px 4px black;
  touch-action: none;
}
.platform-touch-left button { width: 72px; font-size: 24px; }
.platform-touch-right button:nth-child(1) { border-color: rgba(104,226,255,.62); }
.platform-touch-right button:nth-child(2) { border-color: rgba(255,209,102,.68); }
.platform-touch-right button:nth-child(3) { border-color: rgba(120,227,107,.62); }
.platform-touch-controls button.is-held { background: rgba(104,226,255,.28); transform: translateY(1px); }

@media (pointer: coarse), (max-width: 760px) {
  .platform-touch-controls { display: flex; }
  .platform-canvas-wrap canvas { padding-bottom: 72px; }
}
@media (max-width: 900px) {
  .bonus-card { width: calc(100vw - 8px); height: calc(100dvh - 8px); max-height: calc(100dvh - 8px); }
  .bonus-overlay { padding: 4px; }
  .bonus-hub { grid-template-columns: 1fr; padding: 10px; }
  .bonus-game-card { grid-template-columns: 135px 1fr; grid-template-rows: auto auto; }
  .bonus-game-art { grid-row: 1 / span 2; min-height: 150px; }
  .bonus-game-card > button { align-self: end; }
  .bonus-progress-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bonus-toolbar { align-items: stretch; flex-direction: column; }
  .bonus-toolbar-title { justify-content: space-between; }
  .bonus-toolbar .button-row { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .bonus-toolbar button { flex: 0 0 auto; }
}
@media (max-width: 590px) {
  .bonus-header { padding: 12px; }
  .bonus-header p { display: none; }
  .bonus-header h2 { font-size: 25px; }
  .bonus-balance-bar { grid-template-columns: 1fr 1fr; padding: 7px 10px; }
  .bonus-game-card { grid-template-columns: 1fr; grid-template-rows: 130px auto auto; }
  .bonus-game-art { grid-row: auto; }
  .bonus-progress-grid { grid-template-columns: 1fr 1fr; }
  .bonus-toolbar-title { align-items: stretch; flex-direction: column; gap: 5px; }
  .bonus-toolbar-title label { justify-content: space-between; }
  .bonus-toolbar select { min-width: 0; flex: 1; }
  .platform-touch-controls { padding: 7px; }
  .platform-touch-controls button { min-width: 55px; min-height: 48px; font-size: 9px; }
  .platform-touch-left button { width: 58px; font-size: 20px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bonus-card { height: calc(100dvh - 6px); max-height: calc(100dvh - 6px); }
  .bonus-overlay { padding: 3px; }
  .bonus-header { padding: 7px 12px 6px; }
  .bonus-header h2 { margin: 1px 0; font-size: 22px; }
  .bonus-header p { display: none; }
  .bonus-close { width: 34px; height: 34px; flex-basis: 34px; font-size: 22px; }
  .bonus-balance-bar { padding: 4px 10px; gap: 5px; }
  .bonus-balance-bar span { padding: 4px 7px; font-size: 7px; }
  .bonus-balance-bar strong { font-size: 13px; }
  .bonus-toolbar { padding: 4px 8px; flex-direction: row; align-items: center; }
  .bonus-toolbar-title { flex-direction: row; }
  .bonus-toolbar button { padding: 5px 8px; }
  .bonus-status { min-height: 26px; padding: 4px 8px; }
  .bonus-canvas-wrap canvas { min-height: 150px; }
  .platform-touch-controls button { min-height: 44px; }
}

/* 4.5.2 — immersive bonus-game view, overlay controls and variable-jump UI */
.bonus-overlay {
  --bonus-control-alpha: .42;
  --bonus-control-scale: 1;
}
.bonus-card { position: relative; }

.bonus-overlay.is-game-active { padding: 0; }
.bonus-card.is-immersive {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: 100dvh;
  border: 0;
  border-radius: 0;
  grid-template-rows: minmax(0, 1fr);
  box-shadow: none;
}
.bonus-card.is-immersive > .bonus-header,
.bonus-card.is-immersive > .bonus-balance-bar { display: none; }
.bonus-card.is-immersive .bonus-game-panel {
  position: relative;
  height: 100%;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.bonus-card.is-immersive .bonus-toolbar {
  z-index: 8;
  background: rgba(3,13,22,.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.bonus-card.is-immersive .bonus-status {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 0;
  padding: 5px 10px max(5px, env(safe-area-inset-bottom));
  border-top-color: rgba(255,255,255,.1);
  background: rgba(3,13,22,.72);
  pointer-events: none;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.bonus-card.is-immersive .bonus-canvas-wrap canvas { min-height: 0; }

.bonus-settings-panel {
  position: absolute;
  z-index: 40;
  top: 74px;
  right: 14px;
  width: min(350px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(5,18,29,.965);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.bonus-card.is-immersive .bonus-settings-panel { top: 56px; }
.bonus-settings-panel.hidden { display: none !important; }
.bonus-settings-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bonus-settings-panel header strong { display: block; margin-top: 3px; font-size: 17px; }
.bonus-settings-panel header button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 22px;
  cursor: pointer;
}
.bonus-settings-panel > label:not(.bonus-setting-toggle) {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}
.bonus-settings-panel label > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.bonus-settings-panel output { color: var(--gold); }
.bonus-setting-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}
.bonus-setting-toggle input { width: 18px; height: 18px; accent-color: var(--cyan); }
.bonus-setting-toggle span { margin: 0 !important; text-transform: none !important; letter-spacing: 0 !important; }
.bonus-settings-panel p { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Controls are genuine overlays: no reserved strip is cut from the canvas. */
.platform-canvas-wrap canvas { padding-bottom: 0 !important; }
.platform-touch-controls {
  z-index: 6;
  padding: 12px max(12px, env(safe-area-inset-right)) max(40px, calc(env(safe-area-inset-bottom) + 36px)) max(12px, env(safe-area-inset-left));
}
.platform-touch-left,
.platform-touch-right {
  will-change: transform;
}
.platform-touch-left {
  transform: scale(var(--bonus-control-scale));
  transform-origin: left bottom;
}
.platform-touch-right {
  transform: scale(var(--bonus-control-scale));
  transform-origin: right bottom;
}
.platform-touch-controls button {
  border-color: rgba(255,255,255,.34);
  background: rgba(3,14,24,var(--bonus-control-alpha));
  box-shadow: 0 6px 22px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.045);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.platform-touch-controls button.is-held {
  background: rgba(104,226,255,calc(var(--bonus-control-alpha) + .18));
  box-shadow: 0 0 0 2px rgba(104,226,255,.22), 0 7px 24px rgba(0,0,0,.22);
}
.platform-touch-right button[data-platform-action="jump"] { border-color: rgba(104,226,255,.72); }
.platform-touch-right button[data-platform-action="shoot"] { border-color: rgba(255,209,102,.72); }
.platform-touch-right button[data-platform-hold="crouch"] { border-color: rgba(120,227,107,.68); }

@media (max-width: 900px) {
  .bonus-card.is-immersive { width: 100vw; height: 100dvh; max-height: 100dvh; }
  .bonus-overlay.is-game-active { padding: 0; }
}
@media (max-width: 590px) {
  .bonus-settings-panel { top: 52px; right: 7px; width: min(340px, calc(100vw - 14px)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bonus-card.is-immersive { height: 100dvh; max-height: 100dvh; }
  .bonus-card.is-immersive .bonus-toolbar { padding: 4px 7px; }
  .bonus-card.is-immersive .bonus-toolbar-title strong { font-size: 14px; }
  .bonus-card.is-immersive .bonus-toolbar select { padding: 5px 7px; }
  .bonus-card.is-immersive .bonus-status { font-size: 8px; }
  .platform-touch-controls {
    padding-top: 7px;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(31px, calc(env(safe-area-inset-bottom) + 28px));
  }
  .platform-touch-controls button { min-height: 42px; }
}

@media (max-width: 590px) {
  .platform-touch-right button {
    width: 54px;
    min-width: 54px;
    padding: 4px 3px;
    font-size: 8px;
    line-height: 1.05;
    white-space: normal;
  }
  .platform-touch-left button {
    width: 54px;
    min-width: 54px;
  }
}

.bonus-game-panel,
.bonus-toolbar,
.bonus-toolbar .button-row,
.bonus-canvas-wrap {
  min-width: 0;
  max-width: 100%;
}
.bonus-card.is-immersive .bonus-game-panel {
  width: 100%;
  scrollbar-gutter: auto;
}
.bonus-card.is-immersive .bonus-canvas-wrap { width: 100%; }
@media (max-width: 900px) {
  .bonus-toolbar,
  .bonus-toolbar-title,
  .bonus-toolbar .button-row { width: 100%; }
}

/* Keep every critical game command visible on narrow screens. */
@media (max-width: 590px) and (orientation: portrait) {
  .bonus-card.is-immersive .bonus-toolbar .button-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }
  .bonus-card.is-immersive .bonus-toolbar .button-row button {
    min-width: 0;
    width: 100%;
    padding: 6px 3px;
    font-size: 8px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bonus-card.is-immersive .bonus-toolbar-title strong { display: none; }
  .bonus-card.is-immersive .bonus-toolbar-title label { gap: 4px; }
  .bonus-card.is-immersive .bonus-toolbar select { min-width: 145px; max-width: 180px; }
  .bonus-card.is-immersive .bonus-toolbar .button-row {
    flex: 1 1 auto;
    justify-content: flex-end;
    overflow: visible;
    gap: 5px;
  }
  .bonus-card.is-immersive .bonus-toolbar .button-row button {
    min-width: 0;
    padding: 5px 7px;
    font-size: 8px;
  }
}
