/* bitmap.css (FULL) — Barlow everywhere + fixed invalid "#border/#background" comments */

:root{
  --bg: #0b0f1a;
  --panel: rgba(255,255,255,0.06);
  --stroke: rgba(255,255,255,0.10);
  --stroke2: rgba(255,255,255,0.14);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --muted2: rgba(255,255,255,0.40);
  --shadow: 0 16px 40px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius2: 14px;
  --gap: 14px;
  --cell: 22px;
  --cell-gap: 2px;
  --on: #ffffff;
  --off: rgba(255,255,255,0.06);
  --accent: #7c5cff;
  --accent2: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --editor-max: 1700px;
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(124,92,255,0.18), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(34,197,94,0.12), transparent 50%),
    radial-gradient(700px 600px at 80% 90%, rgba(245,158,11,0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  padding: 18px;
}

.sep_clear{
  height: 1px;
  width: 100%;
  margin: 2px 0;
  background: rgba(255,255,255,0);
}

.sep{
  height: 1px;
  width: 100%;
  margin: 5px 0;
  background: rgba(255,255,255,0.10);
}

.app{
  max-width: var(--editor-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo{
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: contain;
  image-rendering: auto;
}

header{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 16px 6px;
}

.title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

h1{
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.panel{
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel .hd{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.panel .hd .left{
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.panel .hd .t{
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.panel .hd .d{
  color: var(--muted);
  font-size: 12px;
}
.panel .bd{ padding: 14px; }

.controls{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
}
.field span{
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

input[type="number"], input[type="text"]{
  width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke2);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  outline: none;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
input[type="text"]{ width: 220px; }

input[type="file"]{
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

select{
  background: rgba(0,0,0,0.55) !important;
  color: rgba(255,255,255,0.92) !important;
  border-color: rgba(255,255,255,0.22) !important;

  border-radius: 12px;
  padding: 8px 10px;
  outline: none;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

select option{
  background-color: #0b0f1a;
  color: #ffffff;
}

select optgroup{
  background-color: #0b0f1a;
  color: rgba(255,255,255,0.75);
  font-weight: 700;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke2);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.2px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.btn:hover{
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(180deg, rgba(124,92,255,0.35), rgba(124,92,255,0.18));
  border-color: rgba(124,92,255,0.55);
}
.btn.good{
  background: linear-gradient(180deg, rgba(34,197,94,0.28), rgba(34,197,94,0.14));
  border-color: rgba(34,197,94,0.50);
}
.btn.warn{
  background: linear-gradient(180deg, rgba(245,158,11,0.24), rgba(245,158,11,0.12));
  border-color: rgba(245,158,11,0.45);
}
.btn.danger{
  background: linear-gradient(180deg, rgba(239,68,68,0.24), rgba(239,68,68,0.12));
  border-color: rgba(239,68,68,0.45);
}

.tog{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.tog input{ accent-color: var(--accent); }
.tog label{ color: var(--muted); font-size: 12px; }

.notice{
  display: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  line-height: 1.35;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.notice.show{ display:block; }
.notice.warn{
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.08);
}
.notice.good{
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.08);
}

.gridWrap{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.gridScroll{
  width: 100%;
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  padding-bottom: 6px;
  border-radius: var(--radius2);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.22);

  /* Firefox */
  scrollbar-width: auto;
  scrollbar-color: rgba(255,255,255,.35) rgba(0,0,0,.25);
}

/* Chrome / Edge / Safari */
.gridScroll::-webkit-scrollbar{
  width: 16px;   /* vertikal */
  height: 16px;  /* horizontal */
}
.gridScroll::-webkit-scrollbar-track{
  background: rgba(0,0,0,.25);
  border-radius: 999px;
}
.gridScroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.30);
  border-radius: 999px;
  border: 3px solid rgba(0,0,0,.25);
}
.gridScroll::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.45);
}

.grid{
  display: inline-grid;
  gap: var(--cell-gap);
  user-select: none;
  touch-action: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  justify-content: start;
  align-content: start;
}

.cell{
  width: var(--cell);
  height: var(--cell);
  border-radius: 7px;
  background: var(--off);
  outline: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.cell.on{
  background: var(--on);
  outline-color: rgba(255,255,255,0.35);
  box-shadow: 0 6px 18px rgba(255,255,255,0.12);
}
.cell.pre{
  background: rgba(124,92,255,0.65);
  outline-color: rgba(124,92,255,0.55);
  box-shadow: 0 6px 18px rgba(124,92,255,0.18);
}

/* selection highlight */
.cell.sel{
  outline-color: rgba(245,158,11,0.55);
  box-shadow: 0 8px 20px rgba(245,158,11,0.12);
}
.cell.sel::after{
  content:"";
  position:absolute;
  inset: 2px;
  border-radius: 6px;
  border: 2px dashed rgba(245,158,11,0.55);
  pointer-events:none;
}

.mini{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.kbd{
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* changed to Barlow */
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.14);
  border-bottom-width: 2px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
}

.stack{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

canvas{
  display: block;
  border-radius: var(--radius2);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.20);
  image-rendering: pixelated;
  max-width: 100%;
}

textarea{
  width: 100%;
  min-height: 240px;
  padding: 12px;
  border-radius: var(--radius2);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.90);
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; /* changed to Barlow */
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  resize: vertical;
}

.meta{
  color: var(--muted2);
  font-size: 12px;
  margin-top: -6px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.toolHint{
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  min-width: 260px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Frame strip */
.frameStrip{
  width: 100%;
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius2);
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}
.frames{
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-height: 86px;
}
.frameCard{
  width: 86px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 8px;
  cursor: pointer;
  transition: transform .06s ease, border-color .15s ease, background .15s ease;
  user-select: none;
}
.frameCard.selected{
  border-color: rgba(245,158,11,0.65);
  background: rgba(245,158,11,0.12);
  box-shadow: 0 10px 25px rgba(245,158,11,0.10);
}
.frameCard:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.frameCard.active{
  border-color: rgba(124,92,255,0.55);
  background: rgba(124,92,255,0.14);
  box-shadow: 0 10px 25px rgba(124,92,255,0.12);
}
.frameThumb{
  width: 100%;
  height: 56px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  display: block;
  image-rendering: pixelated;
}
.frameLbl{
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  display:flex;
  justify-content: space-between;
  gap:6px;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.pill{
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.subgrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 980px){
  .subgrid{
    grid-template-columns: 1fr 1fr;
    align-items:start;
  }
}
