@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');

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

body {
  background: #000;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  color: #c8a84b;
}

#game-canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

/* Global sound mute — above menus and gameplay HUD */
.sound-toggle-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 100;
  pointer-events: all;
  cursor: pointer;
  padding: 8px 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #c8a84b;
  background: rgba(8, 4, 2, 0.85);
  border: 1px solid rgba(200, 168, 75, 0.45);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}
.sound-toggle-btn:hover {
  color: #f0d880;
  border-color: rgba(240, 216, 128, 0.65);
}
.sound-toggle-btn:active {
  transform: scale(0.98);
}

/* ── UI Overlay ── */
#ui-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ── Screens ── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(ellipse at center, rgba(10,0,0,0.96) 0%, rgba(0,0,0,0.99) 100%);
  pointer-events: all;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 32px;
  box-sizing: border-box;
}

.screen:not(.cutscene-fullscreen) > * {
  flex-shrink: 0;
}

/* Center character + map pickers vertically; auto margins drop to 0 when content needs to scroll */
#char-select-screen > :first-child,
#map-select-screen > :first-child {
  margin-top: auto;
}

#char-select-screen > :last-child,
#map-select-screen > :last-child {
  margin-bottom: auto;
}

.screen.cutscene-fullscreen {
  overflow: hidden;
  padding: 0;
  justify-content: stretch;
}

.screen.hidden { display: none; }
.screen.active  { display: flex; }

.hidden { display: none !important; }

/* Blood drip border on screens */
.screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%, #8b0000 15%, #cc0000 30%, #8b0000 50%,
    #cc0000 70%, #8b0000 85%, transparent 100%);
  box-shadow: 0 0 18px #cc000088;
}

.sap-labs-credit {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: #886644;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sap-labs-credit .hub-all-games {
  color: #c8a84b;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: none;
}
.sap-labs-credit .hub-all-games:hover {
  text-decoration: underline;
  color: #f0d880;
}

.title {
  font-size: clamp(3rem, 10vw, 7rem);
  letter-spacing: 0.35em;
  color: #cc2200;
  text-shadow:
    0 0 20px #cc220099,
    0 0 60px #88000055,
    0 0 100px #44000033;
  animation: title-pulse 3s ease-in-out infinite, flicker 6s infinite;
}

/* Trademark — circle sized to the letters (square = max of W/H) + even padding */
.title-tm {
  font-size: clamp(1.15rem, 3.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 0.18em;
  vertical-align: super;
  position: relative;
  top: -0.12em;
  color: #cc2200;
  text-shadow:
    0 0 14px #cc2200aa,
    0 0 36px #88000066;
  animation: title-pulse 3s ease-in-out infinite, flicker 6s infinite;
  line-height: 1;
  white-space: nowrap;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0.14em;
  width: max-content;
  aspect-ratio: 1;
  height: auto;
  border: 0.08em solid rgba(204, 34, 0, 0.92);
  border-radius: 50%;
  background: rgba(12, 4, 2, 0.55);
  box-shadow:
    0 0 12px rgba(204, 34, 0, 0.45),
    0 0 24px rgba(136, 0, 0, 0.25),
    inset 0 0 10px rgba(0, 0, 0, 0.35);
}

@keyframes title-pulse {
  0%, 100% { text-shadow: 0 0 20px #cc220099, 0 0 60px #88000055; }
  50%       { text-shadow: 0 0 40px #ff2200cc, 0 0 80px #aa000077, 0 0 120px #66000044; }
}

.subtitle {
  font-size: 1.05rem;
  color: #664422;
  letter-spacing: 0.2em;
  animation: flicker 8s infinite;
}

button {
  margin-top: 12px;
  padding: 12px 40px;
  background: transparent;
  border: 1px solid #660000;
  color: #aa3300;
  font-family: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(200,0,0,0.04) 0%, transparent 100%);
  pointer-events: none;
}

button:hover {
  background: rgba(100,0,0,0.4);
  color: #ff4422;
  border-color: #cc2200;
  box-shadow: 0 0 20px #cc220055, inset 0 0 10px rgba(200,0,0,0.1);
}

/* ── HUD ── */
#hud {
  position: absolute;
  top: 16px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  pointer-events: none;
}

#hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#powerup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#powerup-stars {
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: #60d0ff;
  text-shadow: 0 0 8px #60d0ff;
  transition: color 0.3s;
}

