/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.logo {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 8vw, 2.8rem);
  color: #F0544F;
  letter-spacing: -0.5px;
  line-height: 1;
}

.mono {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.label {
  font-size: 0.65rem;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.78);
  display: block;
}

small {
  font-size: 0.7rem;
  opacity: 0.6;
  display: block;
  margin-top: 0.2rem;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  padding: 1.1rem 1rem;
  background: var(--screen-bg, #0B2027);
  color: rgba(255,255,255,0.9);
}

.screen.active {
  display: flex;
}

/* Game screen never scrolls — must fit exactly in viewport */
#screen-game {
  height: 100dvh;
  height: 100vh;
  min-height: unset;
  overflow: hidden;
}

/* ============================================================
   LEVEL SELECT SCREEN
   ============================================================ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-score {
  text-align: right;
}

.header-score .mono {
  font-size: 1.5rem;
  color: #1CA694;
}

/* Level indicator in game header */
.game-level-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.8rem;
}

.game-level-info .mono {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.1;
}

/* Level grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.level-card {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.72) 12%,
    rgba(120,200,255,0.9) 34%,
    rgba(55,160,235,0.95) 60%,
    rgba(20,110,200,1) 100%
  );
  box-shadow:
    inset 0 4px 10px rgba(255,255,255,0.85),
    inset 0 -5px 12px rgba(15,70,160,0.4),
    0 6px 18px rgba(30,110,200,0.45),
    0 3px 8px rgba(10,60,150,0.3);
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.level-card:active {
  transform: scale(0.9);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.7),
    inset 0 -4px 10px rgba(15,70,160,0.35),
    0 3px 10px rgba(30,110,200,0.3);
}

.level-card.locked {
  opacity: 0.38;
  cursor: not-allowed;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.6) 0%,
    rgba(200,210,220,0.5) 30%,
    rgba(130,150,170,0.85) 65%,
    rgba(80,100,120,1) 100%
  );
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.5),
    0 3px 10px rgba(0,0,0,0.2);
}

.level-card.completed {
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.68) 12%,
    rgba(80,230,200,0.9) 36%,
    rgba(28,166,148,0.97) 62%,
    rgba(10,110,95,1) 100%
  );
  box-shadow:
    inset 0 4px 10px rgba(255,255,255,0.85),
    inset 0 -5px 12px rgba(5,80,65,0.4),
    0 6px 18px rgba(28,166,148,0.5),
    0 3px 8px rgba(10,100,85,0.35);
}

.level-card.perfect {
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.7) 12%,
    rgba(255,210,100,0.92) 36%,
    rgba(247,164,59,0.97) 62%,
    rgba(200,115,5,1) 100%
  );
  box-shadow:
    inset 0 4px 10px rgba(255,255,255,0.85),
    inset 0 -5px 12px rgba(160,80,0,0.4),
    0 6px 18px rgba(247,164,59,0.5),
    0 3px 8px rgba(180,100,0,0.3);
}

.level-card .level-num {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.5rem;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.level-card .level-name {
  font-size: 0.52rem;
  color: rgba(255,255,255,0.88);
  margin-top: 0.15rem;
  font-weight: 700;
  text-align: center;
  max-width: 75%;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.level-card .level-status {
  font-size: 0.7rem;
  margin-top: 0.1rem;
  min-height: 1rem;
  letter-spacing: -0.05em;
}

/* Infinite mode button */
.infinite-section {
  text-align: center;
  margin-top: 1.2rem;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.btn-infinite {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.05rem;
  padding: 0.85rem 2rem;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1.5px solid rgba(240,84,79,0.5);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 1px rgba(240,84,79,0.2);
  width: 100%;
  line-height: 1.3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-infinite:not(:disabled):active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-infinite:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sound toggle */
.top-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.btn-sound {
  font-size: 0.78rem;
  color: #444;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.btn-howto {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1CA694;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  background: rgba(28,166,148,0.1);
  box-shadow: 0 1px 4px rgba(28,166,148,0.1);
}

.btn-install {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #F0544F 0%, #ff6b6b 100%);
  box-shadow: 0 2px 8px rgba(240,84,79,0.3);
  transition: transform 0.12s ease;
}

.btn-install:active { transform: scale(0.95); }
.btn-install.hidden { display: none; }

/* ============================================================
   GAME SCREEN
   ============================================================ */
.game-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.btn-icon {
  font-size: 1.2rem;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.12);
  color: #fff;
  transition: transform 0.12s ease;
}

.btn-icon:active {
  transform: scale(0.92);
}

.score-group {
  display: flex;
  gap: 0.85rem;
  flex: 1;
  justify-content: flex-end;
}

.score-item {
  text-align: right;
}

.score-item.accent .mono {
  color: #F0544F;
}

.score-item .mono {
  font-size: 1.05rem;
  display: block;
  line-height: 1.1;
}

/* Bomb counter pill in game header */
.bomb-counter .mono {
  color: #F0544F;
}

/* ============================================================
   BOARD
   ============================================================ */
.board {
  display: grid;
  gap: 7px;
  flex: 1;
  min-height: 0;
  align-content: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  overflow: hidden;
}

.tile {
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.07),
    inset 0 1px 0 rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.8rem, 3.5vw, 1.25rem);
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.tile:active {
  transform: scale(0.92);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tile.revealed {
  border-radius: 50%;
  cursor: default;
}

.tile.revealed:active {
  transform: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Hidden tile — solid jelly ball */
.tile.hidden {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.98) 0%,
    rgba(255,255,255,0.75) 12%,
    rgba(120,200,255,0.92) 34%,
    rgba(55,160,235,0.97) 60%,
    rgba(20,110,200,1) 100%
  );
  box-shadow:
    inset 0 5px 12px rgba(255,255,255,0.9),
    inset 0 -6px 14px rgba(15,70,160,0.45),
    0 8px 22px rgba(30,110,200,0.55),
    0 3px 8px rgba(10,60,150,0.35);
  border: none;
}

