:root {
  --frost: #4DA6FF;
  --frost-dark: #2E70BD;
  --snow: #E8F3FA;
  --shadow: #1a2740;
  --aurora: #FF6BA8;
  --aurora-light: #FFB3D0;
  --gold: #FFD93D;
  --green: #4CB85A;
  --red: #FF5A5A;
  --wood: #8B5A2B;
  --stone-gray: #8A929E;
  --deep: #0D1B2E;
  --deeper: #050B16;
  --research: #b070d6;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--deeper);
  font-family: 'Fredoka', sans-serif;
  color: white;
  user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a3a5a, #050b16);
}

#game-wrapper {
  position: relative;
  width: 100vw; height: 100vh;
  max-width: 1500px; max-height: 940px;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: 72px 1fr 82px;
  background: #1a2740;
  border: 4px solid #2E70BD;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(77, 166, 255, 0.3);
}

/* ===== TOP BAR ===== */
#topbar {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #2a4570, #1a2d50);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  border-bottom: 4px solid #0D1B2E;
  overflow-x: auto;
}

.logo {
  font-family: 'Bangers', cursive;
  font-size: 26px;
  letter-spacing: 1.5px;
  color: white;
  text-shadow: 2px 2px 0 var(--frost-dark), 4px 4px 0 rgba(0,0,0,0.4);
  transform: rotate(-2deg);
  flex-shrink: 0;
}
.logo span { color: var(--aurora); }

.resources {
  display: flex;
  gap: 5px;
  flex: 1;
  flex-wrap: nowrap;
}

.resource {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.resource .icon-box {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(0,0,0,0.3);
}

.resource .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; line-height: 1; }
.resource .value { font-size: 17px; font-weight: 700; line-height: 1.1; }

.resource.echo .icon-box {
  background: rgba(255, 107, 168, 0.2);
  box-shadow: inset 0 2px 0 rgba(255,179,208,0.4), inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 8px rgba(255,107,168,0.4);
}
.resource.food .icon-box {
  background: rgba(76, 184, 90, 0.2);
  box-shadow: inset 0 2px 0 rgba(167,233,178,0.4), inset 0 -2px 0 rgba(0,0,0,0.3);
}
.resource.research .icon-box {
  background: rgba(176, 112, 214, 0.2);
  box-shadow: inset 0 2px 0 rgba(220, 180, 240, 0.4), inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 8px rgba(176, 112, 214, 0.4);
}

.villager-count {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: rgba(77, 166, 255, 0.2);
  border: 2px solid var(--frost);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
  flex-shrink: 0;
  font-size: 15px;
}
.villager-count b { color: var(--frost); font-size: 17px; }
.villager-count .class-counts { color: #ffae3d; font-size: 14px; opacity: 0.85; }

.wave-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 8px;
  background: rgba(255, 90, 90, 0.18);
  border: 2px solid var(--red);
  border-radius: 8px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
}
.wave-indicator .label { font-size: 11px; opacity: 0.85; line-height: 1; letter-spacing: 0.5px; }
.wave-indicator .value { font-size: 16px; line-height: 1.1; color: var(--red); font-weight: 700; }
.wave-indicator.incoming { animation: pulseRed 0.8s infinite; }
@keyframes pulseRed {
  0%, 100% { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 0 rgba(255,90,90,0); }
  50% { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 20px rgba(255,90,90,0.7); }
}

.weather-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: rgba(168, 197, 230, 0.18);
  border: 2px solid #a8c5e6;
  border-radius: 8px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
}
.weather-indicator .icon { font-size: 21px; }
.weather-indicator .name { font-size: 14px; }

.day-night {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.day-night-orb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 12px white, inset -2px -2px 0 rgba(0,0,0,0.2);
  transition: all 0.3s;
}
#dn-text { font-size: 13px; letter-spacing: 1px; }
#day-num { color: var(--gold); font-weight: 700; }

