.media-edit-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 38px;
  margin: -5px 0 14px;
  color: #5b4326;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(245, 232, 198, .42);
  font: 600 11px/1 var(--sans);
}
.media-edit-button:hover { background: rgba(245, 232, 198, .72); }

.gme-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #201b14;
  background: rgba(5, 7, 6, .84);
  backdrop-filter: blur(12px);
}
.gme-dialog {
  width: min(980px, 100%);
  max-height: calc(100svh - 40px);
  overflow: auto;
  border: 1px solid rgba(122, 85, 38, .62);
  background:
    radial-gradient(circle at 14% 19%, rgba(255,255,255,.16) 0 .7px, transparent 1.2px),
    radial-gradient(circle at 76% 63%, rgba(87,54,20,.08) 0 .7px, transparent 1.2px),
    repeating-linear-gradient(0deg, rgba(99,69,31,.035) 0 1px, transparent 1px 5px),
    #e7d7ad;
  background-size: 13px 17px, 19px 23px, auto, auto;
  box-shadow: 18px 22px 0 rgba(0,0,0,.25);
}
.gme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(111,79,35,.42);
}
.gme-head span { color: #8b6330; font: 9px/1 "DM Mono", monospace; letter-spacing: .12em; }
.gme-head h2 { margin: 7px 0 0; font: 400 32px/1 "Libre Caslon Display", Georgia, serif; }
.gme-close {
  width: 38px;
  height: 38px;
  color: #201b14;
  border: 1px solid rgba(111,79,35,.42);
  background: transparent;
}
.gme-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); }
.gme-stage {
  min-height: 480px;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(107,83,49,.08) 25%, transparent 25%, transparent 75%, rgba(107,83,49,.08) 75%),
    linear-gradient(45deg, rgba(107,83,49,.08) 25%, transparent 25%, transparent 75%, rgba(107,83,49,.08) 75%),
    #d6c399;
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}
.gme-stage canvas, .gme-stage video {
  display: block;
  max-width: 100%;
  max-height: 62svh;
  background: #17140f;
  box-shadow: 0 18px 36px rgba(50,35,18,.22);
}
.gme-controls { padding: 24px; border-left: 1px solid rgba(111,79,35,.35); }
.gme-control { display: block; margin-bottom: 18px; }
.gme-control > span { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: #684d2b; font: 9px/1 "DM Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.gme-control input[type="range"] { width: 100%; accent-color: #17140f; }
.gme-control input[type="number"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: #201b14;
  border: 1px solid rgba(111,79,35,.42);
  border-radius: 0;
  background: rgba(248,236,204,.62);
}
.gme-control select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 10px;
  color: #201b14;
  border: 1px solid rgba(111,79,35,.42);
  border-radius: 0;
  background: rgba(248,236,204,.72);
  font: 600 12px/1.2 "Inter", Arial, sans-serif;
}
.gme-position { margin-bottom: 13px; }
.gme-toggle { display: flex; align-items: center; gap: 9px; margin: 12px 0; color: #5e513e; font-size: 12px; }
.gme-rotate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.gme-rotate button, .gme-actions button {
  min-height: 40px;
  padding: 9px 12px;
  color: #443622;
  border: 1px solid rgba(111,79,35,.42);
  border-radius: 0;
  background: rgba(245,232,198,.4);
  font-weight: 600;
}
.gme-actions { display: grid; gap: 8px; margin-top: 26px; }
.gme-actions .primary { color: #f8eedb; border-color: #17140f; background: #17140f; }
.gme-actions button:disabled { opacity: .55; cursor: wait; }
.gme-note { min-height: 34px; margin: 14px 0 0; color: #745f42; font-size: 11px; }
.gme-progress { margin-top: 12px; color: #5c472b; font: 9px/1.4 "DM Mono", monospace; }

@media (max-width: 760px) {
  .gme-overlay { padding: 0; }
  .gme-dialog { max-height: 100svh; min-height: 100svh; width: 100%; box-shadow: none; }
  .gme-body { grid-template-columns: 1fr; }
  .gme-stage { min-height: 310px; padding: 12px; }
  .gme-stage canvas, .gme-stage video { max-height: 42svh; }
  .gme-controls { border-left: 0; border-top: 1px solid rgba(111,79,35,.35); }
}
