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

body {
  background: radial-gradient(ellipse at center, #1a0530 0%, #0a0015 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', Arial, sans-serif;
}

#game-container {
  position: relative;
  background: rgba(10, 5, 25, 0.85);
  border-radius: 16px;
  padding: 14px;
  border: 2px solid rgba(200, 150, 255, 0.3);
  box-shadow: 0 0 40px rgba(180, 80, 255, 0.2);
}

/* ── Board ── */
#board-wrapper {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

#board {
  display: grid;
  grid-template-columns: repeat(8, 72px);
  grid-template-rows: repeat(8, 72px);
  gap: 4px;
}

/* ── Tokens ── */
.cell {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  user-select: none;
  position: relative;
  transition: transform 0.12s, filter 0.12s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.35), inset 0 -2px 4px rgba(0,0,0,0.3);
}

.cell::after {
  content: '';
  position: absolute;
  top: 8px; left: 14px;
  width: 22px; height: 14px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: rotate(-30deg);
  pointer-events: none;
}

.cell:hover { filter: brightness(1.25); transform: scale(1.06); }

.cell.selected {
  transform: scale(1.12);
  filter: brightness(1.4);
  box-shadow: 0 0 18px 6px rgba(255,255,255,0.65), 0 4px 8px rgba(0,0,0,0.5);
  z-index: 10;
}

.cell.drag-source {
  opacity: 0.35;
  transform: scale(0.92);
  transition: opacity 0.08s, transform 0.08s;
}

.cell.drag-over {
  transform: scale(1.14);
  filter: brightness(1.35);
  box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255,255,255,0.55), 0 4px 8px rgba(0,0,0,0.5);
  z-index: 10;
}

#drag-ghost {
  position: fixed;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: scale(1.22);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), inset 0 2px 5px rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  opacity: 0.92;
  transition: none !important;
}

#drag-ghost::after {
  content: '';
  position: absolute;
  top: 8px; left: 14px;
  width: 22px; height: 14px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: rotate(-30deg);
  pointer-events: none;
}

.cell.hint-swap {
  animation: hintPulse 0.5s ease-in-out 2;
}

@keyframes hintPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.3); }
}

.cell.matched {
  animation: matchPop 0.35s ease-out forwards;
}

@keyframes matchPop {
  0%   { transform: scale(1);   opacity: 1; }
  40%  { transform: scale(1.35); opacity: 0.85; }
  100% { transform: scale(0);   opacity: 0; }
}

.cell.drop-in {
  animation: dropIn 0.25s ease-out;
}

@keyframes dropIn {
  0%   { transform: translateY(-60px) scale(0.7); opacity: 0; }
  100% { transform: translateY(0)     scale(1);   opacity: 1; }
}

