/* ============================================================
   Bar DuBarao • Boteco Chic 3D UI/UX Design System
   Rasch Studio • Three.js WebGL & Bruno Real
============================================================ */

:root {
  --font-title: 'Playfair Display', Georgia, serif;
  --font-accent: 'Cinzel', serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --color-bg-dark: #120704;
  --color-wood-dark: #240e08;
  --color-wood-mid: #4a1f10;
  --color-wood-light: #7a351c;
  --color-brass: #d4af37;
  --color-gold: #ffca4a;
  --color-gold-glow: rgba(255, 202, 74, 0.4);
  --color-beer: #f59e0b;
  --color-cream: #fff9e6;
  --color-red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background-color: var(--color-bg-dark);
  font-family: var(--font-ui);
  color: var(--color-cream);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #30140a 0%, #150804 70%, #0a0402 100%);
}

/* --- Canvases --- */
#threeCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  display: block;
  touch-action: manipulation;
}

/* --- Top Portal Navigation Bar --- */
.portalBar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 25;
  pointer-events: auto;
}

.hubLink {
  color: #fce8cd;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(26, 12, 7, 0.85);
  border: 1px solid rgba(255, 202, 74, 0.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hubLink:hover {
  background: rgba(255, 202, 74, 0.2);
  color: #fff;
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.serverPill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(26, 12, 7, 0.85);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.pillDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 1.8s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* --- HUD Superior --- */
#hud {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 0;
  padding: max(48px, calc(env(safe-area-inset-top) + 42px)) 12px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}

.hudGroup {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hudGroup.right {
  justify-content: flex-end;
}

.hudCard {
  min-width: 82px;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(36, 16, 10, 0.88), rgba(16, 7, 4, 0.82));
  border: 1px solid rgba(255, 214, 145, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  text-align: left;
}

.hudCard .label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #dfbf97;
  font-weight: 800;
}

.hudCard strong {
  font-size: 19px;
  color: #fff4d9;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  display: block;
}

.hudScore strong {
  color: var(--color-gold);
  text-shadow: 0 0 12px var(--color-gold-glow);
}

.hudCombo strong {
  color: #ff9f43;
}

#timerCard {
  text-align: center;
  min-width: 76px;
  background: linear-gradient(180deg, rgba(46, 20, 12, 0.92), rgba(20, 8, 4, 0.85));
  border-color: rgba(255, 190, 80, 0.35);
}

#timerCard strong {
  font-size: 22px;
  color: #ffdd99;
}

.hudHearts strong {
  font-size: 16px;
  letter-spacing: 2px;
}

.hudBtn {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(28, 12, 7, 0.88);
  border: 1px solid rgba(255, 214, 145, 0.25);
  color: #ffeed1;
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background 0.15s;
}

.hudBtn:active {
  transform: scale(0.92);
  background: rgba(255, 202, 74, 0.25);
}

/* --- Barra de Modo Festa --- */
#comboBar {
  position: absolute;
  z-index: 20;
  top: calc(max(48px, calc(env(safe-area-inset-top) + 42px)) + 58px);
  left: 50%;
  transform: translateX(-50%);
  width: min(72vw, 340px);
  height: 14px;
  border-radius: 999px;
  background: rgba(14, 6, 4, 0.65);
  border: 1px solid rgba(255, 211, 127, 0.25);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

#comboBar.show {
  opacity: 1;
}

#comboFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff8c00, #ffd700, #ff4500);
  box-shadow: 0 0 16px #ffae2d;
  transition: width 0.15s linear;
}

#comboText {
  position: absolute;
  inset: -22px 0 auto;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #ffe8a7;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px #000;
}

#comboBar.fever {
  animation: feverPulse 0.5s ease-in-out infinite alternate;
}

