/* Mona Lisa Heist — UI styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0d0b1e;
  font-family: "Trebuchet MS", "Comic Sans MS", system-ui, sans-serif;
  color: #fff;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}

canvas { display: block; }
.hidden { display: none !important; }

/* ===== Full-screen overlay screens ===== */
.screen {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 24px;
  background: radial-gradient(ellipse at center, #2a1f4d 0%, #0d0b1e 75%);
  text-align: center;
  overflow-y: auto;
}

.game-title {
  font-size: clamp(2rem, 6vw, 4rem);
  letter-spacing: 2px;
  color: #ffd76a;
  text-shadow: 0 4px 0 #7a4b00, 0 8px 24px rgba(255, 200, 60, .35);
}

.tagline { font-size: clamp(1rem, 2.5vw, 1.3rem); color: #cfc4ff; }
.hint { color: #8f85c0; font-size: .95rem; }
.big-text {
  font-size: clamp(1.8rem, 5.5vw, 3.5rem);
  color: #ffd76a;
  text-shadow: 0 4px 0 #7a4b00;
}

/* ===== Character grid ===== */
#character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: min(920px, 96vw);
}

.char-card {
  background: linear-gradient(160deg, #3b2f6e, #241b4a);
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 14px 10px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #fff; font-family: inherit;
}

.char-card:hover, .char-card:focus-visible {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--char-color, #ffd76a);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  outline: none;
}

.char-emoji { font-size: 2.4rem; }
.char-name { font-size: 1.15rem; font-weight: bold; color: var(--char-color, #ffd76a); }
.char-power { font-size: .78rem; color: #cfc4ff; line-height: 1.35; }

/* ===== Buttons ===== */
.menu-btn {
  font-family: inherit;
  font-size: 1.15rem; font-weight: bold;
  padding: 12px 28px;
  border: none; border-radius: 999px;
  background: linear-gradient(180deg, #ffd76a, #f0a832);
  color: #4a2c00;
  cursor: pointer;
  box-shadow: 0 5px 0 #a86e10;
  transition: transform .1s;
}
.menu-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #a86e10; }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

#objective-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(13, 11, 30, .75);
  border: 2px solid #5c4da0;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: clamp(.85rem, 2.4vw, 1.05rem);
  color: #ffd76a; font-weight: bold;
  white-space: nowrap;
}

#alert-wrap {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  width: min(340px, 70vw);
}
.alert-label { font-size: .8rem; font-weight: bold; color: #ff9b9b; }
#alert-bar {
  flex: 1; height: 16px;
  background: rgba(255, 255, 255, .12);
  border: 2px solid #5c4da0; border-radius: 999px;
  overflow: hidden;
}
#alert-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffd76a, #ff7043, #ff1744);
  transition: width .15s linear;
}

#carry-indicator {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  background: rgba(46, 125, 50, .85);
  border-radius: 999px;
  padding: 6px 18px;
  font-weight: bold; font-size: .95rem;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.06); } }

/* ===== Power / grab buttons ===== */
#power-hud {
  position: absolute; right: 18px; bottom: 24px;
  display: flex; flex-direction: column; gap: 14px;
  pointer-events: auto;
}

.game-btn {
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 3px solid #ffd76a;
  background: rgba(59, 47, 110, .9);
  color: #fff;
  font-family: inherit; font-size: .72rem; font-weight: bold;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}
.game-btn:active { transform: scale(.93); }
#power-btn { font-size: 1.5rem; }
#power-btn span { font-size: .62rem; letter-spacing: .5px; }
#power-btn.cooling { border-color: #666; filter: grayscale(.8); }

#cooldown-ring {
  position: absolute; inset: -3px;
  border-radius: 50%;
  background: conic-gradient(rgba(0,0,0,.65) var(--cd, 0%), transparent 0%);
  pointer-events: none;
}

/* ===== Virtual joystick (touch) ===== */
#joystick-zone {
  position: absolute; left: 0; bottom: 0;
  width: 45%; height: 55%;
  pointer-events: auto;
  display: none;
}
body.touch #joystick-zone { display: block; }
body.touch #keys-help { display: none; }

.stick-base {
  position: absolute;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 106, .5);
  background: rgba(59, 47, 110, .35);
  transform: translate(-50%, -50%);
}
.stick-knob {
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 215, 106, .85);
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}

/* ===== Speech bubble (raps, honks, roars) ===== */
#speech-bubble {
  position: absolute; left: 50%; bottom: 30%;
  transform: translateX(-50%);
  max-width: min(420px, 84vw);
  background: #fff; color: #241b4a;
  border-radius: 18px;
  padding: 12px 18px;
  font-weight: bold; font-size: clamp(.85rem, 2.6vw, 1.05rem);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
#speech-bubble::after {
  content: ""; position: absolute; bottom: -12px; left: 50%;
  transform: translateX(-50%);
  border: 12px solid transparent; border-top-color: #fff; border-bottom: 0;
}

/* ===== Laser hit flash ===== */
#laser-flash {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 23, 68, .55) 100%);
  animation: flash .35s ease-out;
  pointer-events: none;
}
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

#keys-help {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: .75rem; color: rgba(255, 255, 255, .45);
  white-space: nowrap;
}

/* ===== Forgery note on win screen ===== */
#forgery-note {
  background: #f5e9c8; color: #4a3410;
  border-radius: 12px;
  padding: 16px 22px;
  max-width: min(520px, 90vw);
  transform: rotate(-1.5deg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.note-label { font-size: .85rem; margin-bottom: 8px; color: #7a5c1e; }
.note-text { font-size: 1.15rem; font-weight: bold; font-style: italic; }

#win-detail { color: #cfc4ff; font-size: 1.05rem; max-width: 560px; }