/* Token palette */
.token-music  { background: radial-gradient(circle at 38% 38%, #7ab8ff, #1a50c8); }
.token-bell   { background: radial-gradient(circle at 38% 38%, #ffe57a, #c87800); }
.token-moon   { background: radial-gradient(circle at 38% 38%, #ffb060, #b84000); }
.token-star   { background: radial-gradient(circle at 38% 38%, #78e878, #1e7a1e); }
.token-heart  { background: radial-gradient(circle at 38% 38%, #ff80c0, #c0006a); }
.token-drop   { background: radial-gradient(circle at 38% 38%, #50e8e8, #006a7a); }
.token-fire   { background: radial-gradient(circle at 38% 38%, #ff7060, #c01000); }
.token-broken { background: radial-gradient(circle at 38% 38%, #c088e0, #700098); }

/* ── Bottom UI ── */
#ui-bottom {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#score-section { flex: 1; }

#score-bar-bg {
  background: #222;
  border-radius: 6px;
  height: 26px;
  overflow: hidden;
  border: 2px solid #444;
}

#score-bar {
  height: 100%;
  background: linear-gradient(to right, #aa0000, #ff4444);
  transition: width 0.4s ease;
  border-radius: 4px;
}

#score-text {
  color: #ddd;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  margin-top: 3px;
}

.stat-box {
  border-radius: 10px;
  padding: 5px 12px;
  text-align: center;
  border: 2px solid;
  min-width: 80px;
  flex-shrink: 0;
}

#passion-box {
  background: linear-gradient(160deg, #e01888, #9a0055);
  border-color: #ff80c0;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}
#passion-box .stat-value { font-size: 13px; font-weight: bold; }

#moves-box {
  background: linear-gradient(160deg, #c88000, #7a4800);
  border-color: #ffd700;
  color: #fff;
}

#sentiment-box {
  background: linear-gradient(160deg, #007888, #004050);
  border-color: #40e0d0;
  color: #fff;
}

.stat-icon { font-size: 16px; }
.stat-value { font-size: 22px; font-weight: bold; line-height: 1; }
.stat-label { font-size: 10px; opacity: 0.8; }

#item-slots { display: flex; gap: 6px; }

.item-slot {
  width: 58px; height: 58px;
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
}

/* ── Overlay messages ── */
#overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  z-index: 50;
  flex-direction: column;
  gap: 16px;
}

#overlay.show { display: flex; }

#overlay-title {
  font-size: 40px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,180,255,0.8);
}

#overlay-sub {
  font-size: 18px;
  color: #ddd;
}

#play-again-btn {
  padding: 12px 36px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, #d01890, #7a10aa);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200,50,200,0.5);
  transition: transform 0.1s, filter 0.1s;
}
#play-again-btn:hover { filter: brightness(1.15); transform: scale(1.04); }

/* ── Combo popup ── */
#combo-popup {
  position: absolute;
  top: 30px; left: 50%;
  transform: translateX(-50%);
  color: #FFD700;
  font-size: 38px;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 20px rgba(255,200,0,0.7);
  pointer-events: none;
  display: none;
  z-index: 40;
}

#combo-popup.show {
  display: block;
  animation: comboAnim 0.8s ease-out forwards;
}

@keyframes comboAnim {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.5) translateY(0); }
  30%  { opacity: 1; transform: translateX(-50%) scale(1.3) translateY(-10px); }
  70%  { opacity: 1; transform: translateX(-50%) scale(1)   translateY(-20px); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(-40px); }
}

/* ── Score popup ── */
.score-popup {
  position: absolute;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 30;
  animation: scoreFloat 0.9s ease-out forwards;
}

@keyframes scoreFloat {
  0%   { opacity: 1; transform: translateY(0)    scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.7); }
}

/* ── Preference display bar ── */
#pref-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}

#round-label {
  font-size: 13px;
  font-weight: bold;
  color: #ccc;
  letter-spacing: 0.06em;
}

.pref-sep { color: #444; }

.pref-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.pref-gem {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5), inset 0 1px 3px rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.pref-item.liked-item .pref-gem   { border: 2px solid #ff90c8; box-shadow: 0 0 7px rgba(255,144,200,0.5); }
.pref-item.disliked-item .pref-gem { border: 2px solid #9060c0; box-shadow: 0 0 7px rgba(144,96,192,0.5); }

.pref-text { color: #ccc; }
.liked-item .pref-label    { color: #ff90c8; font-weight: bold; }
.disliked-item .pref-label { color: #9060c0; font-weight: bold; }

/* ── Powerup slots ── */
.powerup-slot {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  user-select: none;
  position: relative;
}

.powerup-slot.empty { cursor: default; opacity: 0.5; }

.powerup-slot.affordable {
  border-color: #40c8b8;
  box-shadow: 0 0 8px rgba(64,200,184,0.45);
}
.powerup-slot.affordable:hover {
  transform: scale(1.07);
  box-shadow: 0 0 14px rgba(64,200,184,0.65);
}
.powerup-slot.not-affordable { opacity: 0.55; cursor: not-allowed; }

.powerup-emoji { font-size: 26px; line-height: 1; }
.powerup-cost  { font-size: 10px; color: #50d0c0; font-weight: bold; }

/* ── Reward screen ── */
#reward-screen {
  position: absolute;
  inset: 0;
  background: rgba(8, 3, 20, 0.97);
  border-radius: 16px;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 20px;
  overflow-y: auto;
}

#reward-screen h2 {
  color: #fff;
  font-size: 26px;
  text-shadow: 0 0 20px rgba(255,160,255,0.8);
  margin: 0;
}

#reward-sub, #reward-equipped, #reward-next {
  font-size: 13px;
  color: #aaa;
  text-align: center;
}

#reward-choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.powerup-card {
  background: rgba(255,255,255,0.07);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  width: 148px;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.12s, box-shadow 0.14s;
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
}
.powerup-card:hover {
  border-color: #ff90c8;
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(255,144,200,0.3);
}
.powerup-card-emoji { font-size: 34px; }
.powerup-card-name  { color: #fff; font-size: 13px; font-weight: bold; }
.powerup-card-desc  { color: #999; font-size: 11px; line-height: 1.3; }
.powerup-card-cost  { color: #50d0c0; font-size: 11px; }

#skip-reward-btn {
  padding: 9px 28px;
  font-size: 14px;
  background: transparent;
  color: #777;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#skip-reward-btn:hover { color: #bbb; border-color: #888; }

/* ── Setup screen ── */
#setup-screen {
  position: absolute;
  inset: 0;
  background: rgba(8, 3, 20, 0.97);
  border-radius: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 20px;
}

#setup-screen h2 {
  color: #fff;
  font-size: 26px;
  text-shadow: 0 0 20px rgba(255,160,255,0.8);
  margin-bottom: 4px;
}

.setup-section { width: 100%; text-align: center; }

.setup-section-label {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 9px;
  letter-spacing: 0.03em;
}
.setup-section-label.liked    { color: #ff90c8; }
.setup-section-label.liked span   { color: #aaa; font-weight: normal; }
.setup-section-label.disliked { color: #b888e8; }
.setup-section-label.disliked span { color: #aaa; font-weight: normal; }

.gem-picker {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
}

.gem-opt {
  width: 62px; height: 62px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  user-select: none;
  border: 3px solid transparent;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.3);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.15s;
}

.gem-opt::after {
  content: '';
  position: absolute;
  top: 7px; left: 11px;
  width: 18px; height: 11px;
  background: rgba(255,255,255,0.32);
  border-radius: 50%;
  transform: rotate(-30deg);
  pointer-events: none;
}

.gem-opt:not(.unavailable):hover { transform: scale(1.1); }

.gem-opt.liked-sel {
  border-color: #ff90c8;
  box-shadow: 0 0 14px 4px rgba(255,144,200,0.75), 0 3px 8px rgba(0,0,0,0.5);
  transform: scale(1.12);
}

.gem-opt.disliked-sel {
  border-color: #b888e8;
  box-shadow: 0 0 14px 4px rgba(184,136,232,0.75), 0 3px 8px rgba(0,0,0,0.5);
  transform: scale(1.12);
}

.gem-opt.unavailable {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

#start-date-btn {
  margin-top: 6px;
  padding: 13px 50px;
  font-size: 19px;
  font-weight: bold;
  background: linear-gradient(135deg, #d01890, #7a10aa);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(200,50,200,0.5);
  transition: transform 0.1s, filter 0.1s, opacity 0.2s;
}
#start-date-btn:disabled { opacity: 0.38; cursor: not-allowed; }
#start-date-btn:not(:disabled):hover { filter: brightness(1.15); transform: scale(1.04); }

/* ── Main Menu ── */
#main-menu {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #2a0840 0%, #080010 100%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#menu-bg-tiles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.menu-float-gem {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.13;
  animation: menuFloat linear infinite;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.3);
  user-select: none;
}

@keyframes menuFloat {
  0%   { transform: translateY(0px)   rotate(0deg)   scale(1); }
  33%  { transform: translateY(-22px) rotate(120deg) scale(1.06); }
  66%  { transform: translateY(12px)  rotate(240deg) scale(0.94); }
  100% { transform: translateY(0px)   rotate(360deg) scale(1); }
}

#menu-card {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 38px 48px;
  background: rgba(18, 6, 36, 0.88);
  border-radius: 22px;
  border: 2px solid rgba(200, 100, 255, 0.28);
  box-shadow: 0 0 70px rgba(180, 50, 255, 0.18);
  max-width: 480px;
  width: 92%;
}

#game-title {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff90c8, #cc44ff, #ff90c8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShimmer 3.5s linear infinite;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

@keyframes titleShimmer {
  0%   { background-position: 0%   50%; }
  100% { background-position: 200% 50%; }
}

#game-subtitle {
  color: #6a4a7a;
  font-size: 12px;
  font-style: italic;
  margin-bottom: 26px;
}

#high-score-display {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 11px 18px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,0.09);
}

.hs-label {
  font-size: 10px;
  color: #776677;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

#hs-value {
  font-size: 18px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255,215,0,0.35);
}

#menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 11px;
  align-items: center;
}

#play-btn {
  width: 210px;
  padding: 15px 0;
  font-size: 20px;
  font-weight: bold;
  background: linear-gradient(135deg, #d01890, #7a10aa);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(200,50,200,0.5);
  transition: transform 0.1s, filter 0.1s, box-shadow 0.15s;
  letter-spacing: 0.06em;
}
#play-btn:hover { filter: brightness(1.2); transform: scale(1.05); box-shadow: 0 6px 28px rgba(200,50,200,0.7); }

#boss-rush-btn {
  width: 210px;
  padding: 12px 0;
  font-size: 15px;
  font-weight: bold;
  background: linear-gradient(135deg, #bb1010, #660000);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(180,0,0,0.45);
  transition: transform 0.1s, filter 0.1s, box-shadow 0.15s;
  letter-spacing: 0.04em;
}
#boss-rush-btn:hover { filter: brightness(1.2); transform: scale(1.05); box-shadow: 0 6px 26px rgba(200,0,0,0.65); }

#options-btn {
  width: 210px;
  padding: 10px 0;
  font-size: 14px;
  background: transparent;
  color: #999;
  border: 2px solid #3a2a4a;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#options-btn:hover { color: #ddd; border-color: #776688; }

#options-panel {
  margin-top: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

#options-panel h3 {
  color: #aaa;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: #999;
}
.option-row:last-child { margin-bottom: 0; }

.toggle-btn {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 20px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 48px;
  text-align: center;
}
.toggle-btn.on  { background: #d01890; border-color: #ff60c0; color: #fff; }
.toggle-btn.off { background: transparent; border-color: #555; color: #666; }

#volume-slider { width: 110px; accent-color: #d01890; cursor: pointer; }

#menu-back-btn {
  margin-top: 8px;
  padding: 9px 24px;
  font-size: 13px;
  background: transparent;
  color: #666;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#menu-back-btn:hover { color: #bbb; border-color: #777; }

/* ── Locked cells ── */
.cell.locked { opacity: 0.82; cursor: not-allowed; }
.cell.locked::before {
  content: '🔒';
  position: absolute;
  top: 2px; right: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.9));
}

/* ── Void cells (The Void challenge) ── */
.cell.void-cell {
  background: rgba(5,0,15,0.55) !important;
  box-shadow: none !important;
  cursor: default; opacity: 0.35; border-radius: 50%;
}
.cell.void-cell::after { display: none; }
.cell.void-cell:hover  { transform: none !important; filter: none !important; }

/* ── Hidden cells (Blackout challenge) ── */
.cell.hidden-cell {
  background: radial-gradient(circle at 38% 38%, #1a1030, #080010) !important;
  color: rgba(120,90,150,0.7) !important;
  font-size: 20px !important;
}
.cell.hidden-cell::after { display: none; }

/* ── Boss intro screen ── */
#boss-intro {
  position: absolute; inset: 0;
  background: rgba(4, 0, 12, 0.97);
  border-radius: 16px; z-index: 70;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 28px 20px;
  border: 2px solid rgba(220, 50, 50, 0.45);
  box-shadow: inset 0 0 70px rgba(160, 0, 0, 0.13);
}
#boss-warning {
  font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: #ff4444;
  font-weight: bold;
  animation: buffPulse 0.65s ease-in-out infinite;
}
#boss-challenge-emoji { font-size: 62px; line-height: 1.1; }
#boss-challenge-name {
  color: #fff; font-size: 25px; font-weight: bold;
  text-shadow: 0 0 22px rgba(255,70,70,0.7);
  text-align: center;
}
#boss-challenge-desc {
  color: #bbb; font-size: 13px; text-align: center;
  max-width: 340px; line-height: 1.65;
}
#boss-round-info { color: #666; font-size: 12px; }
#boss-start-btn {
  margin-top: 4px; padding: 13px 48px;
  font-size: 17px; font-weight: bold;
  background: linear-gradient(135deg, #bb1010, #770000);
  color: #fff; border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(180,0,0,0.5);
  transition: transform 0.1s, filter 0.1s;
}
#boss-start-btn:hover { filter: brightness(1.2); transform: scale(1.04); }

/* ── Boss label + countdown in pref bar ── */
#boss-label {
  font-size: 11px; font-weight: bold; color: #ff6666;
  background: rgba(160,0,0,0.2);
  border: 1px solid rgba(255,60,60,0.4);
  border-radius: 4px; padding: 2px 7px;
  animation: buffPulse 0.9s ease-in-out infinite;
}
#countdown-display {
  font-size: 12px; font-weight: bold; color: #ff9090;
  background: rgba(120,0,0,0.2);
  border: 1px solid rgba(255,60,60,0.3);
  border-radius: 4px; padding: 2px 7px;
}
#countdown-display.urgent {
  color: #ff2020;
  animation: buffPulse 0.4s ease-in-out infinite;
}

