/* The colors, type and sizes of the in-game menu (Source/cobes/DuelMenuWidgets.h, DuelUi). */
@font-face { font-family: "inter"; src: url("fonts/inter-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "inter"; src: url("fonts/inter-semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --black: #0a0a0a;
  --shell: #363636;
  --sidebar: #262626;
  --content: #1e1e1e;
  --divider: #363636;
  --rowline: #2c2c2c;
  --group: #262626;
  --rowhover: #303030;
  --field: #2a2a2a;
  --fieldhover: #363636;
  --fieldborder: #3f3f3f;
  --title: #dadada;
  --text: #c4c4c4;
  --bright: #e8e8e8;
  --dim: #8c8c8c;
  --faint: #666666;
  --danger: #fb464c;
  --tag: #44cf6e;
  /* Set from the menu color (menu.js), like DuelUi::Accent(). */
  --accent: #575c64;
  --accent-dark: #3d4046;
  --accent-text: #9fa3aa;
  --on-accent: #ffffff;
  --accent-soft: rgba(87, 92, 100, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--content);
  color: var(--text);
  font: 400 15px/1.45 inter, "Segoe UI", system-ui, sans-serif;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; text-transform: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* ---------- the site ---------- */

.site-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  height: 40px; padding: 0 16px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--divider);
  font-size: 13px;
}
.site-bar .brand { font-weight: 600; color: var(--title); letter-spacing: 0.06em; text-decoration: none; }
.site-bar .crumbs { flex: 1; text-align: center; color: var(--dim); }
.site-bar nav { display: flex; gap: 4px; }
.site-bar nav a { padding: 4px 8px; border-radius: 4px; color: var(--dim); text-decoration: none; }
.site-bar nav a:hover { background: var(--rowhover); color: var(--bright); }
@media (max-width: 560px) { .site-bar .crumbs { display: none; } .site-bar { justify-content: space-between; } }

.note { max-width: 1060px; margin: 0 auto; padding: 48px 16px 24px; }
.note h1 { margin: 0; font-size: clamp(40px, 7vw, 56px); font-weight: 600; color: var(--title); letter-spacing: -0.02em; line-height: 1.1; }
.note .summary { margin: 8px 0 22px; color: var(--dim); font-size: 17px; }
.note h2 { margin: 0 0 6px; font-size: 19px; font-weight: 600; color: var(--title); }
.note section { margin-top: 56px; scroll-margin-top: 56px; }
.lead { margin: 0 0 18px; color: var(--dim); font-size: 14px; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 20px; border-radius: 4px; border: 1px solid var(--fieldborder);
  background: var(--field); color: var(--bright); font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--fieldhover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.big { height: 40px; padding: 0 24px; font-size: 15px; }
.meta { color: var(--faint); font-size: 13px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.rows { border-top: 1px solid var(--rowline); }
.srow { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 9px 6px; border-bottom: 1px solid var(--rowline); }
.srow:hover { background: var(--rowhover); }
.srow b { font-weight: 400; color: var(--text); }
.srow span { color: var(--dim); font-size: 14px; }
@media (max-width: 460px) { .srow { grid-template-columns: 1fr; gap: 2px; } }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--rowline); }
.steps li::before { content: counter(s); color: var(--faint); width: 14px; }
.steps { border-top: 1px solid var(--rowline); }
.small { color: var(--dim); font-size: 13px; }

footer { max-width: 1060px; margin: 0 auto; padding: 40px 16px 48px; color: var(--faint); font-size: 13px; }

/* ---------- the menu preview ---------- */

.stage { position: relative; margin: 0 -16px; padding: 28px 16px 24px; background: var(--black); border-block: 1px solid var(--rowline); overflow: hidden; }
.stage-inner { width: 1000px; transform-origin: top left; }
.phone-hint { display: none; margin: 10px 0 0; color: var(--faint); font-size: 13px; }
@media (max-width: 700px) { .phone-hint { display: block; } }

.win {
  position: relative; width: 1000px; height: 640px;
  display: flex; background: var(--content);
  border: 1px solid var(--shell);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  font-size: 14.5px; user-select: none; overflow: hidden;
}

.ribbon { width: 40px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; background: var(--sidebar); border-right: 1px solid var(--divider); }
.ribbon .spacer { flex: 1; }
.rib { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--dim); cursor: pointer; }
.rib:hover { background: var(--rowhover); color: var(--bright); }
.rib.on { background: var(--shell); color: var(--bright); }
.rib svg { width: 18px; height: 18px; }

