/* BlockFort: bright candy buttons on deep-night glass panels. One committed look for a game screen. */
/* Fonts are served with the game (no outside servers): Lilita One for headings, Nunito for text. */
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/lilita-one-latin.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(../fonts/nunito-latin.woff2) format('woff2'); }
:root {
  color-scheme: dark;
  --bg-deep: #0c1030;
  --bg: #161d48;
  --panel-a: rgba(44, 55, 112, 0.96);
  --panel-b: rgba(25, 32, 72, 0.96);
  --card-a: #34418a;
  --card-b: #252f68;
  --card-edge: #151b44;
  --well: rgba(6, 8, 28, 0.55);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f6f7ff;
  --text-dim: #aeb7e2;
  --ink: #1a1426;
  --green-1: #7eea5c; --green-2: #35b83f; --green-3: #1d7a2b;
  --blue-1: #6cbcff;  --blue-2: #2f7de0;  --blue-3: #1c4d9a;
  --purple-1: #cf98ff; --purple-2: #8b4ff0; --purple-3: #5526a6;
  --red-1: #ff8a78;   --red-2: #e8412f;   --red-3: #98231a;
  --gold-1: #ffe36e;  --gold-2: #ffb81c;  --gold-3: #b06f00;
  --slate-1: #7d8bd6; --slate-2: #505ea8; --slate-3: #303a78;
  --emerald: #3ff08e;
  --bad: #ff7a6b;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --outline: drop-shadow(0 2px 0 #1a1426) drop-shadow(0 -2px 0 #1a1426) drop-shadow(2px 0 0 #1a1426) drop-shadow(-2px 0 0 #1a1426);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% -10%, #2b3680 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: var(--body);
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- buttons, panels, slots */
.mc-btn {
  --c1: var(--slate-1); --c2: var(--slate-2); --c3: var(--slate-3);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px;
  font-family: var(--display); font-size: 17px; font-weight: 400; letter-spacing: 0.02em; line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--c3), 0 9px 16px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.mc-btn:hover:not(:disabled) { filter: brightness(1.1); }
.mc-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--c3), 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3); }
.mc-btn:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 3px; }
/* Everything you can reach with the keyboard shows where you are. */
:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mc-btn:disabled { --c1: #626a8e; --c2: #4a5174; --c3: #2e3352; color: rgba(255, 255, 255, 0.55); cursor: not-allowed; text-shadow: none; }
.mc-btn.go { --c1: var(--green-1); --c2: var(--green-2); --c3: var(--green-3); }
/* White on bright green is hard to read on its own, so green (and red) buttons get the same ink outline as the logo. */
.mc-btn.go, .mc-btn.danger { text-shadow: 0 2px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink); }
.mc-btn.danger { --c1: var(--red-1); --c2: var(--red-2); --c3: var(--red-3); }
.mc-btn.enchant { --c1: var(--purple-1); --c2: var(--purple-2); --c3: var(--purple-3); }
.mc-btn.on { --c1: var(--blue-1); --c2: var(--blue-2); --c3: var(--blue-3); box-shadow: 0 5px 0 var(--c3), 0 0 0 3px var(--gold-1), 0 9px 16px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.mc-btn:disabled.go, .mc-btn:disabled.enchant, .mc-btn:disabled.danger { --c1: #626a8e; --c2: #4a5174; --c3: #2e3352; }
.mc-btn.big { font-size: 26px; min-height: 64px; padding: 12px 30px; border-radius: 18px; box-shadow: 0 7px 0 var(--c3), 0 12px 22px rgba(0, 0, 0, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.35); }
.mc-btn.big:active:not(:disabled) { transform: translateY(6px); }
.mc-btn.sq { width: 46px; padding: 0; font-size: 16px; }
.mc-btn img { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3)); }

