/* ==========================================================================
   Gorbas: Bug Squash Mini-Game Styles
   Faithful to the GorbaTech Demo Suite UI/UX standards
   ========================================================================== */

#introScreen,
#resultScreen {
  background: rgba(6, 9, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
}

/* Intro Screen Elements */
.gbs-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: min(1.4cqh, 2.5cqw);
  padding: min(1.5cqh, 3cqw) 5cqw;
  width: 100%;
  max-width: 90cqw;
  height: 100%;
  max-height: 100cqh;
  box-sizing: border-box;
  margin: auto;
}

.gbs-emblem {
  position: relative;
  width: min(18cqh, 22cqw);
  height: min(18cqh, 22cqw);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gbs-emblem-bg {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.9) 0%, rgba(6, 9, 14, 0.95) 70%);
  border: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
}

.gbs-bat-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gbs-bat-svg {
  width: 90%;
  height: 90%;
  overflow: visible;
}

.gbs-bat-art {
  animation: gbsBatStrike 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

@keyframes gbsBatStrike {

  0%,
  100% {
    transform: translate(80px, 80px) rotate(-30deg) scale(0.66);
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
  }

  45% {
    transform: translate(80px, 80px) rotate(-48deg) scale(0.69);
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.65));
  }

  60% {
    transform: translate(80px, 80px) rotate(-12deg) scale(0.65);
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.8));
  }

  75% {
    transform: translate(80px, 80px) rotate(-30deg) scale(0.66);
  }
}

.gbs-title {
  font-size: min(5.5cqh, 10cqw);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 0;
  flex-shrink: 0;
}

.gbs-sub {
  font-size: min(1.8cqh, 3.3cqw);
  max-width: 34ch;
  color: var(--text-muted);
  line-height: 1.3;
  flex-shrink: 0;
}

/* Rules / Instructions Card */
.gbs-rules-card {
  width: 100%;
  padding: min(1.4cqh, 2.5cqw) 3.5cqw;
  display: flex;
  flex-direction: column;
  gap: min(0.9cqh, 1.8cqw);
  text-align: left;
  border-color: rgba(56, 189, 248, 0.2);
  flex-shrink: 0;
}

.gbs-rule-row {
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  font-size: min(1.6cqh, 2.9cqw);
  color: var(--text-main);
  line-height: 1.25;
}

.gbs-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 1.5cqw;
  padding: 0.35em 0.85em;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
}

.gbs-rule-row.good .gbs-rule-pill {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.gbs-rule-row.bad .gbs-rule-pill {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
}

.gbs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.gbs-dot.ok {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.gbs-dot.err {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

/* Nickname Input Box */
.gbs-nickname-box {
  width: 100%;
  padding: min(1.5cqh, 2.8cqw) 4cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(1cqh, 2cqw);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
  flex-shrink: 0;
}

.gbs-nickname-label {
  font-size: min(1.7cqh, 3.2cqw);
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.gbs-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4cqh;
}

.gbs-nickname-input {
  width: 100%;
  padding: min(1cqh, 2.2cqw) 3.5cqw;
  font-size: min(2.5cqh, 4.4cqw);
  font-weight: 700;
  font-family: var(--font-main);
  text-align: center;
  color: #f8fafc;
  background: rgba(6, 9, 14, 0.85);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.gbs-nickname-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
  transform: scale(1.02);
}

.gbs-input-hint {
  font-size: min(1.4cqh, 2.5cqw);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.gbs-btn-start {
  width: 100%;
  font-size: min(2.4cqh, 4.2cqw);
  padding: min(1.1cqh, 2.2cqw) 3cqw;
}

/* Play HUD Overlay */
.gbs-play-hud {
  position: absolute;
  top: 2cqh;
  left: 3cqw;
  right: 3cqw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.gbs-hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8cqh 4cqw;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.gbs-hud-label {
  font-size: 2.4cqw;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.gbs-hud-val {
  font-size: 5.6cqw;
  font-family: var(--font-mono);
  font-weight: 800;
  line-height: 1;
}

.gbs-hud-pill.time .gbs-hud-val {
  color: var(--accent);
}

.gbs-hud-pill.score .gbs-hud-val {
  color: var(--emerald);
}

.gbs-hud-streak {
  display: flex;
  align-items: center;
  gap: 1.5cqw;
  padding: 0.6cqh 3cqw;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 999px;
  font-size: 3.2cqw;
  font-weight: 800;
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
  animation: gbsStreakPulse 1s ease-in-out infinite;
}

@keyframes gbsStreakPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

/* Result & Leaderboard Screen */
.gbs-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: min(1.8cqh, 3.5cqw) 5cqw;
  gap: min(1.2cqh, 2cqw);
  box-sizing: border-box;
  overflow: hidden;
}

.gbs-result-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(0.4cqh, 1cqw);
  width: 100%;
  flex-shrink: 0;
}

.gbs-result-title {
  font-size: min(3.2cqh, 6.2cqw);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  color: #f8fafc;
}

.gbs-score-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: min(0.8cqh, 1.6cqw) 4cqw;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(15, 23, 42, 0.6) 80%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
  width: 100%;
  max-width: 80cqw;
  flex-shrink: 0;
}

.gbs-score-lbl {
  font-size: min(1.4cqh, 2.4cqw);
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--primary);
  font-weight: 700;
}

.gbs-score-number {
  font-size: min(5cqh, 9.5cqw);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.1cqh 0;
}

.gbs-score-sub {
  font-size: min(1.6cqh, 2.8cqw);
  font-weight: 600;
  color: var(--text-muted);
}

/* Leaderboard Card - Flexible & responsive to take all remaining height */
.gbs-leaderboard-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: min(1cqh, 2cqw) 3cqw;
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.9);
  flex: 1 1 0;
  min-height: 0;
}

