* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'VT323', monospace;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

#ui-overlay * {
  pointer-events: auto;
}

.menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.title-text {
  font-family: 'Creepster', cursive;
  font-size: clamp(32px, 8vw, 72px);
  color: #ff2222;
  text-shadow: 0 0 20px #ff0000, 0 0 40px #880000, 0 0 60px #440000;
  letter-spacing: 4px;
  animation: flicker 3s infinite;
  margin-bottom: 8px;
  text-align: center;
}

.subtitle-text {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 3vw, 24px);
  color: #888;
  margin-bottom: 24px;
  text-align: center;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  5% { opacity: 0.8; }
  10% { opacity: 1; }
  15% { opacity: 0.6; }
  20% { opacity: 1; }
  50% { opacity: 0.95; }
  55% { opacity: 0.7; }
  60% { opacity: 1; }
}

.roster-scroll {
  width: 100%;
  max-width: 960px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 30px;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #333 #111;
  -webkit-overflow-scrolling: touch;
}

.roster-scroll::-webkit-scrollbar {
  height: 6px;
}

.roster-scroll::-webkit-scrollbar-track {
  background: #111;
  border-radius: 3px;
}

.roster-scroll::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.roster-scroll::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.cards-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  min-width: min-content;
  padding: 4px 8px;
}

.char-card {
  background: #111;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 12px;
  width: clamp(160px, 40vw, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.char-card:hover {
  border-color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}

.char-card.cosmic:hover {
  border-color: #8844ff;
  box-shadow: 0 0 20px rgba(136, 68, 255, 0.3);
}

.char-card.golden:hover {
  border-color: #ccaa00;
  box-shadow: 0 0 20px rgba(204, 170, 0, 0.3);
}

.char-card.golden-cosmic {
  border-color: #553300;
}

.char-card.golden-cosmic:hover {
  border-color: #ffaa00;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.3), 0 0 40px rgba(136, 68, 255, 0.15);
}

.char-portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: #0a0a0a;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) brightness(0.9);
}

.char-portrait .scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}

.char-name {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(9px, 2vw, 13px);
  color: #ddd;
  margin-bottom: 10px;
  text-align: center;
}

