* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  padding: 20px;
  position: relative;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap');

/* PIXEL CLOUDS */
.clouds-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.pixel-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: floatCloud linear infinite;
  border-radius: 8px;
}

@keyframes floatCloud {
  0% { transform: translateX(0px) translateY(0px); }
  50% { transform: translateX(25px) translateY(-12px); }
  100% { transform: translateX(0px) translateY(0px); }
}

.float-slow { animation-duration: 22s; }
.float-med { animation-duration: 15s; }
.float-fast { animation-duration: 10s; }

/* SCREENS */
.screen-card {
  background: white;
  border-radius: 32px;
  padding: 45px 55px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  z-index: 10;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 450px;
}

h1 {
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 15px;
}

.subtitle {
  font-weight: 700;
  color: #555;
  border-top: 2px solid #eee;
  border-bottom: 2px solid #eee;
  padding: 8px 20px;
  display: inline-block;
  margin-bottom: 30px;
  font-size: 1.2rem;
}

.pixel-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 14px 38px;
  font-size: 1.2rem;
  font-weight: 700;
  font-family: inherit;
  outline: 3px solid #5a67d8;
  outline-offset: 2px;
  box-shadow: 4px 4px 0px #4c51bf;
  cursor: pointer;
  transition: 0.1s;
  border-radius: 0px;
  margin-top: 10px;
}

.pixel-btn:hover {
  background: #5a67d8;
  transform: translate(-2px, -2px);
}

.hidden {
  display: none !important;
}

/* AVATAR GRID */
.avatar-grid {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 25px 0;
}

.avatar-card {
  background: #f5f5f5;
  padding: 14px 12px;
  width: 108px;
  cursor: pointer;
  border: 3px solid #ddd;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
}

.avatar-card.selected {
  border-color: #667eea;
  background: #e8ebff;
  transform: scale(1.02);
}

.avatar-emoji {
  font-size: 2.8rem;
}

.avatar-name {
  font-weight: bold;
  font-size: 0.85rem;
  margin-top: 5px;
}

.avatar-stats {
  font-size: 0.65rem;
  color: #666;
  margin-top: 5px;
}

.social-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #ff6b6b;
  color: white;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: bold;
}

.nickname-input {
  padding: 12px 20px;
  width: 260px;
  border: 3px solid #ddd;
  font-family: monospace;
  text-align: center;
  margin: 10px 0;
  outline: 2px solid #aaa;
  outline-offset: 2px;
}

.nickname-input:focus {
  outline-color: #667eea;
  border-color: #667eea;
}

/* GAME UI */
.game-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 10;
  position: relative;
}

.game-panel {
  background: white;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud {
  display: flex;
  gap: 35px;
  background: #f5f5f5;
  border-radius: 60px;
  padding: 10px 25px;
  margin-bottom: 20px;
}

.hud-item {
  text-align: center;
}

.hud-label {
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 1px;
}

.hud-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #667eea;
}

canvas {
  display: block;
  border-radius: 16px;
  border: 3px solid #667eea;
  background: #1a1a2e;
  cursor: pointer;
}

.arrow-pad {
  display: grid;
  grid-template-columns: repeat(3, 55px);
  grid-template-rows: repeat(2, 55px);
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}

.arrow-pad button {
  background: white;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  font-weight: bold;
}

.arrow-pad button:active {
  transform: scale(0.92);
  background: #667eea;
  color: white;
}

.info-panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 22px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.level-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 12px;
  border-radius: 12px;
  font-weight: bold;
  text-align: center;
}

.ai-message {
  background: #e74c3c20;
  border-left: 4px solid #e74c3c;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  text-align: center;
}

.scarcity-msg {
  background: #e74c3c;
  color: white;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: center;
  font-weight: bold;
}

.character-info {
  background: #e8ebff;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
}

.character-emoji {
  font-size: 2.8rem;
}

/* WHEEL MODAL */
.wheel-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.wheel-card {
  background: white;
  border-radius: 28px;
  padding: 30px;
  max-width: 420px;
  text-align: center;
}

.wheel-area {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 20px auto;
}

.wheel-canvas {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  transition: transform 3s cubic-bezier(0.2, 0.9, 0.1, 1.1);
}

.wheel-arrow {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.8rem;
  color: gold;
  text-shadow: 0 0 5px black;
}

/* RESULT SCREENS - SOLID WHITE BACKGROUND TO BLOCK CLOUDS */
.result-screen {
  background: white;
  border-radius: 32px;
  padding: 45px;
  text-align: center;
  z-index: 100;
  min-width: 450px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.floating-text {
  position: fixed;
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 2000;
  pointer-events: none;
  animation: floatUp 0.8s ease-out forwards;
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 14px;
  border-radius: 30px;
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  top: 35%;
  color: white;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-70px);
  }
}

.level-transition {
  background: white;
  border-radius: 32px;
  padding: 50px 60px;
  text-align: center;
  min-width: 450px;
  z-index: 20;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.leaderboard-list {
  text-align: left;
  margin: 20px 0;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 15px;
}

.leaderboard-entry {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
  font-family: monospace;
  font-size: 1rem;
}

.leaderboard-entry.you {
  color: #667eea;
  font-weight: bold;
  border-bottom: 2px solid #667eea;
}

/* DEBRIEF MODAL */
.debrief-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  overflow-y: auto;
  padding: 20px;
}

.debrief-content {
  background: white;
  border-radius: 32px;
  padding: 40px;
  max-width: 750px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.dark-pattern {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border-left: 5px solid;
}

.pattern-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pattern-location {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
}

.pattern-behavior {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.4;
}

.pattern-why {
  font-size: 0.85rem;
  color: #667eea;
  font-style: italic;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #ddd;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.urgency { border-left-color: #e74c3c; }
.scarcity { border-left-color: #e67e22; }
.misdirection { border-left-color: #9b59b6; }
.socialproof { border-left-color: #3498db; }
.lossaversion { border-left-color: #e84393; }
.confirmshaming { border-left-color: #f39c12; }

.level-stats {
  background: #e8ebff;
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 25px;
  text-align: center;
}