.tile.hidden:active {
  transform: scale(0.86);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.8),
    inset 0 -4px 10px rgba(15,70,160,0.4),
    0 3px 10px rgba(30,110,200,0.35);
}

/* Score 0 — neutral grey */
.tile.score-0 {
  background: linear-gradient(145deg, #e8e4e1 0%, #dedad7 100%);
  color: #b0aba7;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Score low — mustard/amber */
.tile.score-low {
  background: linear-gradient(145deg, #F7A43B 0%, #f8bc5e 100%);
  color: #fff;
  box-shadow:
    0 3px 10px rgba(247,164,59,0.35),
    inset 0 1px 0 rgba(255,255,255,0.25);
}

/* Score high — turquoise */
.tile.score-high {
  background: linear-gradient(145deg, #1CA694 0%, #22c4af 100%);
  color: #fff;
  box-shadow:
    0 3px 10px rgba(28,166,148,0.35),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Spot (bomb) revealed — popped coral jelly */
.tile.bomb {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.98) 0%,
    rgba(255,255,255,0.72) 12%,
    rgba(255,140,130,0.92) 36%,
    rgba(240,84,79,0.97) 62%,
    rgba(185,35,32,1) 100%
  );
  box-shadow:
    inset 0 5px 12px rgba(255,255,255,0.85),
    inset 0 -6px 14px rgba(140,15,12,0.45),
    0 0 0 3px rgba(240,84,79,0.5),
    0 8px 24px rgba(240,84,79,0.6);
  color: #fff;
  font-size: 1.3rem;
}

/* Spot absorbed by shield — 🎊 on teal background */
.tile.shield-saved {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.98) 0%,
    rgba(255,255,255,0.72) 12%,
    rgba(80,230,200,0.92) 36%,
    rgba(28,166,148,0.97) 62%,
    rgba(10,110,95,1) 100%
  );
  box-shadow:
    inset 0 5px 12px rgba(255,255,255,0.85),
    inset 0 -6px 14px rgba(5,80,65,0.45),
    0 0 0 3px rgba(28,166,148,0.45),
    0 8px 24px rgba(28,166,148,0.5);
  color: #fff;
  font-size: 1.1rem;
}

/* Spot revealed after defeat (other bombs, not clicked) */
.tile.bomb-late {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.7) 0%,
    rgba(255,255,255,0.4) 14%,
    rgba(220,100,95,0.75) 42%,
    rgba(190,50,46,0.85) 100%
  );
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.5),
    0 0 0 2px rgba(199,59,55,0.35),
    0 4px 14px rgba(199,59,55,0.35);
  color: rgba(255,255,255,0.85);
  opacity: 0.75;
  font-size: 1.1rem;
}

/* Hole tile — empty space in irregular boards */
.tile.hole {
  background: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
  border-radius: 0;
}
.tile.hole:active { transform: none; box-shadow: none; }