.speed-controls {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.speed-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: linear-gradient(180deg, #34547a, #233e60);
  border: 2px solid #4a7aa8;
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), inset 0 -2px 0 rgba(0,0,0,0.3);
  transition: all 0.1s;
}
.speed-btn:hover { border-color: var(--frost); }
.speed-btn.active {
  background: linear-gradient(180deg, #4CB85A, #2a8038);
  border-color: #6ddc7d;
  color: white;
}

/* ===== CANVAS ===== */
#canvas-container {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  overflow: hidden;
  background: #6db8e0;
}

canvas {
  display: block;
  width: 100%; height: 100%;
  cursor: pointer;
  image-rendering: pixelated;
}
canvas.placing { cursor: copy; }

/* ===== SIDEBAR ===== */
#sidebar {
  grid-column: 2;
  grid-row: 2;
  background: linear-gradient(180deg, #1f3556, #14253f);
  border-left: 4px solid #0D1B2E;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tab-bar {
  display: flex;
  background: #0D1B2E;
  border-bottom: 3px solid #0D1B2E;
}
.tab {
  flex: 1;
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 1.2px;
  background: linear-gradient(180deg, #233e60, #14253f);
  color: rgba(255,255,255,0.5);
  border-right: 2px solid #0D1B2E;
  transition: all 0.15s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.tab:last-child { border-right: none; }
.tab:hover { color: white; background: linear-gradient(180deg, #34547a, #1f3556); }
.tab.active {
  background: linear-gradient(180deg, #4a7aa8, #2E70BD);
  color: white;
  box-shadow: inset 0 -3px 0 var(--frost);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  display: none;
}
.tab-content.active { display: flex; flex-direction: column; }

/* Build menu */
.build-menu {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.build-btn {
  background: linear-gradient(180deg, #34547a, #233e60);
  border: 2px solid #4a7aa8;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), inset 0 -3px 0 rgba(0,0,0,0.3), 0 2px 0 #0d1b2e;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s;
  color: white;
  font-family: 'Fredoka', sans-serif;
  text-align: left;
}
.build-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.25), inset 0 -3px 0 rgba(0,0,0,0.3), 0 4px 0 #0d1b2e, 0 0 12px rgba(77, 166, 255, 0.4);
  border-color: var(--frost);
}
.build-btn:active:not(.disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), inset 0 -2px 0 rgba(0,0,0,0.3), 0 0 0 #0d1b2e;
}
.build-btn.disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.6); }
.build-btn.active {
  background: linear-gradient(180deg, #ff8fc4, #d94a87);
  border-color: var(--aurora);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.3), inset 0 -3px 0 rgba(0,0,0,0.3), 0 2px 0 #6b1f3f, 0 0 16px rgba(255,107,168,0.6);
}
.build-btn .name { font-weight: 700; font-size: 16px; margin-bottom: 3px; text-shadow: 1px 1px 0 rgba(0,0,0,0.4); display: flex; align-items: center; gap: 4px; }
.tier-badge {
  background: rgba(255, 217, 61, 0.25);
  border: 1px solid rgba(255, 217, 61, 0.6);
  color: var(--gold);
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: 700;
}
.build-btn .cost { font-size: 14px; display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 3px; }
.cost-item { display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 10px; }
.cost-item.lack { color: #ff8a8a; background: rgba(255,0,0,0.2); }
.build-btn .desc { font-size: 13px; opacity: 0.85; line-height: 1.3; }

/* Quest panel */
.quest-list { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.quest {
  background: linear-gradient(180deg, #34547a, #233e60);
  border: 2px solid #4a7aa8;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), inset 0 -2px 0 rgba(0,0,0,0.3);
}
.quest.complete {
  background: linear-gradient(180deg, #4cb85a, #3a8a45);
  border-color: #6ddc7d;
  opacity: 0.85;
}
.quest.complete .quest-title { text-decoration: line-through; }
.quest-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.quest-title::before { content: '◆ '; color: var(--gold); }
.quest.complete .quest-title::before { content: '✓ '; color: white; }
.quest-desc { font-size: 14px; opacity: 0.85; line-height: 1.3; margin-bottom: 4px; }
.quest-progress {
  height: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}
.quest-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffae3d);
  transition: width 0.4s;
}
.quest-reward { font-size: 13px; color: var(--aurora-light); }

/* Legacy panel */
.legacy-section {
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255,107,168,0.08), rgba(255,107,168,0.15));
  border-top: 3px solid var(--aurora);
  margin-top: auto;
}
.legacy-title {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--aurora-light);
  text-shadow: 1px 1px 0 #6b1f3f, 0 0 6px rgba(255,107,168,0.5);
  margin-bottom: 6px;
}
.legacy-bar {
  height: 10px;
  background: rgba(0,0,0,0.4);
  border: 2px solid #6b1f3f;
  border-radius: 5px;
  overflow: hidden;
}
.legacy-fill {
  height: 100%;
  background: linear-gradient(180deg, var(--aurora-light), var(--aurora));
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4), 0 0 10px var(--aurora);
  transition: width 0.5s;
}
.legacy-info { display: flex; justify-content: space-between; margin-top: 4px; font-size: 14px; font-weight: 600; }
.legacy-info b { color: var(--aurora-light); }
.perks-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.perk-chip {
  font-size: 13px;
  padding: 2px 6px;
  background: rgba(255,107,168,0.25);
  border: 1px solid var(--aurora);
  border-radius: 10px;
  color: white;
  font-weight: 600;
}