.char-name.cosmic-name {
  background: linear-gradient(90deg, #8844ff, #4488ff, #8844ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.char-name.golden-name {
  background: linear-gradient(90deg, #ccaa00, #ffdd33, #ccaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: golden-shimmer 2s ease-in-out infinite;
}

.char-name.golden-cosmic-name {
  background: linear-gradient(90deg, #ccaa00, #ffdd33, #8844ff, #4488ff, #ccaa00);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gc-shimmer 3s ease-in-out infinite;
}

@keyframes gc-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes golden-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.difficulty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diff-btn {
  width: 32px;
  height: 32px;
  background: #222;
  border: 1px solid #555;
  color: #fff;
  font-family: 'VT323', monospace;
  font-size: 22px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.diff-btn:hover {
  background: #444;
  border-color: #ff4444;
}

.diff-btn:active {
  transform: scale(0.9);
}

.diff-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: #ff4444;
  width: 40px;
  text-align: center;
  text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.diff-value.cosmic-val {
  color: #8844ff;
  text-shadow: 0 0 8px rgba(136, 68, 255, 0.5);
}

.diff-value.golden-val {
  color: #ccaa00;
  text-shadow: 0 0 8px rgba(204, 170, 0, 0.5);
}

.diff-value.gc-val {
  color: #ffaa00;
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.start-btn {
  font-family: 'Creepster', cursive;
  font-size: clamp(24px, 5vw, 42px);
  padding: 12px 48px;
  background: #220000;
  border: 2px solid #ff2222;
  color: #ff2222;
  cursor: pointer;
  border-radius: 6px;
  letter-spacing: 4px;
  transition: all 0.3s;
  text-shadow: 0 0 10px #ff0000;
  margin-bottom: 16px;
}

.start-btn:hover {
  background: #ff2222;
  color: #000;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
  text-shadow: none;
}

.setall-btn {
  font-family: 'Creepster', cursive;
  font-size: clamp(18px, 4vw, 30px);
  padding: 12px 24px;
  background: linear-gradient(135deg, #220a00, #1a0a22);
  border: 2px solid #ff6600;
  color: #ff6600;
  cursor: pointer;
  border-radius: 6px;
  letter-spacing: 2px;
  transition: all 0.3s;
  text-shadow: 0 0 10px #ff4400;
  margin-bottom: 16px;
}

.setall-btn:hover {
  background: linear-gradient(135deg, #ff6600, #ff2222);
  color: #000;
  box-shadow: 0 0 30px rgba(255, 102, 0, 0.6);
  text-shadow: none;
}

.best-score {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: #666;
  margin-bottom: 12px;
}

.footer-link {
  font-family: 'VT323', monospace;
  font-size: 14px;
  margin-top: 8px;
}

.footer-link a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-link a:hover {
  color: #ff4444;
}

/* Guide Button */
.guide-btn {
  font-family: 'VT323', monospace;
  font-size: clamp(16px, 3.5vw, 26px);
  padding: 12px 24px;
  background: #0a0a1a;
  border: 2px solid #666;
  color: #ccc;
  cursor: pointer;
  border-radius: 6px;
  letter-spacing: 2px;
  transition: all 0.3s;
}

.guide-btn:hover {
  border-color: #8844ff;
  color: #bb88ff;
  box-shadow: 0 0 20px rgba(136, 68, 255, 0.3);
  background: #12082a;
}

/* Guide Overlay */
.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-container {
  width: 95%;
  max-width: 720px;
  height: 92%;
  display: flex;
  flex-direction: column;
  background: #0a0a0f;
  border: 1px solid #222;
  border-radius: 8px;
  overflow: hidden;
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #111118;
  border-bottom: 1px solid #1e1e2a;
  flex-shrink: 0;
}

.guide-title {
  font-family: 'Creepster', cursive;
  font-size: clamp(22px, 5vw, 36px);
  color: #ff2222;
  text-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
  letter-spacing: 3px;
}

.guide-close {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #888;
  background: #1a1a22;
  border: 1px solid #333;
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.guide-close:hover {
  color: #ff4444;
  border-color: #ff4444;
}

.guide-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: #333 #0a0a0f;
}

.guide-scroll::-webkit-scrollbar {
  width: 6px;
}

.guide-scroll::-webkit-scrollbar-track {
  background: #0a0a0f;
}

.guide-scroll::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* Enemy Section */
.guide-enemy-section {
  margin-bottom: 8px;
}

.guide-enemy-header {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.guide-enemy-header.freddy-header {
  background: linear-gradient(135deg, rgba(80, 40, 10, 0.25) 0%, rgba(20, 10, 5, 0.4) 100%);
  border: 1px solid rgba(136, 68, 0, 0.3);
}

.guide-enemy-header.cosmic-header {
  background: linear-gradient(135deg, rgba(50, 20, 100, 0.25) 0%, rgba(10, 5, 30, 0.4) 100%);
  border: 1px solid rgba(136, 68, 255, 0.3);
}

.guide-enemy-header.golden-header {
  background: linear-gradient(135deg, rgba(100, 80, 10, 0.25) 0%, rgba(30, 25, 5, 0.4) 100%);
  border: 1px solid rgba(204, 170, 0, 0.3);
}

.guide-portrait-wrap {
  width: clamp(80px, 18vw, 120px);
  height: clamp(80px, 18vw, 120px);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  border: 2px solid #333;
}

.guide-portrait-wrap.cosmic-portrait-wrap {
  border-color: rgba(136, 68, 255, 0.5);
  box-shadow: 0 0 15px rgba(136, 68, 255, 0.2);
}

.guide-portrait-wrap.golden-portrait-wrap {
  border-color: rgba(204, 170, 0, 0.5);
  box-shadow: 0 0 15px rgba(204, 170, 0, 0.2);
}

.guide-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) brightness(0.85);
}

.guide-enemy-title-block {
  flex: 1;
}

.guide-enemy-name {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(11px, 2.5vw, 16px);
  margin-bottom: 4px;
}

.freddy-name-color {
  color: #dd8833;
  text-shadow: 0 0 8px rgba(200, 100, 0, 0.4);
}

.cosmic-name-color {
  background: linear-gradient(90deg, #8844ff, #4488ff, #cc44ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.golden-name-color {
  background: linear-gradient(90deg, #ccaa00, #ffdd33, #eebb00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-enemy-subtitle {
  font-family: 'VT323', monospace;
  font-size: clamp(13px, 2.5vw, 18px);
  color: #777;
  margin-bottom: 8px;
}

.guide-threat-level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.threat-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #888;
}

.threat-bar {
  flex: 1;
  max-width: 120px;
  height: 8px;
  background: #1a1a22;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #333;
}

.threat-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.guide-enemy-body {
  padding: 0 4px;
}

.guide-section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.8vw, 11px);
  color: #aaa;
  margin: 16px 0 8px 0;
  letter-spacing: 1px;
}

.guide-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: rgba(20, 18, 12, 0.6);
  border-radius: 6px;
  border: 1px solid #1e1a14;
}

.guide-path.cosmic-path {
  background: rgba(15, 10, 30, 0.6);
  border-color: #1a1030;
}

.path-node {
  font-family: 'VT323', monospace;
  font-size: clamp(13px, 2.5vw, 17px);
  color: #bba866;
  background: rgba(60, 50, 20, 0.3);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(100, 80, 30, 0.3);
}

.path-node.cosmic-node {
  color: #aa88ff;
  background: rgba(50, 20, 80, 0.3);
  border-color: rgba(100, 50, 180, 0.3);
}

.path-node.door-node {
  color: #ff4444;
  background: rgba(80, 20, 20, 0.3);
  border-color: rgba(150, 40, 40, 0.4);
  font-weight: bold;
}

.path-node.cosmic-door {
  color: #cc44ff;
  background: rgba(60, 10, 60, 0.3);
  border-color: rgba(150, 40, 150, 0.4);
}

.path-arrow {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: #555;
}

.path-arrow.cosmic-arrow {
  color: #8844ff;
}

.path-node.golden-node {
  color: #ccaa00;
  background: rgba(80, 60, 10, 0.3);
  border-color: rgba(150, 120, 20, 0.3);
}

.path-node.golden-door {
  color: #ffdd33;
  background: rgba(80, 60, 10, 0.3);
  border-color: rgba(200, 170, 0, 0.4);
  font-weight: bold;
}

.path-arrow.golden-arrow {
  color: #ccaa00;
}

.guide-path.golden-path {
  background: rgba(30, 25, 5, 0.6);
  border-color: #2a2210;
}

/* Golden Cosmic Guide styles */
.guide-enemy-header.golden-cosmic-header {
  background: linear-gradient(135deg, rgba(100, 70, 10, 0.2) 0%, rgba(40, 20, 80, 0.25) 50%, rgba(20, 10, 40, 0.4) 100%);
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.guide-portrait-wrap.golden-cosmic-portrait-wrap {
  border-color: rgba(255, 170, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.2), 0 0 30px rgba(136, 68, 255, 0.1);
}

.golden-cosmic-name-color {
  background: linear-gradient(90deg, #ccaa00, #ffdd33, #8844ff, #4488ff, #ccaa00);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gc-shimmer 3s ease-in-out infinite;
}

.guide-path.gc-path {
  background: linear-gradient(135deg, rgba(30, 25, 5, 0.6) 0%, rgba(15, 10, 30, 0.6) 100%);
  border-color: rgba(255, 170, 0, 0.2);
}

.path-node.gc-node {
  color: #ffbb44;
  background: linear-gradient(135deg, rgba(60, 50, 20, 0.3), rgba(50, 20, 80, 0.3));
  border-color: rgba(255, 170, 0, 0.3);
}

.path-node.gc-door {
  color: #ffaa00;
  background: linear-gradient(135deg, rgba(80, 60, 10, 0.3), rgba(60, 10, 60, 0.3));
  border-color: rgba(255, 170, 0, 0.4);
  font-weight: bold;
}

.path-arrow.gc-arrow {
  color: #ffaa00;
}

.guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-list li {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 2.8vw, 19px);
  color: #bbb;
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.3;
}

.guide-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #555;
}

.guide-list li strong {
  color: #eee;
}

.guide-list li em {
  color: #ff6666;
  font-style: normal;
}

.guide-list.tips-list li::before {
  content: '★';
  color: #886600;
}

.guide-scaling {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scale-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
}

.scale-label {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.5vw, 9px);
  color: #888;
  min-width: 80px;
}

.scale-desc {
  font-family: 'VT323', monospace;
  font-size: clamp(13px, 2.5vw, 17px);
  color: #999;
}

/* Guide Divider */
.guide-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #333 50%, transparent 100%);
  margin: 20px 0;
}

/* General Mechanics */
.guide-general-section {
  margin-top: 8px;
}

.guide-general-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2.2vw, 14px);
  color: #ccc;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.guide-mechanics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.mechanic-card {
  background: rgba(15, 15, 25, 0.8);
  border: 1px solid #1e1e2e;
  border-radius: 6px;
  padding: 14px;
  transition: border-color 0.2s;
}