#buff-display {
  font-size: 11px;
  font-weight: bold;
  color: #88ffcc;
  background: rgba(0, 200, 120, 0.15);
  border: 1px solid rgba(0, 200, 120, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  animation: buffPulse 1.4s ease-in-out infinite;
}
@keyframes buffPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Pause menu ── */
#pause-menu {
  position: absolute; inset: 0;
  background: rgba(4, 0, 14, 0.93);
  border-radius: 16px; z-index: 80;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 28px 20px;
  backdrop-filter: blur(3px);
}
#pause-title {
  font-size: 34px; font-weight: 900; color: #fff;
  text-shadow: 0 0 22px rgba(200,140,255,0.75);
  letter-spacing: 0.1em;
}
#pause-subtitle {
  font-size: 11px; color: #554466; letter-spacing: 0.14em;
  text-transform: uppercase; margin-top: -6px;
}
#pause-opts {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 14px 20px; width: 240px;
}
#pause-opts h3 {
  color: #665577; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 12px;
}
#pause-resume-btn {
  width: 210px; padding: 13px 0; font-size: 17px; font-weight: bold;
  background: linear-gradient(135deg, #d01890, #7a10aa);
  color: #fff; border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(200,50,200,0.45);
  transition: transform 0.1s, filter 0.1s; letter-spacing: 0.04em;
}
#pause-resume-btn:hover { filter: brightness(1.2); transform: scale(1.04); }
#pause-quit-btn {
  width: 210px; padding: 9px 0; font-size: 13px;
  background: transparent; color: #665577;
  border: 2px solid #2a1a3a; border-radius: 9px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#pause-quit-btn:hover { color: #bbb; border-color: #664477; }