@keyframes feverPulse {
  0% { box-shadow: 0 0 10px #ff3838, inset 0 0 8px #ffb328; }
  100% { box-shadow: 0 0 24px #ffd700, inset 0 0 14px #ff3838; }
}

/* --- Status Inferior --- */
#bottomStatus {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 8, 5, 0.85);
  border: 1px solid rgba(255, 205, 114, 0.25);
  font-size: 11px;
  font-weight: 800;
  color: #f7dfbe;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* --- Botão Interativo da Chopeira (Alavanca de Chopp & Manômetro) --- */
#fillHoldBtn {
  position: absolute;
  z-index: 22;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(100px, calc(env(safe-area-inset-bottom) + 90px));
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #2b1206;
  font-weight: 900;
  background: radial-gradient(circle at 35% 25%, #fff5cc 0%, #ffcf4d 30%, #e68a17 72%, #8c3b06 100%);
  border: 4px solid rgba(255, 246, 196, 0.9);
  box-shadow: 0 8px 0 #5e2604, 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(255, 202, 74, 0.18);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#fillHoldBtn.show {
  display: flex;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#fillHoldBtn.holding {
  transform: translateY(6px) scale(0.96);
  box-shadow: 0 2px 0 #5e2604, 0 8px 18px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 205, 64, 0.7);
}

.tapHandle {
  width: 28px;
  height: 32px;
  background: linear-gradient(180deg, #d4af37, #8c6d18);
  border-radius: 6px 6px 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  margin-top: -4px;
}

.tapKnob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff4d4d, #991b1b);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.pressureGauge {
  margin: 2px 0;
}

.holdPct {
  font-size: 16px;
  font-weight: 950;
  color: #2b1206;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.holdLabel {
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #3d1b08;
  font-weight: 900;
}

/* --- Telas (Screens) & Painéis Centrais --- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 4, 2, 0.78);
  backdrop-filter: blur(12px);
}

.panel {
  width: min(94vw, 440px);
  padding: 28px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(42, 18, 10, 0.94), rgba(18, 7, 4, 0.96));
  border: 1px solid rgba(255, 214, 145, 0.3);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  text-align: center;
}

.logoWrap {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: radial-gradient(circle, rgba(255, 202, 74, 0.25) 0%, transparent 70%);
}

.logoWrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

h1 {
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 900;
  color: #ffd875;
  text-shadow: 0 2px 10px rgba(255, 180, 50, 0.3);
  margin-bottom: 6px;
}

.tagline {
  font-size: 13px;
  color: #dcc2a6;
  line-height: 1.45;
  margin-bottom: 14px;
}

.rulePills {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pill {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 214, 145, 0.2);
  color: #f7e0c4;
}

.nameBox {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

input#playerName {
  flex: 1;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 145, 0.3);
  background: rgba(14, 6, 3, 0.85);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input#playerName:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 14px var(--color-gold-glow);
}

/* --- Botões --- */
button.primary {
  width: 100%;
  padding: 15px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #1a0a03;
  background: linear-gradient(180deg, #ffdc73 0%, #f59e0b 55%, #c27803 100%);
  border: 1px solid #ffe9a6;
  box-shadow: 0 6px 0 #7e4600, 0 12px 28px rgba(245, 158, 11, 0.35);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button.primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #7e4600, 0 6px 14px rgba(245, 158, 11, 0.35);
}

.secondaryRow {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

button.secondary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 800;
  color: #edd1b4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 214, 145, 0.2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

button.secondary:hover {
  background: rgba(255, 202, 74, 0.15);
  color: #fff;
  border-color: var(--color-gold);
}

.offlineNote {
  font-size: 10px;
  color: #a88e78;
  margin-top: 14px;
  line-height: 1.4;
}

/* --- Game Over (End Screen) --- */
.bigScore {
  font-family: var(--font-accent);
  font-size: 54px;
  font-weight: 900;
  color: #ffd875;
  text-shadow: 0 0 20px var(--color-gold-glow);
  margin: 4px 0;
  line-height: 1.1;
}

.finalMessage {
  font-size: 18px;
  font-weight: 800;
  color: #ffe6ba;
  margin-bottom: 14px;
}

.resultStats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.resultBox {
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 145, 0.15);
}

.resultBox strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #fff2d4;
}

.resultBox span {
  font-size: 10px;
  color: #bfa388;
  text-transform: uppercase;
  font-weight: 800;
}

/* --- Modais --- */
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 2, 1, 0.82);
  backdrop-filter: blur(14px);
}

