:root {
  --app-base-width: 560px;
  --app-base-height: 760px;
  --app-scale: 1;
  --cols: 6;
  --rows: 5;
  --cell-gap: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden !important;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: transparent;
  color: #f4fbff;
}

body,
body * {
  -webkit-user-select: none;
  user-select: none;
}
button,
img {
  -webkit-user-drag: none;
}

/* FLUIDO — enche a tela inteira (igual o spin-wheel), ancorado no viewport */
.container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #2a1b54 0%, #160d33 60%, #0d0822 100%);
}

/* ===== loader ===== */
.app-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(111, 173, 255, 0.18), transparent 32%), rgba(7, 10, 20, 0.94);
}
.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.app-loader-card {
  width: min(320px, 86%);
  padding: 22px 18px;
  border: 1px solid rgba(255, 214, 113, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(31, 24, 66, 0.96), rgba(12, 11, 31, 0.96));
  text-align: center;
}
.app-loader-title {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #fff6d5;
}
.app-loader-status {
  display: block;
  margin-bottom: 14px;
  color: rgba(231, 247, 255, 0.82);
  font-size: 14px;
}
.app-loader-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.app-loader-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e4b84f, #fff0a7);
  transition: width 0.16s ease;
}
.app-loader-progress {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 246, 213, 0.72);
}

/* ===== stage ===== */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 16px 22px;
}

.reels-area {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reels-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: var(--cell-gap);
  width: 100%;
  aspect-ratio: var(--cols) / var(--rows);
  padding: 14px;
  border-radius: 18px;
  background: rgba(6, 12, 30, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 214, 113, 0.25), inset 0 8px 40px rgba(0, 0, 0, 0.5);
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.cell img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
}
.cell.is-win {
  background: rgba(255, 214, 113, 0.22);
  box-shadow: 0 0 0 2px #ffd671, 0 0 18px rgba(255, 214, 113, 0.6);
  animation: cell-pulse 0.4s ease;
}
.cell.is-effect {
  box-shadow: 0 0 0 2px #ff7a59, 0 0 22px rgba(255, 122, 89, 0.7);
}
.cell.is-removing {
  transform: scale(0.2);
  opacity: 0;
}
.cell.is-dropping {
  animation: cell-drop 0.26s ease;
}
@keyframes cell-pulse {
  50% { transform: scale(1.08); }
}
@keyframes cell-drop {
  from { transform: translateY(-40%); opacity: 0.3; }
  to { transform: translateY(0); opacity: 1; }
}

/* banner de ganho corrente */
.win-banner {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(8, 14, 30, 0.8);
  border: 1px solid rgba(255, 214, 113, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.win-banner.is-visible { opacity: 1; }
.win-banner-label { font-size: 12px; letter-spacing: 0.12em; color: #ffd671; }
.win-banner-value { font-size: 22px; font-weight: 800; color: #fff; }

/* ===== bottom bar ===== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
}
.coins {
  min-width: 96px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(8, 14, 30, 0.75);
  border: 1px solid rgba(255, 214, 113, 0.45);
  font-weight: 800;
  font-size: 16px;
  color: #ffe9a8;
  text-align: center;
}
.bet-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bet-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #6b8cff, #3a5bd9);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}
.bet-btn:active { transform: scale(0.94); }
.bet-display { text-align: center; min-width: 84px; }
.bet-value { display: block; font-size: 20px; font-weight: 800; color: #fff; }
.bet-label { display: block; font-size: 10px; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.6); }
.spin-btn {
  width: 86px;
  height: 86px;
  border: 3px solid #ffd671;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #7db0ff, #2f6bd9);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.spin-btn:active { transform: scale(0.95); }
.spin-btn:disabled { opacity: 0.6; cursor: default; }

.btn-mute {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(8, 14, 30, 0.7) url("assets/ui/sound-on.png") center/60% no-repeat;
  z-index: 5;
}

/* ===== win overlay (lottie) ===== */
.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(2, 6, 16, 0.55);
}
.win-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}
.win-overlay-lottie { width: 80%; max-width: 420px; }
.win-overlay-points {
  font-size: 40px;
  font-weight: 900;
  color: #ffe9a8;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
