:root {
  --bg: #0b0f17;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.12);
  --primary: #facc15;
  --danger: #ef4444;
  --ok: #34d399;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ticker-h: 0px;
  --ticker-dur: 20s;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding-top: var(--ticker-h);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(239, 68, 68, 0.20), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(250, 204, 21, 0.14), transparent 55%),
    radial-gradient(900px 700px at 60% 120%, rgba(59, 130, 246, 0.16), transparent 55%),
    linear-gradient(180deg, #070a10 0%, #0b0f17 60%, #070a10 100%);
}

 .ticker {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   z-index: 50;
   height: var(--ticker-h);
   display: flex;
   flex-direction: column;
   align-items: stretch;
   border-bottom: 1px solid rgba(255, 255, 255, 0.10);
   background: rgba(11, 15, 23, 0.85);
   backdrop-filter: blur(10px);
   overflow: hidden;
 }

 .ticker__lanes {
   width: 100%;
   display: flex;
   flex-direction: column;
 }

 .ticker__lane {
   height: 28px;
   display: flex;
   align-items: center;
 }

 .ticker__track {
   width: 100%;
   overflow: hidden;
   white-space: nowrap;
 }

 .ticker__content {
   display: inline-block;
   font-size: 12px;
   color: rgba(255, 255, 255, 0.78);
   animation: ticker-marquee var(--ticker-dur) linear 1;
   animation-fill-mode: forwards;
   will-change: transform;
 }

 .ticker__content--shiny {
   color: rgba(250, 204, 21, 0.98);
   font-weight: 700;
   text-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
 }

 .ticker__content--mythic {
   color: rgba(239, 68, 68, 0.98);
   font-weight: 800;
   text-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
 }

 @keyframes ticker-marquee {
   0% {
     transform: translateX(100vw);
   }
   100% {
     transform: translateX(calc(-100% - 100vw));
   }
 }

.topbar {
  position: sticky;
  top: var(--ticker-h);
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: blur(10px);
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand__subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  position: relative;
}

 .serverBuffBar {
   border: 1px solid var(--border);
   border-radius: 14px;
   background: #0b0f17;
   box-shadow: var(--shadow);
   padding: 10px;
   display: flex;
   flex-direction: column;
   gap: 8px;
   width: 64px;
   position: absolute;
   top: 18px;
   left: 18px;
   transform: translateX(calc(-100% - 14px - 260px - 14px));
   z-index: 220;
 }

 .serverBuffBar__slot {
   position: relative;
   display: flex;
   justify-content: center;
 }

 .serverBuffBar__btn {
   width: 44px;
   height: 44px;
   border-radius: 14px;
   border: 1px solid rgba(255, 255, 255, 0.10);
   background: rgba(255, 255, 255, 0.06);
   color: var(--text);
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   position: relative;
 }

 .serverBuffBar__btn.is-off {
   opacity: 0.35;
 }

 .serverBuffBar__lvl {
   position: absolute;
   right: -4px;
   bottom: -4px;
   font-size: 11px;
   font-weight: 800;
   color: rgba(255, 255, 255, 0.92);
   padding: 2px 6px;
   border-radius: 999px;
   border: 1px solid rgba(255, 255, 255, 0.12);
   background: rgba(11, 15, 23, 0.88);
 }

 .serverBuffBar__tip {
   position: absolute;
   left: 56px;
   top: calc(0px - var(--sbuff-tip-shift, 0px));
   width: 260px;
   max-width: 65vw;
   border: 1px solid rgba(255, 255, 255, 0.12);
   border-radius: 14px;
   background: #0b0f17;
   box-shadow: var(--shadow);
   padding: 10px;
   display: none;
   z-index: 260;
 }

 .serverBuffBar__slot:hover .serverBuffBar__tip {
   display: block;
 }

 .serverBuffBar__tipTitle {
   font-weight: 800;
   margin-bottom: 6px;
 }

 .serverBuffBar__tipLine {
   font-size: 12px;
   color: rgba(255, 255, 255, 0.92);
   line-height: 1.35;
 }

 .serverBuffBar__tipLine.muted {
   color: rgba(255, 255, 255, 0.72);
 }

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 12px;
  }

  .bulletin {
    position: static;
    width: auto;
    transform: none;
  }

  .serverBuffBar {
    position: static;
    width: auto;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .serverBuffBar__tip {
    left: 0;
    top: 52px;
    width: min(360px, 90vw);
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
  }

  .input {
    min-width: 140px;
    max-width: 100%;
  }
}

