/* Oval Face Generator Perfect — v1.0.0 (mobile-optimized + sticky preview) */
.ofgp-wrap{
  --ofgp-ink:#17172b;--ofgp-muted:#676174;--ofgp-line:#f0d6b6;--ofgp-soft:#fff7e5;
  --ofgp-card:#fffdf8;--ofgp-accent:#ff7043;--ofgp-green:#20c997;
  max-width:1180px;width:100%;margin:28px auto;padding:22px;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;
  color:var(--ofgp-ink);box-sizing:border-box
}
.ofgp-wrap *{box-sizing:border-box}

/* keep all text horizontal, never let it collapse to one letter per line */
.ofgp-wrap h1,.ofgp-wrap h2,.ofgp-wrap h3,.ofgp-wrap p,.ofgp-wrap button,.ofgp-wrap span,.ofgp-wrap strong{
  writing-mode:horizontal-tb;word-break:normal;overflow-wrap:break-word;white-space:normal
}

.ofgp-head{text-align:center;margin-bottom:22px}
.ofgp-pill{display:inline-flex;padding:8px 14px;border-radius:999px;background:#fff0dd;color:#9b4f00;font-weight:800;font-size:13px}
.ofgp-head h1{font-size:clamp(28px,5vw,56px);line-height:1.08;margin:14px 0 10px;font-weight:900;letter-spacing:-.03em}
.ofgp-head p{max-width:720px;margin:0 auto;color:var(--ofgp-muted);font-size:16px;line-height:1.6}

.ofgp-studio{display:grid;grid-template-columns:410px minmax(0,1fr);gap:22px;background:#fffaf2;border:1px solid var(--ofgp-line);border-radius:28px;padding:18px;box-shadow:0 18px 44px rgba(95,49,18,.08)}
.ofgp-preview-panel{position:sticky;top:16px;align-self:start;background:var(--ofgp-card);border:1px solid var(--ofgp-line);border-radius:24px;padding:18px}
.ofgp-preview-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ofgp-preview-top span{color:var(--ofgp-muted)}
.ofgp-canvas-card{background:#fff4d3;border:1px solid #f6deb5;border-radius:22px;padding:18px}
.ofgp-canvas-card svg{width:100%;height:auto;display:block;border-radius:18px;background:#fff8e2}

.ofgp-actions{display:grid;grid-template-columns:1.15fr 1fr 1fr;gap:10px;margin-top:14px}
.ofgp-actions button,.ofgp-category-head button{min-height:58px;border-radius:16px;border:1px solid var(--ofgp-line);background:#fff;color:var(--ofgp-ink);font-weight:900;font-size:16px;cursor:pointer;transition:.18s;white-space:nowrap}
.ofgp-actions .ofgp-primary{background:var(--ofgp-accent);color:#fff;border-color:var(--ofgp-accent)}
.ofgp-actions button:hover,.ofgp-category-head button:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(50,30,10,.1);color:var(--ofgp-ink)}
.ofgp-actions .ofgp-primary:hover{color:#fff}

/* download size selector */
.ofgp-size{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;padding:10px 12px;border:1px solid var(--ofgp-line);border-radius:16px;background:#fffdf8}
.ofgp-size-label{font-weight:900;font-size:14px;color:var(--ofgp-ink)}
.ofgp-size-opts{display:inline-flex;gap:6px;background:#fff4d3;border:1px solid #f6deb5;border-radius:12px;padding:4px}
.ofgp-size-btn{min-height:40px;padding:0 16px;border:0;border-radius:9px;background:transparent;color:var(--ofgp-muted);font-weight:900;font-size:14px;cursor:pointer;transition:.15s;white-space:nowrap}
.ofgp-size-btn:hover{color:var(--ofgp-ink)}
.ofgp-size-btn.is-active{background:var(--ofgp-accent);color:#fff;box-shadow:0 4px 10px rgba(255,112,67,.25)}

.ofgp-control-panel{min-width:0;background:var(--ofgp-card);border:1px solid var(--ofgp-line);border-radius:24px;padding:16px;overflow:hidden}
.ofgp-tabs{display:flex;gap:10px;overflow-x:auto;padding:2px 0 14px;border-bottom:1px solid var(--ofgp-line);scrollbar-color:#bbb transparent;-webkit-overflow-scrolling:touch}
.ofgp-tab{flex:0 0 auto;min-height:52px;padding:0 20px;border-radius:999px;border:1px solid var(--ofgp-line);background:#fff;color:var(--ofgp-ink)!important;font-weight:900;cursor:pointer;white-space:nowrap}
.ofgp-tab.is-active{background:var(--ofgp-green);color:#fff!important;border-color:var(--ofgp-green)}
.ofgp-category-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0}
.ofgp-category-head h2{font-size:30px;margin:0 0 4px;font-weight:950;letter-spacing:-.03em}
.ofgp-category-head p{margin:0;color:var(--ofgp-muted)}
.ofgp-category-head button{min-height:54px;padding:0 22px;white-space:nowrap}

.ofgp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:12px;max-height:430px;overflow:auto;padding:4px 4px 12px}
.ofgp-option{position:relative;min-height:100px;border:1px solid var(--ofgp-line);border-radius:15px;background:#fffaf5;cursor:pointer;display:grid;place-items:center;padding:8px;transition:.15s}
.ofgp-option:hover{border-color:#ff9b70;box-shadow:0 8px 18px rgba(255,112,67,.12)}
.ofgp-option.is-selected{border:3px solid var(--ofgp-accent)}
.ofgp-option svg{width:86px;height:86px;display:block}
.ofgp-option small{position:absolute;left:7px;bottom:5px;right:7px;font-size:10px;color:#7a6d65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.ofgp-adjust{margin-top:18px;border:1px solid var(--ofgp-line);border-radius:20px;padding:16px;background:#fffdf8}
.ofgp-adjust[hidden]{display:none}
.ofgp-adjust h3{margin:0 0 12px;font-size:20px}
.ofgp-adjust-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.ofgp-adjust label{font-weight:800}
.ofgp-adjust input[type=range]{width:100%;accent-color:var(--ofgp-accent)}
.ofgp-adjust input[type=color]{width:100%;height:40px;border:1px solid #ddd;border-radius:10px;background:#fff}

.ofgp-keycards{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}
.ofgp-keycards div{border:1px solid var(--ofgp-line);border-radius:16px;background:#fff;padding:16px}
.ofgp-keycards strong{display:block}
.ofgp-keycards span{display:block;color:var(--ofgp-muted);font-size:13px;margin-top:5px}

/* ---------- TABLET ---------- */
@media(max-width:900px){
  .ofgp-wrap{padding:12px;margin:16px auto}
  .ofgp-head{margin-bottom:14px}
  .ofgp-head h1{margin:10px 0 8px}
  .ofgp-head p{font-size:15px}
  .ofgp-studio{grid-template-columns:1fr;padding:12px;gap:14px;border-radius:22px}
  .ofgp-preview-panel{position:sticky;top:var(--ofgp-sticky-top,0px);z-index:30;padding:12px;box-shadow:0 6px 16px rgba(50,30,10,.10)}
  .ofgp-canvas-card{padding:10px}
  .ofgp-canvas-card svg{max-height:220px;margin:0 auto}
  .ofgp-grid{grid-template-columns:repeat(3,1fr);max-height:none}
  .ofgp-option{min-height:92px}
  .ofgp-keycards{grid-template-columns:1fr}
  .ofgp-adjust-grid{grid-template-columns:1fr 1fr}
  .ofgp-tab{min-height:48px;padding:0 16px}
  .ofgp-category-head h2{font-size:24px}
}

/* ---------- MOBILE (one-screen friendly) ---------- */
@media(max-width:480px){
  .ofgp-wrap{padding:10px;margin:10px auto}
  .ofgp-head{margin-bottom:8px}
  .ofgp-pill{font-size:12px;padding:6px 12px}
  .ofgp-head h1{font-size:24px;margin:6px 0 4px}
  /* keep description but limit to 2 lines to save vertical space */
  .ofgp-head p{font-size:13px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .ofgp-studio{padding:10px;gap:12px}
  .ofgp-preview-panel{padding:10px}
  .ofgp-preview-top{margin-bottom:8px}
  .ofgp-canvas-card{padding:8px}
  /* compact sticky preview so avatar + Download stay pinned while options scroll */
  .ofgp-canvas-card svg{max-height:150px}
  /* Download full width on top, Random + Reset share a row below */
  .ofgp-size{margin-top:10px;padding:8px 10px}
  .ofgp-size-label{font-size:13px}
  .ofgp-size-btn{min-height:36px;padding:0 12px;font-size:13px}
  .ofgp-actions{grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
  .ofgp-actions .ofgp-primary{grid-column:1 / -1}
  .ofgp-actions button{min-height:50px;font-size:15px}
  .ofgp-tabs{gap:8px;padding-bottom:10px}
  .ofgp-tab{min-height:44px;padding:0 14px;font-size:14px}
  .ofgp-category-head{margin:12px 0}
  .ofgp-category-head h2{font-size:22px}
  .ofgp-category-head button{min-height:46px;padding:0 16px}
  .ofgp-grid{grid-template-columns:repeat(3,1fr);gap:8px;max-height:300px}
  .ofgp-option{min-height:78px}
  .ofgp-option svg{width:64px;height:64px}
  .ofgp-adjust{padding:12px}
  .ofgp-adjust-grid{grid-template-columns:1fr 1fr}
}