.modalCard {
  width: min(94vw, 500px);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #2c130b, #120704);
  border: 1px solid rgba(255, 203, 104, 0.3);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.modal h2 {
  font-family: var(--font-title);
  color: #ffd875;
  font-size: 28px;
  margin-bottom: 6px;
}

.modal p {
  color: #d6bda5;
  font-size: 13px;
  line-height: 1.5;
}

.closeX {
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.closeX:hover {
  background: rgba(255, 255, 255, 0.18);
}

.rulesList {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.rule {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 214, 145, 0.12);
}

.ruleIcon {
  font-size: 22px;
}

.rule b {
  color: #ffc958;
}

/* Guia de Clientes */
.customerGuideGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.customerGuideCard {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 145, 0.15);
  transition: transform 0.15s, background 0.15s;
}

.customerGuideCard:hover {
  background: rgba(255, 202, 74, 0.08);
  transform: translateY(-2px);
}

.cgAvatar {
  width: 46px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.cgInfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.cgInfo b {
  font-size: 13px;
  color: #fff2d4;
}

.cgTier {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.cgInfo small {
  color: #c4ab94;
  font-size: 10.5px;
  line-height: 1.35;
}

.customerGuideCard.vipCard {
  background: rgba(255, 202, 74, 0.12);
  border-color: rgba(255, 202, 74, 0.45);
  box-shadow: 0 0 16px rgba(255, 202, 74, 0.15);
}

.customerGuideCard.vipCard b {
  color: #ffd875;
}

/* --- Ranking Diário --- */
.rankingTabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
}

.rankingTab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #e2ceb8;
  border: 1px solid rgba(255, 210, 120, 0.2);
  font-size: 12px;
  font-weight: 800;
  transition: all 0.2s;
  cursor: pointer;
}

.rankingTab.active {
  background: linear-gradient(135deg, #ffc038, #ff8c1f);
  color: #1f0c05;
  border-color: #ffe6a8;
  box-shadow: 0 4px 14px rgba(255, 140, 31, 0.4);
}

.choppBanner {
  background: rgba(255, 202, 74, 0.08);
  border: 1px solid rgba(255, 202, 74, 0.25);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #ffd875;
  text-align: center;
  margin-bottom: 8px;
}

.rankingStatus {
  font-size: 11px;
  color: #a89482;
  text-align: center;
  margin-bottom: 10px;
}

.ranking {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.rankRow {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
}

.rankRow.me {
  border-color: var(--color-gold);
  background: rgba(255, 202, 74, 0.14);
}

.rankPos {
  font-weight: 900;
  color: #e4bb6c;
}

.rankRow:nth-child(1) .rankPos { color: #ffd84a; font-size: 15px; }
.rankRow:nth-child(2) .rankPos { color: #e2e8f0; }
.rankRow:nth-child(3) .rankPos { color: #e09f5a; }

.rankName {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rankScore {
  font-weight: 900;
  color: #ffe3a8;
}

/* --- Toast --- */
#toast {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 85px;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 11px 18px;
  border-radius: 999px;
  background: #1f0d07;
  color: #ffeed1;
  border: 1px solid rgba(255, 202, 74, 0.35);
  font-weight: 800;
  font-size: 13px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  #hud {
    padding-top: max(46px, calc(env(safe-area-inset-top) + 40px));
    gap: 5px;
  }
  .hudCard {
    min-width: 72px;
    padding: 7px 9px;
  }
  .hudCard strong {
    font-size: 17px;
  }
  #timerCard strong {
    font-size: 19px;
  }
  .hudBtn {
    width: 38px;
    height: 38px;
  }
  .customerGuideGrid {
    grid-template-columns: 1fr;
  }
}

/* --- Barra de Filtros de Clientes & Cards Aprimorados --- */
.tierFilterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px 0;
  justify-content: center;
}

.tierFilterBtn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: #cbd5e1;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tierFilterBtn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  color: #fff;
  transform: translateY(-1px);
}

.tierFilterBtn.active {
  background: linear-gradient(135deg, #ffd700, #d97706);
  color: #0f172a;
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.cgAvatarWrap {
  width: 68px;
  height: 86px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.4) 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.cgAvatar {
  max-width: 90%;
  max-height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}

.customerGuideCard:hover .cgAvatar {
  transform: scale(1.08) translateY(-2px);
}

.cgInfo {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.cgName {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.cgTitle {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.cgTier {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid;
  margin: 3px 0 2px 0;
  width: fit-content;
}

.cgPhrase {
  font-size: 11px;
  color: #fbbf24;
  font-style: italic;
}

.cgDesc {
  font-size: 10.5px;
  color: #cbd5e1;
  line-height: 1.3;
}

.vipCard {
  border-color: #ffd700 !important;
  background: linear-gradient(135deg, rgba(36, 20, 0, 0.85), rgba(20, 10, 5, 0.9)) !important;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25) !important;
}

.vipCard, .ultraVipCard {
  border: 2px solid #ffd700 !important;
  background: linear-gradient(135deg, rgba(40, 25, 0, 0.95), rgba(20, 10, 0, 0.98)) !important;
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.45) !important;
  position: relative;
  overflow: hidden;
}

.vipCard::before, .ultraVipCard::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.15) 50%, transparent 60%);
  transform: rotate(30deg);
  animation: shineGold 4s infinite linear;
  pointer-events: none;
}

@keyframes shineGold {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}


/* ==========================================================================
   MODAL DE CLIENTES & TIERS - ULTRA ESPAÇOSO COM BARRA DE ROLAGEM DOURADA
   ========================================================================== */
#rulesModal .modalCard {
  width: min(96vw, 1080px) !important;
  height: min(93vh, 920px) !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 22px 26px !important;
  background: radial-gradient(circle at 50% 0%, #3d1b10 0%, #1a0a05 55%, #0d0402 100%) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.35) !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 215, 0, 0.15) !important;
  overflow: hidden !important;
}

.modalHeaderBar {
  text-align: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.modalHeaderBar h2 {
  font-family: 'Cinzel', 'Playfair Display', serif !important;
  color: #ffd700 !important;
  margin: 0 0 4px 0 !important;
  font-size: 26px !important;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.modalHeaderBar p {
  color: #cbd5e1;
  font-size: 13px;
  margin: 0;
  line-height: 1.35;
}

.tierFilterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px 0;
  justify-content: center;
  flex-shrink: 0;
}

.tierFilterBtn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: #cbd5e1;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tierFilterBtn:hover {
  background: rgba(255, 215, 0, 0.18);
  border-color: #ffd700;
  color: #ffffff;
  transform: translateY(-1px);
}

.tierFilterBtn.active {
  background: linear-gradient(135deg, #ffd700, #d97706);
  color: #0f172a;
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
}

/* Grid Espaçosa de Clientes */
.customerGuideGrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)) !important;
  gap: 14px !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 6px 12px 16px 4px !important;
  margin-top: 4px !important;
  scrollbar-width: thin;
  scrollbar-color: #ffd700 rgba(0, 0, 0, 0.3);
}

