.gif-maker-page{
  max-width:1280px;
  margin:0 auto;
  padding:34px 18px 46px;
  color:var(--text);
}
.gif-maker-page *{
  box-sizing:border-box;
}
.gif-maker-page h1{
  margin:0 0 12px;
  text-align:center;
  font-size:clamp(32px,5vw,52px);
  line-height:1.05;
  text-shadow:0 0 24px rgba(120,90,255,.24);
}
.gmk-intro{
  max-width:860px;
  margin:0 auto 24px;
  text-align:center;
  color:#c9c9d6;
  font-size:clamp(15px,2vw,18px);
  line-height:1.6;
}
.gmk-tool-box,
.gmk-panel,
.gmk-section{
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.025)),var(--content);
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  box-shadow:0 16px 38px rgba(0,0,0,.18);
}
.gmk-tool-box{
  padding:16px;
  overflow:hidden;
}
.gmk-upload{
  position:relative;
  min-height:108px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:16px;
  padding:18px;
  border:2px dashed rgba(155,135,255,.38);
  border-radius:16px;
  background:radial-gradient(circle at top left,rgba(142,92,255,.18),transparent 42%),rgba(255,255,255,.035);
  transition:border-color .18s ease,background .18s ease,transform .18s ease;
  overflow:hidden;
}
.gmk-upload:hover,
.gmk-upload.gmk-drag-over{
  border-color:rgba(120,230,255,.72);
  background:radial-gradient(circle at top left,rgba(120,230,255,.20),transparent 44%),rgba(255,255,255,.045);
  transform:translateY(-1px);
}
.gmk-upload input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.gmk-upload-label{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  text-align:center;
  color:#f3f1ff;
  font-weight:800;
  pointer-events:none;
}
.gmk-upload-label i{
  font-size:30px;
  color:var(--link);
  filter:drop-shadow(0 0 10px rgba(120,210,255,.28));
}
.gmk-upload-label span{
  display:block;
  font-size:16px;
}
.gmk-upload-label small{
  display:block;
  color:#aaa9bd;
  font-size:13px;
  font-weight:600;
}
.gmk-layout{
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(330px,.88fr);
  gap:16px;
  align-items:start;
  min-width:0;
}
.gmk-panel{
  padding:14px;
  min-width:0;
  overflow:hidden;
}
.gmk-preview-panel,
.gmk-controls,
.gmk-frames-panel{
  min-width:0;
}
.gmk-frames-panel{
  margin-top:16px;
}
.gmk-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.gmk-panel-head h2{
  margin:0;
  color:var(--link);
  font-size:19px;
  line-height:1.2;
}
.gmk-panel-head h2 i{
  margin-right:6px;
}
.gmk-preview-tools,
.gmk-actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
#gmkFrameCount{
  padding:5px 10px;
  border-radius:999px;
  color:#d7d4e9;
  font-size:13px;
  font-weight:800;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
  white-space:nowrap;
}
.gmk-canvas-wrap{
  width:100%;
  min-height:330px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  border-radius:16px;
  background:
    linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%),
    linear-gradient(-45deg,rgba(255,255,255,.035) 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,rgba(255,255,255,.035) 75%),
    linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.035) 75%);
  background-size:22px 22px;
  background-position:0 0,0 11px,11px -11px,-11px 0;
  background-color:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
}
#gmkPreviewCanvas{
  display:block;
  max-width:100%;
  max-height:520px;
  width:auto;
  height:auto;
  border-radius:12px;
  background:#111122;
  box-shadow:0 12px 30px rgba(0,0,0,.28);
}
.gmk-control-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.gmk-control-grid label,
.gmk-frame-info label{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  color:#d9d6e8;
  font-size:13px;
  font-weight:800;
}
.gmk-control-grid input,
.gmk-control-grid select,
.gmk-frame-info input{
  width:100%;
  min-width:0;
  height:38px;
  padding:8px 10px;
  border-radius:11px;
  color:#f4f2ff;
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.10);
  outline:none;
}
.gmk-control-grid input:focus,
.gmk-control-grid select:focus,
.gmk-frame-info input:focus{
  border-color:rgba(120,210,255,.62);
  box-shadow:0 0 0 3px rgba(120,210,255,.10);
}
.gmk-control-grid input[type="color"]{
  padding:4px;
}
.gmk-control-grid input[type="range"]{
  padding:0;
}
.gmk-control-grid label > span{
  color:#aaa9bd;
  font-size:12px;
  font-weight:800;
}
.gmk-actions{
  margin-top:12px;
}