.mc-panel {
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.slot {
  position: relative;
  width: 50px; height: 50px;
  border-radius: 13px;
  background: var(--well);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid; place-items: center;
}
.slot img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.slot .count {
  position: absolute; right: 4px; bottom: 0;
  font-family: var(--display); font-size: 15px; color: #fff;
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -1px 0 var(--ink);
}
.slot .key {
  position: absolute; left: 5px; top: 3px;
  font-family: var(--display); font-size: 11px; color: rgba(255, 255, 255, 0.55);
}
.bump { animation: bump 0.28s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }

.chips { display: flex; flex-wrap: wrap; gap: 4px 9px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 15px; color: var(--text); }
.chip img { width: 20px; height: 20px; }
.chip.missing { color: var(--bad); }

.em {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px 4px 8px;
  border-radius: 999px;
  background: rgba(6, 8, 28, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  font-family: var(--display); font-size: 19px; color: #c6ffe0;
}
.em img { width: 26px; height: 26px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: 0.01em; }

/* ---------------------------------------------------------------- title */
#screen-title {
  align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(180deg, rgba(12, 16, 48, 0.55) 0%, rgba(12, 16, 48, 0.05) 38%, rgba(12, 16, 48, 0.2) 60%, rgba(12, 16, 48, 0.85) 100%);
}
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.logo {
  font-size: clamp(56px, 12vw, 136px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  display: flex; gap: 0.08em;
  animation: float 3s ease-in-out infinite;
}
.logo .w1, .logo .w2 {
  background: linear-gradient(180deg, #ffffff 0%, #dfe6ff 48%, #9aa8e8 52%, #c8d2ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #1a1426) drop-shadow(0 -4px 0 #1a1426) drop-shadow(4px 0 0 #1a1426) drop-shadow(-4px 0 0 #1a1426) drop-shadow(0 10px 0 rgba(10, 6, 30, 0.45));
}
.logo .w2 { background-image: linear-gradient(180deg, #d4ff9a 0%, #7eea5c 48%, #35b83f 52%, #5fd84a 100%); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
.tagline {
  margin: -6px 0 4px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 4px 0 var(--gold-3), 0 8px 16px rgba(0, 0, 0, 0.35);
  font-family: var(--display); font-size: clamp(15px, 2vw, 20px); color: #4a2a00;
  transform: rotate(-3deg);
  animation: splash 1.1s ease-in-out infinite alternate;
}
@keyframes splash { from { transform: rotate(-3deg) scale(1); } to { transform: rotate(-3deg) scale(1.07); } }
.menu { display: flex; flex-direction: column; gap: 16px; width: min(360px, 86vw); }
.menu .mc-btn { width: 100%; }
.title-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.title-foot .stars {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px 4px 8px; border-radius: 999px;
  background: rgba(6, 8, 28, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  font-family: var(--display); font-size: 19px; color: var(--gold-1);
}
.title-foot .stars img { width: 26px; height: 26px; }
.toggles { display: flex; gap: 10px; }
.fort-row { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: rgba(6, 8, 28, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45); text-align: left; align-self: center; }
.fort-badge { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a8, var(--gold-1) 45%, var(--gold-2)); box-shadow: 0 3px 0 var(--gold-3); font-family: var(--display); font-size: 18px; color: #4a2a00; }
.fort-info { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.fort-info b { font-family: var(--display); font-weight: 400; font-size: 18px; color: #fff; }
.fort-info small { font-family: var(--body); font-size: 13px; color: var(--gold-1); font-weight: 800; }
.fort-info .bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.fort-info .bar i { display: block; height: 100%; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); }
.toggles .mc-btn { font-size: 14px; min-height: 44px; padding: 6px 14px; }

/* ---------------------------------------------------------------- menu screens */
.menu-screen { background: linear-gradient(180deg, rgba(12, 16, 48, 0.82), rgba(12, 16, 48, 0.72)); overflow-y: auto; }
.menu-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px;
  background: rgba(16, 21, 58, 0.96);
  border-bottom: 2px solid var(--line);
}
.menu-head h2 { font-size: clamp(24px, 3.4vw, 34px); flex: 1; color: #fff; filter: var(--outline); }
.menu-body { padding: 22px 16px 36px; width: 100%; max-width: 1140px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.map-card {
  position: relative; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.map-card:hover:not(.locked) { transform: translateY(-4px); }
.map-card:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 3px; }
.map-card.selected { box-shadow: 0 0 0 4px var(--gold-1), 0 0 28px rgba(255, 210, 60, 0.45), 0 14px 34px rgba(0, 0, 0, 0.45); }
.map-card .thumb { width: 100%; aspect-ratio: 5 / 3; border-radius: 14px; display: block; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35); }
.map-card h3 { font-size: 21px; color: #fff; }
.map-card .meta-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.map-card .dstars { gap: 3px; }
.map-card .dstars .grp { padding: 2px 2px; }
.map-card .dstars img { width: 14px; height: 14px; }
.map-card .mstars { display: flex; gap: 2px; }
.map-card .mstars img { width: 24px; height: 24px; }
.map-card.locked { cursor: not-allowed; }
.map-card.locked .thumb { filter: grayscale(1) brightness(0.45); }
.map-card.locked h3, .map-card.locked .meta-row { opacity: 0.55; }
.map-card .lock-badge { position: absolute; inset: 12px 12px auto 12px; aspect-ratio: 5/3; display: grid; place-items: center; }
.map-card .lock-badge img { width: 64px; height: 64px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.map-card .crown { position: absolute; top: -14px; right: -8px; width: 46px; height: 46px; transform: rotate(14deg); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }

.map-detail { position: relative; padding: 20px; display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; }
/* With lots of worlds the grid scrolls, so the Start panel stays pinned to the bottom. */
#screen-maps .map-detail { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5), 0 14px 34px rgba(0, 0, 0, 0.45); }
.map-detail .desc { font-size: 17px; color: var(--text-dim); line-height: 1.4; }
.map-detail .desc h3 { font-size: 30px; margin-bottom: 4px; color: #fff; filter: var(--outline); }
.map-detail .boss { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; color: var(--text-dim); margin-top: 8px; }
.map-detail .boss b { color: #fff; }
.map-detail .boss .portrait { width: 48px; height: 48px; }
.map-detail .boss img { width: 22px; height: 22px; }
.diff-row { display: flex; gap: 8px; flex-wrap: wrap; }
.diff-row .mc-btn { font-size: 15px; min-height: 44px; padding: 6px 14px; }
.detail-actions { display: flex; flex-direction: column; gap: 14px; align-items: stretch; min-width: 250px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; color: var(--text); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green-2); }
.inline-note { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: var(--red-2); color: #fff; font-family: var(--display); font-size: 16px; white-space: nowrap; animation: pop 0.25s ease-out; }

.tabs { display: flex; gap: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shop-card { padding: 16px; display: grid; grid-template-columns: 60px 1fr; gap: 6px 14px; align-items: start; }
.shop-card .pic { grid-row: span 3; width: 60px; height: 60px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35)); }
.shop-card h3 { font-size: 20px; color: #fff; line-height: 1.15; }
.shop-card p { margin: 0; font-size: 15px; color: var(--text-dim); line-height: 1.3; }
.pips { display: flex; gap: 4px; }
.pip { width: 18px; height: 8px; border-radius: 4px; background: rgba(6, 8, 28, 0.6); }
.pip.on { background: linear-gradient(180deg, #8affbe, var(--emerald)); box-shadow: 0 0 8px rgba(63, 240, 142, 0.6); }
.shop-card .mc-btn { grid-column: 1 / -1; margin-top: 6px; }
.lvlbar { display: flex; align-items: center; gap: 8px; }
.lvlbar .bar { flex: 1; height: 9px; border-radius: 5px; background: rgba(6, 8, 28, 0.6); overflow: hidden; }
.lvlbar .bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(180deg, #8affbe, var(--emerald)); box-shadow: 0 0 8px rgba(63, 240, 142, 0.6); }
.lvlbar .lvltxt { font-family: var(--display); font-size: 14px; color: var(--text-dim); min-width: 36px; text-align: right; }
.shop-card.locked-t .pic { filter: grayscale(1) brightness(0.55); }
.reset-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; font-size: 15px; color: var(--text-dim); }
.reset-row .mc-btn { font-size: 14px; min-height: 36px; padding: 6px 14px; }

.howto { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.howto .step { padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.howto .step .pic { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; background: var(--well); }
.howto .step .pic img { width: 50px; height: 50px; }
.howto .step h3 { font-size: 20px; margin-bottom: 4px; color: #fff; }
.howto .step p { margin: 0; font-size: 16px; line-height: 1.4; color: var(--text-dim); font-weight: 600; }
.keys { padding: 16px; font-size: 16px; color: var(--text-dim); line-height: 2; }
.keys b { color: #fff; font-family: var(--display); font-weight: 400; margin-right: 6px; }
.keys kbd { font-family: var(--display); font-size: 14px; background: var(--card-a); color: #fff; padding: 2px 8px; border-radius: 7px; box-shadow: 0 3px 0 var(--card-edge); margin: 0 1px; }

/* ---------------------------------------------------------------- in game */
#screen-game { background: transparent; }
.hud-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px 4px;
  min-height: 58px;
}
#hearts {
  display: flex; flex-wrap: wrap; gap: 1px; max-width: 300px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(6, 8, 28, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}
#hearts img { width: 22px; height: 22px; }
#hearts.hurt { animation: shake 0.3s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.wave-box {
  padding: 5px 16px; border-radius: 999px;
  background: rgba(6, 8, 28, 0.55); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  font-family: var(--display); font-size: 20px; color: #fff; white-space: nowrap;
}
.xp-box { position: relative; flex: 1; min-width: 150px; max-width: 380px; display: flex; flex-direction: row; align-items: center; gap: 0; }
#xp-level {
  position: relative; z-index: 1;
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #d8ff8a, #5ed61a 60%, #2e8a0e);
  box-shadow: 0 3px 0 #1e5a0a, 0 0 14px rgba(150, 255, 60, 0.5);
  font-family: var(--display); font-size: 19px; color: #fff;
  text-shadow: 0 2px 0 #1e5a0a;
}
.xp-bar { flex: 1; height: 16px; margin-left: -8px; padding: 3px 3px 3px 10px; border-radius: 0 999px 999px 0; background: rgba(6, 8, 28, 0.65); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5); }
#xp-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(180deg, #d8ff8a, #6ee02a); box-shadow: 0 0 10px rgba(150, 255, 60, 0.6); transition: width 0.2s; }
#btn-enchant { font-size: 16px; min-height: 40px; }
/* Pulsing glows animate only the opacity of a soft halo behind the button (cheap for the browser),
   instead of animating filter, which repaints the whole button every frame. */
#btn-enchant::after, #btn-wave.pulse::after { content: ''; position: absolute; inset: -6px; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0; animation: halo 0.9s ease-in-out infinite alternate; }
#btn-enchant::after { box-shadow: 0 0 18px 4px rgba(207, 152, 255, 0.9); }
#btn-wave.pulse::after { box-shadow: 0 0 20px 4px rgba(126, 234, 92, 0.85); }
@keyframes halo { to { opacity: 1; } }
.buffs { display: flex; gap: 6px; }
.buff { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(6, 8, 28, 0.55); font-family: var(--display); font-size: 16px; }
.buff img { width: 24px; height: 24px; }
.hud-spacer { flex: 1; }

.game-main { flex: 1; display: flex; min-height: 0; }
.canvas-wrap { flex: 1; position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 6px; }
.stage { position: relative; line-height: 0; }
.stage .canvas-overlay, .stage .hint { line-height: 1.3; }
#game-canvas {
  display: block;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(6, 8, 28, 0.8), 0 16px 40px rgba(0, 0, 0, 0.55);
  touch-action: none; cursor: pointer;
}
.canvas-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; padding: 16px; gap: 10px; overflow: hidden; border-radius: 18px; }
.banner {
  font-family: var(--display); font-size: clamp(28px, 5vw, 56px); color: #fff;
  text-shadow: 0 4px 0 var(--ink), 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 -4px 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 12px 18px rgba(0, 0, 0, 0.4);
  animation: banner 2.2s cubic-bezier(.2, 1.4, .4, 1) forwards;
  text-align: center;
  margin-top: 14%;
}
.banner.boss { color: #ff6b6b; }
.banner.good { color: var(--gold-1); }
@keyframes banner { 0% { opacity: 0; transform: scale(0.3); } 14% { opacity: 1; transform: scale(1); } 78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-30px) scale(0.9); } }
/* Notes sit in the bottom-right corner, out of the way of mobs coming in. */
.toasts { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; line-height: 1.3; max-width: min(380px, 60%); }
.toast {
  pointer-events: none; /* never block taps on the map underneath */
  display: flex; gap: 10px; align-items: center;
  padding: 6px 14px 6px 6px;
  border-radius: 16px;
  background: rgba(16, 20, 52, 0.9);
  animation: toastIn 0.35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.adv { box-shadow: 0 0 0 3px var(--gold-1), 0 10px 24px rgba(0, 0, 0, 0.45); }
.toast.adv b { color: #ffe14a; }
.toast .portrait, .toast > img { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--well); }
.toast b { display: block; font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--gold-1); margin-bottom: 2px; }
.toast span { font-size: 14px; line-height: 1.3; color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(0.9); } to { opacity: 1; transform: none; } }
.hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: 90%;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(12, 14, 40, 0.88);
  box-shadow: 0 0 0 3px var(--gold-1), 0 10px 24px rgba(0, 0, 0, 0.45);
  font-size: 17px; font-weight: 800; color: #fff; text-align: center;
  pointer-events: none;
  animation: hintBob 1.4s ease-in-out infinite;
}
@keyframes hintBob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }

.side-panel { width: 280px; flex: none; margin: 6px 12px 6px 0; display: flex; flex-direction: column; min-height: 0; }
.panel-scroll-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel-title { display: flex; align-items: center; gap: 8px; padding: 14px 16px 8px; font-family: var(--display); font-size: 22px; color: #fff; }
.panel-title img { width: 30px; height: 30px; }
.panel-scroll { overflow-y: auto; padding: 4px 12px 14px; flex: 1; min-height: 0; }
.tower-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tcard {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 9px;
  border: 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.13), transparent 60%), linear-gradient(180deg, var(--card-a), var(--card-b));
  box-shadow: 0 4px 0 var(--card-edge), 0 8px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  color: #fff;
  text-align: center;
  transition: transform 0.12s, box-shadow 0.12s;
}
.tcard:hover:not(.locked) { transform: translateY(-3px); }
.tcard:active:not(.locked) { transform: translateY(2px); box-shadow: 0 1px 0 var(--card-edge), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.tcard .portrait { width: 62px; height: 62px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3)); }
.tcard .tname { font-family: var(--display); font-size: 16px; }
.tcard .chips { justify-content: center; gap: 1px 7px; }
.tcard .chip { color: #fff; font-size: 14px; }
.tcard .chip img { width: 18px; height: 18px; }
.tcard .chip.missing { color: var(--bad); }
.tcard .key { position: absolute; left: 8px; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(6, 8, 28, 0.5); font-family: var(--display); font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.tcard.poor { opacity: 0.62; cursor: not-allowed; }
.tcard.poor .portrait { filter: grayscale(0.85) brightness(0.8); }
.tcard.poor:hover { transform: none; }
.tcard.ready { box-shadow: 0 0 0 2px rgba(126, 234, 92, 0.9), 0 0 16px rgba(126, 234, 92, 0.45), 0 4px 0 var(--card-edge), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.tcard.nope { animation: nope 0.3s; }
@keyframes nope { 0%, 100% { translate: 0; } 25% { translate: -5px; } 75% { translate: 5px; } }
.needs { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 5px; min-height: 20px; }
.need { position: relative; display: inline-flex; align-items: center; font-family: var(--display); font-size: 13px; }
.need img { width: 20px; height: 20px; }
.need b { font-weight: 400; margin-left: 1px; text-shadow: 0 1px 0 var(--ink); }
.need.ok b { color: #8dff7a; }
.need.miss img { opacity: 0.7; }
.need.miss b { color: #ff9a8a; }
.miss-row { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.miss-row span { display: inline-flex; align-items: center; gap: 2px; font-family: var(--display); color: #ff9a8a; }
.miss-row img { width: 22px; height: 22px; }
.ready-bar { width: 80%; height: 6px; border-radius: 3px; background: rgba(6, 8, 28, 0.6); overflow: hidden; }
.ready-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(180deg, #b8ff8a, #35b83f); transition: width 0.25s; }
.tcard.ready .ready-bar i { box-shadow: 0 0 8px rgba(126, 234, 92, 0.9); }
.tp-up .needs { justify-content: flex-end; }
.tp-up .ready-bar { width: 100%; flex-basis: 100%; height: 5px; }
.tp-up { flex-wrap: wrap; row-gap: 4px; }
.tp-bars { display: flex; flex-direction: column; gap: 4px; padding: 7px 9px; border-radius: 10px; background: var(--well); }
.pip-row { display: flex; align-items: center; gap: 7px; }
.pip-name { width: 50px; font-family: var(--display); font-size: 13px; color: var(--text-dim); }
.pip-row img { width: 18px; height: 18px; }
.pips5 { display: flex; gap: 3px; }
.pips5 i { width: 22px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.pips5 i.on { background: linear-gradient(180deg, #b8ff8a, #35b83f); }
.pips5 i.up { background: rgba(255, 210, 60, 0.35); box-shadow: inset 0 0 0 1.5px var(--gold-1); }
.tp-specials { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-specials span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 12.5px; font-weight: 800; color: var(--text-dim); }
.tp-specials img { width: 16px; height: 16px; }
.tp-good { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: 13px; color: var(--text-dim); }
.tp-good > img { width: 30px; height: 30px; border-radius: 8px; background: var(--well); }
.tp-good em { margin-left: auto; font-style: normal; display: inline-flex; align-items: center; gap: 3px; color: var(--text); }
.tp-good em img { width: 16px; height: 16px; }
.tp-dig { display: flex; gap: 4px; }
.tp-dig img { width: 20px; height: 20px; }
.toast .drops .best { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; }
.toast .drops .best img { width: 26px; height: 26px; }
.tcard.on { background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.25), transparent 60%), linear-gradient(180deg, #4b8ff0, #2d5fc0); box-shadow: 0 0 0 3px var(--gold-1), 0 0 22px rgba(255, 210, 60, 0.5), 0 4px 0 #1c3f8a; }
.tcard.locked { cursor: not-allowed; }
.tcard.locked .portrait { filter: grayscale(1) brightness(0.4); }
.tcard .lockico { position: absolute; top: 16px; width: 36px; height: 36px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)); }
.tcard:focus-visible { outline: 3px solid var(--gold-1); outline-offset: 2px; }

.tower-pop {
  position: absolute; z-index: 5; width: 252px; line-height: 1.25;
  max-height: calc(100% - 12px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, rgba(44, 55, 112, 0.96), rgba(25, 32, 72, 0.96));
  border: 2px solid var(--line); border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: popIn 0.16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.tower-pop > * { flex-shrink: 0; } /* when it's too tall it scrolls, instead of squashing the buttons */
.tp-head { display: flex; align-items: center; gap: 10px; }
.tp-pic { flex: none; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #4a5ab0, #1c2462); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1), 0 3px 0 var(--card-edge); }
.tp-head .portrait { width: 48px; height: 48px; display: block; }
.tp-title { min-width: 0; }
.tp-title h3 { font-size: 19px; line-height: 1.05; }
.tp-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-family: var(--display); font-size: 13px; color: var(--text-dim); }
.tp-rank { padding: 1px 7px; border-radius: 999px; background: rgba(255, 227, 110, 0.16); color: var(--gold-1); }
.tp-lv { display: flex; gap: 5px; padding-left: 2px; }
.tp-lv i { width: 9px; height: 9px; transform: rotate(45deg); background: rgba(255, 255, 255, 0.18); border-radius: 2px; }
.tp-lv i.on { background: var(--gold-1); box-shadow: 0 0 6px rgba(255, 220, 90, 0.7); }
.tp-lv i.m { background: var(--purple-1); box-shadow: 0 0 6px rgba(207, 152, 255, 0.8); }
.tp-x { margin-left: auto; align-self: flex-start; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: rgba(6, 8, 28, 0.5); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.tp-x:hover { background: rgba(6, 8, 28, 0.8); }
.tp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; padding: 6px 9px; border-radius: 10px; background: var(--well); font-size: 13px; font-weight: 900; }
.tp-stats em { font-style: normal; color: var(--text-dim); font-weight: 700; margin-right: 4px; display: inline-flex; align-items: center; gap: 3px; }
.tp-stats em img { width: 15px; height: 15px; }
.mat-tip { position: fixed; z-index: 45; padding: 10px 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 6px; max-width: 280px; pointer-events: none; animation: popIn 0.15s ease-out; }
.mt-head { display: flex; align-items: center; gap: 8px; }
.mt-head img { width: 30px; height: 30px; }
.mt-head b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.mt-use { font-size: 14px; color: var(--gold-1); font-weight: 800; }
.mt-from { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-from span { width: 44px; height: 44px; border-radius: 12px; background: var(--well); display: grid; place-items: center; }
.mt-from span img { width: 38px; height: 38px; }
.toast .drops { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; color: var(--text-dim); }
.toast .drops img { width: 22px; height: 22px; }
.tp-note { font-size: 13px; color: var(--text-dim); font-weight: 700; }
.tp-done { color: var(--purple-1); }
.tp-up { width: 100%; justify-content: space-between; font-size: 16px; min-height: 44px; padding: 6px 10px; text-align: left; }
.tp-up.enchant { flex-wrap: wrap; gap: 4px 8px; }
.tp-up .chips { gap: 2px 7px; }
.tp-up .chip { color: #fff; font-size: 14px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.tp-up .chip img { width: 17px; height: 17px; }
.tp-up .chip.missing { color: #ffd2c9; text-decoration: line-through; text-decoration-thickness: 2px; }
.tp-up kbd { font-family: var(--display); font-size: 11px; background: rgba(0, 0, 0, 0.22); padding: 0 5px; border-radius: 5px; margin-left: 2px; }
.tp-m { display: flex; flex-direction: column; align-items: flex-start; }
.tp-m small { font-family: var(--body); font-size: 12.5px; font-weight: 700; opacity: 0.88; line-height: 1.15; letter-spacing: 0; }
.tp-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tp-modes button { border: 0; border-radius: 8px; padding: 5px 0; min-height: 36px; font-family: var(--display); font-size: 13.5px; color: var(--text-dim); background: rgba(6, 8, 28, 0.45); cursor: pointer; }
.tp-modes button.on { background: var(--blue-2); color: #fff; box-shadow: 0 0 0 2px var(--gold-1); }
.tp-sell { display: flex; justify-content: space-between; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 5px 10px; min-height: 40px; background: rgba(232, 65, 47, 0.18); color: var(--red-1); font-family: var(--display); font-size: 14px; cursor: pointer; }
.tp-sell:hover { background: rgba(232, 65, 47, 0.35); }
.tp-sell .chip { font-size: 12px; color: var(--text); }
.tp-sell .chip img { width: 15px; height: 15px; }
.ench-cards.arming { pointer-events: none; }

.hud-bottom {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 6px 12px 10px;
}
.hotbar, .potion-bar { display: flex; gap: 5px; padding: 6px; border-radius: 18px; background: rgba(6, 8, 28, 0.45); box-shadow: inset 0 0 0 2px var(--line); }
.potion-bar { background: rgba(60, 20, 100, 0.45); }
.potion-bar .slot { cursor: pointer; }
.potion-bar .slot.empty { cursor: default; }
.potion-bar .slot.armed { background: rgba(232, 65, 47, 0.8); box-shadow: 0 0 0 3px var(--gold-1); }
.potion-bar .slot:not(.empty):hover { background: rgba(140, 90, 255, 0.5); }
.potion-bar .slot:not(.empty) img { animation: potionBob 1.6s ease-in-out infinite; }
@keyframes potionBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.wave-ctrl { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#next-preview { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(6, 8, 28, 0.45); font-family: var(--display); font-size: 15px; color: var(--text-dim); }
#next-preview:empty { display: none; }
#next-preview .portrait { width: 34px; height: 34px; }
#next-preview .np { display: inline-flex; align-items: center; gap: 1px; color: #fff; }
#next-preview .np { position: relative; }
#next-preview .wing { position: absolute; left: -4px; top: -6px; width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
#btn-wave { font-size: 22px; min-width: 200px; min-height: 58px; border-radius: 18px; }
#btn-wave.pulse { animation: pulseGo 0.9s ease-in-out infinite alternate; }
@keyframes pulseGo { from { transform: scale(1); } to { transform: scale(1.05); } }
.auto { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 16px; cursor: pointer; color: var(--text-dim); }
.auto input { width: 22px; height: 22px; accent-color: var(--green-2); }
.rotate-tip { display: none; }

/* ---------------------------------------------------------------- modals */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(8, 10, 30, 0.72); display: grid; place-items: center; padding: 16px; }
.modal { width: min(580px, 100%); max-height: 100%; overflow-y: auto; padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 16px; align-items: stretch; text-align: center; border-radius: 28px; animation: pop 0.35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { font-size: clamp(32px, 6vw, 48px); color: #fff; line-height: 1.05; filter: var(--outline) drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3)); }
.modal h2.win { color: var(--gold-1); }
.modal h2.lose { color: var(--red-1); }
.modal h2.ench { color: var(--purple-1); }
.modal p { margin: 0; font-size: 17px; color: var(--text-dim); line-height: 1.4; }
.modal .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.modal .col { display: flex; flex-direction: column; gap: 14px; }
.big-stars { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 6px; padding: 8px 0; }
.big-stars::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px; z-index: 0;
  background: repeating-conic-gradient(rgba(255, 220, 90, 0.22) 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: spin 12s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.big-stars img { position: relative; z-index: 1; width: 72px; height: 72px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
.big-stars img:nth-child(2) { width: 92px; height: 92px; }
.big-stars img.got { animation: starIn 0.55s cubic-bezier(.2, 1.8, .4, 1) backwards; }
@keyframes starIn { from { transform: scale(0) rotate(-120deg); } to { transform: none; } }
.tally { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--well); text-align: left; }
.tally .line { display: flex; justify-content: space-between; align-items: center; font-size: 17px; color: var(--text); }
.tally .line .v { display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 20px; color: #c6ffe0; font-variant-numeric: tabular-nums; }
.tally .line .v img { width: 24px; height: 24px; }
.tally .line.total { border-top: 2px dashed var(--line); padding-top: 10px; font-family: var(--display); font-size: 20px; }
.tally .line.total .v { font-size: 26px; color: var(--emerald); }
.unlock-note { padding: 10px 14px; border-radius: 14px; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); box-shadow: 0 4px 0 var(--gold-3); font-size: 16px; font-weight: 800; color: #4a2a00; }
.ench-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ench-card {
  padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; border-radius: 20px;
  background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.2), transparent 55%), linear-gradient(180deg, #8a4ff0, #4d1fa0);
  box-shadow: 0 5px 0 #33106e, 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff; cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}
.ench-card:hover, .ench-card:focus-visible { transform: translateY(-4px) scale(1.03); filter: brightness(1.12) drop-shadow(0 0 14px rgba(207, 152, 255, 0.8)); outline: none; }
.ench-card img { width: 54px; height: 54px; animation: potionBob 1.8s ease-in-out infinite; }
.ench-card b { font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; }
.ench-card span { font-size: 15px; line-height: 1.3; color: #eadbff; }
.ench-card .lvl { font-family: var(--display); font-size: 14px; color: var(--gold-1); }
.settings-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tall screens: panel goes under the map */
@media (max-aspect-ratio: 5/4) {
  .game-main { flex-direction: column; }
  .side-panel { width: auto; margin: 0 10px 6px; max-height: 40%; }
  .tower-cards { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .panel-title { padding: 8px 14px 2px; font-size: 18px; }
  #hearts { max-width: 200px; }
  #hearts img { width: 16px; height: 16px; }
  .hotbar .slot, .potion-bar .slot { width: 40px; height: 40px; }
  .slot img { width: 28px; height: 28px; }
  #btn-wave { min-width: 0; font-size: 18px; min-height: 50px; }
  #next-preview { padding: 2px 8px; gap: 4px; font-size: 13px; }
  #next-preview > span:first-child { display: none; }
  #next-preview .portrait { width: 26px; height: 26px; }
  .map-detail { grid-template-columns: 1fr; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .rotate-tip { display: block; padding: 4px 10px; font-size: 14px; text-align: center; color: var(--gold-1); }
  .wave-box { font-size: 16px; }
}
@media (max-height: 560px) {
  .hud-top { min-height: 0; padding: 4px 8px 0; gap: 8px; }
  .hud-bottom { padding: 4px 8px 6px; }
  .side-panel { width: 210px; margin-right: 8px; }
  .panel-title { font-size: 16px; padding: 8px 12px 4px; }
  .panel-title img { width: 22px; height: 22px; }
  .tower-cards { gap: 6px; }
  .tcard .portrait { width: 44px; height: 44px; }
  .tcard .tname { font-size: 13px; }
  .need img { width: 15px; height: 15px; }
  .need { font-size: 12px; }
  #hearts img { width: 15px; height: 15px; }
  #hearts { padding: 3px 8px; }
  .wave-box { font-size: 15px; padding: 3px 10px; }
  #xp-level { width: 28px; height: 28px; font-size: 15px; }
  .em { font-size: 15px; }
  .em img { width: 20px; height: 20px; }
  .mc-btn.sq { width: 42px; min-height: 40px; }
  #next-preview { padding: 2px 8px; gap: 4px; font-size: 13px; }
  #next-preview > span:first-child { display: none; }
  #next-preview .portrait { width: 26px; height: 26px; }
  #btn-wave { min-height: 44px; font-size: 17px; min-width: 0; }
  .hint { font-size: 13px; padding: 6px 12px; bottom: 8px; }
  .toast { padding: 4px 10px 4px 4px; }
  .toast span { font-size: 13px; }
  .toast .portrait { width: 36px; height: 36px; }
  .hotbar .slot, .potion-bar .slot { width: 36px; height: 36px; }
  .slot img { width: 24px; height: 24px; }
  .slot .count { font-size: 12px; }
  .banner { font-size: 28px; }
  .tower-pop { width: 230px; padding: 7px; gap: 5px; }
  .tp-pic { width: 38px; height: 38px; border-radius: 10px; }
  .tp-head .portrait { width: 34px; height: 34px; }
  .tp-title h3 { font-size: 15px; }
  .tp-sub { margin-top: 2px; }
  .tp-score span { padding: 3px 8px; }
  .tp-score b { font-size: 16px; }
  .tp-score img { width: 18px; height: 18px; }
  .tp-bars { padding: 4px 8px; gap: 2px; }
  .tp-up { min-height: 36px; font-size: 14px; }
  .tp-note, .tp-m small, .tp-good, .tp-label { display: none; }
  .tp-foot { padding-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .banner { animation: none !important; }
}

/* ---------------------------------------------------------------- title menu row & badges */
.menu .mc-btn .btn-ico { width: 1.5em; height: 1.5em; margin-right: 2px; vertical-align: middle; flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
#btn-play .btn-ico { width: 1.3em; height: 1.3em; }
.head-play { font-size: 20px; padding: 10px 22px; }
.head-play .btn-ico, .shop-play .btn-ico { width: 1.3em; height: 1.3em; }
.shop-play { align-self: center; width: min(420px, 100%); font-size: 24px; }
.menu-row { display: flex; gap: 12px; }
.menu-row .mc-btn { flex: 1; min-width: 0; }
.mc-btn { position: relative; }
.badge { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #ff4a5a; color: #fff; font-size: 14px; line-height: 24px; box-shadow: 0 0 0 3px var(--ink); animation: badgePop 1.4s ease-in-out infinite; }
@keyframes badgePop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ---------------------------------------------------------------- stars per difficulty */
.dstars { display: inline-flex; gap: 6px; align-items: center; }
.dstars .grp { display: inline-flex; gap: 0; padding: 2px 4px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); }
.dstars img { width: 17px; height: 17px; }
.diff-row .mc-btn.d-easy.on { background: linear-gradient(#6fe05a, #2f9e38); }
.diff-row .mc-btn.d-hard.on { background: linear-gradient(#c77dff, #7b2cbf); }
.diff-row .mc-btn .dmini { display: inline-flex; margin-left: 6px; vertical-align: -3px; }
.diff-row .mc-btn .dmini img { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- trophies */
.trophy-intro { display: flex; align-items: center; gap: 14px; padding: 12px 18px; font-size: 16px; color: var(--text-dim); }
.trophy-intro b { color: #fff; }
.quest-list { display: grid; gap: 14px; }
.quest { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; }
.quest .pic { width: 64px; height: 64px; border-radius: 14px; background: var(--well); }
.quest h3 { font-size: 20px; color: #fff; margin-bottom: 6px; }
.quest .bar { display: block; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.quest .bar i { display: block; height: 100%; background: linear-gradient(90deg, #6fe05a, #2f9e38); border-radius: 7px; }
.quest .qnum { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
.quest .qside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.quest .qrew { font-family: var(--display); font-size: 20px; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.quest .qrew img { width: 24px; height: 24px; }
.quest.tier1 { box-shadow: 0 0 0 3px #8fdcff inset; }
.quest.tier2 { box-shadow: 0 0 0 3px #ffd23f inset; }
.quest.done { box-shadow: 0 0 0 3px #6fe05a inset, 0 0 24px rgba(111, 224, 90, 0.35); }
.prize-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 16px; color: var(--text-dim); }
.prize-row canvas { width: 56px; height: 56px; border-radius: 12px; background: var(--well); }
.prize-row b { color: #fff; }
.adv-cat { font-family: var(--display); font-size: 22px; color: var(--gold-1); margin: 8px 0 -4px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.adv { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; align-items: center; padding: 10px 12px; }
.adv .pic { grid-row: span 3; width: 56px; height: 56px; border-radius: 12px; background: var(--well); }
.adv h4 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 17px; color: #fff; line-height: 1.1; }
.adv p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.25; }
.adv .arow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.adv .arow .bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.adv .arow .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffe14a, #f59e0b); }
.adv .arow img { width: 18px; height: 18px; vertical-align: -4px; }
.adv .arow canvas { width: 22px; height: 22px; vertical-align: -6px; }
.adv:not(.got) .pic { filter: grayscale(0.85) brightness(0.7); }
.adv.got { box-shadow: 0 0 0 3px var(--gold-1) inset; }
.adv.got h4::after { content: ' \2713'; color: #6fe05a; }
.style-slot { display: flex; flex-direction: column; gap: 10px; }
.style-slot h3 { font-size: 22px; color: var(--gold-1); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.style-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; cursor: pointer; text-align: center; color: #fff; font: inherit; border: 0; }
.style-card canvas { width: 88px; height: 88px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #4a5a8a, #1e2448); }
.style-card b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.1; }
.style-card small { font-size: 12.5px; color: var(--text-dim); line-height: 1.2; }
.style-card.on { box-shadow: 0 0 0 4px #6fe05a inset, 0 0 20px rgba(111, 224, 90, 0.35); }
.style-card.locked { cursor: not-allowed; }
.style-card.locked canvas { filter: grayscale(1) brightness(0.45); }
.style-card .lk { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); width: 34px; height: 34px; }
.style-card { position: relative; }
.style-card.new::after { content: 'NEW'; position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 8px; background: #ff4a5a; font-size: 11px; font-weight: 900; }
/* end-of-game list of quests and advancements */
.earned { display: grid; gap: 6px; margin: 8px 0 4px; max-height: 200px; overflow-y: auto; padding: 3px; }
.earned .e { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(255, 225, 74, 0.12); box-shadow: 0 0 0 2px rgba(255, 225, 74, 0.5) inset; font-size: 15px; text-align: left; animation: toastIn 0.4s both; }
.earned .e img, .earned .e canvas { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.earned .e .t { flex: 1; }
.earned .e .t small { display: block; color: var(--text-dim); font-size: 13px; }
.earned .e .v { font-family: var(--display); display: inline-flex; align-items: center; gap: 3px; }
.earned .e .v img { width: 20px; height: 20px; }
.earned .e.style { background: rgba(111, 224, 90, 0.14); box-shadow: 0 0 0 2px rgba(111, 224, 90, 0.6) inset; }
@media (max-height: 560px), (max-aspect-ratio: 5/4) {
  .toasts { max-width: 70%; }
  .quest { grid-template-columns: 48px 1fr auto; }
  .quest .pic { width: 48px; height: 48px; }
}

/* ---------------------------------------------------------------- medals & challenges */
.dmedals { display: inline-flex; align-items: center; gap: 2px; }
.dmedals img { width: 26px; height: 26px; }
.cdots { display: inline-flex; gap: 3px; margin-left: 6px; }
.cdots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.4); }
.cdots i.on { background: #ffd23f; box-shadow: 0 0 6px rgba(255, 210, 63, 0.8); }
.diff-row .mc-btn .dmini img { width: 22px; height: 22px; vertical-align: -6px; }
.big-medal { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--display); font-size: 18px; color: var(--gold-1); }
.big-medal img { width: 110px; height: 110px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); animation: medalIn 0.8s cubic-bezier(.2, 1.6, .4, 1) 0.2s both; }
@keyframes medalIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.chal-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 10px; }
.chal-lbl { width: 100%; font-family: var(--display); font-size: 16px; color: var(--gold-1); }
.chal-lbl small { font-family: var(--body, inherit); font-size: 13px; color: var(--text-dim); }
.chal { position: relative; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; min-width: 150px; flex: 1; padding: 6px 10px 6px 6px; border-radius: 14px; border: 0; background: rgba(0, 0, 0, 0.28); color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12) inset; }
.chal > img { grid-row: span 2; width: 34px; height: 34px; border-radius: 8px; }
.chal b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.1; }
.chal small { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--text-dim); }
.chal small img { width: 14px; height: 14px; }
.chal .no { position: absolute; left: 4px; top: 4px; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #ff4a4a; }
.chal .no::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 3px; background: #ff4a4a; transform: translateX(-50%) rotate(45deg); }
.chal.on { box-shadow: 0 0 0 3px #ffd23f inset, 0 0 18px rgba(255, 210, 63, 0.4); background: rgba(255, 210, 63, 0.14); }
.chal.done small { color: #6fe05a; font-weight: 900; }
.chal:disabled { opacity: 0.45; cursor: not-allowed; }
.chal-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; background: rgba(255, 210, 63, 0.16); box-shadow: 0 0 0 2px rgba(255, 210, 63, 0.6) inset; font-family: var(--display); font-size: 15px; color: #fff; white-space: nowrap; }
.chal-pill img { width: 24px; height: 24px; border-radius: 6px; }
.chal-pill b { color: #ffd23f; font-weight: 400; }
.tcard.banned { opacity: 0.45; filter: grayscale(0.8); }
.tcard.banned::after { content: ''; position: absolute; inset: 8px; border-radius: 14px; background: linear-gradient(to top right, transparent calc(50% - 2px), rgba(255, 74, 74, 0.85) calc(50% - 2px), rgba(255, 74, 74, 0.85) calc(50% + 2px), transparent calc(50% + 2px)); pointer-events: none; }
.modal > * { flex-shrink: 0; }

/* ---------------------------------------------------------------- account */
.account-box { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border: 0; border-radius: 16px; background: rgba(12, 16, 48, 0.65); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15) inset; color: #fff; font: inherit; cursor: pointer; text-align: left; }
.account-box:hover { box-shadow: 0 0 0 2px var(--gold-1) inset; }
.account-box img { width: 36px; height: 36px; }
.account-box b { display: block; font-family: var(--display); font-weight: 400; font-size: 17px; }
.account-box small { display: block; font-size: 13px; color: var(--text-dim); }
.acct-form { display: flex; flex-direction: column; gap: 10px; }
.acct-form input { font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 0; background: rgba(0, 0, 0, 0.35); color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15) inset; }
.mc-input { font: inherit; font-size: 20px; letter-spacing: 2px; padding: 12px 14px; border-radius: 12px; border: 0; background: rgba(0, 0, 0, 0.35); color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15) inset; width: 100%; box-sizing: border-box; }
.mc-input:focus { outline: none; box-shadow: 0 0 0 3px var(--gold-1) inset; }
.grownups { font-size: 13px; opacity: 0.55; }
.grownups[open] { opacity: 1; }
.grownups summary { cursor: pointer; list-style: none; padding: 4px 8px; }
.grownups summary::-webkit-details-marker { display: none; }
.grownups summary::before { content: '\25B8  '; }
.grownups[open] summary::before { content: '\25BE  '; }
.linkish { background: none; border: 0; padding: 4px 8px; font: inherit; font-size: 13px; color: #ff9a9a; text-decoration: underline; cursor: pointer; }
.acct-form input:focus { outline: none; box-shadow: 0 0 0 3px var(--gold-1) inset; }
.acct-status { min-height: 1.2em; margin: 0; color: var(--gold-1); font-weight: 800; }
.share-row { font-size: 13px; color: var(--text-dim); text-align: left; }

/* The end-of-game buttons stay at the bottom of the pop-up, so they are always in view. */
.modal .modal-foot { position: sticky; bottom: -24px; margin: 0 -24px -24px; padding: 14px 24px 18px; background: linear-gradient(180deg, rgba(30, 36, 86, 0), rgba(30, 36, 86, 0.96) 30%); z-index: 2; }
.earned button.e { border: 0; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.earned button.e:hover { box-shadow: 0 0 0 2px var(--gold-1) inset; }
.earned .e .wear { flex: none; min-height: 40px; padding: 4px 14px; font-size: 15px; }
.earned .e .wear.on { --c1: #ffe680; --c2: #f5b50a; --c3: #b06f00; color: #3a2400; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); }

/* ---------------------------------------------------------------- tutorial coach */
.coach { position: fixed; z-index: 60; width: min(340px, 86vw); padding: 14px 16px 12px; border-radius: 18px; box-shadow: 0 0 0 3px var(--gold-1), 0 16px 40px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; animation: toastIn 0.3s cubic-bezier(.2, 1.4, .4, 1); }
.coach p { margin: 0; font-size: 17px; font-weight: 800; color: #fff; line-height: 1.35; }
.coach::after { content: ''; position: absolute; left: var(--arrow-x, 50%); bottom: -12px; width: 20px; height: 20px; margin-left: -10px; background: inherit; transform: rotate(45deg); box-shadow: 3px 3px 0 0 var(--gold-1); }
.coach.below::after { bottom: auto; top: -12px; box-shadow: -3px -3px 0 0 var(--gold-1); }
.coach.quiet { opacity: 0.85; }
.coach .coach-skip { border: 0; background: none; color: var(--text-dim); font: inherit; font-size: 14px; min-height: 32px; text-decoration: underline; cursor: pointer; }
.coach-target { position: relative; z-index: 5; animation: coachGlow 1.1s ease-in-out infinite !important; }
@keyframes coachGlow { 0%, 100% { box-shadow: 0 0 0 3px #ffe14a, 0 0 18px rgba(255, 225, 74, 0.7); } 50% { box-shadow: 0 0 0 6px #ffe14a, 0 0 34px rgba(255, 225, 74, 0.9); } }
.tut-btn { align-self: center; }

/* ---------------------------------------------------------------- tower ranks & fort unlocks */
.rank-chip { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-size: 13px; vertical-align: 3px; background: #4a5a8a; color: #fff; }
.rank-chip.r1 { background: linear-gradient(#e0975a, #8a5020); }
.rank-chip.r2 { background: linear-gradient(#e0e6ee, #7a8494); color: #1a1426; }
.rank-chip.r3 { background: linear-gradient(#ffe680, #c88a0a); color: #3a2400; }
.rank-chip.r4 { background: linear-gradient(#bff8ff, #3ab8c8); color: #06303a; }
.shop-card .rank-bar { grid-column: 2; display: block; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.shop-card .rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8fdcff, #3a9aff); }
.unlock-at { display: flex; align-items: center; gap: 8px; }
.fort-badge.sm { width: 28px; height: 28px; font-size: 14px; flex: none; }
.fort-next { display: inline-flex; flex-direction: column; align-items: center; margin-left: 8px; opacity: 0.9; }
.fort-next img { width: 34px; height: 34px; filter: grayscale(0.6); }
.fort-next small { font-size: 12px; color: var(--text-dim); }
.new-tower { display: flex; align-items: center; justify-content: center; gap: 10px; }
.new-tower img { width: 46px; height: 46px; }
.rank-ups { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rank-up { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: rgba(143, 220, 255, 0.14); box-shadow: 0 0 0 2px rgba(143, 220, 255, 0.5) inset; font-size: 14px; }
.rank-up img { width: 30px; height: 30px; }

/* ---------------------------------------------------------------- in your hand */
.held { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); }
.held img { width: 72px; height: 72px; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.45)); }
.held.small img { width: 58px; height: 58px; }
.held.bob img { animation: heldBob 0.9s ease-in-out infinite; }
.held span { margin-top: 2px; padding: 4px 10px; border-radius: 10px; background: var(--gold-1); color: #3a2400; font-weight: 900; font-size: 14px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
@keyframes heldBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.tcard, .potion-bar .slot { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tcard img, .potion-bar .slot img { pointer-events: none; -webkit-user-drag: none; }

/* The end screen's big "Next World" button shows where it goes. */
.next-world { flex: 1 1 100%; flex-direction: column; gap: 0; line-height: 1.05; font-size: 24px; min-height: 58px; }
.modal-foot .next-world ~ .mc-btn { font-size: 15px; min-height: 42px; padding: 6px 14px; }
.next-world small { font-family: var(--body); font-weight: 800; font-size: 13px; opacity: 0.9; }

/* Tower pop-up: this game's score, section labels, enchantments and the quiet Break button. */
.tp-score { display: flex; gap: 6px; }
.tp-score span { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--well); }
.tp-score img { grid-row: 1 / 3; width: 22px; height: 22px; }
.tp-score b { font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.tp-score small { font-size: 12.5px; color: var(--text-dim); line-height: 1.1; }
.tp-label { margin-bottom: -4px; font-family: var(--display); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.tp-good small.tp-when { margin-left: auto; font-family: var(--body); font-size: 12.5px; }
.tp-foot { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tp-ench { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tp-ench span { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px 2px 3px; border-radius: 999px; background: rgba(207, 152, 255, 0.16); font-family: var(--display); font-size: 12.5px; color: var(--purple-1); }
.tp-ench img { width: 18px; height: 18px; }
.tp-ench small { font-size: 12.5px; color: var(--text-dim); }
.tp-foot .tp-sell { flex: none; min-height: 36px; padding: 4px 10px; background: transparent; box-shadow: inset 0 0 0 2px rgba(232, 65, 47, 0.45); }
.tp-foot .tp-sell:hover { background: rgba(232, 65, 47, 0.2); }
.tp-foot .tp-sell .tp-dig img { width: 16px; height: 16px; }
.chest-note { display: flex; align-items: center; gap: 10px; }
.chest-note img { width: 30px; height: 30px; flex: none; }

/* ---------------------------------------------------------------- challenges mode */
.map-modes { justify-content: center; }
.map-modes .mc-btn { min-width: 150px; font-size: 18px; }
.crowns img { width: 22px; height: 22px; }
.crowns img.open { opacity: 0.35; filter: grayscale(0.6); }
.crowns img.shut { opacity: 0.35; width: 16px; height: 16px; margin: 0 3px; }
.cc-intro { margin: 4px 0 10px; color: var(--text-dim); }
.chal-list { display: flex; flex-direction: column; gap: 8px; }
.chal-card { position: relative; display: grid; grid-template-columns: 28px 44px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 8px; border: 0; border-radius: 16px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.1); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chal-card:hover:not(.locked) { background: rgba(255, 255, 255, 0.06); }
.chal-card.on { background: rgba(255, 210, 63, 0.13); box-shadow: inset 0 0 0 3px var(--gold-1), 0 0 18px rgba(255, 210, 63, 0.3); }
.chal-card.locked { opacity: 0.55; cursor: not-allowed; }
.cc-num { font-family: var(--display); font-size: 22px; color: var(--gold-1); text-align: center; }
.cc-pic { position: relative; width: 44px; height: 44px; }
.cc-pic img { width: 44px; height: 44px; border-radius: 10px; background: var(--well); }
.cc-pic .no { position: absolute; inset: 2px; border-radius: 50%; border: 3px solid #ff4a4a; }
.cc-pic .no::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 3px; background: #ff4a4a; transform: translateX(-50%) rotate(45deg); }
.cc-text { display: flex; flex-direction: column; min-width: 0; }
.cc-text b { font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.1; }
.cc-text small { font-size: 13.5px; color: var(--text-dim); font-weight: 700; }
.cc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.cc-diff { padding: 2px 10px; border-radius: 999px; font-family: var(--display); font-size: 13px; color: #fff; }
.cc-diff.d-normal { background: var(--blue-2); }
.cc-diff.d-hard { background: var(--red-2); }
.cc-rew, .cc-need, .cc-done { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 14px; }
.cc-rew img { width: 16px; height: 16px; }
.cc-need { color: var(--text-dim); font-family: var(--body); font-weight: 800; font-size: 12.5px; }
.cc-need img { width: 14px; height: 14px; }
.cc-done { color: var(--gold-1); }
.cc-crown { position: absolute; top: -10px; right: -6px; width: 30px; height: 30px; opacity: 0; transform: rotate(14deg); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.chal-card.done .cc-crown { opacity: 1; }
.cc-locked-note { color: var(--text-dim); text-align: center; }
#btn-start small { display: block; font-family: var(--body); font-weight: 800; font-size: 14px; opacity: 0.9; }
#btn-start { flex-direction: column; gap: 0; }
@media (max-width: 520px) {
  .chal-card { grid-template-columns: 24px 38px 1fr; }
  .cc-side { grid-column: 2 / 4; flex-direction: row; justify-content: space-between; align-items: center; }
}