/* ── Collection button ── */
#collection-btn {
  width: 210px;
  padding: 10px 0;
  font-size: 14px;
  background: transparent;
  color: #aaa;
  border: 2px solid #3a2a4a;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#collection-btn:hover { color: #fff; border-color: #aa88dd; }

#collection-badge {
  font-size: 11px;
  font-weight: bold;
  color: #50d0c0;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ── Collection screen ── */
#collection-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, #160828 0%, #060010 100%);
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 32px 20px 40px;
  gap: 14px;
}

#collection-header {
  text-align: center;
}

#collection-header h2 {
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(135deg, #cc88ff, #ff90c8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

#collection-count {
  font-size: 13px;
  color: #776688;
  letter-spacing: 0.06em;
}

#collection-grid {
  width: 100%;
  max-width: 660px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.col-section-heading {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #554466;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.col-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Individual collection items ── */
.col-item {
  width: 82px;
  border-radius: 10px;
  padding: 10px 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 2px solid;
  transition: transform 0.12s, box-shadow 0.12s;
  flex-shrink: 0;
}

.col-item.collected {
  background: rgba(255,255,255,0.06);
  border-color: rgba(200,150,255,0.28);
}
.col-item.collected:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(180,100,255,0.25);
}

.col-item.uncollected {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.05);
  cursor: default;
}