.gmk-preview-tools button,
.gmk-actions button,
.gmk-soft-btn,
.gmk-primary-btn,
.gmk-preview-frame,
.gmk-duplicate-frame,
.gmk-remove-frame{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:9px 13px;
  border:0;
  border-radius:12px;
  color:#f7f4ff;
  font-weight:900;
  cursor:pointer;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  transition:transform .15s ease,background .15s ease,border-color .15s ease,opacity .15s ease;
}

.gmk-preview-tools button:hover,
.gmk-actions button:hover,
.gmk-soft-btn:hover,
.gmk-primary-btn:hover,
.gmk-preview-frame:hover,
.gmk-duplicate-frame:hover,
.gmk-remove-frame:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.18);
}

.gmk-preview-tools button:disabled,
.gmk-actions button:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
}
.gmk-primary-btn{
  background:linear-gradient(135deg,#7c5cff,#26d7ff)!important;
  color:#fff!important;
  border-color:rgba(255,255,255,.20)!important;
  box-shadow:0 10px 24px rgba(80,120,255,.24);
}
.gmk-soft-btn{
  color:#d8d5ea!important;
}
.gmk-status{
  margin-top:12px;
  padding:10px 12px;
  color:#c9c7dc;
  font-size:13px;
  font-weight:700;
  border-radius:12px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.07);
}
.gmk-frame-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:12px;
  max-height:560px;
  overflow:auto;
  padding:4px;
  min-width:0;
  scrollbar-width:thin;
}
.gmk-frame-list:empty{
  min-height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#8f8da1;
  text-align:center;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}
.gmk-frame-list:empty:before{
  content:"Upload images to create GIF frames.";
}
.gmk-frame-card{
  display:grid;
  grid-template-columns:74px minmax(0,1fr) 34px;
  gap:10px;
  align-items:center;
  min-width:0;
  padding:9px;
  border-radius:15px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  cursor:grab;
  user-select:none;
  transition:opacity .15s ease,background .15s ease,box-shadow .15s ease;
}
.gmk-frame-card:active{
  cursor:grabbing;
}
.gmk-frame-card.gmk-dragging{
  opacity:.35;
  outline:none;
  box-shadow:none;
}
.gmk-frame-thumb{
  width:74px;
  height:74px;
  border-radius:12px;
  overflow:hidden;
  background:rgba(0,0,0,.24);
  border:1px solid rgba(255,255,255,.09);
  flex:none;
}
.gmk-frame-thumb img{
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  display:block;
  object-fit:cover;
}
.gmk-frame-info{
  min-width:0;
  overflow:hidden;
}
.gmk-frame-info strong{
  display:block;
  max-width:100%;
  margin-bottom:8px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  color:#f3f0ff;
  font-size:13px;
}
.gmk-frame-info label{
  margin-top:7px;
  color:#aaa9bd;
  font-size:11px;
  letter-spacing:.02em;
  text-transform:uppercase;
}
.gmk-frame-info input{
  height:32px;
  padding:6px 8px;
  font-size:13px;
}
.gmk-section{
  margin-top:22px;
  padding:17px;
}
.gmk-section h2{
  margin:0 0 12px;
  color:var(--link);
}
.gmk-section p,
.gmk-section li{
  color:#c9c9d6;
  line-height:1.58;
}
.gmk-section ul{
  margin:0;
  padding-left:20px;
}
.gmk-section li{
  margin-bottom:8px;
}
@media(max-width:980px){
  .gmk-layout{
    grid-template-columns:1fr;
  }
}
@media(max-width:720px){
  .gif-maker-page{
    padding:28px 12px 38px;
  }

  .gmk-tool-box,
  .gmk-panel,
  .gmk-section{
    border-radius:15px;
  }

  .gmk-tool-box{
    padding:12px;
  }

  .gmk-panel-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .gmk-preview-tools,
  .gmk-actions{
    width:100%;
  }

  .gmk-preview-tools button,
  .gmk-actions button{
    flex:1;
  }

  .gmk-control-grid{
    grid-template-columns:1fr;
  }

  .gmk-canvas-wrap{
    min-height:240px;
    padding:10px;
  }

  #gmkPreviewCanvas{
    max-height:360px;
  }

  .gmk-frame-list{
    grid-template-columns:1fr;
    max-height:none;
  }

  .gmk-frame-card{
    grid-template-columns:62px minmax(0,1fr) 32px;
    gap:8px;
  }

  .gmk-frame-thumb{
    width:62px;
    height:62px;
  }

  .gmk-frame-buttons{
    width:32px;
    min-width:32px;
  }
  .gmk-preview-frame,
  .gmk-duplicate-frame,
  .gmk-remove-frame{
    width:32px;
  }
}
@media(max-width:440px){
  .gmk-preview-tools button,
  .gmk-actions button{
    width:100%;
    flex:0 0 100%;
  }

  .gmk-frame-card{
    grid-template-columns:54px minmax(0,1fr) 30px;
    padding:8px;
  }

  .gmk-frame-thumb{
    width:54px;
    height:54px;
  }

  .gmk-frame-buttons{
    width:30px;
    min-width:30px;
  }
  .gmk-preview-frame,
  .gmk-duplicate-frame,
  .gmk-remove-frame{
    width:30px;
  }
}



