:root {
  --pastel-pink: #f8b4c8;
  --pastel-purple: #c8a8e9;
  --pastel-blue: #a8d8ea;
  --pastel-green: #b5e8b0;
  --pastel-yellow: #fff3b0;
  --pastel-orange: #ffd4a8;
  --white: #ffffff;
  --text: #4a4a4a;
  --cold: #4a90d9;
  --warm: #e85d4a;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-purple), var(--pastel-pink));
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Landing / code entry */
.landing {
  text-align: center;
  margin-top: 15vh;
  width: 100%;
}

.landing h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
  color: #5a3e7a;
}

.landing .emoji-title {
  font-size: 3rem;
  margin-bottom: 16px;
}

.landing p {
  font-size: 1.1rem;
  margin-bottom: 24px;
  color: #6a5a7a;
}

.code-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.code-input-group input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  border: 3px solid var(--pastel-purple);
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  color: var(--text);
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, transform 0.2s;
}

.code-input-group input:focus {
  border-color: #9a6dd7;
  transform: scale(1.08);
}

.btn {
  display: inline-block;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, #9a6dd7, #c084fc);
  color: white;
  box-shadow: 0 4px 15px rgba(154, 109, 215, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(154, 109, 215, 0.6);
  transform: translateY(-2px);
}

.btn-hint {
  background: rgba(255,255,255,0.5);
  color: #6a5a7a;
  font-size: 0.9rem;
  padding: 10px 24px;
  margin-top: 12px;
}

/* Clue page */
.clue-page {
  text-align: center;
  width: 100%;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.egg-found {
  font-size: 4rem;
  margin: 20px 0 10px;
  animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.clue-card {
  background: rgba(255,255,255,0.9);
  border-radius: 20px;
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

.clue-card h2 {
  color: #5a3e7a;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.clue-card .riddle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #5a4a6a;
  font-style: italic;
  margin-bottom: 16px;
}

.clue-card .photo-clue {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  margin: 12px auto;
  display: block;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Proximity / hot-cold */
.proximity-bar {
  width: 100%;
  margin: 20px 0;
}

.proximity-bar .bar-track {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--cold), #8ecae6, var(--pastel-yellow), var(--pastel-orange), var(--warm));
  position: relative;
  overflow: visible;
}

.proximity-bar .bar-indicator {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 3px solid #5a3e7a;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  transition: left 0.5s ease-out;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.proximity-label {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 10px;
  transition: color 0.3s;
}

.proximity-label.freezing { color: #2a6cb5; }
.proximity-label.cold { color: #4a90d9; }
.proximity-label.cool { color: #6aadcf; }
.proximity-label.warm { color: #d4a030; }
.proximity-label.hot { color: #d46a30; }
.proximity-label.boiling { color: #d43030; }

/* Progress eggs */
.progress-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.progress-egg {
  font-size: 1.8rem;
  opacity: 0.3;
  transition: opacity 0.3s, transform 0.3s;
  filter: grayscale(100%);
}

.progress-egg.found {
  opacity: 1;
  filter: grayscale(0%);
  animation: popIn 0.4s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0.5); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Direction arrow */
.direction-compass {
  width: 80px;
  height: 80px;
  margin: 16px auto;
  position: relative;
}

.direction-arrow {
  font-size: 3rem;
  display: inline-block;
  transition: transform 0.3s ease-out;
}

/* Confetti canvas */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Error state */
.error-msg {
  background: rgba(255,255,255,0.8);
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  color: #c44;
  font-weight: 600;
}

/* Final / win screen */
.win-screen {
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

.win-screen h1 {
  font-size: 2rem;
  color: #5a3e7a;
  margin: 16px 0;
}

.win-screen .trophy {
  font-size: 5rem;
  animation: bounceIn 0.8s ease-out;
}

/* Admin page */
.admin-page {
  width: 100%;
  max-width: 700px;
}

.admin-page h1 {
  color: #5a3e7a;
  text-align: center;
  margin: 20px 0;
}

.qr-grid {
  display: grid;
  gap: 20px;
}

.qr-item {
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.qr-item h3 {
  margin-bottom: 8px;
  color: #5a3e7a;
}

.qr-item canvas {
  margin: 10px auto;
  display: block;
}

.qr-item .qr-url {
  font-size: 0.8rem;
  color: #888;
  word-break: break-all;
  margin-top: 8px;
}

.btn-print {
  background: var(--pastel-green);
  color: #3a6a35;
  margin-top: 12px;
}

@media print {
  body { background: white; }
  .no-print { display: none; }
  .qr-item { break-inside: avoid; page-break-inside: avoid; border: 2px solid #ccc; }
}

/* Floating decorations */
.floating-eggs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-egg {
  position: absolute;
  font-size: 2rem;
  opacity: 0.15;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(110vh) rotate(0deg); }
  100% { transform: translateY(-10vh) rotate(360deg); }
}
