/* ===== PACMOULE — Web 1.0 / Années 2000 Kitch ===== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Comic+Neue:wght@700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Comic Sans MS', 'Comic Neue', cursive, sans-serif;
  background: #0a0015;
  color: #ffe066;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Fond sombre avec motif rétro répété */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #0a0015;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #ff00ff, transparent),
    radial-gradient(2px 2px at 40px 70px, #00ff88, transparent),
    radial-gradient(1px 1px at 90px 40px, #ffff00, transparent),
    radial-gradient(2px 2px at 130px 80px, #00ffff, transparent),
    radial-gradient(1px 1px at 160px 120px, #ff66aa, transparent),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 19px,
      rgba(0, 255, 136, 0.03) 19px,
      rgba(0, 255, 136, 0.03) 20px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 19px,
      rgba(255, 0, 255, 0.03) 19px,
      rgba(255, 0, 255, 0.03) 20px
    );
  background-size: 200px 150px, 200px 150px, 200px 150px, 200px 150px, 200px 150px, 20px 20px, 20px 20px;
  animation: bg-drift 40s linear infinite;
}

@keyframes bg-drift {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 200px 150px, -200px 150px, 100px -75px, -100px 75px, 50px 50px, 0 0, 0 0; }
}

/* ===== MARQUEE ===== */
.top-marquee {
  display: block;
  background: linear-gradient(90deg, #ff0080, #7928ca, #ff0080);
  color: #ffff00;
  font-weight: bold;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 3px solid #00ff88;
  text-shadow: 1px 1px 0 #000;
  letter-spacing: 1px;
}

/* ===== HEADER / NEON ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 10px 8px;
  flex-wrap: wrap;
}

.neon-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, 2.5vw, 22px);
  text-align: center;
  line-height: 1.6;
  animation: blink-neon 1.2s step-start infinite;
}

.neon-green {
  color: #39ff14;
  text-shadow:
    0 0 5px #39ff14,
    0 0 10px #39ff14,
    0 0 20px #39ff14,
    0 0 40px #0f0,
    2px 2px 0 #000;
}

.neon-pink {
  display: block;
  color: #ff2d95;
  text-shadow:
    0 0 5px #ff2d95,
    0 0 10px #ff2d95,
    0 0 20px #ff2d95,
    0 0 40px #f0f,
    2px 2px 0 #000;
  margin-top: 6px;
}

@keyframes blink-neon {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.55; }
}

.spinning-gif {
  animation: spin 3s linear infinite;
  filter: drop-shadow(0 0 6px #ff0);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.under-construction {
  text-align: center;
  color: #ff0;
  font-size: 13px;
  padding: 4px;
  background: #330033;
  border-top: 2px dashed #ff0;
  border-bottom: 2px dashed #ff0;
}

blink, .ad-blink {
  animation: classic-blink 1s step-start infinite;
}

@keyframes classic-blink {
  50% { opacity: 0; }
}

/* ===== LAYOUT 3 COLONNES ===== */
.layout-3col {
  display: grid;
  grid-template-columns: 160px 1fr 200px;
  gap: 12px;
  max-width: 960px;
  margin: 16px auto;
  padding: 0 8px;
  align-items: start;
}

@media (max-width: 800px) {
  .layout-3col {
    grid-template-columns: 1fr;
  }
  .col-left, .col-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
}

/* ===== BANNIÈRES PUBS ===== */
.banner-ad {
  background: linear-gradient(180deg, #220044, #110022);
  border: 3px ridge #ff00ff;
  padding: 10px 6px;
  margin-bottom: 10px;
  text-align: center;
  box-shadow: 4px 4px 0 #000, inset 0 0 20px rgba(255, 0, 255, 0.2);
}

.banner-ad.pink {
  border-color: #ff6699;
  background: linear-gradient(180deg, #440022, #220011);
}

.banner-ad.green {
  border-color: #39ff14;
  background: linear-gradient(180deg, #003311, #001a08);
}

.banner-ad.yellow {
  border-color: #ffcc00;
  background: linear-gradient(180deg, #332200, #1a1100);
}

.banner-ad.vertical {
  min-height: 140px;
}

.banner-ad.small {
  font-size: 13px;
}

.ad-label {
  font-size: 9px;
  color: #aaa;
  letter-spacing: 2px;
  margin-bottom: 6px;
  border-bottom: 1px dotted #666;
  padding-bottom: 2px;
}

.ad-flash {
  color: #ff0;
  font-weight: bold;
  animation: classic-blink 0.6s step-start infinite;
}

.banner-ad .tiny {
  font-size: 11px;
  color: #ccc;
  margin: 4px 0;
  line-height: 1.3;
}

.ad-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #ffff00, #ff9900);
  color: #000;
  font-weight: bold;
  font-size: 11px;
  text-decoration: none;
  border: 2px outset #fff;
  cursor: pointer;
  animation: classic-blink 1.4s step-start infinite;
}

.ad-btn:hover {
  background: linear-gradient(180deg, #fff, #ffcc00);
  border-style: inset;
}

.hit-counter-mini {
  text-align: center;
  color: #0f0;
  font-size: 10px;
  margin-top: 8px;
}

.hit-counter-mini pre {
  display: inline-block;
  background: #000;
  border: 2px solid #0f0;
  padding: 4px;
}

/* ===== CENTRE JEU ===== */
.col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-frame {
  position: relative;
  background: #000;
  border: 6px ridge #00ffff;
  box-shadow:
    0 0 20px #00ffff,
    0 0 40px rgba(255, 0, 255, 0.4),
    inset 0 0 30px rgba(0, 255, 136, 0.1);
  padding: 8px;
  width: 100%;
  max-width: 460px;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 10px;
  background: linear-gradient(180deg, #1a0033, #000);
  border-bottom: 2px solid #ff00ff;
  margin-bottom: 6px;
}

.hud-item {
  text-align: center;
  flex: 1;
  min-width: 80px;
}

.hud-label {
  display: block;
  font-size: 9px;
  font-family: 'Press Start 2P', monospace;
  color: #ff00ff;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.hud-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #39ff14;
  text-shadow: 0 0 8px #39ff14;
}

.digestion-bar {
  width: 100%;
  height: 10px;
  background: #222;
  border: 2px inset #666;
  margin-top: 4px;
  overflow: hidden;
}

.digestion-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #39ff14, #ffff00, #ff0000);
  transition: width 0.3s;
  box-shadow: 0 0 8px #ff0;
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  background: #000022;
  image-rendering: pixelated;
  border: 2px solid #333;
  max-width: 100%;
  height: auto;
}

.game-controls {
  text-align: center;
  padding: 10px 4px 4px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Pad directionnel mobile / tactile */
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 64px);
  gap: 6px;
  justify-content: center;
  margin: 12px auto 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.dpad-btn {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, #66aaff, #2244aa);
  border: 3px outset #99ccff;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active,
.dpad-btn.is-pressed {
  border-style: inset;
  background: linear-gradient(180deg, #ff66aa, #cc0066);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center {
  grid-column: 2;
  grid-row: 2;
  background: linear-gradient(180deg, #333, #111);
  border-color: #666;
  color: #ff0;
  cursor: default;
  opacity: 0.85;
}
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }

@media (min-width: 801px) {
  .dpad {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(3, 52px);
    opacity: 0.85;
  }
  .dpad-btn { font-size: 18px; }
}

.kitch-btn {
  font-family: 'Comic Sans MS', 'Comic Neue', cursive;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 20px;
  background: linear-gradient(180deg, #ff66aa, #cc0066);
  color: #fff;
  border: 3px outset #ff99cc;
  cursor: pointer;
  text-shadow: 1px 1px 0 #000;
  box-shadow: 3px 3px 0 #000;
}

.kitch-btn:hover {
  background: linear-gradient(180deg, #ff99cc, #ff3388);
}

.kitch-btn:active {
  border-style: inset;
  box-shadow: 1px 1px 0 #000;
  transform: translate(2px, 2px);
}

.controls-hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 8px;
}

.overlay-message {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-message.hidden {
  display: none;
}

.overlay-box {
  background: linear-gradient(180deg, #220044, #110022);
  border: 4px ridge #ffff00;
  padding: 24px;
  text-align: center;
  max-width: 90%;
  box-shadow: 0 0 30px #ff00ff;
}

.overlay-box h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #ffff00;
  text-shadow: 0 0 10px #ff0;
  margin-bottom: 12px;
  line-height: 1.5;
}

.overlay-box p {
  color: #fff;
  margin-bottom: 16px;
  font-size: 14px;
}

.howto-box {
  margin-top: 12px;
  background: #110022;
  border: 3px dashed #00ff88;
  padding: 12px 16px;
  width: 100%;
  max-width: 460px;
}

.howto-box h3 {
  text-align: center;
  color: #00ff88;
  font-size: 14px;
  margin-bottom: 8px;
  text-shadow: 0 0 6px #0f8;
}

.howto-box ul {
  list-style: none;
  font-size: 13px;
  line-height: 1.7;
}

.howto-box li::before {
  content: "► ";
  color: #ff00ff;
}

/* ===== COLONNE DROITE ===== */
.visitor-counter {
  background: #000;
  border: 4px ridge #00ff00;
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.counter-title {
  font-size: 10px;
  color: #0f0;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.counter-digits {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.counter-digits span {
  display: inline-block;
  width: 22px;
  height: 28px;
  line-height: 28px;
  background: #001100;
  border: 2px inset #0a0;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  text-shadow: 0 0 6px #0f0;
}

.counter-sub {
  font-size: 9px;
  color: #6f6;
  margin-top: 6px;
}

.guestbook {
  background: #1a1020;
  border: 3px ridge #ffcc00;
  padding: 10px;
  margin-bottom: 10px;
}

.guestbook h3 {
  text-align: center;
  color: #ffcc00;
  font-size: 14px;
  margin-bottom: 8px;
  border-bottom: 1px dotted #886;
  padding-bottom: 4px;
}

.gb-entry {
  background: #0d0810;
  border: 1px solid #443;
  padding: 6px;
  margin-bottom: 6px;
  font-size: 11px;
}

.gb-entry strong {
  color: #ff66aa;
}

.gb-entry em {
  color: #888;
  font-size: 9px;
}

.gb-entry p {
  color: #ddd;
  margin-top: 2px;
}

.midi-note {
  background: #001122;
  border: 2px solid #00aaff;
  padding: 8px;
  text-align: center;
  margin-top: 8px;
}

.midi-note pre {
  font-size: 10px;
  color: #0af;
  line-height: 1.4;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 24px;
  border-top: 4px double #ff00ff;
  background: #050010;
  padding: 10px;
  text-align: center;
}

.site-footer marquee {
  color: #ff99cc;
  font-size: 12px;
  margin-bottom: 8px;
}

.footer-links {
  font-size: 12px;
  margin: 8px 0;
}

.footer-links a {
  color: #00ffff;
  text-decoration: underline;
}

.footer-links a:hover {
  color: #ffff00;
  background: #ff00ff;
}

.netscape-badge {
  font-size: 11px;
  color: #888;
  margin-top: 6px;
}

/* ===== FAUSSES POPUPS (ads.js) ===== */
.kitch-popup {
  position: fixed;
  z-index: 9999;
  width: 320px;
  font-family: 'MS Sans Serif', Tahoma, sans-serif;
  font-size: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  animation: popup-in 0.25s ease-out;
  user-select: none;
}

@keyframes popup-in {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.kitch-popup-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  font-weight: bold;
  font-size: 11px;
}

.kitch-popup-titlebar .title-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kitch-popup-close {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 2px outset #fff;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  line-height: 10px;
  padding: 0;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
}

.kitch-popup-close:active {
  border-style: inset;
}

.kitch-popup-body {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #0a0a0a #0a0a0a #dfdfdf;
  padding: 16px 12px;
  text-align: center;
  color: #000;
}

.kitch-popup-body .popup-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.kitch-popup-body .popup-msg {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 12px;
  line-height: 1.4;
}

.kitch-popup-click {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(180deg, #ffff00, #ff6600);
  border: 3px outset #fff;
  color: #c00;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  animation: classic-blink 0.8s step-start infinite;
  text-shadow: 1px 1px 0 #fff;
}

.kitch-popup-click:hover {
  background: linear-gradient(180deg, #fff, #ff9900);
}

.kitch-popup-footer {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 4px 8px;
  font-size: 9px;
  color: #666;
  text-align: right;
}