.gmk-preview-bar{
  margin-top:12px;
  padding:10px;
  border-radius:14px;
  background:rgba(0,0,0,.16);
  border:1px solid rgba(255,255,255,.07);
}
#gmkFrameSeek{
  width:100%;
  margin:0 0 9px;
}
.gmk-preview-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#c9c7dc;
  font-size:13px;
  font-weight:800;
}
.gmk-preview-meta label{
  display:flex;
  align-items:center;
  gap:7px;
}
.gmk-preview-meta select{
  height:30px;
  padding:4px 8px;
  border-radius:9px;
  color:#f4f2ff;
  background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.10);
}
@media(max-width:520px){
  .gmk-preview-meta{
    align-items:flex-start;
    flex-direction:column;
  }
}



.gmk-frame-card{
  display:grid;
  grid-template-columns:74px minmax(0,1fr) 34px;
  gap:10px;
  align-items:center;
  min-width:0;
  padding:9px;
  border-radius:15px;
  background:rgba(255,255,255,.045);
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
  cursor:grab;
  user-select:none;
  transition:opacity .15s ease,background .15s ease,box-shadow .15s ease;
}
.gmk-frame-card:active{
  cursor:grabbing;
}
.gmk-frame-card.gmk-dragging{
  opacity:.35;
  box-shadow:none;
}
.gmk-frame-card.gmk-drop-before{
  box-shadow:inset 4px 0 0 #4fc3ff,0 0 18px rgba(79,195,255,.14);
}
.gmk-frame-card.gmk-drop-after{
  box-shadow:inset -4px 0 0 #4fc3ff,0 0 18px rgba(79,195,255,.14);
}
.gmk-frame-buttons{
  display:flex;
  flex-direction:column;
  gap:6px;
  width:34px;
  min-width:34px;
}
.gmk-preview-frame,
.gmk-duplicate-frame,
.gmk-remove-frame{
  width:34px;
  height:30px;
  min-height:30px;
  padding:0;
  flex:none;
}
.gmk-preview-frame{
  color:#bfefff;
  background:rgba(70,190,255,.12);
  border-color:rgba(90,210,255,.22);
}
.gmk-duplicate-frame{
  color:#ffe7aa;
  background:rgba(255,190,80,.12);
  border-color:rgba(255,210,100,.22);
}
.gmk-remove-frame{
  color:#ffbdc7;
  background:rgba(255,65,95,.13);
  border-color:rgba(255,100,120,.22);
}
.gmk-duration-row{
  display:flex;
  align-items:center;
  gap:6px;
}
.gmk-duration-row input{
  width:80px;
  flex:none;
}
.gmk-duration-row span{
  color:#aaa9bd;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.gmk-preview-tools{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.gmk-preview-tools button{
  width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  flex:none;
}
.gmk-preview-tools button i{
  margin:0;
}

.gmk-export-progress{
  height:8px;
  margin-top:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.08);
  opacity:0;
  transition:opacity .18s ease;
}
.gmk-export-progress.gmk-progress-active{
  opacity:1;
}
#gmkExportProgressFill{
  width:0%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#7c5cff,#26d7ff,#5ee27d);
  transition:width .18s ease;
}

#gmkBgColor:disabled{
  opacity:.5;
  cursor:not-allowed;
}





.gmk-duration-setting{
  grid-column:1/-1;
  padding:8px; border-radius:6px;
  background:linear-gradient(180deg,rgba(124,92,255,.12),rgba(38,215,255,.06));
  border:1px solid rgba(124,92,255,.18);
}
.gmk-duration-title{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  color:#ece9ff;
  font-weight:800;
}
.gmk-duration-inline{
  display:flex;
  align-items:center;
  gap:8px;
}
.gmk-duration-inline input{
  width:110px;
  flex:none;
}
.gmk-duration-unit{
  color:#bcb8d8;
  font-size:13px;
  font-weight:700;
}
.gmk-duration-apply{
  margin-left:auto;
  padding:8px 14px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:#e9e7f7;
  font-weight:700;
  transition:.15s;
}
.gmk-duration-apply:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.20);
}