#immune-bar-bg {
  width: 100px;
  height: 4px;
  background: #001a2a;
  border: 1px solid #60d0ff44;
}

#immune-bar {
  height: 100%;
  width: 0%;
  background: #60d0ff;
  box-shadow: 0 0 6px #60d0ff;
  transition: width 0.1s;
}

#hud.hidden { display: none; }

#level-display {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: #88330088;
  text-shadow: 0 0 8px #44000055;
}

#sanity-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

#sanity-label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #88330066;
}

#sanity-bar-bg {
  width: 180px;
  height: 11px;
  background: #1a0000;
  border: 1px solid #66000055;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.8);
}

#sanity-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #cc2200, #ff4400);
  border-radius: 3px;
  transition: width 0.3s, background 0.3s;
  box-shadow: 0 0 6px #cc220066;
}

/* ── Character Select ── */
.select-title {
  font-size: 1.4rem;
  letter-spacing: 0.25em;
  color: #883300;
  margin-bottom: 8px;
  text-shadow: 0 0 16px #44000055;
}

#char-grid,
#char-grid-saplabs {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

#char-grid-saplabs.hidden {
  display: none !important;
}

.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid #44000055;
  background: #080000;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-width: 110px;
}

.char-card:hover {
  border-color: #88000088;
  background: #110000;
}

.char-card.selected {
  border-color: #880000;
  background: #110000;
  box-shadow: 0 0 18px #44000066;
}

.char-preview {
  display: block;
  background: #050000;
}

.char-name {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #66220044;
}

.char-card.selected .char-name {
  color: #883300;
}

/* ── Map Select Screen ── */
#map-select-screen .select-title {
  margin-bottom: 24px;
}

#map-grid,
#map-grid-nightmare {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}
#map-grid-nightmare.hidden {
  display: none !important;
}

.map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 120px;
  border: 3px solid #44000066;
  border-radius: 12px;
  background: #1a0505;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.map-card:hover {
  border-color: #88000088;
  background: #220808;
  transform: scale(1.03);
}

.map-card.selected {
  border-color: #cc3300;
  background: #220808;
  box-shadow: 0 0 20px #88000044;
}

.map-card-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.map-card-name {
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: #886644;
}

.map-card.selected .map-card-name {
  color: #cc6633;
}

#char-select-actions,
#map-select-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

#char-select-actions button,
#map-select-actions button {
  margin-top: 0;
}

#char-back-btn,
#play-btn,
#map-back-btn,
#map-start-btn {
  font-size: 1rem;
  padding: 12px 32px;
  letter-spacing: 0.2em;
}

/* ── Level Intro Screen ── */
#intro-level-label {
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: #55110088;
  margin-bottom: 4px;
}

#intro-theme-label {
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 3px 14px;
  border-radius: 12px;
  display: inline-block;
  font-family: 'Courier New', monospace;
}

#intro-warning {
  font-size: 1.2rem;
  letter-spacing: 0.4em;
  color: #cc1100;
  margin-bottom: 20px;
  text-shadow: 0 0 20px #880000aa, 0 0 40px #44000055;
  animation: flicker 2.5s infinite;
}

#intro-monster-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.intro-monster-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border: 1px solid #880000;
  background: radial-gradient(ellipse at center, #0d0000 0%, #050000 100%);
  min-width: 100px;
  animation: intro-card-in 0.5s ease both;
  box-shadow: 0 0 12px #44000044, inset 0 0 20px rgba(0,0,0,0.5);
}

@keyframes intro-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-monster-canvas {
  display: block;
  background: transparent;
}

.intro-monster-name {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #cc3333;
  text-shadow: 0 0 8px #88000066;
}

/* ── Death screen ── */
#death-screen {
  background: radial-gradient(ellipse at center, rgba(30,0,0,0.98) 0%, rgba(0,0,0,1) 100%) !important;
}

