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

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

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

.gt-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;
}
.gt-drop:hover, .gt-drop:focus-visible, .gt-drop.gt-dragging { background: #101736; border-color: #4fe3a5; }
.gt-drop-big { font-family: "VT323", monospace; font-size: 1.9rem; color: #fff; margin: 0 0 .3rem; }
.gt-drop-sub { font-family: "VT323", monospace; font-size: 1.25rem; color: var(--muted); margin: 0 0 .3rem; }
.gt-drop-note { font-family: "VT323", monospace; font-size: 1.25rem; color: #2ee06f; margin: 0; }

.gt-fileinfo { font-family: "VT323", monospace; font-size: 1.2rem; color: var(--text); margin: .4rem 0; }
.gt-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;
}

/* Operation tabs */
.gt-tabs { display: flex; gap: .6rem; margin: 1.2rem 0 0; }
.gt-tab {
  flex: 1; text-align: center; padding: .7rem .4rem; cursor: pointer;
  border: 1px solid #263069; border-radius: 10px; background: #101736;
  font-family: "VT323", monospace; font-size: 1.35rem; letter-spacing: .04em;
  color: var(--muted);
}
.gt-tab small {
  display: block; font-size: 1rem; letter-spacing: 0;
  color: var(--muted); margin-top: .1rem;
}
.gt-tab:hover { color: #fff; }
.gt-tab-on {
  background: #1a2450; color: #f0b35e; border-color: #f0b35e;
  box-shadow: inset 0 0 0 1px #f0b35e;
}
.gt-tab-on small { color: #f0b35e; }

/* Controls */
.gt-card {
  border: 1px solid #263069; border-radius: 8px; background: #0d1433;
  padding: .9rem 1rem; margin-top: 1rem;
}
.gt-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .7rem; margin: .45rem 0; }
.gt-field { font-family: "VT323", monospace; font-size: 1.3rem; color: #fff; }
.gt-result-line { font-family: "VT323", monospace; font-size: 1.3rem; color: #4fe3a5; }
.gt-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;
}
.gt-chip:hover { color: #fff; }
.gt-chip-on { color: #f0b35e; border-color: #f0b35e; background: #1a2450; }
.gt-chip:disabled { opacity: .35; cursor: not-allowed; }
.gt-chip:disabled:hover { color: var(--muted); }
.gt-slider { accent-color: #f0b35e; width: 170px; vertical-align: middle; }
.gt-val { font-family: "VT323", monospace; font-size: 1.25rem; color: #f0b35e; min-width: 3em; }
.gt-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;
}
.gt-num:focus { outline: none; border-color: #2ee06f; }
.gt-note { font-family: "VT323", monospace; font-size: 1.15rem; color: var(--muted); margin: .45rem 0 0; line-height: 1.45; }
.gt-clamp { font-family: "VT323", monospace; font-size: 1.15rem; color: #ffc44d; margin: .3rem 0 0; }

.gt-apply {
  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;
}
.gt-apply:hover { background: #ffc478; }
.gt-apply:disabled { opacity: .45; cursor: not-allowed; }

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

/* Compress step log */
.gt-steplog {
  border: 1px solid #263069; border-radius: 8px; background: #0a1130;
  padding: .7rem 1rem; margin-top: 1rem;
  font-family: "VT323", monospace; font-size: 1.2rem; color: var(--muted);
  line-height: 1.5; white-space: pre-wrap;
}
.gt-steplog .gt-log-fit { color: #2ee06f; }
.gt-steplog .gt-log-miss { color: #ffc44d; }

/* Before / after compare */
.gt-compare { display: flex; gap: 1rem; margin-top: 1.2rem; }
.gt-panel {
  flex: 1; border: 1px solid #263069; border-radius: 8px; background: #0d1433;
  padding: .9rem 1rem; min-width: 0;
}
.gt-panel-label { font-family: "VT323", monospace; font-size: 1.25rem; color: var(--muted); margin: 0 0 .6rem; }
.gt-label-after { color: #4fe3a5; }
.gt-stage {
  border-radius: 8px; background: #11142a; min-height: 200px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gt-stage img { max-width: 100%; max-height: 340px; display: block; }

.gt-dl {
  font-family: "VT323", monospace; font-size: 1.3rem; cursor: pointer;
  display: block; width: 100%; padding: .7rem; margin-top: 1rem;
  background: #f0b35e; color: #141414; border: 1px solid #f0b35e; border-radius: 10px;
}
.gt-dl:hover { background: #ffc478; }

.gt-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;
}
.gt-crosslink a { color: #4fe3a5; text-decoration: none; }
.gt-crosslink a:hover { text-decoration: underline; }

.gt-howto { line-height: 1.55; padding-left: 1.35rem; margin: .4rem 0 .2rem; }
.gt-howto li { margin: .5rem 0; }
.gt-story { margin-top: 2.2rem; }
.gt-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) {
  .gt-title { font-size: 1.3rem; }
  .gt-tagline { font-size: 1.3rem; }
  .gt-apply { font-size: .65rem; }
  .gt-tabs { flex-wrap: wrap; }
  .gt-tab { flex: 1 1 40%; }
  .gt-compare { flex-direction: column; }
}