.bulletin {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  width: 260px;
  position: absolute;
  top: 18px;
  left: 18px;
  transform: translateX(calc(-100% - 14px));
  z-index: 60;
}

.bulletin__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.bulletin__line {
  line-height: 1.35;
}

.sidebar {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.sidebar__title {
  font-weight: 750;
  letter-spacing: 0.2px;
}

.main {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 750;
  letter-spacing: 0.2px;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tab.is-active {
  color: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.panels {
  padding: 12px;
}

 #panel-options {
   min-height: 540px;
   display: flex;
   flex-direction: column;
 }

 .saveQrWrap {
   margin-top: auto;
   padding-top: 14px;
 }

 .saveQr {
   width: 120px;
   height: 120px;
   border-radius: 14px;
   border: 1px solid var(--border);
   background: rgba(255, 255, 255, 0.04);
   padding: 10px;
   display: flex;
   align-items: center;
   justify-content: center;
 }

 .saveQr__img {
   width: 100%;
   height: 100%;
   object-fit: contain;
   display: block;
   border-radius: 10px;
 }

.panel__title {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 6;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .card {
    grid-column: span 12;
  }
}

.card__title {
  margin: 0 0 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.tile__k {
  font-size: 12px;
  color: var(--muted);
}

.tile__v {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}

.tile__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 10px;
  min-width: 200px;
}

 select.input option {
   color: #111;
   background: #fff;
 }

.textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.80);
  font-size: 13px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 650;
}

.btn--small {
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 750;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

 .btn:active:not(:disabled),
 .btn.is-pressing {
   background: rgba(255, 255, 255, 0.12);
   transform: translateY(1px);
 }

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn--primary {
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.12);
}

.btn--primary:hover {
  background: rgba(125, 211, 252, 0.16);
}

.btn--danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.10);
}

.btn--danger:hover {
  background: rgba(251, 113, 133, 0.14);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.resrow__k {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 750;
  white-space: nowrap;
}

.resrow__v {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.resrow__meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.row__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.row__title {
  font-weight: 750;
}

 .itemEffectInline {
   font-weight: 400;
   font-size: 12px;
   color: rgba(255, 255, 255, 0.62);
   margin-left: 10px;
 }

 .row__title .row__desc {
   font-weight: 400;
 }

.row__titleLine {
  display: flex;
  align-items: center;
  gap: 8px;
}

 .helpBlock {
   border: 1px solid var(--border);
   border-radius: 12px;
   padding: 10px 12px;
   background: rgba(255, 255, 255, 0.04);
 }

 .helpBlock__title {
   cursor: pointer;
   user-select: none;
   font-weight: 700;
 }

 .helpBlock__body {
   margin-top: 8px;
   line-height: 1.6;
 }

.pk-icon {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  flex: 0 0 auto;
}

 .pk-icon--silhouette {
   filter: brightness(0) contrast(1.2) drop-shadow(0 0 1px rgba(255, 255, 255, 0.25));
   opacity: 0.95;
 }

.iconGrid--full .pk-icon {
  width: 32px;
  height: 32px;
}

.iconGrid {
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 6px;
  justify-content: flex-end;
}

.iconGrid--full {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
  align-content: flex-start;
  width: 100%;
}

@media (max-width: 980px) {
  .iconGrid {
    grid-template-columns: repeat(6, 32px);
    justify-content: flex-start;
  }
}

.row__desc {
  font-size: 12px;
  color: var(--muted);
}

 #dexList .row {
   padding-top: 10px;
   padding-bottom: 10px;
 }

 #dexList .row__left {
   gap: 0;
 }