#death-screen h2 {
  color: #cc0000;
  font-size: 3rem;
  letter-spacing: 0.3em;
  text-shadow: 0 0 30px #cc000088, 0 0 60px #88000055;
  animation: flicker 1.5s infinite;
}

#death-screen p {
  color: #552200;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}

/* ── Win screen ── */
#win-screen h2 {
  color: #00cc44;
  font-size: 2.5rem;
  letter-spacing: 0.2em;
  text-shadow: 0 0 30px #00cc4488;
}

.win-sub  { color: #226633; font-size: 0.95rem; letter-spacing: 0.1em; }
.win-level { color: #00cc4444; font-size: 0.8rem; letter-spacing: 0.2em; margin-top: -8px; }

#straight-world-cutscene-screen.cutscene-fullscreen {
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
  background: #000;
}
#cutscene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
#straight-world-death-cutscene-screen.cutscene-fullscreen {
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
  background: #000;
}
#death-cutscene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
#exit-cutscene-screen.cutscene-fullscreen {
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
  background: #000;
}
#exit-cutscene-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ── Story Screen ── */
#story-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 520px;
  width: 90%;
}

#story-title {
  font-size: 1.2rem;
  letter-spacing: 0.35em;
  color: #883300;
  text-shadow: 0 0 20px #44110033;
}

#story-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

#story-text p {
  font-size: 0.95rem;
  color: #664422;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.story-quote {
  font-size: 1.1rem !important;
  color: #883300 !important;
  font-style: italic;
  padding: 8px 0;
}

.story-escape {
  color: #cc2200;
  font-size: 1.2em;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px #88000055;
}

.story-small {
  color: #442211 !important;
  font-size: 0.8rem !important;
}

.story-disclaimer {
  color: #883300 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.15em !important;
  border: 1px solid #44110033;
  padding: 6px 16px !important;
  background: rgba(80,20,0,0.08);
  margin-top: 8px !important;
}

.story-warning {
  color: #662200 !important;
  margin-top: 16px !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.15em !important;
}

.story-final {
  color: #cc1100 !important;
  font-size: 1.4rem !important;
  letter-spacing: 0.3em !important;
  text-shadow: 0 0 24px #880000aa, 0 0 50px #44000055;
  animation: flicker 2s infinite;
  margin-top: 4px !important;
}

/* ── Visit button ── */
#visit-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 24px;
  background: transparent;
  border: 1px solid #c8a84b88;
  color: #c8a84b;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-decoration: none;
  transition: all 0.2s;
  text-shadow: 0 0 10px #c8a84b66;
}

#visit-btn:hover {
  border-color: #c8a84b;
  color: #ffe080;
  box-shadow: 0 0 16px #c8a84b55;
  text-shadow: 0 0 14px #c8a84baa;
}

.code-label {
  display: block;
  margin: 14px auto 4px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: #886644;
}
.code-input-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 12px;
  width: fit-content;
  max-width: calc(100% - 24px);
}
.code-input {
  display: block;
  margin: 0;
  padding: 6px 12px;
  width: 160px;
  min-width: 0;
  flex: 1 1 140px;
  background: #0a0505;
  border: 1px solid #443322;
  color: #c8a84b;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  text-align: center;
}
.code-submit-btn {
  margin-top: 0;
  padding: 6px 16px;
  flex: 0 0 auto;
  align-self: stretch;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.code-input::placeholder {
  color: #664422;
}

#player-name-input {
  display: block;
  margin: 12px auto 8px;
  padding: 6px 12px;
  width: 160px;
  background: #0a0505;
  border: 1px solid #443322;
  color: #c8a84b;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  text-align: center;
  border-radius: 4px;
}

#player-name-input::placeholder {
  color: #664422;
}

#leaderboard-btn {
  display: block;
  margin: 6px auto;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid #886644;
  color: #aa8844;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

#leaderboard-btn:hover {
  border-color: #c8a84b;
  color: #e8c868;
}

/* ── Leaderboard screen ── */
#leaderboard-screen {
  text-align: center;
  padding: 24px;
}

.leaderboard-title {
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: #c8a84b;
  margin-bottom: 4px;
}

.leaderboard-sub {
  font-size: 0.7rem;
  color: #664422;
  margin-bottom: 20px;
}

#leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0 auto 24px;
  max-width: 280px;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

