:root {
  --bg: #f3f4f8;
  --panel: #ffffffd9;
  --panel-solid: #ffffff;
  --text: #101827;
  --muted: #5f6b7d;
  --primary: #9f1239;
  --primary-2: #ef4444;
  --primary-soft: #fee2e2;
  --border: #e3e8f2;
  --danger: #b91c1c;
  --radius: 16px;
  --shadow: 0 14px 35px rgba(16, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, #ffe5e8 0%, transparent 36%),
    radial-gradient(circle at 100% 18%, #ffe7dc 0%, transparent 30%),
    radial-gradient(circle at 78% 100%, #efe4ff 0%, transparent 28%),
    linear-gradient(135deg, #f4f6fb 0%, #f8f2f4 100%);
}

.hero {
  width: min(1180px, 92vw);
  margin: 22px auto 0;
  padding: 24px 26px;
  border: 1px solid #ffffffaa;
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(135deg, #ffffffd9, #ffffffaa),
    linear-gradient(120deg, #fce7f3, #f0f9ff);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.hero p {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
}

.layout {
  width: min(1180px, 92vw);
  margin: 16px auto 36px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.25);
  overflow-x: auto;
}

.tab {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.35);
  color: rgba(226, 232, 240, 0.92);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tab.is-active {
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.12) inset;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.advanced {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.18);
}

.advanced > summary {
  cursor: pointer;
  color: rgba(226, 232, 240, 0.92);
  font-weight: 700;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-note {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.18);
  color: rgba(226, 232, 240, 0.9);
}

.card-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.card-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.linklike {
  border: none;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  cursor: pointer;
  padding: 6px 8px;
}

.linklike:hover {
  color: rgba(226, 232, 240, 0.95);
}

.platform-body[hidden] {
  display: none !important;
}

button.danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.25);
}

button.danger:hover {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.35);
}

.preview-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 2px 12px;
  scroll-snap-type: x mandatory;
}

.preview-item {
  scroll-snap-align: start;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 8px;
  background: rgba(2, 6, 23, 0.25);
  cursor: pointer;
  min-width: 160px;
}

.preview-item.is-active {
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.12) inset;
}

.preview-shot {
  width: 160px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}

.preview-shot canvas {
  width: 160px;
  height: 200px;
  display: block;
}

.preview-item small {
  display: block;
  margin-top: 8px;
  color: rgba(226, 232, 240, 0.85);
  font-size: 12px;
  text-align: center;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel.full {
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  .tabs {
    position: sticky;
    top: 10px;
    z-index: 5;
    backdrop-filter: blur(10px);
  }
}

h2 {
  margin: 0 0 12px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.platform-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--panel-solid);
  box-shadow: inset 0 1px 0 #fff;
}

.platform-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d7deea;
  background: #ffffff;
  border-radius: 11px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8a96a8;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #f87171;
  box-shadow: 0 0 0 4px #fee2e2;
  background: #fffdfd;
}

textarea {
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

button {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 16px rgba(159, 18, 57, 0.22);
}

button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mt-8 {
  margin-top: 8px;
}

.status {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
}

.carousel-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.35);
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.carousel-header h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.slides-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
}

.slide-tab {
  display: grid;
  grid-template-columns: 56px;
  gap: 6px;
  scroll-snap-align: start;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 8px;
  background: rgba(2, 6, 23, 0.3);
  cursor: pointer;
  user-select: none;
  min-width: 72px;
}

.slide-tab.is-active {
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.12) inset;
}

.slide-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
  display: grid;
  place-items: center;
  color: rgba(226, 232, 240, 0.75);
  font-size: 12px;
}

.slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-tab small {
  color: rgba(226, 232, 240, 0.85);
  font-size: 12px;
  text-align: center;
}

.slide-editor {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.25);
}

.slide-editor .grid-2 {
  margin-top: 10px;
}

.slide-editor textarea {
  resize: vertical;
}

.limit-box {
  border: 1px dashed #fca5a5;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0 12px;
  background: linear-gradient(135deg, #fff7f7, #fff);
}

.limit-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #7f1d1d;
}

.limit-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

#xCounter {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
}

#xCounter.over {
  color: var(--danger);
  font-weight: 800;
}

#previewCanvas {
  width: min(390px, 100%);
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: block;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.2);
}

.hint {
  color: var(--muted);
  margin-top: 12px;
  font-size: 14px;
}

@media (max-width: 920px) {
  .hero {
    padding: 18px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel.full {
    grid-column: auto;
  }
}
