/* FIXED26 */

:root{
  --bg:#07070b;
  --card:#0f1118;
  --card2:#0c0d13;
  --line:rgba(255,255,255,.08);
  --text:#f3f4f6;
  --muted:rgba(255,255,255,.65);
  --muted2:rgba(255,255,255,.5);
  --accent:#7c3aed;
  --accent2:#22d3ee;
  --shadow: 0 20px 50px rgba(0,0,0,.5);
  --radius: 22px;
}

*{box-sizing:border-box}
body{
  margin:0;
  background: radial-gradient(1000px 600px at 20% 10%, rgba(124,58,237,.25), transparent 60%),
             radial-gradient(1000px 600px at 80% 20%, rgba(34,211,238,.20), transparent 60%),
             var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

a{color:inherit; text-decoration:none}
code{background:rgba(255,255,255,.06); padding:.15rem .35rem; border-radius:10px}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 22px;
  position:sticky; top:0;
  background:rgba(7,7,11,.6);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--line);
  z-index:20;
}

.brand{display:flex; gap:12px; align-items:center}
.logo-dot{
  width:14px;height:14px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 0 0 6px rgba(124,58,237,.15), 0 0 0 14px rgba(34,211,238,.07);
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted)}

.nav{display:flex; gap:14px}
.navlink{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.02);
}

.container{max-width:none; width:100%; margin:0 auto; padding:22px 20px}

.hero{display:grid; grid-template-columns: 1fr; gap:18px; align-items:stretch}
.hero-card, .side-card, .admincard{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
}
.hero-card h1{margin:0 0 8px; font-size:28px; line-height:1.15}
.muted{color:var(--muted)}
.tiny{font-size:12px; color:var(--muted2)}

.hero-seo{
  margin-top:12px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background: rgba(0,0,0,.18);
}
.hero-lead{margin:0; color:var(--text)}
.hero-bullets{
  margin:10px 0 0;
  padding-left:18px;
  display:grid;
  gap:6px;
}
.hero-bullets li{color:var(--muted)}
.hero-bullets b{color:var(--text)}

.generator{display:flex; gap:10px; margin-top:14px}
input, textarea{
  width:100%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
textarea{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

button{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:12px 14px;
  border-radius:16px;
  cursor:pointer;
}
button.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  font-weight:800;
}
button.ghost{background:transparent}
.iconbtn{
  width:42px;height:42px;border-radius:16px;
  display:grid; place-items:center;
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  font-size:12px;
  color:var(--muted);
}
.meta-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px
}
.meta-actions{display:flex; align-items:center; gap:10px}

.packmenu{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:12px}
.packmenu .pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.84);
  font-weight:750; font-size:13px;
  text-decoration:none;
}
.packmenu .pill:hover{background:rgba(255,255,255,.07)}
.packmenu .pill.active{
  border-color: rgba(34,211,238,.38);
  box-shadow:0 0 0 3px rgba(34,211,238,.08);
}

