@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Medium.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Bold.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/assets/fonts/Poppins-Black.ttf") format("truetype"); font-style: normal; font-weight: 900; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/assets/fonts/BarlowCondensed-ExtraBold.ttf") format("truetype"); font-style: normal; font-weight: 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #111114;
  --line: #27272a;
  --muted: #a1a1aa;
  --ink: #fafafa;
  --lime: #b8ff43;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  height: 76px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 max(24px, calc((100vw - 1500px) / 2));
  position: sticky; top: 0; background: rgba(9, 9, 11, .88); backdrop-filter: blur(16px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 19px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--lime); color: #101214; display: grid; place-items: center; font-weight: 900; transform: rotate(-5deg); }
.brand strong { font-weight: 850; }
.topbar-note { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
main { max-width: 1500px; margin: auto; padding: 0 24px; }

.hero { min-height: 350px; padding: 68px 28px 54px; display: flex; align-items: center; justify-content: space-between; gap: 60px; border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-flex; color: var(--lime); font-weight: 800; font-size: 12px; letter-spacing: .18em; margin-bottom: 20px; }
.hero h1 { font-family: "Barlow Condensed", sans-serif; font-size: clamp(62px, 7vw, 106px); font-weight: 800; text-transform: uppercase; line-height: .86; letter-spacing: -.025em; margin: 0; max-width: 850px; }
.hero h1 em { font-style: normal; color: transparent; -webkit-text-stroke: 1px #71717a; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.65; max-width: 690px; margin: 28px 0 0; }
.hero-badge { width: 210px; height: 210px; border: 1px solid #3f3f46; border-radius: 50%; display: grid; grid-template-columns: 1fr auto 1fr; place-items: center; padding: 40px 24px 54px; position: relative; transform: rotate(6deg); background: radial-gradient(circle, #1d1d22, transparent 68%); font-size: 28px; font-weight: 900; }
.hero-badge b { color: var(--lime); }
.hero-badge small { position: absolute; bottom: 45px; font-size: 9px; letter-spacing: .18em; color: var(--muted); }

.studio-shell { display: grid; grid-template-columns: 340px minmax(360px, 1fr) minmax(330px, 440px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 860px; }
.editor-panel, .content-panel, .preview-panel { padding: 34px; }
.editor-panel, .content-panel { border-right: 1px solid var(--line); }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.section-heading.compact { margin-top: 36px; }
.step { display: inline-grid; place-items: center; min-width: 34px; height: 24px; border: 1px solid #3f3f46; border-radius: 99px; color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.section-heading h2, .content-top h2, .preview-head h2 { font-family: "Poppins", sans-serif; font-weight: 700; }
.section-heading h2, .content-top h2 { font-size: 16px; margin: 0 0 4px; }
.section-heading p { font-size: 12px; color: var(--muted); margin: 0; }

.type-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #09090b; border: 1px solid var(--line); padding: 4px; border-radius: 13px; }
.type-switch button { border: 0; background: transparent; color: #a1a1aa; padding: 11px 4px; border-radius: 9px; font-size: 11px; font-weight: 750; cursor: pointer; }
.type-switch button.active { background: #27272a; color: #fff; box-shadow: 0 1px 5px #000; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { border: 1px solid var(--line); border-radius: 13px; background: #0c0c0f; color: var(--ink); padding: 11px; cursor: pointer; text-align: left; transition: .18s ease; }
.theme-card:hover { border-color: #52525b; transform: translateY(-1px); }
.theme-card.active { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.theme-preview { height: 55px; border-radius: 8px; margin-bottom: 9px; position: relative; overflow: hidden; }
.theme-preview::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 15px; border-radius: 4px; background: rgba(255, 255, 255, .8); box-shadow: 0 -21px 0 -3px rgba(255, 255, 255, .45); }
.theme-card strong { font-size: 12px; display: block; }
.theme-card small { font-size: 10px; color: var(--muted); }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.color-grid label { height: 47px; border: 1px solid var(--line); border-radius: 11px; padding: 7px 8px 7px 12px; display: flex; align-items: center; justify-content: space-between; color: #d4d4d8; font-size: 11px; }
.color-grid input { width: 30px; height: 30px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.color-grid input::-webkit-color-swatch { border: 0; border-radius: 8px; }
.format-field { display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #111114; }
.format-field > span { color: #d4d4d8; font-size: 10px; }
.format-field select { width: 100%; min-height: 43px; border: 1px solid #3f3f46; border-radius: 10px; padding: 0 12px; background: #09090b; color: var(--ink); font: inherit; font-size: 12px; outline: none; cursor: pointer; }
.format-field select:focus { border-color: var(--lime); }
.format-field small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.whatsapp-field span { font-size: 11px; color: #d4d4d8; display: block; margin: 0 0 8px; }
.whatsapp-field input, .search-field input { width: 100%; border: 1px solid var(--line); background: #0c0c0f; color: var(--ink); outline: none; }
.whatsapp-field input { height: 48px; border-radius: 11px; padding: 0 14px; }
.whatsapp-field input:focus, .search-field input:focus { border-color: #71717a; }

.content-panel { min-width: 0; }
.content-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.content-top > div { display: flex; align-items: center; gap: 12px; }
.selection-count { color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; }
.search-field { height: 48px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 0 13px; margin-bottom: 16px; background: #0c0c0f; color: var(--muted); }
.search-field input { height: 44px; border: 0; padding: 0; background: transparent; }
.content-list { display: flex; flex-direction: column; gap: 8px; max-height: 700px; overflow: auto; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; }
.content-card { display: flex; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #0d0d10; cursor: pointer; transition: .15s; }
.content-card:hover { border-color: #52525b; }
.content-card.selected { border-color: var(--lime); background: #151811; }
.content-card input { position: absolute; opacity: 0; pointer-events: none; }
.check { width: 21px; height: 21px; border-radius: 7px; border: 1px solid #52525b; display: grid; place-items: center; flex: 0 0 auto; font-size: 12px; }
.selected .check { background: var(--lime); border-color: var(--lime); color: #111; }
.game-time { font-weight: 900; font-size: 16px; width: 48px; }
.content-info { min-width: 0; flex: 1; }
.content-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-info small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-thumb { width: 42px; height: 58px; object-fit: cover; border-radius: 6px; background: #27272a; }
.promo-symbol { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #22252a; color: var(--lime); font-size: 22px; font-weight: 900; flex: 0 0 auto; }
.promo-editor { margin-top: 12px; padding: 17px; border: 1px solid #3f3f46; border-radius: 15px; background: #111114; display: grid; gap: 12px; }
.promo-editor-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
.promo-editor-title strong { font-size: 13px; }
.promo-editor-title small { font-size: 10px; color: var(--muted); }
.tmdb-trending { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 11px; background: #09090b; border: 1px solid var(--line); }
.tmdb-trending > div { min-width: 0; }
.tmdb-trending strong { display: block; color: var(--lime); font-size: 9px; letter-spacing: .08em; }
.tmdb-trending small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; line-height: 1.35; }
.tmdb-trending > span { display: flex; flex: 0 0 auto; }
.tmdb-trending img { width: 28px; height: 39px; object-fit: cover; border-radius: 4px; margin-left: -6px; border: 2px solid #09090b; background: #27272a; }
.promo-editor label span { display: block; font-size: 10px; color: #d4d4d8; margin-bottom: 6px; }
.promo-editor input, .promo-editor textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #09090b; color: var(--ink); padding: 11px 12px; outline: none; resize: vertical; }
.promo-editor input:focus, .promo-editor textarea:focus { border-color: var(--lime); }
.empty-list, .loading-state { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.loading-state span { display: inline-block; width: 12px; height: 12px; border: 2px solid #52525b; border-top-color: var(--lime); border-radius: 50%; animation: spin .7s linear infinite; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview-panel { background: #0c0c0f; position: relative; }
.preview-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.preview-head span { font-size: 9px; letter-spacing: .15em; color: var(--lime); font-weight: 800; }
.preview-head h2 { font-size: 15px; margin: 5px 0 0; }
.preview-head .ratio { border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; color: var(--muted); }
.preview-box { aspect-ratio: 4 / 5; max-height: 690px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #18181b, #09090b); overflow: hidden; display: grid; place-items: center; position: relative; margin-inline: auto; }
.preview-empty { display: flex; flex-direction: column; text-align: center; align-items: center; color: var(--muted); padding: 30px; }
.preview-empty strong { color: #d4d4d8; font-size: 14px; margin: 13px 0 6px; }
.preview-empty small { font-size: 11px; }
.preview-icon { font-size: 34px; color: var(--lime); }
#previewImage { width: 100%; height: 100%; object-fit: contain; display: none; }
.preview-box.has-image #previewImage { display: block; }
.preview-box.has-image .preview-empty { display: none; }
.generate-button, .download-button { width: 100%; min-height: 52px; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-weight: 900; margin-top: 15px; }
.generate-button { border: 0; background: var(--lime); color: #111; cursor: pointer; }
.generate-button:hover { filter: brightness(1.06); }
.generate-button:disabled { cursor: wait; opacity: .65; }
.generate-button b { font-size: 22px; }
.download-button { border: 1px solid #3f3f46; color: #fff; text-decoration: none; justify-content: center; display: none; }
.download-button.visible { display: flex; }
.status { min-height: 18px; font-size: 11px; color: var(--muted); margin: 10px 0 -5px; }
.status.error { color: #fb7185; }
.status.success { color: var(--lime); }
.privacy-note { font-size: 9px; line-height: 1.5; color: #71717a; text-align: center; margin: 13px 16px 0; }

footer { height: 120px; max-width: 1500px; margin: auto; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 52px; color: var(--muted); font-size: 12px; }
footer span { color: #fff; font-weight: 800; }
footer p { margin: 0; }

@media (max-width: 1180px) {
  .studio-shell { grid-template-columns: 340px 1fr; }
  .preview-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 28px; }
  .preview-head, .preview-box { grid-column: 1; }
  .generate-button, .download-button, .status, .privacy-note { grid-column: 2; }
  .generate-button { align-self: end; }
  .preview-panel .status { margin-top: 90px; }
  .hero-badge { display: none; }
}

@media (max-width: 780px) {
  main { padding: 0 14px; }
  .topbar { height: 64px; padding: 0 18px; }
  .topbar-note { display: none; }
  .hero { min-height: 0; padding: 48px 8px 42px; }
  .hero h1 { font-size: 52px; }
  .hero p { font-size: 15px; }
  .studio-shell { display: block; border: 0; }
  .editor-panel, .content-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 12px; }
  .preview-panel { display: block; padding: 28px 12px; }
  .preview-panel .status { margin-top: 10px; }
  .content-list { max-height: none; }
  .preview-box { max-width: 430px; margin: auto; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  footer { height: 100px; padding: 0 22px; }
  footer p { display: none; }
}

@media (max-width: 470px) {
  .hero h1 { font-size: 44px; }
  .type-switch { grid-template-columns: 1fr 1fr; }
  .type-switch button { font-size: 11px; }
  .color-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .content-card { padding: 11px; }
  .game-time { font-size: 14px; width: 40px; }
}