/* ===== BOTTOM BAR ===== */
#bottombar {
  grid-column: 1 / -1;
  grid-row: 3;
  background: linear-gradient(0deg, #2a4570, #1a2d50);
  border-top: 4px solid #0D1B2E;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 16px;
}

#message-log {
  flex: 1; font-size: 16px; font-weight: 500; overflow: hidden;
}
#message-log .msg {
  opacity: 0;
  transform: translateX(-10px);
  animation: msgIn 0.4s forwards;
  padding: 1px 0;
}
#message-log .msg.echo { color: var(--aurora-light); text-shadow: 0 0 6px rgba(255,107,168,0.5); }
#message-log .msg.warn { color: var(--gold); }
#message-log .msg.danger { color: #ff7878; text-shadow: 0 0 6px rgba(255,107,107,0.4); }
#message-log .msg.quest { color: var(--gold); text-shadow: 0 0 6px rgba(255,217,61,0.4); font-weight: 600; }

@keyframes msgIn { to { opacity: 1; transform: translateX(0); } }

.hint { font-size: 14px; opacity: 0.7; letter-spacing: 0.3px; max-width: 380px; line-height: 1.3; }
.hint b { color: var(--frost); }

/* ===== MODALS ===== */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 11, 22, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.story-card {
  max-width: 600px;
  padding: 32px;
  background: linear-gradient(180deg, #2a4570, #1a2d50);
  border: 4px solid var(--frost);
  border-radius: 14px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.1), inset 0 -4px 0 rgba(0,0,0,0.3), 0 8px 0 #0d1b2e, 0 0 60px rgba(77, 166, 255, 0.4);
  max-height: 90vh;
  overflow-y: auto;
}

.story-card h1 {
  font-family: 'Bangers', cursive;
  font-size: 44px;
  letter-spacing: 4px;
  margin-bottom: 4px;
  color: white;
  text-shadow: 3px 3px 0 var(--frost-dark), 6px 6px 0 rgba(0,0,0,0.4);
  transform: rotate(-1deg);
}
.story-card h1 span { color: var(--aurora); }

