/* ==========================================================================
   Gorbas: Cable Bridge 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);
}

.gcb-emblem-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.gcb-emblem-svg {
  width: 90%;
  height: 90%;
  overflow: visible;
}

.gcb-emblem-pulse {
  animation: gcbPulseGlow 1.8s ease-in-out infinite;
}

@keyframes gcbPulseGlow {
  0%, 100% {
    cx: 56px;
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    cx: 120px;
    opacity: 1;
    transform: scale(1.2);
  }
}

.gcb-emblem-runner {
  animation: gcbRunnerBob 1.2s ease-in-out infinite alternate;
}

@keyframes gcbRunnerBob {
  0% {
    transform: translate(68px, 52px);
  }
  100% {
    transform: translate(68px, 48px);
  }
}

.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.2cqw);
  color: var(--text-muted);
  max-width: 82cqw;
  line-height: 1.35;
  margin: 0;
  text-align: center;
  flex-shrink: 0;
}

.gbs-rules-card {
  display: flex;
  flex-direction: column;
  gap: min(0.6cqh, 1.2cqw);
  width: 100%;
  padding: min(1cqh, 2cqw) 3cqw;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
  flex-shrink: 0;
}

.gbs-rule-row {
  display: flex;
  align-items: center;
  gap: 2cqw;
  font-size: min(1.4cqh, 2.5cqw);
  color: var(--text-muted);
  text-align: left;
}

.gbs-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 0.3cqh 2cqw;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: min(1.2cqh, 2.2cqw);
  letter-spacing: 0.06em;
  color: #f8fafc;
  flex-shrink: 0;
}

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

.gbs-dot.ok {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.gbs-dot.bonus {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.gbs-dot.err {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.6);
}

/* Nickname Box */
.gbs-nickname-box {
  display: flex;
  flex-direction: column;
  gap: min(0.8cqh, 1.4cqw);
  width: 100%;
  padding: min(1.2cqh, 2.2cqw) 3.5cqw;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.7);
  flex-shrink: 0;
}

.gbs-nickname-label {
  font-family: var(--font-mono);
  font-size: min(1.4cqh, 2.5cqw);
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 700;
  text-align: left;
}

.gbs-input-wrap {
  position: relative;
  width: 100%;
}

.gbs-nickname-input {
  width: 100%;
  padding: min(1.1cqh, 2.2cqw) 3cqw;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(6, 9, 14, 0.85);
  color: #f8fafc;
  font-family: var(--font-main);
  font-size: min(2cqh, 3.8cqw);
  font-weight: 600;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gbs-nickname-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.gbs-input-hint {
  display: block;
  font-size: min(1.1cqh, 2cqw);
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.3cqh;
}

.gbs-btn-start {
  width: 100%;
  padding: min(1.2cqh, 2.5cqw) 4cqw;
  font-size: min(2.1cqh, 3.8cqw);
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.demo-note {
  font-size: min(1.2cqh, 2.2cqw);
  color: var(--text-muted);
  margin: 0;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Play HUD */
.gbs-play-hud {
  position: absolute;
  top: min(1.5cqh, 2.5cqw);
  left: 3cqw;
  right: 3cqw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 15;
  pointer-events: none;
}

.gbs-hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: min(0.6cqh, 1.2cqw) 3.5cqw;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 18cqw;
}

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

.gbs-hud-val {
  font-size: min(2.8cqh, 5cqw);
  font-weight: 800;
  line-height: 1;
  color: #f8fafc;
}

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

.gbs-hud-streak {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: min(0.6cqh, 1.2cqw) 3.5cqw;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(239, 68, 68, 0.3));
  border: 1px solid rgba(245, 158, 11, 0.6);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: min(1.6cqh, 2.8cqw);
  color: #fef08a;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  animation: gbsStreakPulse 0.8s infinite alternate ease-in-out;
}

@keyframes gbsStreakPulse {
  0% { transform: scale(1); }
  100% { 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 */
.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;
  border-radius: var(--radius-md);
}

.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);
}

.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;
}

/* Floating In-Game Popup */
.popup {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: #fef08a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: min(3cqh, 5.5cqw);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 18;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

/* Mobile Portrait Orientation Blocker Overlay */
.orientation-blocker {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 14, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

/* Triggered via CSS media query on mobile devices in landscape */
@media (max-width: 900px) and (orientation: landscape) {
  .orientation-blocker {
    display: flex !important;
  }
}

/* Also triggered via explicit JS class */
body.is-mobile-landscape .orientation-blocker {
  display: flex !important;
}

.orientation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.25);
  gap: 16px;
}

.rotate-phone-icon {
  width: 90px;
  height: 90px;
}

.rotate-phone-svg {
  width: 100%;
  height: 100%;
  animation: phoneRotateAnim 2.4s ease-in-out infinite;
}

@keyframes phoneRotateAnim {
  0%, 15% {
    transform: rotate(-90deg);
  }
  50%, 85% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-90deg);
  }
}

.orientation-card h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f8fafc;
  margin: 0;
}

.orientation-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

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

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

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

