@font-face {
  font-family: "DM Sans";
  src: url("./visual/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --text: #f5f5f5;
  --dim: #c8cbd0;
  --gold: #ffc451;
  --border: #30343a;
  --button: linear-gradient(165deg, #ffcf64 0%, #f8be56 54%, #e79b39 100%);
  font: 400 15px/1.4 "DM Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; position: relative; isolation: isolate;
  background: radial-gradient(ellipse at 84% 15%, #17161355, transparent 30%),
    linear-gradient(120deg, #0c0f13, #0a0d11 65%, #0f1017);
  color: var(--text);
}
body::before, body::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
body::before {
  inset: 0 0 auto auto; width: min(48vw, 850px); aspect-ratio: 880 / 300;
  background: url("./visual/ribbon.svg") right top / contain no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 18%);
}
body::after {
  inset: auto auto 0 0; width: min(21vw, 310px); aspect-ratio: 305 / 370;
  background: url("./visual/fold.svg") left bottom / contain no-repeat;
  mask-image: linear-gradient(180deg,transparent,#000 30%),linear-gradient(90deg,#000 55%,transparent);
  mask-composite: intersect;
}
.wrap { width: min(1022px, calc(100% - 48px)); margin-inline: auto; }
header { border-bottom: 1px solid #ffffff12; background: #090b0e54; }
.brand { height: 51px; display: flex; align-items: center; gap: 11px; font-size: 16px; }
.brand strong { font-weight: 780; letter-spacing: -.5px; }
.mark { width: 47px; height: 24px; display: grid; place-items: center; background: var(--button); color: #131515; border-radius: 5px; box-shadow: inset 0 1px 1px #ffea9f; }
.mark .icon { width: 39px; height: 23px; }
.slash { color: #676565; }.brand-sub { color: #d7d9dc; }
.icon { width: 21px; height: 21px; flex: none; display: inline-block; }
.languages { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.languages a, .game { display: inline-flex; gap: 6px; align-items: center; border-radius: 15px; text-decoration: none; }
.languages a { padding: 6px 12px; color: var(--text); border: 1px solid transparent; }
.languages a[aria-current], .game { color: var(--gold); border: 1px solid #755728; background: linear-gradient(135deg, #332819bb, #1b1915cc); }
.languages .icon, .game .icon { width: 14px; height: 14px; }
.languages a:hover { color: var(--gold); }
.hero { position: relative; display: flex; align-items: center; padding: 21px 0 27px; }
.hero-copy { position: relative; z-index: 1; }
.game { padding: 5px 11px; font-size: 12px; font-weight: 750; }
h1, h2, h3, p, fieldset { margin: 0; }
h1 { font-size: clamp(36px, 4.2vw, 47px); line-height: 1.04; letter-spacing: -.045em; font-weight: 800; margin: 5px 0 4px; }
h1 span { display: block; width: fit-content; font-size: 1.13em; letter-spacing: -.015em; color: #f9bb52; background: linear-gradient(#ffe08b,#f2ac46); background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 10px #e8a33935); }
.hero p { color: #d9dadc; font-size: 15px; }
.signal { position: absolute; top: 47%; right: 9%; width: 25%; max-height: 90px; transform: translateY(-50%); color: var(--gold); filter: drop-shadow(0 0 7px #ffa72a88); pointer-events: none; }
.signal rect { transform-box: fill-box; transform-origin: center; }
.grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; }
.panel, .guide-card {
  position: relative; min-width: 0; border: 1px solid transparent; border-radius: 16px;
  background: radial-gradient(ellipse at top left, #af8b4e18, transparent 35%) padding-box,
    linear-gradient(145deg, #171b20fa, #10141afb 70%, #10141afc) padding-box,
    linear-gradient(120deg, #61513a, #343941 22%, #22272f 72%, #363940) border-box;
  box-shadow: inset 0 1px 0 #ffffff05, inset 0 5px 24px #ffffff02, 0 8px 22px #0002;
}
.grid .panel { padding: 16px 20px 18px; }
.section-head, .queue-head { display: flex; align-items: center; gap: 17px; }
.tile { flex: none; width: 46px; height: 41px; border-radius: 13px; display: inline-grid; place-items: center; color: var(--gold); background: linear-gradient(145deg,#4a3b246e,#30291f82); box-shadow: inset 0 1px 4px #fff1; }
.tile .icon { width: 26px; height: 26px; filter: drop-shadow(0 0 4px #ffb23533); }
h2, legend { color: var(--text); font-size: 16px; font-weight: 790; letter-spacing: -.035em; }
.section-head p, .format-help, .note, #status, .drop-hint, em { color: var(--dim); font-size: 12.5px; }
.section-head p, #status { margin-top: 3px; }
.input-panel { display: flex; flex-direction: column; }
.drop {
  flex: 1; min-height: 204px; padding: 19px 12px; margin: 17px 0 15px; border: 1px dashed #be8b36;
  border-radius: 14px; background: linear-gradient(115deg,#24221f77,#17191e9c 58%,#24211c64);
  display: flex; align-items: center; justify-content: center; flex-direction: column; perspective: 600px;
}
.drop.over { border-color: #ffde88; background-color: #4a3826; }
.folder { position: relative; display: block; width: 47px; height: 47px; color: #ffc155; margin-bottom: 9px; transform-style: preserve-3d; filter: drop-shadow(0 0 7px #eda42e80); }
.folder svg { fill: #342c20; stroke: currentColor; stroke-width: 2.4; position: absolute; inset: 0; width: 100%; height: 100%; }
.folder-front { transform-origin: 50% 83%; }
.drop strong { font-size: 18px; letter-spacing: -.035em; font-weight: 780; }
.drop > strong + span { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
button, .download { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font: 700 13px/1.25 "DM Sans", sans-serif; color: var(--text); border: 1px solid #40444a; background: #20252b; border-radius: 9px; padding: 9px 13px; text-decoration: none; cursor: pointer; }
[hidden] { display: none !important; }
#pick, #convert { color: #201704; border: 1px solid #edb747; background: var(--button); box-shadow: 0 2px 9px #e6a03730, inset 0 1px 1px #ffdf91; border-radius: 13px; }
#pick { min-height: 41px; padding: 8px 19px; margin-top: 16px; }
#pick .icon { width: 16px; height: 16px; }
.note { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.note .icon { width: 17px; height: 17px; color: #747b82; }
fieldset { position: relative; min-width: 0; padding: 0; border: none; }
legend { position: relative; padding: 0 0 0 63px; line-height: 22px; }
legend .tile { position: absolute; left: 0; top: 0; }
.format-help { padding-left: 63px; margin: 2px 0 17px; min-height: 18px; }
label { min-height: 55px; display: flex; align-items: center; gap: 15px; padding: 8px 16px; border: 1px solid #30343b; border-radius: 14px; background: linear-gradient(120deg,#1e2328,#181c21); box-shadow: inset 0 1px 0 #ffffff08; cursor: pointer; }
label + label { margin-top: 7px; }
label:has(input:checked) { border-color: var(--gold); background: linear-gradient(115deg,#413521,#25221d); box-shadow: 0 0 9px #ffbd452d, inset 0 0 7px #ffbd4514; }
input[type=radio] { appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 2px solid #656b73; border-radius: 50%; box-shadow: inset 0 1px 4px #0006; }
input[type=radio]:checked { border-color: var(--gold); background: radial-gradient(circle,var(--gold) 0 51%,transparent 56%); }
label span { display: grid; gap: 1px; }label b { font-size: 15px; line-height: 1.2; }small { font-size: 10px; margin-left: 5px; font-weight: 700; color: var(--dim); }
input:checked + span small { color: var(--gold); }em { font-style: normal; color: #e0e1e4; }
#convert { min-height: 43px; width: 100%; margin-top: 17px; padding-inline: 21px; justify-content: flex-start; font-size: 14px; }
#convert .icon { width: 17px; height: 17px; }.end-arrow { margin-left: auto; }
button:disabled { cursor: default; }#convert:disabled { filter: saturate(.88); color: #42341b; }
#pick:disabled, fieldset:disabled, .queue-actions button:disabled { opacity: .65; }
button:enabled:hover, .download:hover { filter: brightness(1.1); }
:focus-visible { outline: 2px solid #ffe5aa; outline-offset: 4px; }
.queue { margin-top: 21px; padding: 16px 20px; overflow: hidden; }
.queue-head { position: relative; min-height: 43px; z-index: 1; }
.queue-copy { min-width: 0; }#status { overflow-wrap: anywhere; }
.queue-actions { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
#download-all, .download { color: var(--gold); }
.queue ul { position: relative; list-style: none; padding: 0; margin: 0; }
.queue::before { content: ""; position: absolute; right: 18px; bottom: 12px; width: 185px; height: 50px; opacity: .09; background: repeating-linear-gradient(90deg,transparent 0 5px,#bac3cd 5px 13px,transparent 13px 15px); clip-path: polygon(0 96%,0 88%,7% 88%,7% 79%,14% 79%,14% 96%,20% 96%,20% 75%,29% 75%,29% 84%,35% 84%,35% 68%,43% 68%,43% 58%,50% 58%,50% 20%,58% 20%,58% 39%,66% 39%,66% 0,73% 0,73% 43%,82% 43%,82% 71%,90% 71%,90% 86%,100% 86%,100% 100%,0 100%); }
.queue:has(li)::before { display:none; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); }
.row div { min-width: 0; }.row strong,.row span { display: block; overflow-wrap: anywhere; }.row span { color: var(--dim); font-size: 12px; }.row.error span { color: #ffb5a0; }
.guide { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 22px; margin-top: 24px; padding-top: 17px; border-top: 1px solid #303339; }
.guide h2 { grid-column: 1/-1; font-size: 23px; }
.guide-card { display: flex; align-items: flex-start; gap: 18px; padding: 13px 20px 15px; min-height: 104px; }
.guide-card h3 { font-size: 15px; letter-spacing: -.035em; margin-bottom: 5px; }
.guide-card p,footer { color: var(--dim); font-size: 12px; line-height: 1.45; }
.guide code { font-size: .95em; }footer { padding: 18px 0 24px; color: #a8acb0; }
@media (prefers-reduced-motion: no-preference) {
  .signal rect { animation: meter 1.2s ease-in-out var(--delay) infinite; }
  .folder-front, .tile, #pick, #convert { transition: transform .28s ease, filter .25s ease; }
  .drop:is(:hover,:focus-within,.over) .folder-front { transform: perspective(130px) rotateX(-38deg) translateZ(3px); }
  .section-head:hover .tile, .guide-card:hover .tile { transform: perspective(200px) rotateY(-13deg) rotateX(8deg); }
  #pick:hover:enabled, #convert:hover:enabled { transform: translateY(-1px); }
  #pick:active:enabled, #convert:active:enabled { transform: translateY(1px); }
  @keyframes meter { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.62); } }
}
@media (max-width: 840px) {
  .signal { right: 1%; width: 21%; top: 38%; }
  .grid { gap: 16px; }.grid .panel, .guide-card { padding-inline: 16px; }
}
@media (max-width: 700px) {
  .wrap { width: min(540px, calc(100% - 28px)); }
  .grid, .guide { grid-template-columns: minmax(0,1fr); }
  .hero { padding: 22px 0; }.hero p { max-width: 46ch; font-size: 14px; }
  .signal { width: 22%; right: 1%; top: 55%; opacity: .6; }
  h1 { font-size: clamp(30px,6.4vw,41px); text-wrap: balance; }
  body::before { width: 55%; opacity: .65; }
  .queue { margin-top: 16px; padding: 14px 16px; }
  .queue-head { flex-wrap: wrap; gap: 10px; }.queue-copy { flex: 1; }
  .queue-actions:not(:has(button:enabled)) { margin: 0; }
  .guide-card { min-height: 0; }.guide { margin-top: 20px; }
}
@media (max-width: 460px) {
  .brand { gap: 6px; font-size: 14px; }.mark { width: 35px; height: 22px; }.mark .icon { width: 30px; }
  .languages { gap: 0; }.languages a { padding: 6px 7px; font-size: 11px; }
  .signal { right: 0; width: 19%; }.queue-actions:not(:has([hidden])) { width: 100%; margin-left: 0; }
}
@media (max-width: 350px) { .brand-sub,.slash { display:none; } }
@media (forced-colors: active) { h1 span { -webkit-text-fill-color: currentColor; } input[type=radio] { appearance: auto; } }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
footer a { color: var(--gold); text-underline-offset: 3px; }