#leaderboard-list li {
  padding: 10px 14px;
  margin-bottom: 6px;
  background: rgba(20,10,5,0.6);
  border: 1px solid #443322;
  border-radius: 6px;
  color: #c8a84b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#leaderboard-list li .rank {
  color: #886622;
  margin-right: 12px;
  font-weight: bold;
}

#leaderboard-list li .streak {
  color: #aa8844;
  font-weight: bold;
}

#leaderboard-back-btn {
  padding: 10px 28px;
  background: transparent;
  border: 1px solid #664422;
  color: #aa8844;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 6px;
}

#leaderboard-back-btn:hover {
  border-color: #c8a84b;
  color: #e8c868;
}

/* ── Nightmare Mode ── */
#nightmare-btn {
  background: transparent;
  border: 1px solid #440000;
  color: #660000;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  padding: 10px 28px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: -4px;
}

#nightmare-btn:hover {
  background: #1a0000;
  color: #cc0000;
  border-color: #880000;
  box-shadow: 0 0 16px #44000055;
}

#nightmare-btn.nightmare-active {
  background: #0d0000;
  color: #ff1100;
  border-color: #cc0000;
  box-shadow: 0 0 24px #88000088;
  animation: nm-pulse 0.7s infinite;
  text-shadow: 0 0 12px #ff0000cc;
}

#nightmare-status {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  min-height: 1em;
  color: #cc2200;
  text-shadow: 0 0 8px #88000066;
  animation: flicker 4s infinite;
}

body.nightmare-bg {
  background: #020000;
}

body.nightmare-bg #game-canvas {
  filter: saturate(0.35) hue-rotate(-20deg) brightness(0.75) contrast(1.15);
  box-shadow: 0 0 60px #cc000066, inset 0 0 40px #88000044;
  animation: nm-canvas-pulse 1.8s ease-in-out infinite;
}