.gmk-output-card{
  grid-column:1/-1;
  padding:8px;
  border-radius:6px;
  background:linear-gradient(135deg,rgba(124,92,255,.10),rgba(38,215,255,.055));
  border:1px solid rgba(120,210,255,.16);
}
.gmk-output-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 104px;
  gap:10px;
  align-items:end;
}
.gmk-output-row + .gmk-output-row{
  margin-top:10px;
  grid-template-columns:minmax(0,1fr) 138px;
}
.gmk-output-card label{
  margin:0;
  min-width:0;
}
.gmk-output-card label > span{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
  color:#ece9ff;
  font-size:13px;
  font-weight:800;
}
.gmk-output-card select,
.gmk-output-card input[type="number"]{
  width:100%;
  height:38px;
  margin:0;
}
.gmk-output-small input{
  text-align:center;
}
.gmk-output-quality{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) 28px;
  gap:8px;
  align-items:center;
}
.gmk-output-quality span{
  margin:0!important;
  white-space:nowrap;
}
.gmk-output-quality input{
  min-width:0;
}
.gmk-output-quality strong{
  color:#dcd9f2;
  font-size:13px;
  text-align:right;
}
.gmk-output-export{
  height:38px;
  min-height:38px;
  padding:0 13px;
  border:0;
  border-radius:12px;
  color:#fff;
  font-weight:900;
  cursor:pointer;
  background:linear-gradient(135deg,#7c5cff,#26d7ff);
  border:1px solid rgba(255,255,255,.20);
  box-shadow:0 10px 24px rgba(80,120,255,.24);
  white-space:nowrap;
}
.gmk-output-export:hover{
  transform:translateY(-1px);
}

.gmk-bg-card{
  grid-column:1/-1;
  padding:8px;
  border-radius:6px;
  background:linear-gradient(135deg,rgba(90,180,255,.08),rgba(120,120,255,.04));
  border:1px solid rgba(120,180,255,.14);
}
.gmk-bg-title{
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:6px;
  color:#ece9ff;
  font-size:13px;
  font-weight:800;
}
.gmk-bg-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 56px;
  gap:8px;
  align-items:center;
}
.gmk-bg-row select{
  width:100%;
  height:38px;
  margin:0;
}
.gmk-bg-row input[type="color"]{
  width:56px;
  height:38px;
  margin:0;
  padding:2px;
  border-radius:6px;
  cursor:pointer;
}

.gmk-loop-inline{
  display:flex;
  align-items:center;
  gap:8px;
}
.gmk-loop-inline input{
  width:90px;
  margin:0;
}
.gmk-loop-inline small{
  color:#a9a7bc;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}


.gmk-clear-head-btn{
  display:flex;
  align-items:center;
  gap:6px;
  height:32px;
  padding:0 10px;
  border:1px solid rgba(255,90,90,.18);
  border-radius:8px;
  background:rgba(255,70,70,.08);
  color:#ffb8b8;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:.15s;
}
.gmk-clear-head-btn:hover{
  background:rgba(255,70,70,.14);
  border-color:rgba(255,90,90,.28);
  color:#ffd3d3;
}
.gmk-clear-head-btn:active{
  transform:translateY(1px);
}
.gmk-clear-head-btn i{
  font-size:12px;
}


.gmk-frame-head-actions{
  display:flex;
  align-items:center; /* <-- this fixes the Y alignment */
  gap:10px;
}
#gmkFrameCount{
  display:flex;
  align-items:center;
  line-height:1;
}
.gmk-clear-head-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:30px;
  margin:0;
  padding:0 10px;
  line-height:1;
  border-radius:8px;
}




/* Only GIF Maker selects */
.gmk-control-grid select,
.gmk-output-card select,
.gmk-bg-row select{
  background:#1a1d2b;
  color:#f2f4ff;
  color-scheme:dark;
}

.gmk-control-grid select option,
.gmk-output-card select option,
.gmk-bg-row select option{
  background:#1a1d2b;
  color:#f2f4ff;
}

.gmk-control-grid select option:checked,
.gmk-output-card select option:checked,
.gmk-bg-row select option:checked{
  background:#4f7cff;
  color:#fff;
}