.packlist{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.pack{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(0,0,0,.18);
  cursor:pointer;
}
.pack.active{
  border-color: rgba(34,211,238,.38);
  box-shadow:0 0 0 3px rgba(34,211,238,.08);
}
.pack b{font-weight:800}

.grid-head{display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin-top:22px}
.grid{display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; margin-top:12px}
.card{
  background:rgba(0,0,0,.22);
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  position:relative;
  cursor:pointer;
  transition: transform .12s ease;
}
.card:hover{transform: translateY(-2px)}
.thumb{display:block; width:100%; height:140px}
.card-foot{
  padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.badge{
  font-size:11px;
  padding:6px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  color:var(--muted);
}
.badge.premium{
  background:rgba(124,58,237,.15);
  border-color:rgba(124,58,237,.3);
  color:#e9ddff;
}

.loading{
  text-align:center;
  padding:22px;
  color:var(--muted);
}

.modal.hidden{display:none !important;}
.modal{position:fixed; inset:0; z-index:50; display:block;}
.modal-backdrop{position:absolute; inset:0; background:rgba(0,0,0,.72);}
.modal-card{position:relative;
  margin: min(5vh, 34px) auto 0;
  width: min(1040px, 94vw);
  background: rgba(10,12,18,.94);
  background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:14px 14px; border-bottom:1px solid var(--line);background: rgba(12,14,20,.96); backdrop-filter: blur(10px);}
.modal-title{font-weight:900; font-size:16px}
.modal-body{padding:14px; display:flex; flex-direction:column; gap:12px;}

.toast.hidden{display:none !important;}
.toast{position:fixed; right:16px; bottom:16px; z-index:60}
.toast-card{
  width:min(420px, 92vw);
  background:rgba(0,0,0,.55);
  border:1px solid var(--line);
  border-radius: 22px;
  padding:14px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.toast-title{font-weight:900; margin-bottom:8px}
.toast ul{margin:0; padding-left:18px}
.toast li{margin:6px 0; color:var(--muted)}

.switch{position:relative; display:inline-block; width:44px; height:26px}
.switch input{display:none}
.slider{
  position:absolute; cursor:pointer; inset:0;
  background:rgba(255,255,255,.1);
  border:1px solid var(--line);
  border-radius:999px;
  transition:.2s;
}
.slider:before{
  content:"";
  position:absolute; height:20px; width:20px; left:3px; top:2px;
  background:linear-gradient(135deg, rgba(255,255,255,.9), rgba(255,255,255,.6));
  border-radius:999px;
  transition:.2s;
}
.switch input:checked + .slider{background:rgba(124,58,237,.25); border-color:rgba(124,58,237,.35)}
.switch input:checked + .slider:before{transform: translateX(18px)}

.adminwrap{display:grid; grid-template-columns: 1fr; gap:14px}
.adminhead{display:flex; justify-content:space-between; align-items:center}
.adminactions{display:flex; gap:10px}
.formrow{display:flex; flex-direction:column; gap:6px; margin:10px 0}
.toggleRow{display:flex; align-items:center; gap:12px; margin:10px 0}
.sep{border:none; border-top:1px solid var(--line); margin:18px 0}

@media (max-width: 980px){
  .hero{grid-template-columns: 1fr}
  .grid{grid-template-columns: repeat(2, 1fr)}
}
@media (max-width: 520px){
  .generator{flex-direction:column}
  .grid{grid-template-columns: 1fr}
}



.footer{
  margin-top:26px;
  padding:18px 4px 8px;
  border-top:1px solid var(--line);
  color:var(--muted);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.footer a{color:rgba(255,255,255,.75)}
.footer a:hover{color:rgba(255,255,255,.92)}
.footer .links{display:flex; gap:14px; flex-wrap:wrap}
.page{
  max-width:900px;
  margin:0 auto;
  padding:18px;
}
.page h1{margin:0 0 10px; font-size:28px}
.page p, .page li{color:var(--muted); line-height:1.6}
.form{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}
.form .row{display:grid; grid-template-columns: 1fr 1fr; gap:10px}
@media (max-width:720px){ .form .row{grid-template-columns:1fr} }
.notice{
  margin-top:12px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:rgba(255,255,255,.8);
}

.rendering{position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,.32);}
.rendering .box{padding:18px 18px; border-radius:22px;background: rgba(10,12,18,.92); border:1px solid rgba(255,255,255,.12);box-shadow: 0 22px 60px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06) inset;backdrop-filter: blur(10px); display:grid; gap:8px; justify-items:center;}
.rendering .spinner{
  width:46px;height:46px;border-radius:999px;
  border:4px solid rgba(255,255,255,.18);
  border-top-color: rgba(255,255,255,.85);
  animation: spin 1s linear infinite;
}
.rendering .label{
  font-weight:800;
  letter-spacing:.2px;
  color:rgba(255,255,255,.85);
}
@keyframes spin{to{transform:rotate(360deg)}}


.previewWrap{position:relative;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(0deg, rgba(0,0,0,.12), rgba(0,0,0,.12)),
    repeating-conic-gradient(rgba(255,255,255,.10) 0 25%, rgba(255,255,255,.02) 0 50%) 50%/36px 36px;}
#previewCanvas{width:100%; height:auto; display:block; max-height: 62vh;}
.actions{display:flex; gap:12px; justify-content:center; align-items:center; flex-wrap:wrap;padding:14px; margin-top:6px; border:1px solid rgba(255,255,255,.10); border-radius:18px;background: rgba(12,14,20,.94); backdrop-filter: blur(10px);}
.actions .primary{flex:1; min-width:220px}
.actions .ghost{flex:1; min-width:220px}
.actions .muted{flex-basis:100%}


.modal-card{max-height: calc(100vh - 80px); overflow:auto}
.modal-body{padding:14px}

.actions #premiumNote{flex-basis:100%; order:99; margin-top:2px;}

.actions button{min-width: 160px;}
@media (max-width:720px){.actions button{flex:1; min-width: 0}}

#renderingOverlay.hidden{display:none !important;}
.rendering.hidden{display:none !important;}

/* FIXED15: guarantee modal hides */
.modal.hidden{display:none !important;}
.rendering.hidden{display:none !important;}
#renderingOverlay.hidden{display:none !important;}

/* Menu styling */
.nav .menu{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.nav .pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.84);
  font-weight:750; font-size:13px;
  text-decoration:none;
}
.nav .pill:hover{background:rgba(255,255,255,.07)}
.nav .pill.active{
  border-color: rgba(34,211,238,.38);
  box-shadow:0 0 0 3px rgba(34,211,238,.08);
}
.nav .pill .dot{
  width:8px; height:8px; border-radius:999px;
  background: linear-gradient(135deg,#8B5CF6,#22D3EE,#34D399);
}
.seo-cards{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:12px;
}
.seocard{
  padding:14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background: rgba(0,0,0,.14);
}
.seocard h3{margin:0 0 6px; font-size:15px}
.seocard p{margin:0}

@media (max-width:900px){
  .seo-cards{grid-template-columns: 1fr;}
}

.seo{
  margin-top:24px;
  padding:18px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:22px;
  background: rgba(0,0,0,.20);
}

.adminhtml{
  margin-top:12px;
  padding:14px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background: rgba(0,0,0,.18);
}

.adminhtml{margin-top:14px}
.adminhtml:empty{display:none}

/* FIXED18: nicer rendering overlay + button layout + auth modal */
.rendering{background: rgba(0,0,0,.46) !important;}
.rendering .box{padding:18px 18px; border-radius:22px;background: rgba(10,12,18,.92); border:1px solid rgba(255,255,255,.12);box-shadow: 0 22px 60px rgba(0,0,0,.75), 0 0 0 1px rgba(255,255,255,.06) inset;backdrop-filter: blur(10px); display:grid; gap:8px; justify-items:center;}
.rendering .spinner{
  width:54px;height:54px;border-width:5px;
}

.actions{display:flex; gap:12px; justify-content:center; align-items:center; flex-wrap:wrap;padding:14px; margin-top:6px; border:1px solid rgba(255,255,255,.10); border-radius:18px;background: rgba(12,14,20,.94); backdrop-filter: blur(10px);}
.actions button{
  width:100%;
}
button.locked{
  opacity: .92;
  position:relative;
}
button.locked::after{
  content:"🔒";
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  opacity:.9;
}

.auth-card{
  max-width:520px;
}
.auth-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
@media (max-width:640px){
  .auth-grid{grid-template-columns:1fr;}
}

.backdrop{position:absolute; inset:0; background:rgba(0,0,0,.72); backdrop-filter: blur(10px);}

.locked::after{content:'🔒'; margin-left:8px; font-size:14px; opacity:.9;}

.premium-protect canvas{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}

/* FIXED22: reduce transparency further + auth modal depth */
#authModal .backdrop{background:rgba(0,0,0,.82) !important;}
.modal-head{background: rgba(12,14,20,.96) !important;}
.modal-card{background: rgba(10,12,18,.97) !important;}
.actions{background: rgba(12,14,20,.95) !important;}
.auth-card{background: rgba(10,12,18,.985) !important; box-shadow: 0 32px 90px rgba(0,0,0,.78), 0 0 0 1px rgba(255,255,255,.08) inset !important;}
.rendering .box{box-shadow: 0 40px 120px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.08) inset !important;}

/* --- Members/Premium modal theme fixes --- */
html[data-theme="light"] #authModal .backdrop{ background: rgba(11,18,32,.28) !important; }
html[data-theme="light"] #authModal .auth-card{
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 24px 80px rgba(11,18,32,.22) !important;
  border: 1px solid rgba(11,18,32,.12) !important;
}
html[data-theme="light"] #authModal .modal-head{
  background: rgba(255,255,255,.92) !important;
  border-bottom: 1px solid rgba(11,18,32,.10) !important;
}
html[data-theme="light"] #authModal .modal-title{ color: rgba(11,18,32,.95) !important; }
html[data-theme="light"] #authModal .muted{ color: rgba(11,18,32,.72) !important; }
html[data-theme="light"] #authModal .actions{
  background: rgba(255,255,255,.92) !important;
  border-top: 1px solid rgba(11,18,32,.10) !important;
}