.gbs-lb-title-bar {
  display: flex;
  align-items: center;
  gap: 2cqw;
  padding-bottom: min(0.6cqh, 1.2cqw);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: min(0.5cqh, 1cqw);
  flex-shrink: 0;
}

.gbs-lb-trophy {
  font-size: min(2.5cqh, 4.2cqw);
}

.gbs-lb-title-bar h3 {
  font-size: min(2cqh, 3.5cqw);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  color: #f8fafc;
  flex: 1;
  text-align: left;
}

.gbs-lb-status {
  font-size: min(1.4cqh, 2.4cqw);
  font-family: var(--font-mono);
  color: var(--accent);
  animation: gbsStatusBlink 1.5s infinite;
}

@keyframes gbsStatusBlink {
  50% {
    opacity: 0.4;
  }
}

.gbs-lb-table-wrap {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  flex: 1 1 0;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

.gbs-lb-table-wrap::-webkit-scrollbar {
  width: 6px;
}

.gbs-lb-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 999px;
}

.gbs-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: min(1.6cqh, 2.9cqw);
}

.gbs-lb-table th {
  padding: min(0.5cqh, 1cqw) 2cqw;
  font-family: var(--font-mono);
  font-size: min(1.3cqh, 2.3cqw);
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: #0f172a;
  z-index: 2;
}

.gbs-lb-table td {
  padding: min(0.65cqh, 1.2cqw) 2cqw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.gbs-lb-row {
  opacity: 0;
  transform: translateY(12px);
  animation: gbsRowFadeIn 0.35s ease forwards;
}

@keyframes gbsRowFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gbs-lb-row.mine {
  background: rgba(56, 189, 248, 0.18);
  border-left: 3px solid var(--primary);
  font-weight: 800;
}

.gbs-lb-rank {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

.gbs-lb-rank.top1 {
  color: #fbbf24;
}

.gbs-lb-rank.top2 {
  color: #e2e8f0;
}

.gbs-lb-rank.top3 {
  color: #d97706;
}

.gbs-lb-nick {
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32cqw;
}

.gbs-lb-score {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--emerald);
  text-align: right;
}

/* Actions */
.gbs-result-actions {
  display: flex;
  gap: 2.5cqw;
  width: 100%;
  flex-shrink: 0;
}

.gbs-btn-again,
.gbs-btn-new-player {
  flex: 1;
  font-size: min(1.9cqh, 3.4cqw);
  padding: min(0.9cqh, 1.8cqw) 2cqw;
  white-space: nowrap;
}

/* Consultation CTA Strip */
.gbs-cta-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: min(0.5cqh, 1cqw);
  padding: min(0.8cqh, 1.6cqw) 3cqw;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  font-size: min(1.3cqh, 2.4cqw);
  color: var(--text-muted);
  width: 100%;
  flex-shrink: 0;
}

.gbs-cta-strip .gt-btn {
  font-size: min(1.5cqh, 2.7cqw);
  padding: 0.4cqh 2cqw;
}

/* Responsive tweaks for smaller screens */
@media (max-height: 680px) {
  .gbs-intro {
    gap: 1cqh;
  }

  .gbs-title {
    font-size: 8.5cqw;
  }

  .gbs-sub {
    font-size: 3cqw;
  }
}