/* Path Logic — Casual mobile puzzle game: board-focused, no website look */

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

body {
  overflow: hidden;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  /* Flad gul baggrund som i Quick, Draw! */
  background: #ffeb3b;
  font-family: "Nunito", system-ui, sans-serif;
  color: #2b2b2b;
  user-select: none;
  -webkit-user-select: none;
}

/* Ingen ekstra overlays på kroppen */
body::after {
  content: none;
}

#game-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 16px;
  gap: 16px;
}

/* Ingen flyvende farveklatter her – stilen er simpel og “papir-agtig” */
#game-container::before,
#game-container::after {
  content: none;
}

/* Top-bar med logo + HUD */
#top-bar {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#logo-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

#logo-title {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #333333;
}

#logo-tagline {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 15px;
  color: #5c4a1c;
}

/* Compact game HUD — blød, håndtegnet stil */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 14px;
  background: rgba(255, 248, 209, 0.95);
  border-radius: 999px;
  box-shadow:
    0 2px 0 rgba(225, 199, 115, 1),
    0 6px 14px rgba(212, 180, 84, 0.55);
  position: relative;
}

#hud-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-label {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 14px;
  color: #6b5a24;
}

.hud-value {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #333333;
}

.hud-dot {
  font-size: 14px;
  color: #b0a46b;
}

#score-num {
  color: #2e7d32;
}

#hud-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fefefe;
  background: #f4b000;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 3px 0 #d39500,
    0 6px 14px rgba(180, 137, 22, 0.55);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.icon-btn-small {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 #c68900,
    0 8px 16px rgba(180, 137, 22, 0.65);
}

.icon-btn:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 #b37a00,
    0 3px 8px rgba(160, 120, 18, 0.55);
}

/* Board-area: bræt + lille hjælpetekst */
#board-area {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Board frame — hvidt “papir”-bræt ovenpå gul baggrund */
#board-frame {
  padding: 16px 18px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 4px 0 #e0cf96,
    0 10px 24px rgba(184, 157, 77, 0.6);
  position: relative;
}

#game-canvas {
  display: block;
  border-radius: 12px;
  touch-action: none;
  box-shadow: inset 0 0 0 2px #f0e4c8;
}

#instructions {
  max-width: 420px;
  text-align: center;
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 15px;
  color: #5c4a1c;
}

/* Info / credit button bottom-left */
#info-btn {
  position: fixed;
  left: 12px;
  bottom: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: "Nunito", system-ui, sans-serif;
  background: rgba(255, 248, 209, 0.95);
  color: #4b5563;
  box-shadow:
    0 2px 0 rgba(225, 199, 115, 1),
    0 4px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 40;
}

#info-btn:hover {
  background: rgba(255, 244, 189, 1);
}

#info-panel {
  position: fixed;
  bottom: 40px;
  left: 12px;
  max-width: 260px;
  background: #fffdf4;
  border-radius: 12px;
  box-shadow:
    0 3px 0 #e0cf96,
    0 10px 24px rgba(184, 157, 77, 0.7);
  z-index: 39;
}

#info-panel.hidden {
  display: none;
}

.info-panel-inner {
  padding: 12px 14px 10px;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 12px;
  color: #374151;
}

.info-panel-inner h3 {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 16px;
  margin-bottom: 4px;
}

.info-credit {
  margin-top: 6px;
  font-size: 11px;
  color: #4b5563;
}

.info-credit span {
  font-weight: 700;
}

.info-credit a {
  color: #1d4ed8;
  text-decoration: underline;
}

#info-close-btn {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  border: none;
  background: #facc6b;
  color: #4b5563;
  cursor: pointer;
  box-shadow: 0 2px 0 #e0b24e;
}

#info-close-btn:hover {
  background: #fbbf24;
}

/* Shake on invalid move */
#board-frame.shake {
  animation: boardShake 0.35s ease-out;
}

@keyframes boardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  z-index: 20;
  animation: fadeIn 0.2s ease;
}

.overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-panel {
  text-align: center;
  padding: 24px 32px;
  background: #fffdf4;
  border-radius: 18px;
  box-shadow:
    0 3px 0 #e0cf96,
    0 12px 26px rgba(184, 157, 77, 0.7);
  max-width: 88vw;
}

.overlay-panel-wide {
  width: min(520px, 92vw);
}

.overlay-subtitle {
  margin-top: -2px;
}

.btn-secondary {
  margin-top: 10px;
  background: #ffffff;
  color: #333333;
  box-shadow:
    0 3px 0 #e0cf96,
    0 6px 14px rgba(184, 157, 77, 0.4);
}

.btn-secondary:hover {
  background: #fff7d6;
}

.btn-secondary:active {
  box-shadow:
    0 1px 0 #d7c383,
    0 3px 8px rgba(184, 157, 77, 0.35);
}

.overlay-panel h2 {
  font-family: "Kalam", system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  color: #333333;
}

.overlay-panel p {
  font-size: 15px;
  font-family: "Kalam", system-ui, sans-serif;
  color: #555555;
  margin-bottom: 20px;
}

.overlay-panel button {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #ffffff;
  background: #4caf50;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow:
    0 3px 0 #3c8f40,
    0 6px 14px rgba(60, 143, 64, 0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.overlay-panel button:hover {
  background: #5cb85c;
  transform: translateY(-1px);
  box-shadow:
    0 4px 0 #3c8f40,
    0 8px 16px rgba(60, 143, 64, 0.7);
}

.overlay-panel button:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 #357a38,
    0 3px 8px rgba(60, 143, 64, 0.6);
}

@media (max-width: 380px) {
  #hud {
    max-width: 100%;
    padding: 6px 10px;
  }
  .hud-value {
    font-size: 16px;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  #board-frame {
    padding: 10px;
    border-radius: 18px;
  }
  #game-canvas {
    border-radius: 10px;
  }
}