/* Footer (menu + ad injection) */
.tlg-footer{
  width:100%;
  margin-top:24px;
  padding: 18px 10px;
  box-sizing:border-box;
}
.tlg-footer-inner{
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  background: rgba(10,12,18,.55);
  backdrop-filter: blur(14px);
}
html[data-theme="light"] .tlg-footer-inner{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
.tlg-footer-menu{
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  font-weight:700;
}
.tlg-footer-menu a{
  text-decoration:none;
  padding:6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}
html[data-theme="light"] .tlg-footer-menu a{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.65);
}
.tlg-footer-menu .sep{ opacity:.6; }
.tlg-footer-ads{
  margin-top: 12px;
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: 1px;
}
.tlg-footer-copy{
  margin-top: 10px;
  text-align:center;
  opacity:.75;
  font-size: 13px;
}


/* SEO copy blocks */
.hero-4k{
  max-width: 980px;
  margin: 12px auto 0 auto;
  text-align: center;
  line-height: 1.45;
  opacity: 0.95;
}

.seo-tip{
  display:block;
  margin-top: 6px;
  font-size: 0.95em;
  opacity: 0.9;
}

/* ============================
   LIGHT THEME (FULL) OVERRIDES
   ============================ */
html[data-theme="light"]{
  --bg:#f3f5fb;
  --card:#ffffff;
  --card2:#ffffff;
  --line:rgba(11,18,32,.12);
  --text:#0b1220;
  --muted:rgba(11,18,32,.72);
  --muted2:rgba(11,18,32,.58);
  --shadow: 0 20px 50px rgba(11,18,32,.12);
}