@keyframes nm-canvas-pulse {
  0%, 100% { box-shadow: 0 0 60px #cc000066; }
  50%       { box-shadow: 0 0 100px #ff000099, 0 0 20px #880000aa; }
}

@keyframes nm-pulse {
  0%, 100% { box-shadow: 0 0 24px #88000088; }
  50%       { box-shadow: 0 0 55px #ff0000cc, 0 0 12px #cc000099; }
}

/* ── Peaceful Mode ── */
#peaceful-btn {
  background: transparent;
  border: 1px solid #ffb3d966;
  color: #cc66aa;
  font-family: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  padding: 10px 28px;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: -4px;
}

#peaceful-btn:hover {
  background: #fff0fa;
  color: #ff69b4;
  border-color: #ff69b4;
  box-shadow: 0 0 18px #ff69b455;
}

#peaceful-btn.peaceful-active {
  background: linear-gradient(135deg, #fff0fa, #ffe4f5);
  color: #ff1493;
  border-color: #ff69b4;
  box-shadow: 0 0 28px #ff69b488;
  animation: pm-pulse 1.2s ease-in-out infinite;
  text-shadow: 0 0 10px #ff69b4aa;
}

#peaceful-status {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  min-height: 1em;
  color: #ff69b4;
  text-shadow: 0 0 8px #ff69b444;
}

body.peaceful-bg {
  background: linear-gradient(135deg, #fff0fa 0%, #e8f4ff 50%, #f0fff4 100%);
  animation: pm-bg-shift 6s ease-in-out infinite;
}

body.peaceful-bg #game-canvas {
  filter: saturate(1.5) brightness(1.15) hue-rotate(5deg);
  box-shadow: 0 0 60px #ff69b444, 0 0 30px #a29bfe33;
  animation: pm-canvas-glow 2s ease-in-out infinite;
}

@keyframes pm-bg-shift {
  0%   { background: linear-gradient(135deg, #fff0fa 0%, #e8f4ff 50%, #f0fff4 100%); }
  33%  { background: linear-gradient(135deg, #fff8e1 0%, #fff0fa 50%, #e8f4ff 100%); }
  66%  { background: linear-gradient(135deg, #f0fff4 0%, #fff8e1 50%, #fff0fa 100%); }
  100% { background: linear-gradient(135deg, #fff0fa 0%, #e8f4ff 50%, #f0fff4 100%); }
}

@keyframes pm-canvas-glow {
  0%, 100% { box-shadow: 0 0 60px #ff69b444, 0 0 30px #a29bfe33; }
  50%       { box-shadow: 0 0 90px #ff69b466, 0 0 50px #ffd32a44, 0 0 20px #0be88133; }
}

@keyframes pm-pulse {
  0%, 100% { box-shadow: 0 0 28px #ff69b488; }
  50%       { box-shadow: 0 0 50px #ff1493bb, 0 0 20px #ffd32a88; }
}

/* ── Flicker animation ── */
@keyframes flicker {
  0%, 93%, 100% { opacity: 1; }
  94%  { opacity: 0.3; }
  95%  { opacity: 1; }
  97%  { opacity: 0.1; }
  98%  { opacity: 0.9; }
  99%  { opacity: 0.4; }
}

/* ── Scanline overlay on all screens ── */
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* All screen content above scanlines */
.screen > * {
  position: relative;
  z-index: 2;
}

/* ── Stick Can locked card ── */
.char-card-locked {
  opacity: 0.55;
  cursor: not-allowed;
  position: relative;
}

.char-card-locked .char-lock-overlay {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 1.1rem;
  z-index: 3;
  filter: drop-shadow(0 0 4px #000);
}

.char-unlock-hint {
  font-size: 0.55rem;
  color: #888866;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.char-card-locked.unlocked {
  opacity: 1;
  cursor: pointer;
  border-color: #c8a84b88;
  animation: unlock-glow 1.5s ease-in-out 3;
}

.char-card-locked.unlocked .char-lock-overlay {
  display: none;
}

.char-card-locked.unlocked .char-unlock-hint {
  color: #c8a84b;
}

.char-card-locked.unlocked.stickcan-blocked {
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
  box-shadow: none;
}

.char-card-locked.unlocked.stickcan-blocked .char-unlock-hint {
  color: #666655;
}

@keyframes unlock-glow {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 20px #c8a84baa, 0 0 8px #c8a84b55; }
}

/* ── Unlock banner ── */
#unlock-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

#unlock-banner.hidden { display: none; }

#unlock-banner-inner {
  background: linear-gradient(135deg, #1a1200, #2a2000);
  border: 1px solid #c8a84b;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 10px 28px;
  box-shadow: 0 4px 24px #c8a84b55;
  animation: banner-drop 0.4s ease-out;
}

#unlock-banner-text {
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: #c8a84b;
  text-shadow: 0 0 12px #c8a84baa;
}

@keyframes banner-drop {
  from { transform: translateY(-60px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Stick Can hit flash (HUD indicator) ── */
#stickcan-hp {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #c8a84b;
  min-height: 1em;
}

/* ── Mobile maze controls (touch / small screens) — compact, side-mounted ── */
.mobile-move-pad {
  display: none;
  position: fixed;
  z-index: 95;
  left: max(10px, env(safe-area-inset-left, 0px));
  bottom: max(72px, calc(env(safe-area-inset-bottom, 0px) + 56px));
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px 48px;
  gap: 6px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.mobile-move-pad.mobile-move-pad--visible {
  display: grid;
}

/* Hide on mouse-first desktops; keep on phones & most tablets */
@media (hover: hover) and (pointer: fine) {
  .mobile-move-pad.mobile-move-pad--visible {
    display: none;
  }
}

.mobile-move-pad .move-btn {
  pointer-events: auto;
  touch-action: none;
  margin: 0;
  padding: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 9px;
  border: 1.5px solid rgba(200, 168, 75, 0.5);
  background: rgba(12, 8, 4, 0.72);
  color: #e8c060;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mobile-move-pad .move-btn:active {
  background: rgba(80, 40, 20, 0.9);
  border-color: #f0d880;
}

.mobile-move-pad .move-up    { grid-column: 2; grid-row: 1; }
.mobile-move-pad .move-left  { grid-column: 1; grid-row: 2; }
.mobile-move-pad .move-right { grid-column: 3; grid-row: 2; }
.mobile-move-pad .move-down  { grid-column: 2; grid-row: 3; }