/* Barra de Rolagem Dourada Sofisticada */
.customerGuideGrid::-webkit-scrollbar {
  width: 9px;
}
.customerGuideGrid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
}
.customerGuideGrid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ffd700, #b45309);
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.4);
}
.customerGuideGrid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffe066, #d97706);
}

/* Card Individual de Cliente com Espaço Amplo */
.customerGuideCard {
  display: flex !important;
  gap: 16px !important;
  align-items: center !important;
  padding: 14px 18px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 215, 0, 0.15) !important;
  transition: all 0.22s ease !important;
  min-height: 135px !important;
  box-sizing: border-box;
}

.customerGuideCard:hover {
  background: rgba(255, 215, 0, 0.08) !important;
  border-color: rgba(255, 215, 0, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* Avatar Grande e Nítido */
.cgAvatarWrap {
  width: 96px !important;
  height: 124px !important;
  min-width: 96px !important;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.5) 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6) !important;
}

.cgAvatar {
  width: 90% !important;
  height: 94% !important;
  max-width: 90% !important;
  max-height: 94% !important;
  object-fit: contain !important;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7)) !important;
  transition: transform 0.25s ease !important;
}

.customerGuideCard:hover .cgAvatar {
  transform: scale(1.12) translateY(-2px) !important;
}

