html, body { width: 100%; height: 100%; padding: 0; margin: 0; background: #fff }

/* Desktop: centered canvas window. */
#unity-container { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) }

/* Mobile: fill the whole viewport, suppress browser gestures/selection. */
body.unity-mobile {
  position: fixed;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body.unity-mobile #unity-container {
  position: fixed;
  left: 0; top: 0;
  transform: none;
  width: 100%;
  height: 100%;
}

#unity-canvas { background: #fff; display: block }
.unity-mobile #unity-canvas { width: 100%; height: 100%; touch-action: none }

#unity-loading-bar { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; pointer-events: none }
/* Hidden until index.html has fully decoded the logo, so it fades in whole
   instead of painting top-to-bottom while the PNG is still downloading. */
#unity-logo { width: 150px; height: 38px; background: url('jahez-logo-dark.02f1999a3a8533b1.webp') no-repeat center; background-size: contain; opacity: 0; transition: opacity .2s ease }
#unity-logo.ready { opacity: 1 }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 20px; box-sizing: border-box; border: 2px solid #ed0000; border-radius: 9px; overflow: hidden }
#unity-progress-bar-full { width: 0%; height: 100%; background: #ed0000 }

#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.9e8b3bdb67c2446d.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.21221581673a54b8.png') no-repeat center }
/* Player-facing notices (YallaNotice in index.html): a blocking card over a dimmed
   game, or a short toast at the top. Sized for a ~360px-tall landscape phone. */
#yalla-notice { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif; -webkit-user-select: none; user-select: none }
#yalla-notice:empty { display: none }
.yn-scrim {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: rgba(17, 17, 17, 0);
  transition: background-color .2s ease;
  touch-action: none;
}
.yn-scrim.in { background: rgba(17, 17, 17, .6) }
.yn-card {
  width: 100%; max-width: 340px; max-height: 100%; overflow-y: auto; box-sizing: border-box;
  padding: 20px 22px 14px; border-radius: 20px;
  background: #fff; color: #1f1f1f; text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(8px) scale(.96);
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.2);
}
.yn-scrim.in .yn-card { opacity: 1; transform: none }
.yn-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fdecec; color: #c40000 }
.yn-icon-offline { background: #fdf3e3; color: #a35a00 }
.yn-icon svg { width: 24px; height: 24px }
.yn-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700 }
.yn-body { margin: 6px 0 16px; font-size: 14px; line-height: 1.45; color: #5c5c5c }
.yn-button {
  display: block; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: #ed0000; color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .1s ease, background-color .15s ease;
}
.yn-button:active { transform: scale(.97); background: #c40000 }
.yn-button:focus-visible { outline: 3px solid rgba(237, 0, 0, .35); outline-offset: 2px }
.yn-hint { margin: 0; padding: 10px 0; font-size: 14px; color: #1f1f1f; font-weight: 600 }
.yn-code { margin: 10px 0 0; font-size: 11px; color: #9a9a9a; letter-spacing: .04em }
.yn-toast {
  position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); z-index: 40;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px); box-sizing: border-box;
  padding: 6px; padding-inline-start: 12px; border-radius: 999px;
  background: #fff; color: #1f1f1f; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  font-size: 13px; line-height: 1.3;
  opacity: 0; transform: translate(-50%, -8px);
  transition: opacity .2s ease, transform .2s ease;
}
.yn-toast.in { opacity: 1; transform: translate(-50%, 0) }
.yn-toast:not(:has(.yn-toast-button)) { padding-inline-end: 14px }
.yn-toast-icon { display: flex; color: #a35a00 }
.yn-toast-icon svg { width: 18px; height: 18px }
.yn-toast-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.yn-toast-button {
  flex: none; min-height: 30px; padding: 4px 12px; border: 1px solid #f3c2c2; border-radius: 999px;
  background: #fff; color: #c40000; font: inherit; font-weight: 700; cursor: pointer;
}
/* Body-level layers sit above #unity-container; while a card is up, get them out
   of its way (the transparent swipe layer would otherwise swallow the button tap). */
body.yn-open #intro-overlay.show, body.yn-open #ios-swipe-hint { display: none }

/* Portrait intro overlay: two full-screen tutorial slides shown on mobile in
   portrait. The artwork includes bleed on the left, right, and top around the
   original 1290x2796 design area. Rendering the 3231px source height at
   3231 / 2796 = 115.56% and anchoring it bottom-center keeps the content at its
   previous scale while cropping only that bleed. */
#intro-overlay { display: none }
body.unity-mobile #intro-overlay.show {
  display: block;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #000;
  touch-action: none;
}
.intro-slide {
  position: absolute;
  inset: 0;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: auto 115.56%;
  opacity: 0;
  transition: opacity .25s ease;
}
.intro-slide.active { opacity: 1 }
.intro-slide[data-step="1"] { background-image: url('intro_1.3d302c8e60dbd69b.webp'); background-color: #1a0808 }
.intro-slide[data-step="2"] { background-image: url('intro_2.c775d5059c696d7b.webp'); background-color: #1a0808 }

/* iOS Safari (not a Home-Screen web app): iPhone has no element Fullscreen API, but
   Safari collapses its toolbar when the document scrolls. In landscape the page is
   made a little taller than the viewport so that scroll can happen; the game
   container stays position:fixed, so scrolling never moves the canvas. Portrait is
   untouched (the intro overlay owns it). Toggled from index.html via .ios-tb. */
@media (orientation: landscape) {
  html.ios-tb { overflow-y: auto; overscroll-behavior-y: none }
  body.unity-mobile.ios-tb { position: static; overflow: visible; height: auto; min-height: calc(100% + 200px) }
}
/* Transparent "swipe up" layer shown only while the toolbar is still detected in
   landscape: a real swipe on it scrolls the document and Safari hides the bar. */
#ios-swipe-hint { position: fixed; inset: 0; z-index: 30; display: none; touch-action: pan-y; background: transparent }
#ios-swipe-hint.show { display: block }
#ios-swipe-hint .pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,.7); color: #fff; font: 600 14px/1.2 -apple-system, "Segoe UI", Arial, sans-serif; white-space: nowrap; pointer-events: none }
