


.game-viewport {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  height: calc(100vh - 73px);
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  gap: 16px;
  padding: 0 16px;
  box-sizing: border-box;
}

.game-sidebar {
  padding: 10px 14px;
  border-right: 1px solid var(--panel-border);
  background: rgba(var(--panel-bg), 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}

.gameplay-sidebar {
  border-right: none;
  border-left: 1px solid var(--panel-border);
}

.mobile-settings-toggle {
  display: none;
}


.medals-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-medal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.medal-icon {
  font-size: 20px;
}

.medal-info {
  display: flex;
  flex-direction: column;
}

.medal-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.medal-req {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}


.control-panel-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-section-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 0 0 2px 0;
}

.skin-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.skin-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  transition: var(--transition-smooth);
}

.skin-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--text-primary);
}

.skin-btn.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #39ff14;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: left;
  transition: var(--transition-smooth);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--text-primary);
}

.mode-btn.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.mode-btn.active .mode-name {
  color: #39ff14;
}


.mode-btn-insane:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.mode-btn-insane.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(245, 158, 11, 0.2) 100%);
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.mode-btn-insane.active .mode-name {
  color: #ff453a;
  text-shadow: 0 0 8px rgba(255, 69, 58, 0.6);
}

.mode-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-desc {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.3;
}


.arcade-cabinet.mode-insane {
  border-color: #ef4444 !important;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(239, 68, 68, 0.4) !important;
  animation: insaneCabinetPulse 2s infinite alternate;
}

@keyframes insaneCabinetPulse {
  0% { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.5); }
}


.game-arena-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 6px;
  position: relative;
}

.arcade-cabinet {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border: 4px solid #374151;
  border-radius: 16px;
  width: 100%;
  max-width: min(440px, calc((100vh - 160px) * (2 / 3)));
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(234, 179, 8, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}


.arcade-cabinet.skin-arcade {
  background: linear-gradient(180deg, #1c2e24 0%, #0d1a13 100%);
  border-color: #22c55e;
}

.arcade-cabinet.skin-cyber {
  background: linear-gradient(180deg, #090e17 0%, #030508 100%);
  border-color: #00f0ff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(0, 240, 255, 0.3);
}

.arcade-cabinet.skin-cyber .arcade-marquee {
  background: #05070d;
  border-bottom-color: #00f0ff;
}

.arcade-cabinet.skin-cyber .marquee-title {
  color: #00f0ff;
  text-shadow: 0 0 6px #fff, 0 0 14px #00f0ff, 0 0 24px #00f0ff;
}

.arcade-cabinet.skin-handheld {
  background: #879169;
  border-color: #556038;
  border-width: 6px;
}

.arcade-cabinet.skin-handheld .arcade-marquee {
  background: #4a5430;
  border-bottom-color: #2e351b;
}

.arcade-cabinet.skin-handheld .marquee-title {
  color: #c7d19e;
  text-shadow: none;
}


.arcade-marquee {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #22c55e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.marquee-decor-left, .marquee-decor-right {
  font-size: 11px;
  color: #22c55e;
  letter-spacing: 3px;
  opacity: 0.85;
}

.marquee-title {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 4px;
  text-shadow: 
    0 0 4px #fff,
    0 0 10px #eab308,
    0 0 18px #ca8a04;
}


.arcade-screen-container {
  background: #000;
  padding: 8px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.arcade-screen-bezel {
  background: #080808;
  border: 3px solid #1f2937;
  border-radius: 8px;
  position: relative;
  width: 100%;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.95);
}

.canvas-holder {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: calc(100vh - 200px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

#flappy-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}


.overhead-live-score {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'VT323', var(--font-mono), monospace;
  font-size: 48px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 
    -2px -2px 0 #000,  
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0px  4px 8px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 2px;
}


.crt-scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.55;
}

.screen-glare {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    135deg, 
    rgba(255, 255, 255, 0.06) 0%, 
    rgba(255, 255, 255, 0.01) 35%, 
    transparent 35%
  );
  pointer-events: none;
  z-index: 6;
}


.arcade-joystick-panel {
  background: linear-gradient(180deg, #181822 0%, #0e0e14 100%);
  border-top: 2px solid #2e2e42;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  min-height: 48px;
}

.acme-brand-plate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #08080c;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.acme-logo {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
  color: #facc15;
  letter-spacing: 1.5px;
}

.acme-sub {
  font-size: 8px;
  color: #777;
  letter-spacing: 1px;
}

.arcade-big-button-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.arcade-big-flap-btn {
  width: 90px;
  height: 32px;
  border-radius: 16px;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  background: radial-gradient(circle at 35% 35%, #22c55e, #15803d);
  color: #fff;
  box-shadow: 0 4px 0 #0f5126, 0 0 10px rgba(34, 197, 94, 0.3);
  transition: all 0.1s ease;
  user-select: none;
}

.arcade-big-flap-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0f5126;
}

.button-subtext {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #777;
  letter-spacing: 0.5px;
}


.screen-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(8, 6, 12, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
  transition: opacity 0.2s ease;
}

.screen-overlay.hidden {
  display: none !important;
}

.overlay-panel {
  background: rgba(18, 24, 38, 0.95);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: 20px 24px;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(var(--primary-accent-rgb), 0.2);
}

.overlay-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 3px 10px;
  border-radius: 12px;
}

.tutorial-anim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px 0;
}

.tutorial-bird {
  font-size: 32px;
  animation: birdBob 1.2s ease-in-out infinite alternate;
}

.tutorial-hand {
  font-size: 28px;
  animation: tapTap 0.8s ease-in-out infinite alternate;
}

@keyframes birdBob {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}

@keyframes tapTap {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-6px) scale(0.92); }
}