.cgInfo {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  text-align: left !important;
  flex: 1 !important;
  min-width: 0;
}

.cgName {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.cgTitle {
  font-size: 11.5px !important;
  color: #94a3b8 !important;
  font-style: italic !important;
}

.cgTier {
  display: inline-block !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  padding: 3px 9px !important;
  border-radius: 12px !important;
  border: 1px solid !important;
  margin: 3px 0 2px 0 !important;
  width: fit-content !important;
  letter-spacing: 0.3px;
}

.cgPhrase {
  font-size: 11.5px !important;
  color: #fbbf24 !important;
  font-style: italic !important;
  line-height: 1.35 !important;
}

.cgDesc {
  font-size: 11px !important;
  color: #cbd5e1 !important;
  line-height: 1.35 !important;
}

/* Card Especial dos 5 ULTRA VIPS Dourados */
.ultraVipCard {
  border: 2px solid #ffd700 !important;
  background: linear-gradient(135deg, rgba(48, 30, 0, 0.95), rgba(24, 12, 0, 0.98)) !important;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.4) !important;
  position: relative !important;
  overflow: hidden !important;
}

.ultraVipCard .cgAvatarWrap {
  border-color: #ffd700 !important;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.22) 0%, rgba(0, 0, 0, 0.7) 100%) !important;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35) !important;
}

.ultraVipCard .cgName {
  color: #ffd700 !important;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  font-size: 17px !important;
}

.ultraVipCard::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.16) 50%, transparent 60%);
  transform: rotate(30deg);
  animation: shineGold 4s infinite linear;
  pointer-events: none;
}

/* Accordion de Regras Compacto no Rodapé */
.rulesAccordion {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 14px;
  padding: 8px 14px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.rulesAccordion summary {
  cursor: pointer;
  color: #ffd700;
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.rulesAccordion summary::-webkit-details-marker {
  display: none;
}

.rulesAccordion summary:hover {
  color: #ffe566;
}

.accArrow {
  font-size: 14px;
  transition: transform 0.25s ease;
}

.rulesAccordion[open] .accArrow {
  transform: rotate(180deg);
}

.rulesListGrid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.ruleCompact {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ruleCompact .ruleIcon {
  font-size: 18px;
  flex-shrink: 0;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
  #rulesModal .modalCard {
    width: 96vw !important;
    height: 94vh !important;
    padding: 16px 12px !important;
  }
  .customerGuideGrid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding-right: 6px !important;
  }
  .cgAvatarWrap {
    width: 80px !important;
    height: 108px !important;
    min-width: 80px !important;
  }
  .customerGuideCard {
    padding: 10px 12px !important;
    min-height: 115px !important;
  }
  .modalHeaderBar h2 {
    font-size: 21px !important;
  }
}

/* ==========================================================================
   MELHORIAS DE LAYOUT MOBILE - ZERO EMBOLADO & ERGONOMIA
   ========================================================================== */
@media (max-width: 520px) {
  #fillHoldBtn {
    width: 80px !important;
    height: 80px !important;
    right: 14px !important;
    /* Elevação suficiente para não ficar cortado quando sair do fullscreen */
    bottom: max(44px, calc(env(safe-area-inset-bottom) + 36px)) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 215, 0, 0.35) !important;
  }
  #fillHoldBtn .tapHandle {
    width: 22px !important;
    height: 24px !important;
    margin-top: -2px !important;
  }
  #fillHoldBtn .tapKnob {
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
  }
  #fillHoldBtn .holdPct {
    font-size: 13px !important;
  }
  #fillHoldBtn .holdLabel {
    font-size: 8.5px !important;
    margin-top: 1px !important;
  }
  #bottomStatus {
    left: 14px !important;
    transform: none !important;
    bottom: max(46px, calc(env(safe-area-inset-bottom) + 38px)) !important;
    max-width: calc(100% - 108px) !important;
    font-size: 11px !important;
    padding: 7px 12px !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  #hud {
    padding-top: max(38px, calc(env(safe-area-inset-top) + 34px)) !important;
    gap: 4px !important;
  }
  .hudCard {
    min-width: 58px !important;
    padding: 5px 6px !important;
    border-radius: 10px !important;
  }
  .hudCard span {
    font-size: 8.5px !important;
  }
  .hudCard strong {
    font-size: 14.5px !important;
  }
  #timerCard strong {
    font-size: 16.5px !important;
  }
  .hudBtn {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
  }
}