/* Flagged bubble — coral jelly */
.tile.flagged {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.98) 0%,
    rgba(255,255,255,0.72) 12%,
    rgba(255,150,140,0.92) 36%,
    rgba(240,84,79,0.97) 62%,
    rgba(190,40,36,1) 100%
  );
  box-shadow:
    inset 0 5px 12px rgba(255,255,255,0.9),
    inset 0 -6px 14px rgba(150,20,16,0.4),
    0 8px 22px rgba(240,84,79,0.5),
    0 3px 8px rgba(180,30,26,0.35);
}

/* Mystery bubble — amber jelly */
.tile.mystery.hidden {
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.98) 0%,
    rgba(255,255,255,0.72) 12%,
    rgba(255,210,100,0.92) 36%,
    rgba(247,164,59,0.97) 62%,
    rgba(200,120,10,1) 100%
  );
  box-shadow:
    inset 0 5px 12px rgba(255,255,255,0.9),
    inset 0 -6px 14px rgba(160,80,0,0.4),
    0 8px 22px rgba(247,164,59,0.5),
    0 3px 8px rgba(180,100,0,0.3);
}

/* Multiplier indicator badge */
.tile.is-multiplier::after {
  content: '×2';
  position: absolute;
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  color: #F7A43B;
  background: rgba(255,255,255,0.92);
  border-radius: 6px;
  padding: 2px 5px;
  line-height: 1.4;
}

/* ============================================================
   POWER-UP BAR
   ============================================================ */
.powerup-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem 0;
  flex-shrink: 0;
}

.powerup-bar.hidden {
  display: none;
}

.btn-powerup {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  /* disabled look — overridden below when active */
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.35);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-powerup:not(:disabled) {
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.7) 14%,
    rgba(255,210,100,0.92) 38%,
    rgba(247,164,59,0.97) 64%,
    rgba(200,115,5,1) 100%
  );
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.88),
    inset 0 -4px 10px rgba(160,80,0,0.38),
    0 5px 14px rgba(247,164,59,0.48),
    0 2px 6px rgba(180,100,0,0.3);
  color: #fff;
  cursor: pointer;
}

.btn-powerup:not(:disabled):active {
  transform: scale(0.91);
  box-shadow:
    inset 0 2px 6px rgba(255,255,255,0.75),
    inset 0 -3px 8px rgba(160,80,0,0.35),
    0 2px 8px rgba(247,164,59,0.35);
}

/* ============================================================
   GUARANTEE BUTTON
   ============================================================ */
.game-footer {
  padding-top: 0.75rem;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn-guarantee {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  padding: 0.9rem 2.5rem;
  color: rgba(255,255,255,0.55);
  border: none;
  border-radius: 20px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
  max-width: 360px;
  /* disabled (default) — grey, flat */
  background: rgba(255,255,255,0.1);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-guarantee:not(:disabled) {
  background: radial-gradient(circle at 32% 24%,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.68) 12%,
    rgba(80,230,200,0.9) 36%,
    rgba(28,166,148,0.97) 62%,
    rgba(10,110,95,1) 100%
  );
  box-shadow:
    inset 0 4px 10px rgba(255,255,255,0.88),
    inset 0 -5px 12px rgba(5,80,65,0.42),
    0 6px 20px rgba(28,166,148,0.52),
    0 3px 8px rgba(10,100,85,0.35);
  color: #fff;
  cursor: pointer;
}

.btn-guarantee:not(:disabled):active {
  transform: scale(0.96);
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,0.75),
    inset 0 -4px 10px rgba(5,80,65,0.38),
    0 3px 10px rgba(28,166,148,0.35);
}

.btn-guarantee.ready {
  animation: pulse-green 1.8s ease-in-out infinite;
}

/* ============================================================
   GAME PHRASE (cycling quote below board)
   ============================================================ */
.game-phrase {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(0.8rem, 2.8vw, 1rem);
  font-style: italic;
  font-weight: 500;
  color: rgba(255,255,255,0.82);
  text-align: center;
  padding: 0.55rem 1.4rem;
  line-height: 1.5;
  flex-shrink: 0;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
  transition: opacity 0.7s ease;
}

.game-phrase.fading {
  opacity: 0;
}

/* ============================================================
   FLOATING POINTS
   ============================================================ */
.float-point {
  position: fixed;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1CA694;
  pointer-events: none;
  z-index: 100;
  text-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

.float-point.multiplied {
  color: #F7A43B;
  font-size: 1.3rem;
}

/* Power-up progress bar — shown below header when level earns powerups */
.powerup-progress-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.powerup-progress-wrap.hidden { display: none; }

.powerup-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  overflow: hidden;
}

.powerup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1CA694, #F7A43B);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.powerup-progress-text {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
