/* emoki.io web tool — island styles. Everything is scoped under .emk. The shell is rendered by
   the page generator, so these rules apply before the script runs (no layout shift). */
.emk { --emk-bg: #141414; --emk-panel: #1b1b1b; --emk-line: rgba(255,255,255,.10); --emk-text: #f7f4ef;
  --emk-muted: #aaa49d; --emk-accent: #ff6a5d; --emk-accent2: #ff9b6a;
  color: var(--emk-text); width: 100%; max-width: 440px; margin: 0 auto;
  min-width: 0; }  /* as a grid/flex item the scrolling style row would otherwise widen the page past a phone screen */
.emk-frame { background: var(--emk-panel); border: 1px solid var(--emk-line); border-radius: 22px; padding: 12px;
  display: flex; flex-direction: column; gap: 12px; }
.emk-stage { position: relative; width: 100%; aspect-ratio: var(--emk-ar, 0.8); border-radius: 14px; overflow: hidden;
  background: #0d0d0d; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.emk-stage:active { cursor: grabbing; }
.emk-poster, .emk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.emk-canvas[hidden], .emk-poster[hidden] { display: none; }
.emk-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 5px 10px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1.3; text-align: center; pointer-events: none;
  white-space: nowrap; opacity: 0; transition: opacity .25s; }
.emk.has-photo .emk-hint { opacity: 1; animation: emk-fade 4s 1.5s forwards; }
@keyframes emk-fade { to { opacity: 0; } }
.emk-drop { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center;
  background: rgba(255,106,93,.18); border: 2px dashed var(--emk-accent); border-radius: 14px; font-weight: 700; padding: 16px; }
.emk.is-drop .emk-drop { display: flex; }
.emk-spin { position: absolute; right: 10px; bottom: 10px; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; display: none; animation: emk-rot .8s linear infinite; }
.emk.is-loading .emk-spin { display: block; }
@keyframes emk-rot { to { transform: rotate(360deg); } }
.emk-bar { display: flex; align-items: center; gap: 8px; background: var(--emk-bg); border: 1px solid var(--emk-line);
  border-radius: 12px; padding: 0 12px; }
/* A textarea that starts as one 46px line and grows to about three lines (the app's maxHeight), then scrolls.
   16px font: iOS Safari zooms the page into any field below 16px. */
.emk-input { flex: 1; min-width: 0; height: 46px; max-height: 92px; padding: 12px 0; box-sizing: border-box; resize: none;
  overflow-y: auto; background: transparent; border: 0; color: var(--emk-text); font: inherit; font-size: 16px;
  line-height: 22px; outline: none; display: block; }
.emk-input::placeholder { color: var(--emk-muted); }
.emk-count { color: var(--emk-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.emk-styles-label { margin: 0; color: var(--emk-muted); font-size: 13px; }
.emk-styles { display: grid; grid-auto-flow: column; grid-auto-columns: 84px; gap: 8px; overflow-x: auto;
  scroll-snap-type: x proximity; padding-bottom: 4px; scrollbar-width: thin; }
.emk-style { scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding: 0; background: none;
  border: 0; color: var(--emk-muted); font: inherit; font-size: 11px; line-height: 1.2; text-align: center; cursor: pointer; }
.emk-style img { width: 84px; height: 105px; object-fit: cover; border-radius: 10px; border: 2px solid transparent; display: block; }
.emk-style[aria-pressed="true"] { color: var(--emk-text); }
.emk-style[aria-pressed="true"] img { border-color: var(--emk-accent); }
.emk-style:focus-visible img { outline: 2px solid var(--emk-accent2); outline-offset: 2px; }
.emk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emk-choose, .emk-share { height: 48px; border-radius: 12px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 0 10px; }
.emk-choose { background: var(--emk-bg); color: var(--emk-text); border: 1px solid var(--emk-line); }
.emk-choose:focus-within { outline: 2px solid var(--emk-accent2); }
.emk-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.emk-share { border: 0; color: #1a0f0d; background: linear-gradient(135deg, var(--emk-accent), var(--emk-accent2)); }
.emk-share:disabled { opacity: .45; cursor: default; }
.emk-msg { margin: 0; min-height: 1.3em; font-size: 13px; color: var(--emk-muted); }
.emk-msg[data-kind="error"] { color: #ffb4a8; }
.emk-note { margin: 0; font-size: 12px; color: var(--emk-muted); }
/* After a download: the app for this device. Hidden until the first successful export. */
.emk-after { position: relative; background: var(--emk-bg); border: 1px solid rgba(255,106,93,.45); border-radius: 16px;
  padding: 16px 16px 14px; display: grid; gap: 10px; }
.emk-after[hidden] { display: none; }
.emk-after-h { margin: 0; padding-right: 28px; font-size: 17px; font-weight: 800; line-height: 1.25; }
.emk-after-p { margin: 0; color: #d9d3cc; font-size: 14px; line-height: 1.45; }
.emk-after-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--emk-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.emk-after-close:focus-visible { outline: 2px solid var(--emk-accent2); }
.emk-after-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.emk-after[data-platform="android"] [data-store="appstore"],
.emk-after[data-platform="ios"] [data-store="play"] { display: none; }
.emk-after-qr { display: none; align-items: center; gap: 12px; color: var(--emk-muted); font-size: 13px; }
.emk-after-qr img { width: 96px; height: 96px; border-radius: 8px; background: #fff; flex: none; }
.emk-after[data-platform="desktop"] .emk-after-qr { display: flex; }
@media (min-width: 1024px) {
  /* A generic phone frame on desktop — no device-specific shapes or brand elements. */
  .emk { max-width: 400px; }
  .emk-frame { border: 10px solid #2a2a2a; border-radius: 44px; padding: 18px 14px 16px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
  .emk-frame::before { content: ""; display: block; width: 56px; height: 5px; margin: 0 auto 4px; border-radius: 99px; background: #333; }
}
