/* Fonts bundled locally (from Fontsource, OFL licensed) so the site works without Google Fonts. */
@font-face { font-family: 'Rubik'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/rubik-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/rubik-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/rubik-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/rubik-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/rubik-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'VT323'; font-weight: 400; font-display: swap; src: url('/fonts/vt323-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Press Start 2P'; font-weight: 400; font-display: swap; src: url('/fonts/press-start-2p-latin-400-normal.woff2') format('woff2'); }

/* =========================================================
   RadRed hub - Poké Ball theme (red / white / black)
   ========================================================= */
:root {
  --bg: #0b0b0e;
  --bg2: #121216;
  --panel: #16161b;
  --panel2: #1c1c22;
  --line: #2a2a32;
  --line2: #383842;
  --text: #f4f4f6;
  --muted: #9a9aa6;
  --red: #e3242b;
  --red2: #ff3b42;
  --red-dark: #8f1117;
  --white: #ffffff;
  --green: #2fd06a;
  --amber: #ffb020;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pixel: 'Press Start 2P', monospace;
  --dexfont: 'VT323', monospace;
  --dex-green: #9fe870;
  --dex-screen: #1d2a1a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font-family: 'Rubik', system-ui, sans-serif; font-size: 15px; line-height: 1.45;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(227, 36, 43, .22), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 8px),
    var(--bg);
  background-attachment: fixed;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { image-rendering: pixelated; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.flex1 { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.ico { flex: none; }
[hidden] { display: none !important; }

#app { max-width: 1320px; margin: 0 auto; padding: 18px 16px 120px; }
.page { animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--panel2); cursor: pointer; font-weight: 600; letter-spacing: .2px;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); border-color: #50505c; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; padding: 13px; font-size: 16px; }
.btn.primary { background: linear-gradient(180deg, var(--red2), var(--red)); border-color: #ff5a60; color: #fff; box-shadow: 0 6px 18px rgba(227, 36, 43, .35), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(227, 36, 43, .5), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.light { background: linear-gradient(180deg, #fff, #e6e6ea); color: #111; border-color: #fff; box-shadow: 0 6px 18px rgba(255,255,255,.12); }
.btn.danger { background: rgba(227, 36, 43, .14); border-color: rgba(227, 36, 43, .6); color: #ff7a7f; }
.btn.danger:hover { background: rgba(227, 36, 43, .25); }
.btn.ghost { background: transparent; }
.btn.ghost.on, .btn.on { background: #fff; color: #111; border-color: #fff; }
.danger-text { color: #ff7a7f !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: all .2s var(--ease); flex: none;
}
.icon-btn:hover { border-color: var(--red); color: var(--red2); transform: translateX(-1px); }

.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line2);
  background: #0e0e12; color: var(--text); font: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227, 36, 43, .2); }
.input.big { font-size: 18px; padding: 13px 15px; font-weight: 600; }
.input.sm { padding: 7px 10px 7px 30px; font-size: 13px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #aaa 50%), linear-gradient(135deg, #aaa 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); font-size: 12px; font-weight: 600; background: #0f0f13; white-space: nowrap; }
.pill.pl { border-color: var(--pc); color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, transparent); }
.pill.pl.full { background: var(--pc); color: #111; }
.pill.fail { border-color: var(--red); color: #ff7a7f; }
.tag { margin-left: 6px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: #fff; color: #111; text-transform: uppercase; vertical-align: middle; }
.code-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; background: #fff; color: #111; font-family: var(--pixel); font-size: 11px; border: 0; letter-spacing: 1px; }
.code-chip.click { cursor: pointer; transition: transform .15s; }
.code-chip.click:hover { transform: scale(1.05); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.section-title .ico { color: var(--red2); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 2px 12px; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); background: rgba(255,255,255,.015); }
.empty.sm { padding: 14px; font-size: 13px; }
.empty-page { text-align: center; padding: 80px 20px; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line2); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 400; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 18px; border-radius: 12px; background: #fff; color: #111; font-weight: 600; box-shadow: var(--shadow); animation: toastIn .35s var(--ease) both; border-left: 5px solid #111; max-width: 92vw; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
body.is-dragging #toasts { bottom: 120px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(4, 4, 6, .72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s ease both; overflow-y: auto; }
.modal-back.closing { animation: fadeOut .18s ease both; }
.modal-back.closing .modal { animation: popOut .18s ease both; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: popIn .28s var(--ease) both; max-width: 100%; }
.modal.small { width: 420px; padding: 22px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes popOut { to { opacity: 0; transform: scale(.97); } }
.confirm h3 { margin: 0 0 8px; }
.confirm p { color: var(--muted); margin: 0 0 18px; }
.confirm .input { margin-bottom: 16px; }

/* ---------- Menu ---------- */
.menu { position: absolute; z-index: 500; min-width: 190px; padding: 6px; background: #fff; color: #111; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: popIn .16s var(--ease) both; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.menu-item:hover:not(:disabled) { background: #f0f0f3; }
.menu-item:disabled { opacity: .35; cursor: default; }
.menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; background: #e5e5ea; margin: 5px 4px; }

/* =========================================================
   HOME
   ========================================================= */
.hero { text-align: center; padding: 26px 0 10px; }
.hero-ball { display: grid; place-items: center; margin-bottom: 18px; }
.ball { position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 4px solid #0a0a0a; box-shadow: 0 0 0 3px #fff2, 0 12px 40px rgba(227,36,43,.45); background: #fff; animation: wobble 3.2s ease-in-out infinite; }
.ball-top { position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, #ff4a50, var(--red)); }
.ball-band { position: absolute; left: 0; right: 0; top: calc(50% - 4px); height: 8px; background: #0a0a0a; }
.ball-btn { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 4px solid #0a0a0a; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px #ccc; }
@keyframes wobble { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-14deg); } 74% { transform: rotate(12deg); } 82% { transform: rotate(-6deg); } 90% { transform: rotate(3deg); } }
.logo { margin: 0; font-family: var(--pixel); font-size: clamp(22px, 5vw, 40px); letter-spacing: 3px; line-height: 1.3; text-shadow: 0 4px 0 var(--red-dark), 0 0 40px rgba(227,36,43,.35); }
.logo span { display: block; color: var(--red2); font-size: .5em; letter-spacing: 8px; margin-top: 6px; text-shadow: none; }
.hero-sub { color: var(--muted); margin: 14px 0 0; }
.trainer { max-width: 620px; margin: 26px auto 18px; }
.trainer-row { display: flex; gap: 14px; align-items: flex-end; }
.trainer p { margin: 10px 0 0; }
.card-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.card-ico.red { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(227,36,43,.45); }
.card-ico.white { background: #fff; color: #111; }
.card-ico.dark { background: #0a0a0a; border: 1px solid var(--line2); color: #fff; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 980px; margin: 0 auto; }
.action-card { display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; transition: transform .25s var(--ease), border-color .25s; animation: pageIn .5s var(--ease) both; }
.action-card.join { animation-delay: .08s; }
.action-card:hover { transform: translateY(-3px); border-color: #3c3c46; }
.action-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--red); }
.action-card.join::before { background: #fff; }
.card-head { display: flex; gap: 14px; align-items: flex-start; }
.card-head h2 { margin: 0 0 3px; font-size: 20px; }
.card-head p { margin: 0; font-size: 14px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-btn { padding: 10px; border-radius: 10px; border: 1px solid var(--line2); background: #0e0e12; cursor: pointer; display: flex; flex-direction: column; align-items: center; transition: all .2s var(--ease); }
.seg-btn:hover { border-color: #555; }
.seg-btn.on { background: var(--red); border-color: var(--red2); box-shadow: 0 6px 16px rgba(227,36,43,.35); transform: translateY(-1px); }
.seg-n { font-family: var(--pixel); font-size: 18px; }
.seg-l { font-size: 11px; color: inherit; opacity: .75; margin-top: 4px; }
.digits { display: flex; gap: 10px; }
.digit { width: 100%; max-width: 70px; aspect-ratio: 1 / 1.1; text-align: center; font-family: var(--pixel); font-size: 26px; border-radius: 12px; border: 2px solid var(--line2); background: #0e0e12; color: #fff; outline: none; transition: all .2s var(--ease); }
.digit:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.12); transform: translateY(-2px); }
.recent { max-width: 980px; margin: 30px auto 0; }
.recent .section-title { margin-bottom: 12px; }
.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; transition: all .2s var(--ease); }
.recent-item:hover { border-color: var(--red); transform: translateY(-2px); }
.recent-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.recent-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   TOP BAR (room + run)
   ========================================================= */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(227,36,43,.16), rgba(227,36,43,.03)); border: 1px solid rgba(227,36,43,.3); position: relative; overflow: hidden; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--red), #fff 50%, #0a0a0a); opacity: .7; }
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { margin: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title h1.click { cursor: text; }
.tb-title h1.click:hover { text-decoration: underline dotted var(--muted); }
.tb-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 3px; }
.tb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tb-players { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.tb-player { display: inline-flex; align-items: center; gap: 6px; }
.tb-player i, .you-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tb-player.me { text-decoration: underline; text-underline-offset: 4px; }
.tb-link { color: var(--muted); display: inline-flex; }
.you-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #0e0e12; border: 1px solid var(--line2); font-weight: 700; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line2); background: #0e0e12; cursor: pointer; }
.status-chip i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.status-chip.ongoing i { animation: blink 1.6s infinite; }
.status-chip.success { border-color: var(--green); color: var(--green); }
.status-chip.success i { background: var(--green); }
.status-chip.failed { border-color: var(--red); color: #ff7a7f; }
.status-chip.failed i { background: var(--red); }
@keyframes blink { 50% { opacity: .25; } }

/* =========================================================
   ROOM
   ========================================================= */
.slots { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: all .3s var(--ease); flex-wrap: wrap; }
.slot > div:nth-child(2) { flex: 1; min-width: 0; }
.slot.filled { border-color: var(--pc); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 35%, transparent), 0 8px 24px color-mix(in srgb, var(--pc) 15%, transparent); animation: slotIn .5s var(--ease) both; }
.slot.empty { border-style: dashed; }
.slot-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.slot-ball { width: 30px; height: 30px; border-radius: 50%; flex: none; border: 3px solid #0a0a0a; background: linear-gradient(180deg, var(--pc, #444) 0 45%, #0a0a0a 45% 55%, #fff 55%); box-shadow: 0 0 0 2px #fff1; }
.slot.empty .slot-ball { background: linear-gradient(180deg, #333 0 45%, #0a0a0a 45% 55%, #666 55%); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); opacity: .5; } }
@keyframes slotIn { from { transform: scale(.94); opacity: 0; } }
.filter-tabs, .hist-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.ftab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .2s; display: inline-flex; gap: 6px; align-items: center; }
.ftab span { font-size: 11px; opacity: .7; }
.ftab.on { background: #fff; color: #111; border-color: #fff; }
.new-run { display: flex; gap: 10px; margin-bottom: 14px; }
.run-list { display: grid; gap: 10px; }
.run-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); border-left: 5px solid #fff; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: pageIn .4s var(--ease) both; }
.run-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.run-card.failed { border-color: rgba(227,36,43,.55); border-left-color: var(--red); background: linear-gradient(90deg, rgba(227,36,43,.12), var(--panel) 45%); }
.run-card.success { border-color: rgba(47,208,106,.45); border-left-color: var(--green); background: linear-gradient(90deg, rgba(47,208,106,.1), var(--panel) 45%); }
.run-status { font-family: var(--pixel); font-size: 9px; padding: 7px 8px; border-radius: 6px; background: #fff; color: #111; min-width: 84px; text-align: center; }
.run-card.failed .run-status { background: var(--red); color: #fff; }
.run-card.success .run-status { background: var(--green); color: #062; }
.run-main h4 { margin: 0 0 2px; font-size: 17px; }
.run-stats { display: flex; gap: 14px; }
.stat { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.stat b { color: var(--text); }
.run-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.run-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #fff); transition: width .6s var(--ease); }

/* =========================================================
   RUN PAGE
   ========================================================= */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; animation: pageIn .4s var(--ease) both; }
.banner > div { flex: 1; }
.banner.failed { background: repeating-linear-gradient(135deg, rgba(227,36,43,.2) 0 12px, rgba(227,36,43,.12) 12px 24px); border: 1px solid var(--red); color: #ffd0d2; }
.banner.success { background: rgba(47,208,106,.12); border: 1px solid var(--green); color: #c9f7da; }

/* Tracker box */
.tracker { padding: 14px 18px 16px; margin-bottom: 14px; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tr-progress { display: flex; align-items: center; gap: 8px; }
.tr-progress b { font-family: var(--pixel); font-size: 16px; color: var(--red2); }
.tr-bar { width: 160px; height: 8px; border-radius: 99px; background: #0e0e12; border: 1px solid var(--line2); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #fff); transition: width .6s var(--ease); }
.tr-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)) 2px repeat(4, minmax(0, 1fr)) 2px minmax(0, 1fr); gap: clamp(3px, .7vw, 10px); align-items: center; }
.tr-sep { width: 2px; height: 70%; border-radius: 2px; background: var(--line2); justify-self: center; }
.ms { position: relative; aspect-ratio: 1; min-width: 0; border-radius: clamp(6px, 1vw, 12px); border: 1px solid var(--line2); background: #141419; cursor: pointer; display: grid; place-items: center; padding: 6px; transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .2s; }
.ms img { width: 100%; max-width: 56px; height: auto; filter: grayscale(1) brightness(.45); opacity: .7; transition: filter .3s, opacity .3s, transform .3s var(--ease); }
.ms:hover { transform: translateY(-2px); border-color: #666; }
.ms:hover img { filter: grayscale(.6) brightness(.8); opacity: 1; }
.ms.done { border-color: #fff; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.14), #16161b 70%); box-shadow: 0 0 18px rgba(255,255,255,.12); }
.ms.done.pop { animation: msPop .45s var(--ease); }
.ms.done img { filter: none; opacity: 1; }
.ms.pressing img { transform: scale(.85); }
.ms-n { position: absolute; left: 5px; top: 3px; font-family: var(--pixel); font-size: 7px; color: var(--muted); }
.ms-check { position: absolute; right: -5px; top: -5px; width: 17px; height: 17px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; border: 2px solid var(--bg); }
@keyframes msPop { 0% { transform: scale(.85); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* Route tracker */
.routes { padding: 0; margin-bottom: 6px; overflow: hidden; }
.rt-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.rt-title { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.rt-toggle { width: 30px; height: 30px; transition: transform .3s var(--ease); transform: rotate(-90deg); }
.routes.open .rt-toggle { transform: rotate(0); }
.rt-counts { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.rt-actions { display: flex; gap: 8px; }
.rt-body { display: none; }
.routes.open .rt-body { display: block; animation: fadeIn .3s ease both; }
.rt-tools { display: flex; gap: 8px; padding: 0 16px 10px; }
.search-wrap { position: relative; flex: 1; }
.search-wrap .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.rt-scroll { max-height: 440px; overflow-y: auto !important; border-top: 1px solid var(--line); }
.rt-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); border-left: 3px solid transparent; transition: background .2s; }
.rt-row:hover { background: rgba(255,255,255,.02); }
.rt-row.complete { border-left-color: var(--green); }
.rt-row.partial { border-left-color: var(--amber); }
.rt-row.failed { border-left-color: var(--red); background: rgba(227,36,43,.05); }
.rt-headrow { position: sticky; top: 0; z-index: 2; background: #101014; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.rt-route { padding: 9px 14px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.rt-route b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-route small { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.rt-row.failed .rt-route small { color: #ff7a7f; }
.rt-cell { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 8px; border: 0; background: none; min-width: 0; font-size: 13px; font-weight: 600; }
.rt-cell.head { font-weight: 800; }
.rt-cell .dot { width: 5px; height: 5px; border-radius: 50%; background: #444; }
.rt-cell.has { cursor: pointer; border-radius: 8px; margin: 3px; transition: background .2s; }
.rt-cell.has:hover { background: rgba(255,255,255,.06); }
.rt-cell.has span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-cell.dead span { text-decoration: line-through; color: var(--muted); }
.rt-cell.failed span, .rt-cell.failed-empty { color: #ff7a7f; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.rt-cell.failed img { filter: grayscale(1) opacity(.5); }
.rt-cell.add { cursor: pointer; color: var(--muted); }
.rt-cell.add .ico { width: 26px; height: 26px; padding: 5px; border-radius: 8px; border: 1px dashed var(--line2); transition: all .2s; }
.rt-cell.add:hover .ico { border-color: var(--red); color: var(--red2); transform: scale(1.1); }
img.mini { width: 32px; height: 32px; object-fit: contain; flex: none; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin: 22px 0 0; padding: 6px; background: #0d0d11; border: 1px solid var(--line); border-radius: 14px; position: sticky; top: 8px; z-index: 20; box-shadow: 0 10px 24px rgba(0,0,0,.4); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; font-weight: 700; transition: all .25s var(--ease); }
.tab:hover { background: rgba(255,255,255,.04); }
.tab.on { background: linear-gradient(180deg, #fff, #e7e7ec); color: #111; box-shadow: 0 6px 16px rgba(255,255,255,.1); }
.tab.on.t-grave { background: linear-gradient(180deg, var(--red2), var(--red)); color: #fff; }
.tab-n { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: rgba(127,127,127,.2); }
body.is-dragging .tab { border: 1px dashed #666; }
.drop-over { border-color: var(--red2) !important; background: rgba(227,36,43,.2) !important; color: #fff !important; transform: scale(1.03); }
.tab-anim { animation: pageIn .35s var(--ease) both; }

/* Linked rows */
.links { display: grid; gap: 12px; padding: 12px; border: 1px dashed var(--line2); border-radius: var(--radius); background: rgba(255,255,255,.012); }
.link-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; row-gap: 6px; animation: pageIn .4s var(--ease) both; border-radius: 14px; transition: opacity .2s, transform .2s; }
.link-grip { grid-row: 1 / 3; align-self: center; color: #555; cursor: grab; padding: 6px 2px; }
.link-grip:hover { color: #fff; }
.link-route { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.link-cells { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0; align-items: stretch; }
.link-cells { grid-template-columns: minmax(0,1fr) repeat(calc(var(--cols) - 1), 34px minmax(0,1fr)); }
.link-ball { align-self: center; justify-self: center; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #0a0a0a; background: linear-gradient(180deg, var(--red) 0 44%, #0a0a0a 44% 56%, #fff 56%); box-shadow: 0 0 0 2px #ffffff22; position: relative; }
.link-ball::after { content: ''; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 2px solid #0a0a0a; }
.link-row.drag-group, .drag-src { opacity: .45; transform: scale(.98); }

/* Pokémon card */
.pcard { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 8px; min-height: 96px; border-radius: 14px; border: 2px solid var(--pc); background: linear-gradient(180deg, #1b1b21, #131317); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; box-shadow: 0 0 0 1px color-mix(in srgb, var(--pc) 25%, transparent), 0 6px 18px rgba(0,0,0,.35); min-width: 0; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--pc), 0 12px 28px color-mix(in srgb, var(--pc) 25%, transparent); }
.pcard:active { cursor: grabbing; }
.pc-sprite { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 60%, rgba(255,255,255,.08), transparent 70%); }
.pc-sprite img { width: 64px; height: 64px; object-fit: contain; transition: transform .3s var(--ease); }
.pcard:hover .pc-sprite img { transform: scale(1.1) translateY(-2px); }
img.placeholder { width: 34px !important; height: 34px !important; opacity: .5; image-rendering: auto; }
.pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pc-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.pc-name b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-name small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #c9c9d2; }
.pc-meta span { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-meta .ico { color: var(--red2); }
.pc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; align-self: stretch; gap: 6px; }
.pc-menu { width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: all .2s; }
.pc-menu:hover { background: #fff; color: #111; }
.pc-tag { font-family: var(--pixel); font-size: 7px; padding: 4px 5px; border-radius: 5px; }
.pc-tag.dead { background: var(--red); color: #fff; }
.pc-tag.fail { background: #3a3a44; color: #ddd; border: 1px dashed #888; }
.pc-link { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 700; }
.types { display: flex; gap: 4px; flex-wrap: wrap; }
.type-badge { height: 22px; width: auto; image-rendering: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.type-badge.sm { height: 18px; }
.no-type { font-size: 11px; color: var(--muted); font-style: italic; }
/* Fainted = red tint, Failed catch = grey dashed + stripes */
.pcard.fainted { border-color: var(--red); background: linear-gradient(180deg, #2a1215, #160b0d); box-shadow: 0 0 0 1px rgba(227,36,43,.3), inset 4px 0 0 var(--pc); }
.pcard.fainted .pc-sprite img { filter: grayscale(.85) brightness(.8); }
.pcard.failed { border: 2px dashed #6a6a76; background: repeating-linear-gradient(135deg, #18181d 0 10px, #1d1d23 10px 20px); box-shadow: inset 4px 0 0 var(--pc); }
.pcard.failed .pc-sprite img { filter: grayscale(1) opacity(.45); }
.pcard.failed .pc-name b { text-decoration: line-through; color: #aaa; }
.pc-x { position: absolute; inset: 10px; pointer-events: none; }
.pc-x::before, .pc-x::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--red); border-radius: 2px; }
.pc-x::before { transform: rotate(45deg); } .pc-x::after { transform: rotate(-45deg); }
.pcard.waiting { border-style: dashed; border-color: color-mix(in srgb, var(--pc) 45%, #333); background: transparent; box-shadow: none; flex-direction: column; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: default; }
.pcard.waiting:hover { transform: none; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.lg { display: inline-flex; gap: 6px; align-items: center; }
.lg i { width: 14px; height: 14px; border-radius: 4px; }
.lg.dead i { background: #2a1215; border: 2px solid var(--red); }
.lg.fail i { border: 2px dashed #6a6a76; background: repeating-linear-gradient(135deg, #18181d 0 3px, #2a2a33 3px 6px); }
.team-counts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Unlinked columns */
.unlinked { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; }
.ucol { border: 1px dashed var(--line2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 110px; transition: all .2s; }
.ucol-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.ucol-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.ucol-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 0; }
body.is-dragging .ucol { border-color: #555; }

/* Drop dock (appears while dragging) */
.drop-dock { position: fixed; left: 50%; bottom: 18px; z-index: 150; display: flex; gap: 10px; padding: 10px; border-radius: 18px; background: rgba(12,12,16,.92); border: 1px solid var(--line2); box-shadow: 0 18px 50px rgba(0,0,0,.6); backdrop-filter: blur(8px); transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .25s; }
body.is-dragging .drop-dock { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.dock-t { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-radius: 12px; border: 2px dashed #555; font-weight: 700; min-width: 170px; justify-content: center; transition: all .2s var(--ease); }
.dock-t.t-grave { border-color: rgba(227,36,43,.6); color: #ff9a9e; }

/* Detail pop-up */
.detail-modal { width: 560px; overflow: hidden; }
.dt-top { position: relative; display: flex; gap: 16px; padding: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 22%, transparent), transparent); border-bottom: 1px solid var(--line); }
.dt-screen { width: 120px; height: 120px; flex: none; border-radius: 14px; background: var(--dex-screen); border: 4px solid #0a0a0a; box-shadow: inset 0 0 20px rgba(0,0,0,.6), 0 0 0 3px var(--red); display: grid; place-items: center; }
.dt-img { width: 104px; height: 104px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.dt-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dt-head h2 { margin: 0; font-size: 24px; }
.dt-owner { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.dt-owner i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); }
.dt-close { position: absolute; right: 12px; top: 12px; }
.dt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 18px 6px; }
.dt-field.wide { grid-column: span 2; }
.dt-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 4px; }
.dt-val { font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 3px 9px; border-radius: 8px; background: #0e0e12; border: 1px solid var(--line2); font-size: 13px; }
.st.ok { color: var(--green); } .st.dead { color: #ff7a7f; } .st.fail { color: #bbb; text-decoration: underline dashed; }
.dt-linked { padding: 10px 18px; }
.dt-links { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-link { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 12px; border: 2px solid var(--pc); background: #0e0e12; cursor: pointer; transition: transform .2s; text-align: left; }
.dt-link:hover { transform: translateY(-2px); }
.dt-link span { display: flex; flex-direction: column; line-height: 1.2; }
.dt-link small { color: var(--muted); }
.dt-unlinked { padding: 4px 18px; }
.dt-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px 18px; border-top: 1px solid var(--line); margin-top: 8px; }
.dt-move { display: flex; gap: 6px; }

/* History drawer */
.modal-back:has(.drawer-modal) { place-items: stretch end; padding: 0; }
.drawer-modal { width: min(440px, 100vw); height: 100vh; border-radius: 0; border-width: 0 0 0 1px; animation: slideIn .3s var(--ease) both; overflow-y: auto; }
.modal-back.closing .drawer-modal { animation: slideOut .2s ease both; }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes slideOut { to { transform: translateX(100%); } }
.drawer { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.drawer p { margin: 0; }
.hist-list { display: flex; flex-direction: column; }
.hist-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); animation: fadeIn .3s both; }
.hist-item > i { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.hist-item p { margin: 0 0 2px; font-size: 14px; }

/* =========================================================
   POKéDEX MODAL (Add Catch / Add Pokémon / Edit)
   ========================================================= */
.dex-modal { background: transparent; border: 0; box-shadow: none; width: min(1180px, 100%); }
.dex { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; font-family: var(--dexfont); }
.dex-panel { background: linear-gradient(160deg, #7c1c1f, #5a1215 60%, #4a0f12); border-radius: 26px; padding: 20px; border: 3px solid #1a0607; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -6px 0 rgba(0,0,0,.25), 0 30px 70px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.dex-left { animation: dexLeft .45s var(--ease) both; }
.dex-right { animation: dexRight .45s var(--ease) both; }
@keyframes dexLeft { from { opacity: 0; transform: translateX(40px) rotateY(12deg); } }
@keyframes dexRight { from { opacity: 0; transform: translateX(-40px) rotateY(-12deg); } }
.dex-lights { display: flex; align-items: center; gap: 10px; }
.lens { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9fd4ff, #2f7ed8 55%, #174b8c); border: 3px solid #e8e8e8; box-shadow: 0 0 16px rgba(80,160,255,.55); animation: lensGlow 2.6s ease-in-out infinite; }
@keyframes lensGlow { 50% { box-shadow: 0 0 26px rgba(80,160,255,.9); } }
.led { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #1a0607; }
.led.r { background: #ff3b3b; } .led.y { background: #ffd23b; } .led.g { background: #3bdc5a; }
.dex-ver { margin-left: auto; font-family: var(--pixel); font-size: 9px; color: #f4d6d6; letter-spacing: 1px; }
.dex-screen { background: var(--dex-screen); border-radius: 12px; border: 6px solid #0f0f0f; box-shadow: inset 0 0 0 2px #3c5a2f, inset 0 0 30px rgba(0,0,0,.6); color: var(--dex-green); position: relative; overflow: hidden; }
.dex-screen::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px); z-index: 2; }
.dex-screen.big { height: 260px; display: grid; place-items: center; }
.dex-sprite { display: grid; place-items: center; }
.dex-sprite.pop { animation: dexPop .45s var(--ease); }
@keyframes dexPop { 0% { transform: scale(.3); opacity: 0; filter: brightness(3); } 70% { transform: scale(1.08); } }
.dex-img { width: 200px; height: 200px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; }
.dex-idle { display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 22px; letter-spacing: 2px; opacity: .8; }
.dex-idle-ball { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--dex-green); background: linear-gradient(180deg, transparent 45%, var(--dex-green) 45% 55%, transparent 55%); animation: wobble 2.6s ease-in-out infinite; }
.list-screen { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dex-idrow { display: flex; justify-content: space-between; font-size: 24px; letter-spacing: 1px; }
.dex-types { min-height: 20px; }
.dex-types .no-type { color: #6f9a55; font-family: var(--dexfont); font-size: 17px; font-style: normal; }
.dex-searchwrap { display: flex; align-items: center; gap: 8px; border: 1px solid #4b6d3a; border-radius: 6px; padding: 0 10px; background: rgba(0,0,0,.2); }
.dex-search { flex: 1; background: transparent; border: 0; outline: none; color: var(--dex-green); font-family: var(--dexfont); font-size: 22px; padding: 6px 0; letter-spacing: 1px; }
.dex-search::placeholder, .dex-input::placeholder { color: #5f8a48; }
.dex-list { height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; position: relative; z-index: 3; }
.dex-list::-webkit-scrollbar, .form-screen::-webkit-scrollbar { width: 8px; }
.dex-list::-webkit-scrollbar-thumb, .form-screen::-webkit-scrollbar-thumb { background: #4b6d3a; border-radius: 4px; }
.dex-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; border: 0; border-left: 3px solid transparent; background: transparent; color: var(--dex-green); font-family: var(--dexfont); font-size: 21px; cursor: pointer; text-align: left; border-radius: 3px; letter-spacing: 1px; }
.dex-row small { font-size: 15px; opacity: .6; }
.dex-row:hover { background: rgba(159,232,112,.08); }
.dex-row.on { background: rgba(159,232,112,.18); border-left-color: var(--dex-green); }
.dex-tabs { display: flex; gap: 8px; align-items: center; }
.dex-tab { flex: 1; padding: 11px; border-radius: 8px; border: 2px solid #1a0607; background: linear-gradient(180deg, #5a1a1c, #3a0e10); color: #f4d6d6; font-family: var(--pixel); font-size: 10px; cursor: pointer; letter-spacing: 1px; transition: all .2s; box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.dex-tab:hover { filter: brightness(1.2); }
.dex-tab.on { background: linear-gradient(180deg, #fff, #ddd); color: #3a0e10; }
.dex-close { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; background: #1a0607; color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.form-screen { flex: 1; padding: 18px; overflow-y: auto; max-height: 640px; }
.dex-form { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 14px; }
.dex-form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dex-title { font-size: 26px; letter-spacing: 1px; }
.dex-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dex-label { font-size: 17px; letter-spacing: 1px; color: #8cc766; }
.dex-val { font-size: 22px; letter-spacing: 1px; }
.dex-val.muted { color: #5f8a48; }
.dex-input { width: 100%; background: rgba(0,0,0,.25); border: 1px solid #4b6d3a; border-radius: 6px; color: var(--dex-green); font-family: var(--dexfont); font-size: 22px; padding: 7px 11px; outline: none; transition: border-color .2s, box-shadow .2s; }
.dex-input:focus { border-color: var(--dex-green); box-shadow: 0 0 0 2px rgba(159,232,112,.2); }
select.dex-input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, #9fe870 50%), linear-gradient(135deg, #9fe870 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
select.dex-input option { background: #1d2a1a; color: #9fe870; }
select.dex-input option:disabled { color: #4f6f3c; }
.dex-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dex-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dex-chip { border: 1px solid #4b6d3a; background: rgba(0,0,0,.2); color: var(--dex-green); font-family: var(--dexfont); font-size: 19px; padding: 2px 10px; border-radius: 5px; cursor: pointer; }
.dex-chip:hover { border-color: var(--dex-green); }
.dex-actions { display: flex; justify-content: space-between; margin-top: 4px; }
.dex-btn { font-family: var(--pixel); font-size: 10px; padding: 12px 14px; border-radius: 6px; border: 2px solid #0f0f0f; background: linear-gradient(180deg, #5a1a1c, #3a0e10); color: #f4d6d6; cursor: pointer; letter-spacing: 1px; transition: all .15s; }
.dex-btn:hover { filter: brightness(1.25); transform: translateY(-1px); }
.dex-btn:disabled { opacity: .5; }
.dex-btn.go { background: linear-gradient(180deg, #2b1416, #140809); border-color: #6fb8ff; box-shadow: 0 0 12px rgba(111,184,255,.4); color: #fff; }
.dex-btn.danger { background: linear-gradient(180deg, #b3262b, #7d1216); color: #fff; font-size: 9px; padding: 9px 11px; }
.dex-routeinfo { border-top: 1px dashed #4b6d3a; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.dex-routeinfo:empty { display: none; }
.dex-note { color: #6f9a55; font-size: 19px; }
.dex-warn { color: #ffb3b3; font-size: 19px; }
.dex-linkrow { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.dex-linkrow i { width: 10px; height: 10px; border-radius: 50%; }
/* type picker (inside dex) */
.tp { position: relative; display: flex; flex-direction: column; gap: 5px; }
.tp-label { text-transform: uppercase; font-size: 17px; letter-spacing: 1px; color: #8cc766; }
.tp-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 42px; padding: 6px 11px; border-radius: 6px; border: 1px solid #4b6d3a; background: rgba(0,0,0,.25); color: var(--dex-green); cursor: pointer; }
.tp-btn .type-badge { height: 26px; }
.tp-empty { font-family: var(--dexfont); font-size: 21px; color: #6f9a55; }
.tp-pop { position: static; margin-top: 4px; display: none; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; border-radius: 10px; background: #111a0f; border: 2px solid #4b6d3a; box-shadow: 0 14px 34px rgba(0,0,0,.6); }
.tp.open .tp-pop { display: grid; animation: popIn .18s var(--ease) both; }
.tp-opt { border: 2px solid transparent; background: transparent; border-radius: 999px; padding: 2px; cursor: pointer; display: grid; place-items: center; transition: transform .15s; }
.tp-opt:hover { transform: scale(1.06); }
.tp-opt.on { border-color: #fff; }
.tp-opt .type-badge { height: 26px; width: 100%; object-fit: contain; }
.tp-opt.none { grid-column: 1 / -1; font-family: var(--dexfont); font-size: 20px; color: var(--dex-green); border: 1px dashed #4b6d3a; border-radius: 6px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .dex { grid-template-columns: 1fr; }
  .dex-screen.big { height: 190px; }
  .dex-img { width: 150px; height: 150px; }
  .run-card { grid-template-columns: 1fr; gap: 10px; }
  .run-status { justify-self: start; }
}
@media (max-width: 760px) {
  #app { padding: 10px 10px 110px; }
  .topbar { flex-wrap: wrap; }
  .tb-right { width: 100%; justify-content: flex-start; }
  .slots { grid-template-columns: 1fr 1fr; }
  .links, .unlinked { overflow-x: auto; }
  .link-cells, .unlinked { min-width: calc(var(--cols) * 240px); }
  .dt-grid { grid-template-columns: 1fr 1fr; }
  .dock-t { min-width: 0; padding: 12px; font-size: 13px; }
  .new-run { flex-direction: column; }
  .rt-row { grid-template-columns: 120px repeat(var(--cols), minmax(0, 1fr)); }
  .rt-cell.has span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 760px) {
  .rt-counts { order: 3; flex-basis: 100%; }
  .rt-title { flex: 1; }
}
@media (max-width: 760px) {
  .ms { padding: 2px; }
  .ms-n { font-size: 5px; left: 2px; top: 1px; }
  .ms-check { width: 12px; height: 12px; right: -3px; top: -3px; }
  .ms-check .ico { width: 7px; height: 7px; }
}

/* ---------- Pokédex details view ---------- */
.dex-sub { margin-top: 2px; }
.linked-list { height: 250px; }
.dex-row.link-entry { justify-content: flex-start; gap: 10px; padding: 5px 10px; }
.dex-row.link-entry .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dex-row.link-entry img.mini { width: 36px; height: 36px; }
.le-main { display: flex; flex-direction: column; line-height: 1; flex: 1; min-width: 0; }
.le-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-main small { font-size: 16px; opacity: .65; margin-top: 3px; }
.le-loc { font-size: 16px; opacity: .8; border: 1px solid #4b6d3a; border-radius: 4px; padding: 1px 6px; }
.dex-row.link-entry.waiting { cursor: default; opacity: .55; border-left-style: dashed; }
.dex-row.link-entry.waiting:hover { background: transparent; }
.dex-view .dex-title { font-size: 30px; }
.dex-status { font-family: var(--pixel); font-size: 9px; padding: 6px 8px; border-radius: 5px; border: 2px solid #0f0f0f; }
.dex-status.ok { background: #2f5c22; color: #cfffb0; }
.dex-status.dead { background: #b3262b; color: #fff; }
.dex-status.fail { background: #3a3a3a; color: #ddd; border-style: dashed; border-color: #888; }
.dex-owner { display: inline-flex; align-items: center; gap: 8px; }
.dex-owner i { width: 10px; height: 10px; border-radius: 50%; }
.dex-val.small { font-size: 19px; }
.dex-chip.static { cursor: default; }
.dex-move { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dex-btn.mv.on { background: linear-gradient(180deg, #fff, #ddd); color: #3a0e10; opacity: 1; }
.dex-sprite.dead .dex-img { filter: grayscale(.8) sepia(.4) hue-rotate(-30deg) brightness(.8); }
.dex-sprite.fail .dex-img { filter: grayscale(1) opacity(.45); }
.dex-stamp { position: absolute; z-index: 3; right: 14px; bottom: 12px; font-family: var(--pixel); font-size: 10px; padding: 6px 8px; border-radius: 4px; transform: rotate(-6deg); }
.dex-stamp:empty { display: none; }
.dex-stamp.dead { border: 2px solid #ff6b70; color: #ff6b70; }
.dex-stamp.fail { border: 2px dashed #bbb; color: #ddd; }

/* =========================================================
   BOSSES panel
   ========================================================= */
.bosses { margin-bottom: 14px; }
.bosses .section-title .ico { color: var(--red2); }
.bp-stats { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.pill.opt { border-color: #4a6fa5; color: #9cc0ff; background: rgba(74,111,165,.12); }
.boss-list { max-height: 620px; overflow-y: auto; border-top: 1px solid var(--line); }
.boss-row { border-bottom: 1px solid var(--line); border-left: 3px solid transparent; transition: background .2s, opacity .2s; }
.boss-row.next { border-left-color: var(--amber); background: rgba(255,176,32,.05); }
.boss-row.open { background: rgba(255,255,255,.02); box-shadow: inset 0 0 0 1px rgba(255,176,32,.35); }
.boss-head { display: grid; grid-template-columns: 20px minmax(0, 1.2fr) minmax(0, 1fr) auto 64px 200px 16px; align-items: center; gap: 14px; padding: 9px 14px; cursor: pointer; }
.boss-head:hover { background: rgba(255,255,255,.03); }
.bchk { width: 20px; height: 20px; border-radius: 5px; border: 2px solid #cfcfd6; background: transparent; display: grid; place-items: center; cursor: pointer; color: #111; padding: 0; transition: all .2s var(--ease); flex: none; }
.bchk:hover { border-color: #fff; transform: scale(1.08); }
.bchk.on { background: var(--green); border-color: var(--green); }
.bchk.on.pop { animation: msPop .35s var(--ease); }
.boss-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.boss-name b { font-size: 14px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-tag { font-size: 10px; font-weight: 800; letter-spacing: .8px; padding: 2px 8px; border-radius: 999px; background: rgba(74,111,165,.25); color: #9cc0ff; border: 1px solid rgba(74,111,165,.6); flex: none; }
.boss-loc { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boss-team { display: flex; gap: 2px; justify-content: flex-end; }
img.bmini { width: 30px; height: 30px; object-fit: contain; }
.boss-chev { color: var(--muted); transform: rotate(-90deg); transition: transform .25s var(--ease); display: inline-flex; }
.boss-row.open .boss-chev { transform: rotate(0); }
.boss-row.done .boss-name b, .boss-row.done .boss-loc { color: #6d6d78; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.25); }
.boss-row.done .boss-team img { filter: grayscale(1); opacity: .45; }
.boss-body { padding: 4px 14px 16px 48px; animation: fadeIn .25s ease both; }
.boss-effect { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--amber); text-transform: uppercase; margin: 4px 0 10px; }
.boss-effect.sub { color: var(--muted); }
.boss-variants { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.boss-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bcard { border: 1px solid var(--line2); border-radius: 12px; padding: 12px; background: #111116; display: flex; flex-direction: column; gap: 6px; animation: pageIn .35s var(--ease) both; }
.bc-top { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.bc-sprite { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle at 50% 60%, rgba(255,255,255,.07), transparent 70%); }
.bc-sprite img { width: 56px; height: 56px; object-fit: contain; }
.bc-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bc-id b { font-size: 15px; }
.bc-kv { display: grid; grid-template-columns: 60px 1fr; font-size: 13px; }
.bc-kv span { color: var(--muted); }
.bc-moves { margin: 4px 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.bc-mu { display: grid; grid-template-columns: 52px 1fr; gap: 6px 6px; align-items: start; font-size: 12px; margin-top: 4px; }
.bc-l { color: var(--muted); padding-top: 2px; }
.mchips { display: flex; flex-wrap: wrap; gap: 4px; }
.mchip { padding: 1px 7px; border-radius: 6px; font-weight: 700; font-size: 11px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); white-space: nowrap; }
.tc-normal { background: #a8a898; } .tc-fire { background: #e0461d; } .tc-water { background: #2f7fe3; }
.tc-electric { background: #e8a200; } .tc-grass { background: #4fa82b; } .tc-ice { background: #4cc4e6; }
.tc-fighting { background: #8a2e17; } .tc-poison { background: #8a3f93; } .tc-ground { background: #c9a352; }
.tc-flying { background: #7d95e6; } .tc-psychic { background: #e0467f; } .tc-bug { background: #8a9d1b; }
.tc-rock { background: #a08a3c; } .tc-ghost { background: #5a54a3; } .tc-dragon { background: #6250db; }
.tc-dark { background: #4a3b33; } .tc-steel { background: #8e95a8; } .tc-fairy { background: #d98bdd; }
@media (max-width: 760px) {
  .boss-head { grid-template-columns: 20px 1fr 16px; gap: 8px; }
  .boss-rewards, .boss-cap { grid-column: 2; }
  .boss-loc { grid-column: 2; grid-row: 2; font-size: 11px; }
  .boss-team { grid-column: 2 / 4; grid-row: 3; justify-content: flex-start; }
  .boss-chev { grid-column: 3; grid-row: 1; }
  .boss-body { padding-left: 14px; }
}

.boss-rewards { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.reward-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; border: 1px solid #f0a020; color: #ffbf47; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(240,160,32,.08); }
.boss-cap { color: #ffb020; font-weight: 700; font-size: 14px; text-align: right; white-space: nowrap; }
.boss-cap b { font-size: 15px; }
.boss-row.done .boss-cap, .boss-row.done .reward-pill { opacity: .45; }
.boss-reward-info { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 12px; font-size: 13px; }
.boss-reward-info div { display: flex; align-items: center; gap: 6px; color: #ffbf47; }
.boss-reward-info .muted { color: var(--muted); }
.dex-formfield select { text-transform: none; }

/* =========================================================
   Floating menu button, floating windows (notepad)

   ========================================================= */
:root { --sp-track: #2a2a33; }

/* ---------- floating menu button (run page only) ---------- */
.fab-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 197; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab { width: 58px; height: 58px; border-radius: 50%; border: 3px solid #111; cursor: pointer; position: relative; padding: 0;
  background: linear-gradient(180deg, var(--red2) 0 46%, #111 46% 54%, #f4f4f6 54%); box-shadow: 0 10px 28px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.08); transition: transform .2s var(--ease), box-shadow .2s; }
.fab::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #f4f4f6; border: 3px solid #111; transform: translate(-50%, -50%); transition: background .2s; }
.fab:hover { transform: translateY(-2px) rotate(-8deg); box-shadow: 0 14px 34px rgba(227,36,43,.45), 0 0 0 3px rgba(255,255,255,.12); }
.fab.open { transform: rotate(180deg); }
.fab.open::after { background: var(--red2); }
.fab-menu { min-width: 220px; padding: 6px; background: #fff; color: #111; border-radius: 14px; box-shadow: 0 18px 44px rgba(0,0,0,.55); transform-origin: bottom right; animation: popIn .18s var(--ease) both; }
.fab-menu[hidden] { display: none; }
.fab-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 14px; text-align: left; }
.fab-item:hover { background: #f1f1f4; }
.fab-item .ico { color: var(--red); }
.fab-item small { display: block; font-weight: 500; color: #666; font-size: 12px; }
body.is-dragging .fab-wrap { opacity: 0; pointer-events: none; }

/* ---------- boss card button ---------- */
.boss-body-top { display: flex; align-items: flex-start; gap: 10px; }
.boss-body-top > :first-child { flex: 1; min-width: 0; }
.bc-kv.lv b { color: #fff; }
.bc-spread { font-size: 11px; color: var(--muted); line-height: 1.35; }
.bc-spread b { color: #d8d8de; font-weight: 600; }

/* ---------- floating tool windows (calculator, notepad) ---------- */
.fw-win { position: fixed; z-index: 180; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.97); opacity: 0;
  display: flex; flex-direction: column; background: #101014; border: 3px solid #1a0607; border-radius: 18px;
  box-shadow: 0 40px 120px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.04); transition: opacity .18s ease, transform .2s var(--ease); overflow: hidden; }
.fw-win.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fw-win.placed, .fw-win.placed.in { transform: none; }
.fw-win.dragging { transition: none; user-select: none; }
.note-win { width: min(460px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); }
.fw-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 14px; flex: none;
  background: linear-gradient(180deg, #8a2024, #5a1215); border-bottom: 3px solid #1a0607; cursor: grab; user-select: none; }
.fw-win.dragging .fw-titlebar { cursor: grabbing; }
.fw-tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; }
.fw-title { font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
.fw-sub { font-size: 12px; color: #f4d6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-ball { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #111; flex: none; background: linear-gradient(180deg, #fff 0 44%, #111 44% 56%, #fff 56%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.fw-ball.note { background: linear-gradient(180deg, #ffd34d 0 44%, #111 44% 56%, #fff 56%); }
.fw-tb-right { display: flex; gap: 6px; }
.fw-btn { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #1a0607; background: rgba(0,0,0,.25); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.fw-btn:hover { background: rgba(0,0,0,.45); }
.fw-btn.close:hover { background: #fff; color: var(--red); }
.fw-body { flex: 1; min-height: 0; overflow: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* minimized windows sit in a dock along the bottom of the screen, left of the menu button */
.fw-dock { position: fixed; z-index: 196; right: 92px; bottom: 22px; left: 16px; display: flex; flex-direction: row-reverse; flex-wrap: wrap-reverse; gap: 8px; pointer-events: none; }
.fw-dock .fw-win { pointer-events: auto; }
.fw-win.min { position: static; transform: none !important; opacity: 1; width: auto; height: auto; max-width: 340px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.55); animation: dockIn .2s var(--ease) both; }
.fw-win.min .fw-body { display: none; }
.fw-win.min .fw-titlebar { cursor: pointer; border-bottom: 0; padding: 7px 8px 7px 12px; }
.fw-win.min .fw-title { font-size: 9px; }
.fw-win.min .fw-sub { max-width: 120px; }
.fw-win.min .fw-btn { width: 26px; height: 26px; }
@keyframes dockIn { from { opacity: 0; transform: translateY(12px); } }
body.is-dragging .fw-dock { opacity: 0; }

/* ---------- notepad ---------- */
.note-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.np-tabs { display: flex; gap: 6px; padding: 4px; background: #0b0b0e; border: 1px solid var(--line2); border-radius: 12px; }
.np-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.np-tab.on { background: #fff; color: #111; }
.np-info span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.np-conflict { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255,176,32,.5); background: rgba(255,176,32,.1); font-size: 13px; }
.np-conflict span { flex: 1; min-width: 160px; }
.np-pad { flex: 1; min-height: 0; display: flex; }
.np-text { flex: 1; width: 100%; min-height: 220px; resize: none; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); outline: none;
  background: var(--dex-screen); color: var(--dex-green); font-family: var(--dexfont); font-size: 21px; line-height: 1.3; letter-spacing: .5px;
  box-shadow: inset 0 0 0 2px #2c4422, inset 0 0 30px rgba(0,0,0,.5); }
.np-text:focus { border-color: var(--dex-green); }
.np-text::placeholder { color: #5f8a48; }
.np-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.np-status { display: inline-flex; align-items: center; gap: 6px; }
.np-dot { width: 8px; height: 8px; border-radius: 50%; background: #55555f; display: inline-block; }
.np-dot.ok { background: var(--green); }
.np-dot.busy { background: var(--amber); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .fw-win:not(.min), .fw-win.in:not(.min) { left: 0 !important; top: 0 !important; width: 100vw; height: 100dvh; border-radius: 0; border-width: 0; transform: none !important; }
  .fw-dock { right: 82px; left: 10px; bottom: 16px; }
  .fw-win.min { max-width: calc(100vw - 100px); }
  .fw-titlebar { cursor: default; }
  .fab-wrap { right: 14px; bottom: 14px; }
  .fw-title { font-size: 9px; }
}
/* phones: keep wide rows (linked rows, tabs) scrolling inside their box instead of widening the whole page */
@media (max-width: 760px) {
  .unlinked { min-width: 0; grid-template-columns: repeat(var(--cols), minmax(240px, 1fr)); }
  .tabs { overflow-x: auto; }
  .tab { flex: none; }
}

/* =========================================================
   Public Tracker v1: settings boxes, help tour, links, footer, scrollbars
   ========================================================= */
/* prettier scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: #3a3a46 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #33333d; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #4a4a57; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
.dex-list, .form-screen { scrollbar-color: #4b6d3a transparent; }
.dex-list::-webkit-scrollbar-thumb, .form-screen::-webkit-scrollbar-thumb { background: #4b6d3a; border-radius: 999px; }

/* footer (every page) */
.site-foot { max-width: 1320px; margin: -90px auto 0; padding: 22px 16px 34px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.site-foot a { color: #ff7a7f; font-weight: 600; }
.site-foot a:hover { text-decoration: underline; }

/* help button + tour */
.help-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 8px; border: 1px solid var(--line2); background: #0f0f13; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.help-btn:hover { color: #fff; border-color: var(--red); }
.help-shade { position: fixed; inset: 0; z-index: 240; background: transparent; }
.help-box { position: fixed; z-index: 260; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); padding: 16px 18px; border-radius: 16px; background: #fff; color: #111; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: popIn .2s var(--ease) both; }
.help-head { display: flex; align-items: center; gap: 8px; }
.help-head .ico:first-child { color: var(--red); }
.help-head h3 { margin: 0; font-size: 16px; flex: 1; }
.help-head .icon-btn { background: #f1f1f4; border-color: #e1e1e6; color: #333; }
.help-box p { margin: 8px 0 14px; font-size: 14px; color: #333; line-height: 1.5; }
.help-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.help-count { font-size: 12px; color: #777; font-weight: 600; }
.help-box .btn.ghost { color: #111; border-color: #d4d4da; }
.help-focus { position: relative; z-index: 250 !important; outline: 3px solid var(--red2); outline-offset: 4px; box-shadow: 0 0 0 9999px rgba(4,4,6,.6) !important; }

/* game page: settings boxes */
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.set-card { position: relative; padding: 16px 18px; }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.set-head .section-title { margin: 0; }
.set-gear { width: 34px; height: 34px; }
.set-gear .ico { transition: transform .35s var(--ease); }
.set-gear:hover { transform: none; }
.set-gear:hover .ico { transform: rotate(60deg); }
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.set-row:last-child { border-bottom: 0; }
.set-row span { color: #cfcfd6; }
.set-row b { text-align: right; }
.code-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* codes use a clear monospace font (the pixel font made "6" look like a "G") */
.code-pill { font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, 'Roboto Mono', 'Courier New', monospace; font-weight: 700; font-size: 13px; line-height: 1; padding: 6px 9px; border-radius: 6px; background: #fff; color: #111; letter-spacing: .3px; }
.code-pill.mono { background: var(--red); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.code-chips .muted { width: 100%; margin-top: 4px; }
.set-modal-wrap { width: min(560px, 100%); padding: 20px; }
.set-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.set-modal-head h3 { margin: 0; flex: 1; }
.set-modal-head .ico:first-child { color: var(--red2); }
.set-modal-body { display: flex; flex-direction: column; gap: 12px; max-height: min(62vh, 640px); overflow-y: auto; margin: 10px -6px 16px; padding: 0 6px; }
.set-field { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #111116; }
.set-field.compact { padding: 9px 12px; }
.set-field p { margin: 6px 0 0; }
.sf-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-group { display: flex; flex-direction: column; gap: 8px; }
.sg-head { display: flex; flex-direction: column; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.choice { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line2); background: #0c0c10; cursor: pointer; transition: all .15s; }
.choice small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice:hover { border-color: #55555f; }
.choice.on { border-color: var(--red2); background: rgba(227,36,43,.12); box-shadow: inset 0 0 0 1px var(--red2); }
.switch { position: relative; width: 44px; height: 24px; flex: none; border-radius: 999px; border: 1px solid var(--line2); background: #2a2a33; cursor: pointer; transition: background .2s; padding: 0; }
.switch i { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #aaa; transition: all .2s var(--ease); }
.switch.on { background: var(--red); border-color: var(--red2); }
.switch.on i { left: 23px; background: #fff; }

/* game page: players + delete */
.slot { position: relative; }
.slot-kick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; }
.slot:has(.slot-kick) > small { margin-right: 30px; }
.danger-zone { margin-top: 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: rgba(227,36,43,.35); }
.danger-zone .section-title { margin: 0 0 4px; color: #ff7a7f; }
.danger-zone p { margin: 0; max-width: 640px; }
.inactive-note { text-align: center; margin-top: 26px; }

/* run page: bosses mode line */
.boss-mode { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }

/* route tracker: custom routes + static encounters */
.rt-del { margin-left: 6px; width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 5px; border: 1px solid var(--line2); background: transparent; color: var(--muted); cursor: pointer; vertical-align: middle; padding: 0; }
.rt-del:hover { color: #ff7a7f; border-color: var(--red); }
.rt-row.custom .rt-route b { color: #ffd6d8; }
.rt-row.static .rt-route small { text-transform: none; letter-spacing: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-group { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-top: 2px solid var(--line2); background: #121217; cursor: pointer; text-align: left; flex-wrap: wrap; position: sticky; bottom: 0; }
.rt-group .ico { transform: rotate(-90deg); transition: transform .2s; }
.rt-group.open .ico { transform: none; }
.rt-group b { font-size: 13px; }
.rt-group span { font-size: 12px; }
.rt-group.open { position: static; }

/* team / box / graveyard */
.link-ball { cursor: pointer; padding: 0; transition: transform .15s; }
button.link-ball:hover { transform: scale(1.15) rotate(-12deg); }
.link-ball.off { cursor: default; background: transparent; border: 2px dashed var(--line2); box-shadow: none; width: 18px; height: 18px; }
.link-ball.off::after { display: none; }
.unlinked.solo { grid-template-columns: 1fr; }
.unlinked.solo .ucol { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; border: 0; padding: 0; }
.unlinked.solo .ucol-empty { grid-column: 1 / -1; border: 1px dashed var(--line2); border-radius: var(--radius); }
.links + .unlinked { margin-top: 12px; }

/* Pokédex: link tools + link picker */
.dex-linktools { display: flex; gap: 8px; margin-top: 8px; }
.dex-btn.sm { padding: 5px 10px; font-size: 16px; }
.dex-note.left { text-align: left; font-size: 17px; line-height: 1.2; }
.link-pick { width: min(480px, 100%); }
.link-pick h3 { margin: 0 0 6px; }
.lp-group { margin-top: 12px; }
.lp-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.lp-head i { width: 10px; height: 10px; border-radius: 50%; }
.lp-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.lp-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #111116; cursor: pointer; text-align: left; }
.lp-item:hover { border-color: var(--red2); }
.lp-item span { display: flex; flex-direction: column; }
.lp-item small { font-size: 12px; }
.modal.small:has(.link-pick) { width: 500px; }

@media (max-width: 980px) {
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr; }
  .site-foot { margin-top: -100px; }
}

/* =========================================================
   Public Tracker v2
   ========================================================= */
/* linked rows: no route label above the row (cards show their own route) */
.link-row { grid-template-rows: auto; }
.link-grip { grid-row: auto; }
.link-grip.off { cursor: default; opacity: .3; }
.link-grip.off:hover { color: #555; }
/* team over 6 (moved there by hand) */
.pill.over { background: var(--red); border-color: var(--red2); color: #fff; }

/* single player: 3 cards per row */
.unlinked.solo .ucol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .unlinked.solo .ucol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .unlinked.solo .ucol { grid-template-columns: 1fr; } }

/* monotype picker (looks like the type picker; options look like the code pill they become) */
.mp { position: relative; }
.mp-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 42px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line2); background: #0c0c10; color: var(--text); cursor: pointer; }
.mp-btn:hover, .mp.open .mp-btn { border-color: #55555f; }
.mp.open .mp-btn .ico { transform: rotate(180deg); }
.mp-pop { display: none; position: static; margin-top: 8px; padding: 10px; border-radius: 12px; background: #15151b; border: 1px solid var(--line2); box-shadow: 0 18px 40px rgba(0,0,0,.55); animation: popIn .16s var(--ease) both; }
.mp.open .mp-pop { display: block; }
.mp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.mp-opt { display: grid; place-items: center; padding: 5px; border-radius: 9px; border: 2px solid transparent; background: transparent; cursor: pointer; transition: transform .12s, border-color .12s; }
.mp-opt:hover { transform: translateY(-1px); border-color: #3a3a46; }
.mp-opt.on { border-color: #fff; }
.mp-opt .code-pill { width: 100%; text-align: center; }
.mp-opt.none { width: 100%; padding: 8px; border: 1px solid var(--line2); color: var(--muted); font-size: 13px; }
.mp-opt.none.on { border-color: #fff; color: #fff; }
@media (max-width: 480px) { .mp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pokédex: ability dropdown + description */
.dex-ability { appearance: auto; }
.dex-mini { align-self: flex-start; margin-top: 6px; font-family: var(--pixel); font-size: 8px; letter-spacing: 1px; padding: 5px 8px; border-radius: 5px; border: 1px solid #4b6d3a; background: rgba(0,0,0,.25); color: var(--dex-green); cursor: pointer; }
.dex-mini:hover { border-color: var(--dex-green); }
.dex-abdesc { margin-top: 6px; padding: 6px 9px; border-left: 3px solid var(--dex-green); background: rgba(159,232,112,.08); color: #cfeeb9; font-size: 19px; line-height: 1.15; border-radius: 3px; }
.dex-abilityfield { display: flex; flex-direction: column; min-width: 0; }
.dex-input option, .dex-input optgroup { background: #1d2a1a; color: var(--dex-green); }

/* Pokédex: dupes clause popup (centered in the Pokédex) */
.dex { position: relative; }
.dupe-ov { position: absolute; inset: -6px; z-index: 20; display: grid; place-items: center; padding: 16px; border-radius: 28px; background: rgba(6,4,4,.66); backdrop-filter: blur(2px); animation: fadeIn .15s ease both; }
.dupe-box { width: min(420px, 100%); padding: 18px; border-radius: 16px; background: var(--dex-screen); border: 6px solid #0f0f0f; box-shadow: inset 0 0 0 2px #3c5a2f, 0 30px 70px rgba(0,0,0,.7); color: var(--dex-green); font-family: var(--dexfont); animation: popIn .2s var(--ease) both; }
.dupe-title { font-family: var(--pixel); font-size: 11px; letter-spacing: 1px; color: #ff9a9a; }
.dupe-mon { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.dupe-sprite { width: 76px; height: 76px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid #4b6d3a; }
.dupe-sprite img { width: 72px; height: 72px; object-fit: contain; }
.dupe-name { font-size: 24px; letter-spacing: 1px; }
.dupe-owner { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #8cc766; }
.dupe-owner i { width: 9px; height: 9px; border-radius: 50%; }
.dupe-text { margin: 0 0 14px; font-size: 19px; line-height: 1.2; color: #cfeeb9; }
.dupe-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* help: spotlight that works on the page and inside popups */
.help-spot { position: fixed; z-index: 245; pointer-events: none; border-radius: 12px; outline: 3px solid var(--red2); outline-offset: 0; box-shadow: 0 0 0 9999px rgba(4,4,6,.55); transition: left .2s var(--ease), top .2s var(--ease), width .2s var(--ease), height .2s var(--ease); }
.help-box.top { bottom: auto; top: 18px; }
/* monotype code pill takes its type's color */
.code-pill.mono.tc-normal { background: #a8a898; }
.code-pill.mono.tc-fire { background: #e0461d; }
.code-pill.mono.tc-water { background: #2f7fe3; }
.code-pill.mono.tc-electric { background: #e8a200; }
.code-pill.mono.tc-grass { background: #4fa82b; }
.code-pill.mono.tc-ice { background: #4cc4e6; }
.code-pill.mono.tc-fighting { background: #8a2e17; }
.code-pill.mono.tc-poison { background: #8a3f93; }
.code-pill.mono.tc-ground { background: #c9a352; }
.code-pill.mono.tc-flying { background: #7d95e6; }
.code-pill.mono.tc-psychic { background: #e0467f; }
.code-pill.mono.tc-bug { background: #8a9d1b; }
.code-pill.mono.tc-rock { background: #a08a3c; }
.code-pill.mono.tc-ghost { background: #5a54a3; }
.code-pill.mono.tc-dragon { background: #6250db; }
.code-pill.mono.tc-dark { background: #4a3b33; }
.code-pill.mono.tc-steel { background: #8e95a8; }
.code-pill.mono.tc-fairy { background: #d98bdd; }

/* Pokédex: searchable ability dropdown */
.ab-combo { position: relative; }
.ab-combo .dex-input { padding-right: 34px; }
.ab-caret { position: absolute; right: 11px; top: 13px; color: var(--dex-green); pointer-events: none; transition: transform .2s; }
.ab-combo.open .ab-caret { transform: rotate(180deg); }
.ab-list { margin-top: 4px; max-height: 210px; overflow-y: auto; border: 1px solid #4b6d3a; border-radius: 6px; background: rgba(0,0,0,.35); padding: 3px; display: flex; flex-direction: column; scrollbar-color: #4b6d3a transparent; }
.ab-group { font-size: 15px; letter-spacing: 1px; color: #6f9a55; padding: 5px 8px 2px; }
.ab-opt { text-align: left; border: 0; border-left: 3px solid transparent; background: transparent; color: var(--dex-green); font-family: var(--dexfont); font-size: 20px; padding: 3px 8px; border-radius: 3px; cursor: pointer; }
.ab-opt:hover, .ab-opt.act { background: rgba(159,232,112,.12); }
.ab-opt.on { border-left-color: var(--dex-green); background: rgba(159,232,112,.2); }
.ab-opt.clear { color: #6f9a55; font-size: 17px; }
.ab-empty { color: #6f9a55; font-size: 18px; padding: 6px 8px; }

/* =========================================================
   v4: Nuzlocke rules off -> big Add Catch button instead of the route list
   ========================================================= */
.catch-panel { margin-bottom: 18px; }
.catch-panel[hidden] { display: none; }
.catch-big { position: relative; display: flex; align-items: center; gap: 18px; width: 100%; padding: 18px 22px; border-radius: var(--radius); border: 1px solid var(--line2); cursor: pointer; text-align: left; color: var(--text); overflow: hidden;
  background: radial-gradient(500px 160px at 0% 50%, rgba(227,36,43,.28), transparent 70%), linear-gradient(180deg, #19191f, #121216);
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.catch-big:hover { transform: translateY(-2px); border-color: var(--red2); box-shadow: 0 16px 40px rgba(227,36,43,.22); }
.catch-big:active { transform: translateY(0); }
.cb-ball { width: 62px; height: 62px; flex: none; border-radius: 50%; border: 3px solid #111; position: relative;
  background: linear-gradient(180deg, var(--red2) 0 46%, #111 46% 54%, #f4f4f6 54%); box-shadow: 0 8px 22px rgba(0,0,0,.5); transition: transform .35s var(--ease); }
.cb-ball::after { content: ''; position: absolute; left: 50%; top: 50%; width: 17px; height: 17px; border-radius: 50%; background: #f4f4f6; border: 3px solid #111; transform: translate(-50%, -50%); }
.catch-big:hover .cb-ball { transform: rotate(-18deg) scale(1.05); }
.cb-text { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cb-text b { font-family: var(--pixel); font-size: 17px; letter-spacing: 1px; }
.cb-text small { color: var(--muted); font-size: 14px; }
.cb-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cb-plus { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(227,36,43,.45); transition: transform .2s var(--ease); }
.catch-big:hover .cb-plus { transform: rotate(90deg); }
@media (max-width: 640px) {
  .catch-big { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .cb-ball { width: 46px; height: 46px; }
  .cb-text b { font-size: 13px; }
  .cb-stats { order: 3; width: 100%; justify-content: flex-start; }
}
.routes[hidden] { display: none; }
.dex-customplace { margin-top: 6px; }
.dex-customplace[hidden] { display: none; }
.rule-points { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 4px; }
.rule-points li::marker { color: var(--red2); }

/* =========================================================
   v5: drag ghost (card shrinks to its sprite while dragged)
   ========================================================= */
.cb-plus, .catch-big:hover .cb-plus { transform: none; }
.drag-src { opacity: 0 !important; transform: scale(.94); transition: opacity .12s ease, transform .18s var(--ease) !important; }
.link-row.drag-group .pcard:not(.drag-src) { opacity: .55; }
.link-row.drag-group { opacity: 1; transform: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 600; pointer-events: none; will-change: transform, width, height; }
.ghost-inner { width: 100%; height: 100%; }
.drag-ghost .pcard { width: 100%; height: 100%; min-height: 0; margin: 0; overflow: hidden; opacity: 1; cursor: grabbing; transform: none;
  box-shadow: 0 0 0 1px var(--pc), 0 18px 40px rgba(0,0,0,.6); transition: padding .2s var(--ease), border-radius .2s var(--ease), gap .2s, background .2s; }
.drag-ghost .pc-body, .drag-ghost .pc-side { transition: opacity .12s; }
.drag-ghost.mini .pcard { padding: 6px; gap: 0; justify-content: center; border-radius: 20px; border-width: 3px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--pc) 22%, #1b1b21), #131317); }
.drag-ghost.mini .pc-body, .drag-ghost.mini .pc-side { opacity: 0; width: 0; flex: 0 0 0; overflow: hidden; }
.drag-ghost.mini .pc-sprite { width: 62px; height: 62px; }
.drag-ghost.mini .pc-sprite img { width: 62px; height: 62px; transform: none !important; }
/* drop-plop: falls a short way onto the section, squashes, bounces, settles, then slips in */
.drag-ghost.plop .ghost-inner { transform-origin: 50% 100%; animation: ghostPlop .6s cubic-bezier(.3,.7,.4,1) forwards; }
@keyframes ghostPlop {
  0%   { transform: translateY(-22px) scale(.92, 1.06); opacity: 1; }
  30%  { transform: translateY(0) scale(1.14, .84); }
  48%  { transform: translateY(-7px) scale(.96, 1.05); }
  62%  { transform: translateY(0) scale(1.04, .96); }
  74%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(4px) scale(.35); opacity: 0; }
}
.link-grip[draggable="true"] { cursor: grab; }
.rule-site { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--red2); background: rgba(227,36,43,.06); border-radius: 6px; font-size: 13px; line-height: 1.45; color: #d6d6dc; }

/* v10: weak / resist / immune chips = type badge + multiplier strip */
.mchips .xb { display: inline-flex; align-items: center; height: 22px; border-radius: 999px; border: 1.5px solid #0a0a0a; padding-right: 8px; box-sizing: border-box; background-image: linear-gradient(rgba(0,0,0,.32), rgba(0,0,0,.32)); }
.mchips .xb .type-badge { height: 22px; margin: -1.5px 3px -1.5px -1.5px; filter: none; }
.mchips .xb i { font-style: normal; font-weight: 800; font-size: 12px; line-height: 1; color: #fff; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.bc-mu { display: block; }
.bc-mu .bc-l { display: block; padding: 6px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.mchips { gap: 4px; }
.mchips .xb { height: 19px; padding-right: 6px; }
.mchips .xb .type-badge { height: 19px; margin-right: 2px; }
.mchips .xb i { font-size: 11px; }

/* v10: RadRed hub wordmark */
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: 'Rubik', system-ui, sans-serif; font-weight: 800; font-size: clamp(34px, 7vw, 56px); letter-spacing: -1px; line-height: 1; text-shadow: none; color: #fff; }
.logo .logo-rr { display: inline; color: #fff; font-size: 1em; letter-spacing: -1px; margin: 0; text-shadow: none; }
.logo .logo-hub { display: inline-block; background: var(--red); color: #fff; font-size: 1em; letter-spacing: -1px; margin: 0; text-shadow: none; border-radius: .2em; padding: .06em .2em .14em; }

/* v10: footer, Ko-fi button and popup, credits page */
.site-foot p { margin: 0 0 10px; }
.foot-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 12px; }
.site-foot .foot-link { color: var(--muted); font-weight: 600; }
.site-foot .foot-link:hover { color: #fff; }
.site-foot .foot-disclaimer { font-size: 11.5px; opacity: .8; margin: 0; }
.kofi-btn, .site-foot a.kofi-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 13px; border-radius: 999px; background: var(--red); color: #fff; font-family: 'Rubik', system-ui, sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .2px; border: 2px solid var(--red-dark); box-shadow: 0 3px 0 var(--red-dark), 0 6px 18px rgba(227, 36, 43, .3); transition: transform .12s, box-shadow .12s, background .12s; text-decoration: none; cursor: pointer; }
.kofi-btn:hover, .site-foot a.kofi-btn:hover { background: var(--red2); transform: translateY(-1px); box-shadow: 0 4px 0 var(--red-dark), 0 8px 22px rgba(227, 36, 43, .4); text-decoration: none; }
.kofi-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dark), 0 3px 10px rgba(227, 36, 43, .3); }
.kofi-btn svg { flex: none; }
.modal.kofi-modal { width: 440px; padding: 22px 22px 18px; position: relative; max-height: calc(100vh - 32px); overflow: auto; }
.kofi-pop h3 { margin: 0 0 8px; font-size: 20px; }
.kofi-pop p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.kofi-pop p.muted { margin-bottom: 14px; }
.kofi-x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line2); background: #0f0f13; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.kofi-x:hover { color: #fff; border-color: var(--red); }
.kofi-frame-wrap { border-radius: 12px; overflow: hidden; background: #f9f9f9; border: 2px solid var(--red-dark); }
.kofi-frame { display: block; width: 100%; height: 620px; border: 0; background: #f9f9f9; }
.kofi-page { display: block; text-align: center; margin-top: 12px; color: #ff7a7f; font-weight: 600; font-size: 14px; }
.kofi-page:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .modal-back:has(.kofi-modal) { padding: 0; }
  .modal.kofi-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .kofi-frame { height: calc(100vh - 230px); min-height: 420px; }
}
.credits { max-width: 760px; margin: 0 auto; padding: 18px 0 40px; }
.credits-top { margin-bottom: 8px; }
.credits h1 { margin: 6px 0 6px; font-size: 30px; }
.credits-intro { color: var(--muted); margin: 0 0 18px; }
.credit-group { padding: 16px 20px; margin-bottom: 14px; }
.credit-group h2 { margin: 0 0 10px; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--red2); }
.credit-group h2 + p, .credit-group p + h2 { margin-top: 0; }
.credit-group p + h2 { margin-top: 16px; }
.credit-item { padding: 10px 0; border-top: 1px solid var(--line); }
.credit-item:first-of-type { border-top: 0; padding-top: 2px; }
.credit-item b { font-size: 15px; }
.credit-item p { margin: 3px 0 4px; color: #cfcfd6; font-size: 14px; }
.credit-group > p { color: #cfcfd6; font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.credit-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.credit-links a, .credit-group p a { color: #ff7a7f; font-weight: 600; }
.credit-links a:hover, .credit-group p a:hover { text-decoration: underline; }
.credits-disclaimer { color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; margin-top: 18px; }

/* v10: paused update checks */
.poll-paused { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 300; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line2); background: #16161b; color: #fff; font: 600 13px 'Rubik', system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: pointer; animation: fadeIn .25s ease both; }
.poll-paused:hover { border-color: var(--red); }