/* ==========================================================================
   SISTEMA DE ABAS & CARTAS ESPAÇOSAS DO MODAL DE REGRAS
   ========================================================================== */
.rulesModalTabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: center;
  flex-shrink: 0;
}

.rulesModalTab {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 215, 0, 0.25);
  color: #cbd5e1;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rulesModalTab:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: #ffd700;
  color: #fff;
}

.rulesModalTab.active {
  background: linear-gradient(135deg, #ffd700, #d97706);
  color: #0f172a;
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.45);
}

.rulesPanel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.rulesPanel.hidden {
  display: none !important;
}

/* Barra de Filtros Deslizável (Carrossel Horizontal de 1 Linha) */
.tierFilterBar {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  gap: 8px !important;
  padding: 6px 4px 10px 4px !important;
  margin: 8px 0 10px 0 !important;
  scrollbar-width: none !important;
  flex-shrink: 0 !important;
}

.tierFilterBar::-webkit-scrollbar {
  display: none !important;
}

.tierFilterBtn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

/* Painel de Regras com Rolagem */
.rulesContentScroll {
  overflow-y: auto;
  padding: 8px 6px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.ruleCardLarge {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.ruleCardLarge:hover {
  background: rgba(255, 215, 0, 0.07);
  border-color: rgba(255, 215, 0, 0.4);
}

.ruleCardLarge.vipRuleCard {
  background: radial-gradient(circle at 10% 50%, rgba(255, 215, 0, 0.15), rgba(20, 10, 4, 0.7));
  border: 1.5px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.ruleCardIcon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ruleCardBody h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
  margin-bottom: 4px;
}

.ruleCardBody p {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  margin: 0;
}

/* Ajustes Específicos para Mobile */
@media (max-width: 600px) {
  #rulesModal .modalCard {
    width: 96vw !important;
    height: 94vh !important;
    max-height: 94vh !important;
    padding: 14px 10px !important;
  }
  .modalHeaderBar h2 {
    font-size: 18px !important;
    margin-bottom: 2px !important;
  }
  .modalHeaderBar p {
    display: none !important; /* Esconde subtítulo para liberar espaço total para as cartas */
  }
  .rulesModalTabs {
    margin-top: 6px !important;
    gap: 6px !important;
  }
  .rulesModalTab {
    padding: 5px 12px !important;
    font-size: 11.5px !important;
  }
  .customerGuideGrid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 4px 6px 16px 2px !important;
    flex: 1 1 auto !important;
  }
  .customerGuideCard {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 10px 12px !important;
    min-height: 110px !important;
    border-radius: 14px !important;
  }
  .cgAvatarWrap {
    width: 72px !important;
    height: 96px !important;
    min-width: 72px !important;
    border-radius: 10px !important;
  }
  .cgInfo {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: left !important;
  }
  .cgName {
    font-size: 14.5px !important;
    line-height: 1.2 !important;
    margin-bottom: 1px !important;
  }
  .cgTitle {
    font-size: 10.5px !important;
    line-height: 1.2 !important;
  }
  .cgTier {
    font-size: 9.5px !important;
    padding: 2px 7px !important;
    margin: 2px 0 !important;
  }
  .cgPhrase {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
  }
  .cgDesc {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }
}