.story-card .subtitle {
  font-family: 'Bangers', cursive;
  font-size: 19px;
  letter-spacing: 4px;
  color: var(--aurora-light);
  margin-bottom: 18px;
  text-shadow: 2px 2px 0 #6b1f3f;
}
.story-card p { font-size: 17px; line-height: 1.6; color: white; margin-bottom: 12px; }
.story-card p em { color: var(--aurora-light); font-style: normal; font-weight: 600; }
.story-card p strong { color: var(--frost); font-weight: 700; }

.story-card .objective {
  margin: 16px 0;
  padding: 12px 14px;
  background: rgba(77, 166, 255, 0.15);
  border: 2px solid var(--frost);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2);
}
.story-card .objective .label {
  font-family: 'Bangers', cursive;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--frost);
  margin-bottom: 6px;
}

.start-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: linear-gradient(180deg, var(--green), #3a8a45);
  border: 3px solid #2a6535;
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 23px;
  letter-spacing: 4px;
  cursor: pointer;
  border-radius: 10px;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.2), inset 0 -4px 0 rgba(0,0,0,0.2), 0 4px 0 #2a6535;
  transition: all 0.1s;
}
.start-btn:hover { transform: translateY(-2px); }
.start-btn:active { transform: translateY(2px); box-shadow: inset 0 4px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(0,0,0,0.2), 0 0 0 #2a6535; }

/* Perk modal */
.perk-modal {
  max-width: 760px;
  padding: 28px;
  background: linear-gradient(180deg, #4a2a4a, #1f1535);
  border: 4px solid var(--aurora);
  border-radius: 14px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.1), inset 0 -4px 0 rgba(0,0,0,0.3), 0 8px 0 #2a0d1f, 0 0 60px rgba(255,107,168,0.5);
  text-align: center;
}
.perk-modal h2 {
  font-family: 'Bangers', cursive;
  font-size: 36px;
  letter-spacing: 4px;
  color: white;
  text-shadow: 3px 3px 0 #6b1f3f, 0 0 14px var(--aurora);
  margin-bottom: 4px;
}
.perk-modal .perk-sub {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 3px;
  color: var(--aurora-light);
  margin-bottom: 20px;
}
.perk-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.perk-card {
  padding: 18px 14px;
  background: linear-gradient(180deg, #2a4570, #1a2d50);
  border: 3px solid #4a7aa8;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.1), inset 0 -3px 0 rgba(0,0,0,0.3), 0 3px 0 #0d1b2e;
}
.perk-card:hover {
  transform: translateY(-4px);
  border-color: var(--aurora);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.2), inset 0 -3px 0 rgba(0,0,0,0.3), 0 6px 0 #0d1b2e, 0 0 20px rgba(255,107,168,0.6);
}
.perk-card .perk-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.perk-card .perk-name {
  font-family: 'Bangers', cursive;
  font-size: 21px;
  letter-spacing: 1.5px;
  color: var(--aurora-light);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  margin-bottom: 6px;
}
.perk-card .perk-desc {
  font-size: 15px;
  color: white;
  line-height: 1.4;
  opacity: 0.95;
}

/* Research modal */
.research-modal {
  max-width: 880px;
  max-height: 88vh;
  padding: 24px;
  background: linear-gradient(180deg, #2a1a4a, #14082a);
  border: 4px solid var(--research);
  border-radius: 14px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.1), inset 0 -4px 0 rgba(0,0,0,0.3), 0 8px 0 #1a0530, 0 0 60px rgba(176, 112, 214, 0.5);
  overflow-y: auto;
  position: relative;
}
.research-modal h2 {
  font-family: 'Bangers', cursive;
  font-size: 32px;
  letter-spacing: 4px;
  color: white;
  text-shadow: 3px 3px 0 #4a1f6b, 0 0 14px var(--research);
  margin-bottom: 4px;
  text-align: center;
}
.research-modal .sub {
  font-family: 'Bangers', cursive;
  font-size: 15px;
  letter-spacing: 3px;
  color: #d8b4f0;
  margin-bottom: 18px;
  text-align: center;
}
.research-tier {
  margin-bottom: 16px;
}
.tier-label {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 3px;
  color: white;
  text-shadow: 1px 1px 0 #4a1f6b;
  margin-bottom: 8px;
  padding-left: 4px;
  border-left: 4px solid var(--research);
}
.research-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.research-card {
  padding: 12px 10px;
  background: linear-gradient(180deg, #3a2a5a, #1f1535);
  border: 2px solid #4a3a6a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.1), inset 0 -2px 0 rgba(0,0,0,0.3);
}
.research-card.affordable {
  border-color: var(--research);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.15), 0 0 12px rgba(176, 112, 214, 0.5);
}
.research-card.affordable:hover {
  transform: translateY(-2px);
  border-color: #d8b4f0;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.2), 0 0 16px rgba(176, 112, 214, 0.8);
}
.research-card.researched {
  background: linear-gradient(180deg, #2a5a3a, #14352a);
  border-color: #4cb85a;
  cursor: default;
  opacity: 0.85;
}
.research-icon { font-size: 28px; margin-bottom: 4px; }
.research-name {
  font-family: 'Bangers', cursive;
  font-size: 17px;
  letter-spacing: 1px;
  color: white;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  margin-bottom: 4px;
}
.research-desc { font-size: 13px; color: rgba(255,255,255,0.9); line-height: 1.3; min-height: 28px; }
.research-cost {
  margin-top: 6px;
  font-size: 14px;
  color: var(--research);
  font-weight: 700;
}
.research-card.researched .research-cost { color: #6ddc7d; }
.research-req {
  font-size: 12px;
  margin-top: 3px;
  color: #ff9090;
  opacity: 0.85;
}

#research-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 2px solid var(--research);
  background: rgba(0,0,0,0.4);
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 21px;
  border-radius: 8px;
  cursor: pointer;
}
#research-close:hover { background: rgba(176, 112, 214, 0.3); }

/* Tooltip */
#tooltip {
  position: absolute;
  pointer-events: none;
  background: linear-gradient(180deg, #2a4570, #1a2d50);
  border: 2px solid var(--frost);
  padding: 6px 10px;
  font-size: 15px;
  color: white;
  font-weight: 500;
  border-radius: 6px;
  z-index: 50;
  display: none;
  box-shadow: 0 4px 0 #0d1b2e, 0 0 12px rgba(77,166,255,0.3);
  max-width: 260px;
  line-height: 1.4;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
::-webkit-scrollbar-thumb { background: var(--frost-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--frost); }

.icon-svg { width: 22px; height: 22px; }

/* Banners */
.wave-banner {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #6b1f3f, #2a0d1f);
  border: 3px solid var(--red);
  color: white;
  padding: 12px 28px;
  font-family: 'Bangers', cursive;
  font-size: 23px;
  letter-spacing: 3px;
  border-radius: 10px;
  z-index: 80;
  pointer-events: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
  box-shadow: 0 4px 0 rgba(0,0,0,0.5), 0 0 30px rgba(255,90,90,0.6);
  opacity: 0;
  animation: bannerIn 4s forwards;
  text-align: center;
}
@keyframes bannerIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  15%, 85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
.wave-banner .small {
  display: block;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-top: 2px;
}

.reward-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #4a2a4a, #1f1535);
  border: 3px solid var(--aurora);
  color: white;
  padding: 18px 32px;
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 3px;
  border-radius: 10px;
  z-index: 80;
  pointer-events: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
  box-shadow: 0 4px 0 rgba(0,0,0,0.5), 0 0 40px rgba(255,107,168,0.7);
  opacity: 0;
  animation: rewardIn 3.5s forwards;
  text-align: center;
}
.reward-banner .small { display: block; font-size: 16px; letter-spacing: 1.5px; color: var(--aurora-light); margin-top: 4px; }
@keyframes rewardIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}