.row__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row__mid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 140px;
}

.monSkills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lbTeamWrap {
  margin-top: 6px;
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.lbTeamAvatar {
  width: 76px;
  height: auto;
  align-self: stretch;
  border-radius: 12px;
  object-fit: cover;
}

.lbTeamMons {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: center;
}

@media (max-width: 520px) {
  #monList .row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #monList .row__titleLine {
    flex-wrap: wrap;
  }

  #monList .pk-icon {
    width: 48px;
    height: 48px;
  }

  #monList .row__left {
    flex: 1 1 auto;
    min-width: 0;
  }

  #monList .row__right {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  #monList .row__mid {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  #monList .monSkills {
    justify-content: flex-start;
  }
}

.row.is-locked {
  opacity: 0.78;
}

.row.is-locked .row__title {
  color: rgba(255, 255, 255, 0.82);
}

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 200;
  padding: 18px;
  overflow: auto;
}

.modal {
  width: min(860px, 96vw);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(11, 15, 23, 0.98);
  box-shadow: var(--shadow);
  padding: 14px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.modal__title {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.modal__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal__desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.chk {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.badge--muted {
  color: rgba(255, 255, 255, 0.62);
}

.badge {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.badge--ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
}

.type {
  font-weight: 800;
}

.type-normal {
  color: #e5e7eb;
  border-color: rgba(229, 231, 235, 0.25);
  background: rgba(229, 231, 235, 0.10);
}

.type-fire {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.28);
  background: rgba(251, 146, 60, 0.14);
}

.type-water {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(96, 165, 250, 0.14);
}

.type-electric {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.30);
  background: rgba(250, 204, 21, 0.14);
}

.type-grass {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.14);
}

.type-ice {
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.28);
  background: rgba(103, 232, 249, 0.14);
}

.type-fighting {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.14);
}

.type-poison {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.28);
  background: rgba(192, 132, 252, 0.14);
}

.type-ground {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.14);
}

.type-flying {
  color: #a5b4fc;
  border-color: rgba(165, 180, 252, 0.28);
  background: rgba(165, 180, 252, 0.14);
}

.type-psychic {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.14);
}

.type-bug {
  color: #a3e635;
  border-color: rgba(163, 230, 53, 0.28);
  background: rgba(163, 230, 53, 0.14);
}

.type-rock {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.14);
}

.type-ghost {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.14);
}

.type-dragon {
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.28);
  background: rgba(129, 140, 248, 0.14);
}

.type-dark {
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.28);
  background: rgba(156, 163, 175, 0.14);
}

.type-steel {
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.28);
  background: rgba(203, 213, 225, 0.12);
}

.type-fairy {
  color: #f9a8d4;
  border-color: rgba(249, 168, 212, 0.28);
  background: rgba(249, 168, 212, 0.14);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.sidebar__divider {
  margin: 12px 0;
  border-top: 1px solid var(--border);
}

.sidebar__sectionTitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
}

.sidebar__sectionTitleRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar__sectionTitleRow .sidebar__sectionTitle {
  margin-bottom: 0;
}

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.log {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  flex: 1;
  min-height: 220px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.18);
}

.log.is-collapsed {
  min-height: 0;
  max-height: 120px;
  overflow: hidden;
}

.bottomLog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px 18px;
}

.bottomLog__inner {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottomLog .sidebar__divider--log {
  display: none;
}

.logFab {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1001;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 15, 23, 0.82);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-weight: 800;
  letter-spacing: 0.2px;
}

.pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px 22px;
}

[hidden] {
  display: none !important;
}
