/* ============================================
   The Hundred Acre Wood - Winnie the Pooh Map
   Warm, storybook aesthetic
   ============================================ */

:root {
  /* Honey & forest palette */
  --honey: #e8a838;
  --honey-light: #f5d68a;
  --honey-dark: #c4842a;
  --forest: #4a6b3a;
  --forest-light: #6b8e5a;
  --forest-dark: #2d4a22;
  --paper: #f5ecd8;
  --paper-dark: #e8dcc4;
  --ink: #3d2c1e;
  --ink-light: #5c4a3a;
  --accent: #c45c3a;
  --sky: #87ceeb;
}

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

body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #a8d5ba 0%, #87ceeb 50%, #e8d4a8 100%);
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
}

.page-wrapper {
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.map-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.map-header h1 {
  font-family: 'Caveat', cursive;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--forest-dark);
  text-shadow: 2px 2px 0 var(--honey-light);
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 1rem;
  color: var(--ink-light);
  margin-top: 0.25rem;
}

/* Map container */
.map-container {
  flex: 1;
  width: 100%;
  max-width: 900px;
  position: relative;
}

.map-background {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 600px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 30px rgba(61, 44, 30, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Parchment-style map paper */
.map-paper {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(245, 236, 216, 0.9) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(232, 220, 196, 0.8) 0%, transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-dark) 100%);
  border-radius: 12px;
}

.map-border {
  position: absolute;
  inset: 12px;
  border: 3px double var(--forest);
  border-radius: 8px;
  opacity: 0.6;
  pointer-events: none;
}

/* Decorative trees & water */
.map-decorations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.water {
  fill: rgba(74, 107, 58, 0.08);
  stroke: rgba(74, 107, 58, 0.15);
  stroke-width: 2;
}

.water.pond {
  stroke-width: 1;
}

.water.stream {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
}

.tree {
  fill: rgba(45, 74, 34, 0.12);
  stroke: rgba(45, 74, 34, 0.2);
  stroke-width: 1;
}

.tree.pine {
  stroke-width: 1.5;
}

/* Character markers */
.character-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.2s ease, filter 0.2s ease;
  z-index: 10;
}

.character-marker:hover:not(.character-marker--locked) {
  transform: translate(-50%, -50%) scale(1.15);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.character-marker:active:not(.character-marker--locked) {
  transform: translate(-50%, -50%) scale(1.05);
}

.character-marker.playing .marker-icon {
  animation: bounce 0.5s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.marker-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--paper);
  border: 3px solid var(--forest);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: box-shadow 0.2s ease;
}

.marker-check {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: bold;
  color: white;
  background: var(--forest);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.character-marker--visited .marker-check {
  opacity: 1;
  transform: scale(1);
}

.character-marker:hover .marker-icon {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Piglet area - contains warning sign + marker */
.piglet-area {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 10;
}

.warning-sign {
  position: absolute;
  top: -45%;
  right: -25%;
  width: 36px;
  height: 36px;
  color: var(--accent);
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.warning-sign svg {
  width: 100%;
  height: 100%;
}

/* Center character - 3x larger (Piglet) */
.character-marker--center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.character-marker--center .marker-icon {
  width: 168px;
  height: 168px;
  font-size: 6rem;
}

.character-marker--center .marker-check {
  width: 28px;
  height: 28px;
  font-size: 1rem;
  top: 4px;
  right: 4px;
}

/* Locked Piglet - must hear others first */
.character-marker--locked {
  cursor: not-allowed !important;
  filter: grayscale(0.4) brightness(0.9);
}

.character-marker--locked:hover {
  transform: none;
  filter: grayscale(0.4) brightness(0.9);
}

.character-marker--locked .marker-icon {
  opacity: 0.85;
}

/* Slight color variations per character */
.pooh-face { border-color: var(--honey-dark); background: linear-gradient(135deg, #f5d68a, #e8a838); }
.piglet-face { border-color: #e8a0a0; background: linear-gradient(135deg, #ffd4d4, #ffb0b0); }
.eeyore-face { border-color: #8b7355; background: linear-gradient(135deg, #c4b8a8, #a89888); }
.rabbit-face { border-color: var(--forest); background: linear-gradient(135deg, #d4e8c4, #b8d8a8); }
.owl-face { border-color: #6b5a4a; background: linear-gradient(135deg, #e8dcc4, #d4c8a8); }
.christopher-face { border-color: var(--forest-dark); background: linear-gradient(135deg, #f5ecd8, #e8dcc4); }

.marker-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

/* Playing indicator */
.playing-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--forest);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.playing-indicator.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.playing-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .marker-icon {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }

  .character-marker--center .marker-icon {
    width: 144px;
    height: 144px;
    font-size: 4.5rem;
  }
  
  .marker-label {
    font-size: 0.65rem;
  }
}