.col-item-emoji {
  font-size: 26px;
  line-height: 1;
}

/* Silhouette effect for undiscovered items */
.col-item.uncollected .col-item-emoji {
  filter: brightness(0.12) grayscale(1);
}

.col-item-name {
  font-size: 9px;
  font-weight: bold;
  color: #ccc;
  line-height: 1.25;
  word-break: break-word;
  hyphens: auto;
}

.col-item.uncollected .col-item-name {
  color: #2a1a3a;
}

.col-item-cost {
  font-size: 9px;
  color: #50d0c0;
  font-weight: bold;
}

#close-collection-btn {
  margin-top: 8px;
  padding: 10px 36px;
  font-size: 14px;
  background: transparent;
  color: #666;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#close-collection-btn:hover { color: #ccc; border-color: #886699; }

/* ── Custom tooltip ── */
#tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  display: none;
  max-width: 230px;
  background: rgba(8, 3, 20, 0.97);
  border: 1px solid rgba(180, 100, 255, 0.4);
  border-radius: 9px;
  padding: 10px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.75), 0 0 10px rgba(120,50,200,0.18);
  font-family: 'Segoe UI', Arial, sans-serif;
  line-height: 1;
}
#tooltip.visible { display: block; }

.tt-name {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
  white-space: nowrap;
}

