/* ==========================================================================
   COLOR BALL SORT GAME - DEDICATED STYLES
   ========================================================================== */

.game-page-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  padding-top: 100px;
  padding-bottom: 70px;
}

.game-wrapper-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 85px 24px 30px 24px;
  max-width: 980px;
  margin: 0 auto;
}

.game-workbench {
  background: rgba(18, 18, 22, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
}

.game-top-bar {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px 28px 0 0;
  flex-wrap: nowrap;
  gap: 12px;
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.game-title-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.game-tag-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.game-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.metric-label {
  color: var(--ink-faint);
  font-weight: 500;
}

.metric-value {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.game-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.ctrl-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ctrl-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), #1400FF);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(255, 156, 245, 0.25);
}

.ctrl-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 156, 245, 0.4);
}

.game-stage-viewport {
  position: relative;
  flex: 1;
  min-height: 380px;
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 156, 245, 0.03), transparent 70%);
}

/* Win Overlay Modal Styling */
.ball-sort-win-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(5, 7, 14, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ball-sort-win-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.win-card {
    background: #0f1322;
    border: 1.5px solid rgba(255, 156, 245, 0.3);
    border-radius: 24px;
    padding: 32px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 156, 245, 0.2), 0 20px 60px rgba(0, 0, 0, 0.9);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ball-sort-win-overlay.active .win-card {
    transform: scale(1);
}

.win-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 156, 245, 0.15);
    border: 1px solid rgba(255, 156, 245, 0.3);
    color: #FF9CF5;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    border-radius: 99px;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.win-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.win-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #8b949e;
    margin: 0 0 24px 0;
}

.win-actions {
    width: 100%;
}

.btn-win-next {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FF9CF5, #9B51E0);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 156, 245, 0.4);
    transition: all 0.2s ease;
}

.btn-win-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 156, 245, 0.6);
}

.game-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 12px;
}

.game-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-dim);
}

.game-badge-privacy {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-faint);
}

/* Minimal Game Footer - Sticky to Viewport Bottom */
.minimal-game-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  padding: 14px 24px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 10, 14, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  z-index: 100 !important;
}

.minimal-footer-inner {
  max-width: 940px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
}

.minimal-link {
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.minimal-link:hover {
  color: var(--accent);
}

.minimal-dot {
  opacity: 0.4;
}

/* Tube Completion Glow Effect */
.ball-sort-flask.completed {
  border-color: #38ef7d !important;
  box-shadow: inset 0 -4px 14px rgba(56, 239, 125, 0.25), 0 0 20px rgba(56, 239, 125, 0.4) !important;
}

.ball-sort-flask.completed::before {
  border-color: #38ef7d !important;
}

@media (max-width: 680px) {
  .game-wrapper-page {
    padding: 85px 12px 30px 12px;
  }

  .game-top-bar {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .game-brand {
    justify-content: space-between;
  }

  .game-metrics {
    justify-content: center;
  }

  .game-controls {
    justify-content: center;
  }

  .game-footer-bar {
    padding: 12px 16px;
    flex-direction: column;
    text-align: center;
  }
}

/* Slide-in Info Drawer Styles */
.game-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 7, 14, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.game-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #0f1322;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.game-drawer-overlay.active .game-drawer-panel {
    transform: translateX(0);
}

.game-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-drawer-title {
    font-family: var(--font-heading, 'IBM Plex Serif', serif);
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.game-drawer-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b949e;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.game-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    color: var(--ink-dim, #a8a39a);
    font-family: var(--font-body, 'IBM Plex Sans', sans-serif);
    font-size: 14px;
    line-height: 1.8;
}
