/* The hidden attribute must win over the flex/grid displays below. */
#vg-fileinfo[hidden], #vg-error[hidden], #vg-workspace[hidden],
#vg-progress-wrap[hidden], #vg-result[hidden], #vg-clamp-note[hidden] { display: none; }

/* Video to GIF tool page — same idiom as snipgif.css: VT323 labels,
   Press Start 2P title and main action, navy surfaces, amber CTA. */

.vg-hero { text-align: center; padding: 2.2rem 0 1.2rem; }
.vg-title {
  font-family: "Press Start 2P", monospace; font-size: 2rem; line-height: 1.5;
  color: #fff; margin: 0 0 1rem;
}
.vg-tagline { font-family: "VT323", monospace; font-size: 1.55rem; color: #4fe3a5; margin: 0; }

.vg-drop {
  border: 2px dashed #2ee06f; border-radius: 10px; background: #0d1433;
  text-align: center; padding: 2.4rem 1.2rem; margin: 1.4rem 0 .6rem;
  cursor: pointer; outline: none;
}
.vg-drop:hover, .vg-drop:focus-visible, .vg-drop.vg-dragging { background: #101736; border-color: #4fe3a5; }
.vg-drop-big { font-family: "VT323", monospace; font-size: 1.9rem; color: #fff; margin: 0 0 .3rem; }
.vg-drop-sub { font-family: "VT323", monospace; font-size: 1.25rem; color: var(--muted); margin: 0 0 .3rem; }
.vg-drop-note { font-family: "VT323", monospace; font-size: 1.25rem; color: #2ee06f; margin: 0; }

.vg-fileinfo { font-family: "VT323", monospace; font-size: 1.2rem; color: var(--text); margin: .4rem 0; }
.vg-error {
  font-family: "VT323", monospace; font-size: 1.2rem; color: #ff8f86;
  border: 1px solid #d96a5f; border-radius: 8px; background: #2a1414;
  padding: .6rem .9rem; margin: .6rem 0;
}

/* Player + trim timeline */
.vg-player {
  background: #000; border: 1px solid #263069; border-radius: 10px;
  padding: .8rem; margin-top: 1rem;
}
.vg-player video {
  display: block; margin: 0 auto; max-width: 720px; width: 100%;
  max-height: 480px; background: #000; border-radius: 6px;
}
.vg-playbar {
  display: flex; align-items: center; gap: .8rem;
  max-width: 720px; margin: .8rem auto .2rem;
}
.vg-playbtn {
  background: #1a2450; border: 1px solid #263069; color: var(--text);
  border-radius: 50%; width: 38px; height: 38px; flex: none; cursor: pointer;
  font-size: .95rem; line-height: 1;
}
.vg-playbtn:hover { border-color: #4fe3a5; color: #4fe3a5; }
.vg-time { font-family: "VT323", monospace; font-size: 1.15rem; color: var(--muted); min-width: 3.2em; text-align: center; }
.vg-track {
  position: relative; flex: 1; height: 28px; cursor: pointer;
  touch-action: none;
}
.vg-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 10px; transform: translateY(-50%);
  background: #1a2450; border-radius: 5px;
}
.vg-track-sel {
  position: absolute; top: 50%; height: 10px; transform: translateY(-50%);
  background: #f0b35e; border-radius: 5px; opacity: .9; pointer-events: none;
}
.vg-playhead {
  position: absolute; top: 2px; bottom: 2px; width: 2px;
  background: #fff; opacity: .85; pointer-events: none;
}
.vg-handle {
  position: absolute; top: 50%; width: 14px; height: 24px;
  transform: translate(-50%, -50%);
  background: #fff; border: 2px solid #0a1130; border-radius: 4px;
  cursor: ew-resize; z-index: 2; padding: 0;
}
.vg-handle:hover, .vg-handle.vg-active { background: #f0b35e; }

/* Controls */
.vg-card {
  border: 1px solid #263069; border-radius: 8px; background: #0d1433;
  padding: .9rem 1rem; margin-top: 1rem;
}
.vg-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .7rem; margin: .45rem 0; }
.vg-field { font-family: "VT323", monospace; font-size: 1.3rem; color: #fff; }
.vg-seldur { font-family: "VT323", monospace; font-size: 1.3rem; color: #4fe3a5; }
.vg-chip {
  font-family: "VT323", monospace; font-size: 1.15rem; cursor: pointer;
  background: #0d1433; color: var(--muted); border: 1px solid #263069;
  border-radius: 999px; padding: .3rem .8rem;
}
.vg-chip:hover { color: #fff; }
.vg-chip-on { color: #f0b35e; border-color: #f0b35e; background: #1a2450; }
.vg-chip-teal.vg-chip-on { color: #4fe3a5; border-color: #4fe3a5; }
.vg-num {
  font-family: "VT323", monospace; font-size: 1.2rem; width: 5.2em;
  background: #0a1130; color: var(--text); border: 1px solid #263069;
  border-radius: 6px; padding: .25rem .5rem;
}
.vg-num:focus { outline: none; border-color: #2ee06f; }
.vg-estimate { font-family: "VT323", monospace; font-size: 1.3rem; color: #4fe3a5; margin: .6rem 0 0; }
.vg-estimate.vg-est-warn { color: #ffc44d; }
.vg-note { font-family: "VT323", monospace; font-size: 1.15rem; color: var(--muted); margin: .45rem 0 0; line-height: 1.45; }
.vg-clamp { font-family: "VT323", monospace; font-size: 1.15rem; color: #ffc44d; margin: .3rem 0 0; }

.vg-convert {
  font-family: "Press Start 2P", monospace; font-size: .85rem; line-height: 1.6;
  display: block; width: 100%; margin: 1.2rem 0 0; padding: 1rem 1.2rem;
  text-align: center; cursor: pointer;
  background: #f0b35e; color: #141414; border: none; border-radius: 10px;
}
.vg-convert:hover { background: #ffc478; }
.vg-convert:disabled { opacity: .45; cursor: not-allowed; }

.vg-progress-wrap { margin: 1.2rem 0 0; }
.vg-progress-text { font-family: "VT323", monospace; font-size: 1.3rem; color: #fff; margin: 0 0 .45rem; }
.vg-progress {
  height: 20px; border: 1px solid #263069; border-radius: 4px;
  background: #0d1433; overflow: hidden;
}
.vg-progress-bar {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, #f0b35e 0 14px, #0d1433 14px, #0d1433 18px);
  transition: width .2s;
}

/* Result */
.vg-result-panel {
  border: 1px solid #263069; border-radius: 8px; background: #0d1433;
  padding: .9rem 1rem; margin-top: 1.2rem;
}
.vg-result-label { font-family: "VT323", monospace; font-size: 1.3rem; color: #4fe3a5; margin: 0 0 .6rem; }
.vg-stage {
  border-radius: 8px; background: #11142a; min-height: 200px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.vg-stage img { max-width: 100%; max-height: 420px; display: block; }
.vg-dl {
  font-family: "VT323", monospace; font-size: 1.3rem; cursor: pointer;
  display: block; width: 100%; padding: .7rem; margin-top: .8rem;
  background: #f0b35e; color: #141414; border: 1px solid #f0b35e; border-radius: 10px;
}
.vg-dl:hover { background: #ffc478; }
.vg-dl-ghost { background: transparent; color: #4fe3a5; border-color: #4fe3a5; }
.vg-dl-ghost:hover { background: #12312a; }
.vg-dl small {
  display: block; font-family: "VT323", monospace; font-size: 1.05rem; opacity: .8;
}

.vg-crosslink {
  display: block; margin-top: 1.2rem; text-align: center;
  border: 1px dashed #4fe3a5; border-radius: 10px; padding: .8rem 1rem;
  color: #4fe3a5; font-family: "VT323", monospace; font-size: 1.3rem;
  letter-spacing: .04em; text-decoration: none;
}
.vg-crosslink:hover { background: #12312a; text-decoration: none; }

.vg-howto { line-height: 1.55; padding-left: 1.35rem; margin: .4rem 0 .2rem; }
.vg-howto li { margin: .5rem 0; }
.vg-story { margin-top: 2.2rem; }
.vg-footnotes {
  text-align: center; font-family: "VT323", monospace; font-size: 1.25rem;
  color: var(--muted); line-height: 1.5; margin: 2.4rem 0 0;
}

@media (max-width: 700px) {
  .vg-title { font-size: 1.3rem; }
  .vg-tagline { font-size: 1.3rem; }
  .vg-convert { font-size: .65rem; }
}