.tt-desc {
  font-size: 11px;
  color: #9980aa;
  line-height: 1.45;
  margin-bottom: 5px;
}

.tt-cost {
  font-size: 11px;
  font-weight: bold;
  color: #50d0c0;
}

.tt-note {
  margin-top: 5px;
  font-size: 10px;
  color: #664455;
  font-style: italic;
}

/* ── Debug menu ── */
#debug-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, 92vw);
  max-height: 78vh;
  background: rgba(0, 10, 3, 0.98);
  border: 1px solid #00cc55;
  border-radius: 6px;
  z-index: 9500;
  display: none;
  flex-direction: column;
  font-family: 'Courier New', Courier, monospace;
  box-shadow: 0 0 40px rgba(0,200,80,0.12), 0 10px 40px rgba(0,0,0,0.85);
  overflow: hidden;
}

#debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 200, 80, 0.08);
  border-bottom: 1px solid rgba(0,204,85,0.35);
  flex-shrink: 0;
}

#debug-header-label {
  font-size: 11px;
  font-weight: bold;
  color: #00ff66;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#debug-hint {
  font-size: 10px;
  color: #226633;
  letter-spacing: 0.06em;
}

#debug-close-btn {
  background: transparent;
  border: 1px solid rgba(0,204,85,0.4);
  color: #00cc55;
  cursor: pointer;
  border-radius: 3px;
  padding: 2px 9px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: background 0.12s, color 0.12s;
}
#debug-close-btn:hover { background: rgba(0,200,80,0.18); color: #00ff66; }

#debug-body {
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.debug-section-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #226633;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0,200,80,0.14);
}

/* Scrollable item list */
#debug-item-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

/* Shared row button style */
.debug-row-btn {
  background: transparent;
  border: 1px solid rgba(0,200,80,0.12);
  border-radius: 3px;
  color: #77bb99;
  cursor: pointer;
  padding: 5px 8px;
  text-align: left;
  font-family: inherit;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  width: 100%;
}
.debug-row-btn:hover {
  background: rgba(0,200,80,0.09);
  border-color: rgba(0,200,80,0.5);
  color: #ccffdd;
}

/* Boss buttons use red tint */
.debug-row-btn--boss         { border-color: rgba(200,80,80,0.12); color: #bb7777; }
.debug-row-btn--boss:hover   { background: rgba(200,60,60,0.09); border-color: rgba(200,80,80,0.5); color: #ffcccc; }

.debug-row-icon  { font-size: 14px; flex-shrink: 0; }
.debug-row-label { flex: 1; }
.debug-row-tag   { font-size: 10px; color: #50d0c0; flex-shrink: 0; }

/* Complete round button */
#debug-complete-btn {
  background: rgba(0,200,80,0.06);
  border: 1px solid rgba(0,200,80,0.35);
  border-radius: 3px;
  color: #00ff66;
  cursor: pointer;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.08em;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
}
#debug-complete-btn:hover { background: rgba(0,200,80,0.16); }
