/* Bracha Arcade - shared styling for game containers, intro screen, and leaderboards. */

:root {
  /* Fun heading font for arcade UI chrome (game titles, section headings). Sarona has no
     unicode-range restriction (see sarona.css) so it'll apply to Hebrew text too if the file
     happens to cover those glyphs - otherwise the browser falls back per-glyph automatically. */
  --bracha-heading-font: 'Sarona', sans-serif;
}

.bracha-game {
  position: relative; /* anchor for the level/ready-set-go overlay (.bracha-announce) */
  /* Bumping this to a bigger fixed px value (720 -> 960) wasn't enough - the real ceiling is
     whatever container the page/theme provides, not a number we pick here. max-width: 100% just
     defers to that container entirely, so the game genuinely fills the page's content width. */
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
  box-sizing: border-box;
}

.bracha-heading-font {
  font-family: var(--bracha-heading-font);
}

/* Breadcrumb (Home > Bracha Arcade > game), shared by every game page and the hub - see
   brachos_games_render_breadcrumb() in includes/games.php. */
.bracha-breadcrumb {
  max-width: 100%;
  margin: 0 auto 8px;
  padding: 0 16px;
  font-size: 13px;
  color: #928d8d;
  text-align: left;
  box-sizing: border-box;
}

.bracha-breadcrumb a {
  color: #928d8d;
  text-decoration: none;
}

.bracha-breadcrumb a:hover {
  color: #f3724b;
  text-decoration: underline;
}

.bracha-breadcrumb-sep {
  margin: 0 6px;
  color: #d9d4d0;
}

.bracha-breadcrumb-current {
  color: #19100c;
  font-weight: 600;
}

/* Game-name heading on the gameplay screen only (BrachaGameIntro.playTitle()) - the intro and
   setup screens show the name themselves. */
.bracha-game-title {
  font-size: 28px;
  font-weight: 700;
  color: #19100c;
  text-align: center;
  margin: 0 0 16px;
}

.bracha-game-intro-instructions {
  max-width: 460px;
  margin: 4px auto 8px;
  color: #6f6b6b;
  font-size: 15px;
  line-height: 1.5;
}

/* Shared base for the "no image" placeholder - see assets/js/game-image.js. Each game's own
   CSS pairs this with its existing image-sizing rule (e.g. ".mm-card-front .bracha-img-placeholder")
   so the placeholder occupies exactly the same space a real <img> would. Uses the site's own
   placeholder photo (assets/images/brachos-placeholder.jpg) rather than a generic icon. */
.bracha-img-placeholder {
  background-image: url('../images/brachos-placeholder.jpg');
  background-size: cover;
  background-position: center;
}

.bracha-game-intro-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}

.bracha-game-intro-title {
  font-family: var(--bracha-heading-font);
  font-size: 32px;
  font-weight: 700;
  color: #19100c;
  margin: 0 0 8px;
}

.bracha-game-coming-soon {
  color: #6f6b6b;
  font-size: 16px;
  margin: 0 0 32px;
}

.bracha-game-intro-start {
  cursor: pointer;
  background-color: #19100c;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 16px;
  transition: background-color 0.2s;
}

.bracha-game-intro-start:hover {
  background-color: #f3724b;
}

.bracha-game-leaderboard {
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  text-align: left;
}

.bracha-game-leaderboard h3 {
  font-family: var(--bracha-heading-font);
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: #19100c;
  text-align: center;
}

.bracha-leaderboard-filter {
  text-align: center;
  color: #f3724b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: -8px 0 12px;
}

.bracha-leaderboard-filter:empty {
  display: none;
}

.bracha-leaderboard-loading,
.bracha-leaderboard-empty {
  text-align: center;
  color: #928d8d;
  font-size: 14px;
  padding: 12px 0;
}

.bracha-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bracha-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
}

.bracha-leaderboard-row:last-child {
  border-bottom: none;
}

.bracha-leaderboard-rank {
  font-weight: 700;
  color: #928d8d;
  width: 24px;
  flex-shrink: 0;
}

.bracha-leaderboard-row .fi {
  border-radius: 2px;
  flex-shrink: 0;
}

.bracha-leaderboard-name {
  flex: 1;
  font-weight: 600;
  color: #19100c;
}

.bracha-leaderboard-score {
  font-weight: 700;
  color: #f3724b;
}

.bracha-country-select {
  width: 100%;
  margin: 8px 0;
}

.bracha-country-select + .ts-wrapper .fi,
.ts-dropdown .fi {
  margin-right: 6px;
  border-radius: 2px;
}

.bracha-country-select + .ts-wrapper {
  text-align: left;
}

/* The country dropdown is attached to <body> (dropdownParent) so SweetAlert2's scrolling
   content box can't clip it - it has to sit above the SweetAlert2 overlay (z-index 1060). */
.ts-dropdown {
  z-index: 2000;
  text-align: left;
}

.bracha-swal-score {
  font-family: var(--bracha-heading-font);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: #f3724b;
  margin: 4px 0;
}

.bracha-swal-score-label {
  color: #d9d4d0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
}

/* "New High Score!" popup (SweetAlert2 customClass hooks) - a dark, game-y card instead of
   SweetAlert2's plain white default, matching the rest of the arcade's palette. */
.bracha-swal-popup {
  background: linear-gradient(160deg, #19100c, #3d2418) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 4px rgba(243, 114, 75, 0.25), 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}

.bracha-swal-title {
  color: #fff !important;
  font-family: var(--bracha-heading-font);
}

.bracha-swal-html {
  color: #d9d4d0 !important;
}

.bracha-swal-input {
  border: 2px solid transparent !important;
}

.bracha-swal-input:focus {
  border-color: #f3724b !important;
  box-shadow: 0 0 0 3px rgba(243, 114, 75, 0.25) !important;
}

.bracha-swal-confirm {
  background-color: #f3724b !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 28px !important;
  box-shadow: none !important;
}

.bracha-swal-confirm:hover {
  background-color: #e2603a !important;
}

@media (max-width: 480px) {
  .bracha-game-intro-icon {
    font-size: 44px;
  }

  .bracha-game-intro-title {
    font-size: 22px;
  }
}

/* Floating check / heart "bubbles" - see BrachaGameFx.bubbles() in game-fx.js. Positioned in
   viewport coordinates so they rise from wherever the answer was. */
.bracha-fx-bubble {
  position: fixed;
  z-index: 3000;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.bracha-fx-bubble--check {
  background: #4caf50;
}

.bracha-fx-bubble--heart {
  background: #ff4d6d;
}

/* Between-level / Ready-Set-Go overlay - see BrachaGameFx.announce() in game-fx.js. */
.bracha-announce {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  border-radius: 12px;
  background: rgba(25, 16, 12, 0.82);
}

.bracha-announce-message {
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.3;
  animation: bracha-pop 0.35s ease;
}

.bracha-announce-level {
  font-size: 44px;
}

.bracha-announce-sub {
  margin-top: 8px;
  font-size: 22px;
  color: #ffb199;
}

.bracha-announce-sub strong {
  color: #fff;
  font-size: 30px;
}

@keyframes bracha-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Countdown/level readouts shared by the timed games */
.is-low {
  color: #d32f2f !important;
}