.mechanic-card:hover {
  border-color: #333;
}

.mechanic-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.mechanic-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #aaa;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.mechanic-desc {
  font-family: 'VT323', monospace;
  font-size: clamp(13px, 2.5vw, 17px);
  color: #888;
  line-height: 1.35;
}

/* Pro Tip */
.guide-pro-tip {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(40, 30, 0, 0.3) 0%, rgba(20, 15, 0, 0.4) 100%);
  border: 1px solid rgba(200, 150, 0, 0.2);
  border-radius: 8px;
}

.pro-tip-label {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(9px, 1.8vw, 12px);
  color: #ccaa00;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.pro-tip-text {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 2.8vw, 19px);
  color: #aa9955;
  line-height: 1.4;
}

.pro-tip-text strong {
  color: #ddbb44;
}

/* Game HUD */
.game-hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.game-hud * {
  pointer-events: auto;
}

.time-display {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 3vw, 22px);
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.power-display {
  position: absolute;
  bottom: 80px;
  left: 16px;
  font-family: 'VT323', monospace;
  font-size: clamp(16px, 3vw, 24px);
  color: #4f4;
}

.power-display.low {
  color: #ff4;
}

.power-display.critical {
  color: #f44;
  animation: flicker 0.5s infinite;
}

.power-bar {
  width: clamp(100px, 25vw, 200px);
  height: 12px;
  background: #222;
  border: 1px solid #444;
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.power-fill {
  height: 100%;
  background: #4f4;
  transition: width 0.5s, background 0.5s;
}

.power-fill.low {
  background: #ff4;
}

.power-fill.critical {
  background: #f44;
}

.door-btn {
  position: absolute;
  width: clamp(50px, 10vw, 80px);
  height: clamp(100px, 25vh, 180px);
  background: rgba(40, 40, 40, 0.8);
  border: 2px solid #555;
  color: #ccc;
  font-family: 'VT323', monospace;
  font-size: clamp(12px, 2.5vw, 18px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  border-radius: 4px;
}

.door-btn.left {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.door-btn.right {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.door-btn:hover {
  background: rgba(60, 60, 60, 0.9);
}

.door-btn.closed {
  background: rgba(180, 30, 30, 0.7);
  border-color: #ff4444;
  color: #ff4444;
}

.door-btn .door-icon {
  font-size: clamp(20px, 5vw, 36px);
}

.cam-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 28px;
  background: rgba(30, 30, 30, 0.85);
  border: 2px solid #666;
  color: #ccc;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, 2vw, 14px);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.cam-btn:hover {
  border-color: #aaa;
  background: rgba(50, 50, 50, 0.9);
}

.cam-btn.active {
  border-color: #44ff44;
  color: #44ff44;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Camera view */
.camera-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.cam-feed {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cam-feed-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.cam-feed-content canvas {
  width: 100%;
  height: 100%;
}

.cam-static-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 255, 0, 0.03) 1px,
    rgba(0, 255, 0, 0.03) 2px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}

.cam-label {
  position: absolute;
  top: 12px;
  left: 16px;
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: rgba(200, 200, 200, 0.8);
}

.cam-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  justify-content: center;
  background: rgba(0,0,0,0.95);
  border-top: 1px solid #333;
}

.cam-grid-btn {
  padding: 6px 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #aaa;
  font-family: 'VT323', monospace;
  font-size: clamp(11px, 2vw, 15px);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  min-width: 60px;
  text-align: center;
}

.cam-grid-btn:hover {
  border-color: #888;
  color: #fff;
}

.cam-grid-btn.active {
  background: #333;
  border-color: #44ff44;
  color: #44ff44;
}

.cam-grid-btn.has-freddy {
  border-color: #884400;
  box-shadow: 0 0 6px rgba(136, 68, 0, 0.4);
}

.cam-grid-btn.has-cosmic {
  border-color: #6633cc;
  box-shadow: 0 0 6px rgba(102, 51, 204, 0.4);
}

.cam-grid-btn.has-gc {
  border-color: #cc8800;
  box-shadow: 0 0 6px rgba(204, 136, 0, 0.4);
}

.cam-close-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 5;
}

.cam-close-btn:hover {
  color: #ff4444;
}

/* Jumpscare */
.jumpscare-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jumpscare-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: jumpscare-shake 0.1s infinite;
}

