/* ==========================================================================
   Afiş Stüdyo — arayüz
   ========================================================================== */

:root {
  --ink: #1c1916;
  --ink-2: #3d3731;
  --muted: #8a7f73;
  --faint: #b3a899;
  --line: #e8e1d6;
  --line-soft: #f1ece4;
  --paper: #f4efe7;
  --panel: #ffffff;
  --warm: #fbf7f1;
  --red: #d7262e;
  --red-dark: #b21b22;
  --red-soft: #fdeceb;
  --green: #2f6b3f;
  --shadow-sm: 0 1px 2px rgba(40, 30, 20, .06), 0 2px 6px rgba(40, 30, 20, .04);
  --shadow-md: 0 10px 30px rgba(50, 38, 24, .10);
  --radius: 12px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

/* ------------------------------------------------------------------ topbar */

.topbar {
  flex: none;
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, #e63038, #c31d24);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px rgba(215, 38, 46, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
  flex: none;
}
.brand-mark svg { width: 21px; height: 21px; }

.brand-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-txt strong { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt span { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink-2);
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--warm); border-color: #dcd3c6; }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(180deg, #e02b33, var(--red));
  border-color: #b82027;
  color: #fff;
  box-shadow: 0 6px 14px rgba(215, 38, 46, .26), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.primary:hover { background: linear-gradient(180deg, #e53a42, #cf2229); }

.btn.soft {
  background: var(--warm);
  border-color: var(--line);
  color: var(--ink-2);
  height: 36px;
  font-size: 12.5px;
  padding: 0 11px;
}
.btn.soft svg { width: 15px; height: 15px; }
.btn.soft:hover { background: #f4ede3; }

.btn[disabled] { opacity: .55; cursor: wait; }

.vline { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }

.menu { position: relative; }
.menu-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 40;
}
.menu.open .menu-pop { display: block; animation: pop .14s ease-out; }
.menu-pop button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: none;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.menu-pop button:hover { background: var(--warm); }
.menu-pop small { color: var(--faint); font-size: 11px; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ layout */

.layout { flex: 1; display: flex; min-height: 0; }

.editor {
  width: 408px;
  flex: none;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 40px;
}

.ed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ed-head h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; margin: 0; }
.autosave { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.autosave i { width: 6px; height: 6px; border-radius: 50%; background: #37a15b; box-shadow: 0 0 0 3px rgba(55, 161, 91, .14); }
.autosave.saving i { background: #d9a12b; box-shadow: 0 0 0 3px rgba(217, 161, 43, .16); }

.panel { padding: 16px 0 18px; border-top: 1px solid var(--line-soft); }
.panel:first-of-type { border-top: 0; padding-top: 0; }
.panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

/* --------------------------------------------------------------- templates */

.templates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.tpl {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 4px 4px 6px;
  background: #fff;
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .12s;
}
.tpl:hover { border-color: #d5cabb; transform: translateY(-1px); }
.tpl canvas { width: 100%; height: auto; border-radius: 6px; display: block; background: #fff; }
.tpl b { display: block; font-size: 10.5px; font-weight: 700; margin: 5px 2px 0; letter-spacing: -.01em; line-height: 1.2; }
.tpl small { display: none; }
.tpl.on { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 38, 46, .12); }
.tpl.on::after {
  content: "";
  position: absolute;
  top: 7px; right: 7px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--red) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 13 4 4L19 7'/></svg>") center/10px no-repeat;
  box-shadow: 0 2px 6px rgba(180, 20, 26, .35);
}

/* ------------------------------------------------------------------ fields */

.field { display: block; margin-top: 10px; }
.field > span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.field input[type="text"] {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="text"]::placeholder { color: #c3b8aa; }
.field input[type="text"]:focus,
.field input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(215, 38, 46, .1);
}

.field select {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a7f73' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") right 10px center/14px no-repeat;
  font-size: 13px;
  appearance: none;
  cursor: pointer;
}
.field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 38, 46, .1); }
.field.featured { margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--warm); border: 1px dashed #ded4c5; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.hint { font-size: 11.5px; line-height: 1.45; color: var(--muted); margin: 0; }

.link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-top: 8px;
}
.link:hover { color: var(--ink); }
.link.danger { color: #b3352f; }

/* -------------------------------------------------------------------- logo */

.logo-row { display: flex; gap: 12px; align-items: flex-start; }
.logo-drop {
  width: 88px;
  height: 88px;
  flex: none;
  border: 1.5px dashed #d9cfc1;
  border-radius: 12px;
  background: var(--warm);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .16s, background .16s;
  position: relative;
}
.logo-drop:hover { border-color: var(--red); background: #fff8f2; }
.logo-drop img { max-width: 82px; max-height: 82px; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #a5988a; }
.logo-empty svg { width: 21px; height: 21px; margin-bottom: 2px; }
.logo-empty b { font-size: 10.5px; font-weight: 700; color: #8c7f71; }
.logo-empty small { font-size: 9px; letter-spacing: .02em; }
.logo-side { padding-top: 4px; }

/* ------------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0 2px; }
.chips button {
  border: 1px dashed #ddd3c5;
  background: var(--warm);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #7c7166;
  transition: all .14s;
}
.chips button:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 17px; height: 17px; border: 1.5px solid #d6ccbe; border-radius: 5px; background: #fff; margin: 0; position: relative; cursor: pointer; transition: all .14s; }
.check input:checked { background: var(--red); border-color: var(--red); }
.check input:checked::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'><path d='m5 13 4 4L19 7'/></svg>") center/11px no-repeat;
}
.badge-head { margin-top: 12px; }

/* ----------------------------------------------------------------- products */

.product-list { display: flex; flex-direction: column; gap: 8px; }

.pcard {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pcard:focus-within { border-color: #cfc3b4; box-shadow: var(--shadow-sm); }

.pthumb {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  background: #f7f2ea;
  border: 1px solid #efe7db;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  color: #b6a897;
  position: relative;
}
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb svg { width: 20px; height: 20px; }
.pthumb:hover { border-color: var(--red); color: var(--red); }

.pfields { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pfields input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #ece5db;
  border-radius: 7px;
  font-size: 12.5px;
  background: #fff;
  transition: border-color .14s, background .14s;
}
.pfields input:focus { outline: none; border-color: var(--red); background: #fffdfb; }
.pfields input::placeholder { color: #c7bcae; }
.pfields .pname { font-weight: 600; }
.pfields .prow { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pfields .prow input { color: var(--ink-2); }

.pactions { display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.pactions button {
  border: 0;
  background: none;
  color: #b6a99a;
  width: 22px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  padding: 0;
}
.pactions button:hover { background: var(--warm); color: var(--ink); }
.pactions button[data-act="del"]:hover { color: var(--red); background: var(--red-soft); }
.pactions svg { width: 12px; height: 12px; }

.product-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.product-actions .btn { height: 36px; }

/* ------------------------------------------------------------------ colors */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: #f5f0e8;
  border-radius: 10px;
}
.segmented button {
  height: 31px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #877b6e;
  transition: all .14s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.color { display: block; cursor: pointer; }
.color input {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.color input::-webkit-color-swatch-wrapper { padding: 4px; }
.color input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.color span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }

.ed-foot { font-size: 10.5px; line-height: 1.5; color: #a99d90; border-top: 1px solid var(--line-soft); padding-top: 14px; margin: 6px 0 0; }

/* ------------------------------------------------------------------- stage */

.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #efe9e1;
  background-image: radial-gradient(rgba(110, 95, 78, .13) 1px, transparent 1px);
  background-size: 18px 18px;
  position: relative;
}

.stage-bar {
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(120, 104, 86, .14);
  background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(6px);
}
.stage-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6d6155; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #37a15b; box-shadow: 0 0 0 4px rgba(55, 161, 91, .16); }
.stage-meta { font-size: 11.5px; color: #938675; }
.stage-tools { margin-left: auto; display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #6f6356;
  transition: all .14s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); }

.stage-canvas {
  flex: 1;
  min-height: 0;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage-canvas.dragover { background: rgba(215, 38, 46, .06); box-shadow: inset 0 0 0 3px rgba(215, 38, 46, .35); }
.paper {
  max-height: 100%;
  max-width: 100%;
  display: flex;
  border-radius: 3px;
  box-shadow: 0 30px 70px rgba(60, 44, 28, .26), 0 4px 12px rgba(60, 44, 28, .12), 0 0 0 1px rgba(60, 44, 28, .06);
  background: #fff;
  overflow: hidden;
  transition: box-shadow .2s;
}
.paper canvas {
  max-height: calc(100vh - 64px - 46px - 44px - 34px);
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: zoom-in;
}

.stage-foot {
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #9b8e7f;
}
.stage-foot .dot { opacity: .5; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  background: #1d1a17;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 11px;
  box-shadow: 0 16px 40px rgba(20, 14, 8, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22, 17, 12, .9);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  border-radius: 2px;
}
.lb-close {
  position: absolute;
  top: 18px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 15px;
}
.lb-close:hover { background: rgba(255, 255, 255, .18); }

/* --------------------------------------------------------------- scrollbar */

.editor::-webkit-scrollbar { width: 10px; }
.editor::-webkit-scrollbar-thumb { background: #ded5c8; border-radius: 99px; border: 3px solid #fff; }
.editor::-webkit-scrollbar-thumb:hover { background: #cfc4b5; }

:focus-visible { outline: 2px solid rgba(215, 38, 46, .55); outline-offset: 2px; }
.field input:focus-visible, .pfields input:focus-visible { outline: none; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .btn-label { display: none; }
  .btn { padding: 0 11px; }
}

@media (max-width: 920px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .topbar { position: sticky; top: 0; }
  .layout { flex-direction: column; }
  .editor { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .stage { order: -1; flex: none; }
  .stage-canvas { height: 52vh; padding: 14px; }
  .paper { max-height: 100%; }
  .paper canvas { max-height: calc(52vh - 28px); width: auto; height: auto; max-width: 100%; }
  .templates { grid-template-columns: repeat(3, 1fr); }
  .tpl { min-width: 0; }
  .tpl canvas { max-width: 100%; }
  .brand-txt span { display: none; }
  .stage-foot { display: none; }
}

@media (max-width: 560px) {
  .templates { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; height: 58px; }
  .stage-bar { padding: 0 12px; gap: 8px; }
  .stage-meta { display: none; }
  .row2 { grid-template-columns: 1fr; }
}

@media print {
  body { display: none; }
}

/* ==========================================================================
   Hesap, coin ve galeri arayüzü
   ========================================================================== */

.topnav { display: flex; align-items: center; gap: 2px; }
.navlink {
  border: 0;
  background: none;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.navlink:hover { background: var(--warm); color: var(--ink); }

.cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3ede4;
  color: #75685b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}
.btn.primary .cost { background: rgba(255, 255, 255, .2); color: #fff; }
.cost i,
.coins i,
.coin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #f0b429 72%);
  box-shadow: inset 0 0 0 1px rgba(150, 100, 0, .28);
}

.user-wrap { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.user-chip:hover { border-color: #d9cfc1; box-shadow: var(--shadow-sm); }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e63038, #c31d24);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
  flex: none;
}
.avatar.big { width: 38px; height: 38px; font-size: 13px; }
.uname { font-size: 12.5px; font-weight: 700; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coins {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fdf6e5;
  color: #8a6a14;
  font-size: 12px;
  font-weight: 800;
}
.coins i { width: 11px; height: 11px; }

.user-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 302px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 14px;
  z-index: 45;
  animation: pop .14s ease-out;
}
.pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pop-head b { display: block; font-size: 13px; }
.pop-head span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.coin-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--warm);
  border-radius: 11px;
  padding: 10px 12px;
}
.coin-box span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.coin-box strong { font-size: 22px; font-weight: 800; line-height: 1.1; }
.coin-box .btn { height: 32px; font-size: 11.5px; }
.coin-note { font-size: 10.5px; color: var(--muted); margin: 7px 2px 0; line-height: 1.4; }
.pop-title { font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 13px 2px 4px; }
.pop-list { max-height: 148px; overflow: auto; }
.coin-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--line-soft); font-size: 11.5px; color: var(--ink-2); }
.coin-row:last-child { border-bottom: 0; }
.coin-row b { color: #b3352f; font-weight: 800; }
.coin-row b.plus { color: #2f7d4d; }
.coin-row.empty { color: var(--muted); justify-content: center; border: 0; padding: 14px 0; }
.pop-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.pop-actions .link { margin: 0; }
.pop-hint { font-size: 10px; color: var(--muted); }

.lock-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #f0d8ab;
  background: #fff7e8;
  border-radius: 12px;
  margin-bottom: 14px;
}
.lock-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; background: #fbe6bd; color: #a16207; display: grid; place-items: center; }
.lock-ic svg { width: 16px; height: 16px; }
.lock-txt { flex: 1; min-width: 0; }
.lock-txt b { display: block; font-size: 12px; letter-spacing: -.01em; }
.lock-txt span { display: block; font-size: 11px; color: #8a6d3b; margin-top: 2px; line-height: 1.35; }
.lock-banner .btn { height: 32px; padding: 0 10px; font-size: 11.5px; flex: none; }
.editor.locked #editorBody { pointer-events: none; opacity: .48; filter: saturate(.65); }
.editor.locked .ed-head { opacity: .6; }

.autosave i { background: #d9a12b; box-shadow: 0 0 0 3px rgba(217, 161, 43, .16); }
.autosave.saved i { background: #37a15b; box-shadow: 0 0 0 3px rgba(55, 161, 91, .15); }

.btn.is-busy { opacity: .62; pointer-events: none; }
.btn.block { width: 100%; height: 42px; margin-top: 14px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 18, 12, .56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 80;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 30px 80px rgba(20, 12, 6, .35);
  animation: pop .16s ease-out;
}
.modal-card.wide { max-width: 840px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--warm);
  color: var(--muted);
  font-size: 13px;
}
.modal-close:hover { background: #efe7db; color: var(--ink); }
.modal-card h2 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.02em; }
.modal-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.45; }

.auth-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #e63038, #c31d24);
  color: #fff;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  box-shadow: 0 6px 14px rgba(215, 38, 46, .25);
}
.auth-mark svg { width: 22px; height: 22px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: #f5f0e8; border-radius: 10px; margin-bottom: 14px; }
.tabs button { height: 32px; border: 0; border-radius: 8px; background: none; font-size: 12px; font-weight: 700; color: #877b6e; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-error { background: #fdecec; color: #a3241f; font-size: 12px; padding: 9px 11px; border-radius: 9px; margin: 12px 0 0; line-height: 1.35; }
.auth-bonus { font-size: 11.5px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.auth-bonus b { color: #8a6a14; }
.auth-demo { font-size: 11px; color: var(--muted); text-align: center; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.auth-demo b { color: var(--ink-2); }

.my-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-height: 58vh; overflow: auto; padding: 2px; }
.my-card {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.my-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #ddd2c2; }
.my-thumb { aspect-ratio: 1240 / 1754; background: #f7f2ea; display: grid; place-items: center; overflow: hidden; }
.my-thumb img, .my-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.my-placeholder { font-size: 11px; color: #a1927f; font-weight: 700; text-align: center; padding: 10px; }
.my-meta { padding: 8px 9px 10px; }
.my-meta b { display: block; font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-meta span { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.my-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  color: var(--muted);
  font-size: 11px;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .15s;
}
.my-card:hover .my-del { opacity: 1; }
.my-del:hover { color: var(--red); border-color: #e7b6b4; }
.my-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 10px 20px; }
.my-empty .link { display: inline; margin-left: 4px; }

/* ------------------------------------------------------------------ galeri */

body.gallery-page { display: block; overflow: auto; background: var(--paper); background-image: radial-gradient(rgba(110, 95, 78, .10) 1px, transparent 1px); background-size: 18px 18px; }
body.gallery-page .topbar { position: sticky; top: 0; }
.gallery-main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 26px 22px 60px; }
.gallery-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.gallery-hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.025em; }
.gallery-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 560px; line-height: 1.5; }
.gallery-badge { font-size: 12px; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, 248px); justify-content: center; gap: 18px; }
.gcard {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.gcard:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(60, 42, 24, .14); border-color: #ddd2c2; }
.gthumb { position: relative; background: #f7f2ea; overflow: hidden; }
.gthumb.a4p { aspect-ratio: 1240 / 1754; }
.gthumb.a4l { aspect-ratio: 1754 / 1240; }
.gthumb.sq { aspect-ratio: 1; }
.gthumb img, .gthumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb .g-lock {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20, 16, 12, .72);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  backdrop-filter: blur(3px);
}
.gmeta { padding: 10px 12px 12px; }
.gmeta b { display: block; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmeta span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.gallery-empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

@media (max-width: 1080px) {
  .uname { display: none; }
  .user-chip { padding-right: 6px; }
}

@media (max-width: 920px) {
  .topnav { display: none; }
  .topbar { gap: 8px; }
  .my-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-main { padding: 18px 14px 40px; }
  .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
}

@media (max-width: 560px) {
  #btnNew, #btnSave .btn-label, #btnPng .btn-label { display: none; }
  .user-chip .coins { display: none; }
  .modal-card { padding: 20px; }
  .my-grid { grid-template-columns: 1fr 1fr; }
}
