/* Views shared by the image tools: picture cards, the stage, crop frame,
   photo editor, watermark and meme layers. */

.stack { display: flex; flex-direction: column; gap: 14px; }
.seg--wrap { flex-wrap: wrap; }
.seg--wrap button { flex: 1 0 auto; min-width: 52px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .btn { justify-content: center; }
.field--color { padding: 4px; height: 44px; cursor: pointer; }
.seo { padding: 40px 0; }
.seo ul { padding-left: 1.2em; line-height: 1.9; }

/* picture cards */
.card__img img { max-width: 88%; max-height: 176px; object-fit: contain; border-radius: 4px; box-shadow: 0 6px 18px -6px rgba(18, 40, 38, .3); transition: transform .25s; background: repeating-conic-gradient(#eef2f1 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.card__tools { display: flex; justify-content: center; gap: 6px; }

/* one big picture */
.stage { display: grid; place-items: center; min-height: 420px; padding: 20px; border-radius: 18px; background: var(--stage); overflow: hidden; }
.stage > canvas, .stage > img { max-width: 100%; max-height: 70vh; height: auto; border-radius: 4px; box-shadow: 0 14px 34px -14px rgba(18, 40, 38, .4); }
.checker { background: repeating-conic-gradient(#e3e9e8 0 25%, #fff 0 50%) 0 0 / 20px 20px; }

/* crop */
.crop { position: relative; display: inline-block; max-width: 100%; touch-action: none; user-select: none; line-height: 0; }
.crop img { display: block; max-width: 100%; max-height: 68vh; border-radius: 3px; }
.crop__shade { position: absolute; inset: 0; pointer-events: none; }
.crop__box { position: absolute; cursor: move; outline: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(10, 30, 28, .55); background-image: linear-gradient(rgba(255, 255, 255, .45) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .45) 1px, transparent 1px); background-size: 33.34% 33.34%; background-position: -1px -1px; }
.crop { overflow: hidden; }
.crop__h { position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); transform: translate(-50%, -50%); }
.crop__h--nw { left: 0; top: 0; cursor: nwse-resize; } .crop__h--se { left: 100%; top: 100%; cursor: nwse-resize; }
.crop__h--ne { left: 100%; top: 0; cursor: nesw-resize; } .crop__h--sw { left: 0; top: 100%; cursor: nesw-resize; }
.crop__h--n { left: 50%; top: 0; cursor: ns-resize; border-radius: 4px; width: 26px; height: 8px; } .crop__h--s { left: 50%; top: 100%; cursor: ns-resize; border-radius: 4px; width: 26px; height: 8px; }
.crop__h--e { left: 100%; top: 50%; cursor: ew-resize; border-radius: 4px; width: 8px; height: 26px; } .crop__h--w { left: 0; top: 50%; cursor: ew-resize; border-radius: 4px; width: 8px; height: 26px; }

/* layers placed on a picture (watermark, meme text, editor text) */
.layered { position: relative; display: inline-block; max-width: 100%; line-height: 0; touch-action: none; }
.layered > canvas { display: block; max-width: 100%; max-height: 68vh; height: auto; border-radius: 3px; box-shadow: 0 14px 34px -14px rgba(18, 40, 38, .4); }
.layer { position: absolute; cursor: move; line-height: 1.15; white-space: pre; user-select: none; outline: 1px dashed transparent; outline-offset: 4px; }
.layer:hover, .layer.sel { outline-color: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }

/* photo editor */
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: .76rem; color: var(--muted); }
.filter canvas { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.filter.on { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.tabs button { flex: 1; padding: 8px 4px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 600; font-size: .84rem; cursor: pointer; }
.tabs button.on { background: #fff; color: var(--primary); box-shadow: 0 0 0 1px var(--primary-line); }
.compare { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* html */
.html-paste { font: 13px/1.5 ui-monospace, Consolas, monospace; min-height: 200px; resize: vertical; }
.html-view { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

@media (max-width: 640px) {
  .stage { min-height: 260px; padding: 10px; }
  .filters { grid-template-columns: repeat(4, 1fr); }
}

/* hero art: keep the sparkle off the crop corner */
.art__sig { bottom: -6%; right: 20%; }

/* watermark position */
.spots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; border-radius: 13px; background: var(--surface-2); }
.spots button { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; position: relative; }
.spots button::after { content: ''; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.spots button.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.spots button.on::after { background: var(--primary); }
.spots .spots__tile { grid-column: 1 / -1; height: auto; padding: 8px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.spots .spots__tile::after { display: none; }
.spots .spots__tile.on { color: var(--primary); }
.center { text-align: center; }
.html-frame { position: fixed; left: -20000px; top: 0; border: 0; background: #fff; pointer-events: none; }
.linkbtn.danger { color: var(--bad); align-self: flex-start; }

/* the longer name must fit the phone header on one line */
.brand, .nav a { white-space: nowrap; }
@media (max-width: 430px) {
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .nav a { padding: 8px 9px; }
}