@keyframes jumpscare-shake {
  0% { transform: translate(-5px, -5px) scale(1.1); }
  25% { transform: translate(5px, -3px) scale(1.15); }
  50% { transform: translate(-3px, 5px) scale(1.1); }
  75% { transform: translate(3px, 3px) scale(1.12); }
  100% { transform: translate(-5px, -5px) scale(1.1); }
}

/* Game Over / Victory */
.overlay-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  background: rgba(0,0,0,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.gameover-text {
  font-family: 'Creepster', cursive;
  font-size: clamp(36px, 10vw, 80px);
  color: #ff2222;
  text-shadow: 0 0 30px #ff0000;
  animation: flicker 1.5s infinite;
}

.victory-text {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(28px, 8vw, 64px);
  color: #fff;
  text-shadow: 0 0 20px #fff, 0 0 40px #88f;
  animation: victory-glow 2s infinite alternate;
}

@keyframes victory-glow {
  0% { text-shadow: 0 0 20px #fff, 0 0 40px #88f; }
  100% { text-shadow: 0 0 30px #fff, 0 0 60px #44f, 0 0 80px #88f; }
}

.survived-text {
  font-family: 'VT323', monospace;
  font-size: clamp(18px, 4vw, 32px);
  color: #4f4;
}

.stats-text {
  font-family: 'VT323', monospace;
  font-size: clamp(14px, 3vw, 22px);
  color: #999;
  text-align: center;
  line-height: 1.6;
}

.retry-btn, .menu-btn {
  font-family: 'VT323', monospace;
  font-size: clamp(18px, 4vw, 28px);
  padding: 10px 32px;
  background: #1a1a1a;
  border: 2px solid #666;
  color: #ccc;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.retry-btn:hover, .menu-btn:hover {
  border-color: #ff4444;
  color: #ff4444;
}

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  z-index: 55;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Darkness overlay when power out */
.darkness-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}

.darkness-text {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #222;
  animation: darkness-flicker 4s forwards;
}

.jumpscare-overlay.golden-jumpscare {
  background: #0a0800;
}

.jumpscare-overlay.golden-jumpscare img {
  filter: sepia(0.3) saturate(1.5) brightness(0.9);
}

@keyframes darkness-flicker {
  0% { opacity: 0; }
  10% { opacity: 0.3; }
  20% { opacity: 0; }
  30% { opacity: 0.2; }
  50% { opacity: 0; }
  100% { opacity: 0; }
}