.arcade-title {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  margin: 0;
}

.arcade-title.death-neon {
  color: #ef4444;
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

.neon-pulse {
  animation: neon-glow 1.5s ease-in-out infinite alternate;
}

@keyframes neon-glow {
  from { text-shadow: 0 0 4px #fff, 0 0 10px #facc15; }
  to { text-shadow: 0 0 8px #fff, 0 0 18px #facc15, 0 0 28px #eab308; }
}

.arcade-tagline {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.arcade-start-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  border: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.arcade-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6);
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}


.score-card-panel {
  padding: 16px 20px;
}

.flappy-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #ded895;
  border: 3px solid #543847;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.2);
}

.medal-slot-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.medal-slot-label {
  font-family: 'VT323', var(--font-mono);
  font-size: 14px;
  font-weight: bold;
  color: #e66020;
}

.medal-slot-badge {
  width: 44px;
  height: 44px;
  background: #c3b97b;
  border: 2px solid #543847;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.4);
}

.medal-emoji {
  font-size: 24px;
}

.score-slot-holder {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.score-slot-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-slot-label {
  font-family: 'VT323', var(--font-mono);
  font-size: 13px;
  font-weight: bold;
  color: #e66020;
  line-height: 1;
}

.score-slot-val {
  font-family: 'VT323', var(--font-mono);
  font-size: 26px;
  font-weight: 900;
  color: #000;
  line-height: 1;
}

.new-high-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.5);
  padding: 3px 10px;
  border-radius: 12px;
  animation: pulse 1.2s infinite;
}


.score-stat-card {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
}

.highlight-num {
  font-size: 36px;
  color: #22c55e;
}

.best-score-card {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.3);
}

.best-medal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--panel-border);
}

.best-medal-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.best-medal-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #facc15;
}

.next-medal-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
}

.medal-progress-track {
  width: 100%;
  height: 8px;
  background: #0d111d;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 6px;
}

.medal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #22c55e 100%);
  border-radius: 4px;
  transition: width 0.2s ease;
}




@media (max-width: 1440px) and (min-width: 1025px) {
  .game-viewport {
    grid-template-columns: 260px 1fr 260px;
    gap: 12px;
    padding: 0 12px;
  }
  .arcade-cabinet {
    max-width: min(400px, calc((100vh - 165px) * (2 / 3)));
  }
  .canvas-holder {
    max-height: calc(100vh - 200px);
  }
}


@media (max-height: 768px) {
  .game-header {
    padding: 8px 20px;
  }
  .game-viewport {
    height: calc(100vh - 58px);
    gap: 10px;
  }
  .arcade-marquee {
    padding: 5px 12px;
  }
  .marquee-title {
    font-size: 16px;
    letter-spacing: 2px;
  }
  .arcade-joystick-panel {
    padding: 4px 12px;
    min-height: 42px;
  }
  .arcade-big-flap-btn {
    width: 78px;
    height: 28px;
    font-size: 10px;
  }
  .arcade-cabinet {
    max-width: min(370px, calc((100vh - 140px) * (2 / 3)));
  }
  .canvas-holder {
    max-height: calc(100vh - 170px);
  }
  .overlay-panel {
    padding: 14px 18px;
    gap: 8px;
  }
  .arcade-title {
    font-size: 20px;
  }
}


@media (max-width: 1024px) {
  .mobile-settings-toggle {
    display: flex !important;
  }
  .game-body {
    overflow-x: hidden;
    height: auto;
  }
  .game-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    min-height: calc(100vh - 56px);
    overflow-y: visible;
    padding: 8px 12px;
    gap: 10px;
  }
  .settings-sidebar {
    display: none;
  }
  .settings-sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 20, 32, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99;
    padding: 24px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
  }
  .gameplay-sidebar {
    border: none;
    padding: 0;
    background: transparent;
    width: 100%;
    max-width: 440px;
    order: -1;
  }
  .arcade-cabinet {
    max-width: 95vw;
  }
  .canvas-holder {
    max-height: 65vh;
  }
}