html[data-theme="light"] body{
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(1000px 600px at 80% 20%, rgba(34,211,238,.14), transparent 60%),
    var(--bg);
  color: var(--text);
}

/* Guarantee full-width layout with 20px side padding */
html[data-theme="light"] .container,
.container{
  max-width:none !important;
  width:100% !important;
  padding-left:20px !important;
  padding-right:20px !important;
}

html[data-theme="light"] .topbar{
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--line);
}

html[data-theme="light"] .navlink,
html[data-theme="light"] .nav .pill{
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  color: rgba(11,18,32,.90);
}
html[data-theme="light"] .navlink:hover,
html[data-theme="light"] .nav .pill:hover{ background: rgba(255,255,255,.92); }

/* Cards / panels */
html[data-theme="light"] .hero-card,
html[data-theme="light"] .side-card,
html[data-theme="light"] .admincard,
html[data-theme="light"] .seocard,
html[data-theme="light"] .seo,
html[data-theme="light"] .adminhtml{
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(11,18,32,.10);
}

html[data-theme="light"] .hero-seo,
html[data-theme="light"] .pack,
html[data-theme="light"] .notice{
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  color: rgba(11,18,32,.85);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .tiny,
html[data-theme="light"] .hero-bullets li,
html[data-theme="light"] .badge{ color: var(--muted) !important; }
html[data-theme="light"] .hero-bullets b{ color: var(--text) !important; }

/* Inputs */
html[data-theme="light"] input,
html[data-theme="light"] textarea{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  color: var(--text);
}

/* Buttons */
html[data-theme="light"] button{
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  color: var(--text);
}

/* Pack menu pills (logo menu) */
html[data-theme="light"] .packmenu .pill{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  color: rgba(11,18,32,.92);
}
html[data-theme="light"] .packmenu .pill.active{
  border-color: rgba(34,211,238,.55);
  box-shadow: 0 0 0 3px rgba(34,211,238,.12);
}

/* Cards */
html[data-theme="light"] .card{
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
}
html[data-theme="light"] .badge{
  background: rgba(11,18,32,.04);
  border: 1px solid rgba(11,18,32,.10);
}

/* Modal (editor) */
html[data-theme="light"] .modal-backdrop{ background: rgba(11,18,32,.30); }
html[data-theme="light"] .modal-card{
  background: rgba(255,255,255,.96) !important;
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px rgba(11,18,32,.22);
}
html[data-theme="light"] .modal-head{
  background: rgba(255,255,255,.92) !important;
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .modal-title{ color: rgba(11,18,32,.95) !important; }

html[data-theme="light"] .actions{
  background: rgba(255,255,255,.92) !important;
  border: 1px solid var(--line);
}

html[data-theme="light"] .previewWrap{
  border: 1px solid rgba(11,18,32,.12);
  background:
    linear-gradient(0deg, rgba(255,255,255,.55), rgba(255,255,255,.55)),
    repeating-conic-gradient(rgba(11,18,32,.08) 0 25%, rgba(11,18,32,.02) 0 50%) 50%/36px 36px;
}

/* Rendering overlay */
html[data-theme="light"] .rendering{ background: rgba(11,18,32,.25) !important; }
html[data-theme="light"] .rendering .box{
  background: rgba(255,255,255,.96) !important;
  border: 1px solid rgba(11,18,32,.12) !important;
  box-shadow: 0 30px 100px rgba(11,18,32,.18) !important;
}
html[data-theme="light"] .rendering .label{ color: rgba(11,18,32,.86) !important; }
html[data-theme="light"] .rendering .spinner{
  border-color: rgba(11,18,32,.18) !important;
  border-top-color: rgba(11,18,32,.75) !important;
}

/* Footer links */
html[data-theme="light"] .footer a{ color: rgba(11,18,32,.72); }
html[data-theme="light"] .footer a:hover{ color: rgba(11,18,32,.92); }