.side { width: 198px; flex: none; display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--divider); }
.side .appname { height: 36px; display: flex; align-items: center; padding: 0 18px; font-weight: 600; color: var(--dim); letter-spacing: 0.08em; font-size: 14px; }
.search { margin: 2px 10px 8px; height: 24px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--fieldborder); background: var(--field); color: var(--bright); font: inherit; font-size: 13.5px; text-transform: lowercase; }
.search::placeholder { color: var(--faint); }
.tree { flex: 1; overflow: auto; padding: 0 10px 10px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.ti { display: flex; align-items: center; gap: 4px; height: 25px; padding: 0 6px; border-radius: 4px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ti:hover { background: var(--rowhover); color: var(--bright); }
.ti.on { background: var(--shell); color: var(--bright); font-weight: 600; }
.ti .chev { width: 12px; height: 12px; flex: none; color: var(--faint); transition: transform 0.12s; }
.ti.open .chev { transform: rotate(90deg); }
.ti.sub { padding-left: 34px; color: var(--dim); }
.ti.sub:hover { color: var(--bright); }
.ti.result { flex-direction: column; align-items: flex-start; height: auto; padding: 4px 8px; gap: 0; }
.ti.result small { color: var(--faint); font-size: 12px; }
.tree .empty { padding: 6px 8px; color: var(--faint); font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 36px; flex: none; display: flex; align-items: center; padding: 0 8px; background: var(--sidebar); border-bottom: 1px solid var(--divider); }
.top .appname { padding: 0 12px 0 6px; font-weight: 600; color: var(--dim); letter-spacing: 0.08em; font-size: 14px; }
.top .crumb { flex: 1; text-align: center; color: var(--dim); font-size: 13.5px; }
.top .crumb b { font-weight: 400; color: var(--text); }
.ib { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 4px; background: none; color: var(--dim); cursor: pointer; }
.ib:hover:not(:disabled) { background: var(--rowhover); color: var(--bright); }
.ib:disabled { color: var(--faint); opacity: 0.5; cursor: default; }
.ib svg { width: 14px; height: 14px; }

.page { flex: 1; overflow: auto; padding: 22px 28px 40px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.page.fade { animation: fade 0.16s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page h3.ptitle { margin: 0; font-size: 29px; font-weight: 600; color: var(--title); line-height: 1.25; }
.page .psum { margin: 4px 0 18px; color: var(--dim); }
.pcols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: start; }
.pcol { min-width: 0; }
.sec { margin-top: 18px; scroll-margin-top: 10px; }
.sec h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; font-size: 18.5px; font-weight: 600; color: var(--title); }
.sec h4 .extra { font-size: 13.5px; font-weight: 600; color: var(--accent-text); }
.sec.flash h4 { color: var(--bright); }

.row { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 34px; padding: 0 6px; border-top: 1px solid var(--rowline); position: relative; }
.row.wide { grid-template-columns: 1fr 1fr; }
.row:hover { background: var(--rowhover); }
.row.sel::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; border-radius: 1px; background: var(--accent-text); }
.row > label, .row > .lbl { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.ctl { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.pnote { margin: 4px 0 8px; color: var(--dim); font-size: 13px; line-height: 1.4; }
.ptext { margin: 0 0 8px; color: var(--dim); font-size: 13px; line-height: 1.45; }

.switch { width: 32px; height: 16px; flex: none; position: relative; border: 0; border-radius: 8px; background: var(--fieldhover); cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); transition: left 0.12s, background 0.12s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 18px; background: #fff; }

.swatch { width: 30px; height: 16px; flex: none; position: relative; border-radius: 4px; border: 1px solid var(--fieldborder); cursor: pointer; overflow: hidden; }
.swatch input { position: absolute; inset: -6px; width: 200%; height: 200%; opacity: 0; cursor: pointer; }

.drop { width: 100%; height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; border: 1px solid var(--fieldborder); border-radius: 4px; background: var(--field); color: var(--bright); cursor: pointer; font-size: 14px; }
.drop:hover, .drop.open { background: var(--fieldhover); }
.drop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop svg { width: 12px; height: 12px; flex: none; color: var(--dim); }

.slider { width: 100%; display: flex; align-items: center; gap: 12px; }
.track { flex: 1; height: 16px; position: relative; cursor: pointer; touch-action: none; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; border-radius: 1px; background: var(--fieldhover); }
.track .fill { position: absolute; left: 0; top: 7px; height: 2px; border-radius: 1px; background: var(--dim); }
.track .knob { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #f0f0f0; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.num { width: 70px; height: 22px; flex: none; display: flex; align-items: center; border: 1px solid var(--fieldborder); border-radius: 4px; background: var(--field); }
.num span { flex: 1; text-align: center; color: var(--bright); font-weight: 600; font-size: 13px; }
.num button { width: 16px; height: 100%; border: 0; background: none; color: var(--dim); cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.num button:hover { color: var(--bright); }

.key { min-width: 92px; height: 24px; padding: 0 10px; border: 1px solid var(--fieldborder); border-radius: 4px; background: var(--field); color: var(--bright); cursor: pointer; font-size: 13.5px; }
.key:hover { background: var(--fieldhover); }
.key.wait { border-color: var(--accent-text); color: var(--accent-text); }

.pbtn { min-width: 126px; height: 26px; padding: 0 16px; border: 1px solid var(--fieldborder); border-radius: 4px; background: var(--field); color: var(--bright); font-weight: 600; font-size: 14px; cursor: pointer; }
.pbtn:hover { background: var(--fieldhover); }
.pbtn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pbtn.primary:hover { filter: brightness(1.12); }

.popup { position: absolute; z-index: 20; min-width: 160px; max-height: 240px; overflow: auto; padding: 4px; background: var(--group); border: 1px solid var(--fieldborder); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,0.45); }
.popup .opt { height: 26px; display: flex; align-items: center; padding: 0 10px; border-radius: 4px; color: var(--text); cursor: pointer; white-space: nowrap; }
.popup .opt:hover { background: var(--rowhover); color: var(--bright); }
.popup .opt.on { background: var(--accent-soft); color: var(--bright); }

.xpreview { position: relative; height: 150px; border-radius: 8px; border: 1px solid var(--fieldborder); overflow: hidden; }
.xpreview canvas { width: 100%; height: 100%; display: block; }

.cards { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.card { width: 134px; padding: 6px 6px 8px; border: 1px solid var(--fieldborder); border-radius: 8px; background: var(--group); cursor: pointer; text-align: left; }
.card:hover { background: var(--rowhover); }
.card.on { border-color: #7a7a7a; }
.card img { display: block; width: 100%; height: 62px; object-fit: contain; border-radius: 4px; background: #1c1c1c; image-rendering: auto; }
.card b { display: block; margin-top: 6px; font-weight: 400; color: var(--text); font-size: 14px; }
.card.on b { font-weight: 600; color: var(--bright); }
.card small { display: block; height: 16px; color: var(--dim); font-size: 12.5px; }

.aside { width: 224px; margin: 18px auto 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--fieldborder); }
.aside img { display: block; width: 100%; }

.servers { border-top: 1px solid var(--rowline); }
.srv { display: grid; grid-template-columns: 1fr 150px 70px 50px; align-items: center; height: 32px; padding: 0 8px; border-bottom: 1px solid var(--rowline); cursor: pointer; }
.srv:hover { background: var(--rowhover); }
.srv.on { background: var(--accent-soft); color: var(--bright); }
.srv.head { cursor: default; color: var(--faint); font-size: 13px; height: 28px; }
.srv.head:hover { background: none; }
.srv span:not(:first-child) { color: var(--dim); }
.srv .ping { text-align: right; }
.srvbar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.hudbox { position: relative; height: 300px; margin: 4px auto 6px; width: 534px; background: #0c0c0c; border-radius: 8px; border: 1px solid var(--fieldborder); overflow: hidden; font-size: 9px; color: #e8e8e8; }
.hudbox .el { position: absolute; white-space: nowrap; cursor: grab; transform: translate(-50%, -50%); padding: 1px 3px; border-radius: 3px; }
.hudbox .el:hover, .hudbox .el.sel { outline: 1px solid rgba(255,255,255,0.35); }
.hudbox .cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #ffef00; font-size: 14px; }

.graph { position: absolute; inset: 0; }
.graph canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.legend { position: absolute; left: 16px; bottom: 14px; color: var(--dim); font-size: 12.5px; line-height: 1.6; pointer-events: none; }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; }
.legend p { margin: 6px 0 0; color: var(--faint); }

.notice { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,0.35); }
.notice > div { width: 340px; padding: 18px 20px 16px; background: var(--group); border: 1px solid var(--fieldborder); border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,0.5); }
.notice h5 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--bright); }
.notice p { margin: 0 0 14px; color: var(--dim); font-size: 13.5px; }
.notice .pbtn { float: right; }
.notice::after { content: ""; display: table; clear: both; }

.card-under { display: flex; align-items: center; gap: 10px; width: 236px; height: 46px; margin-top: 8px; padding: 0 12px; background: var(--content); border: 1px solid var(--shell); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.card-under .av { position: relative; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7a7a7a, #2b2b2b); }
.card-under .av::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--tag); border: 2px solid var(--content); }
.card-under b { display: block; font-weight: 600; color: var(--bright); font-size: 14px; line-height: 1.2; text-transform: none; }
.card-under small { color: var(--dim); font-size: 12.5px; }
