/* ==========================================================================
   VÒNG QUAY MAY MẮN - Styles
   ========================================================================== */

/* Google Fonts - Loaded via HTML <link> */
:root {
  --bg-gradient: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  --panel-bg: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.14);
  --panel-blur: 14px;
  --accent: #ffd84d;
  --accent-2: #ff5ca8;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-muted: rgba(255, 255, 255, 0.45);
  --success: #4ade80;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.25s ease;
  --app-font: "Be Vietnam Pro", "Baloo 2", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100vh;
  font-family: var(--app-font);
  color: var(--text);
  background: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { position: relative; }

/* Custom cursor state */
body.custom-cursor, body.custom-cursor * { cursor: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* ===== Light BG override (dark text scheme for bright backgrounds) ===== */
body.light-bg {
  --text: #1a1a2e;
  --text-dim: rgba(26, 26, 46, 0.78);
  --text-muted: rgba(26, 26, 46, 0.55);
  --panel-bg: rgba(255, 255, 255, 0.55);
  --panel-border: rgba(0, 0, 0, 0.1);
  color: #1a1a2e;
}
body.light-bg .site-header .logo { color: #1a1a2e; }
body.light-bg nav.main-nav a { color: rgba(26, 26, 46, 0.72); }
body.light-bg nav.main-nav a:hover { color: #1a1a2e; background: rgba(0,0,0,0.06); }
body.light-bg nav.main-nav a.active { color: #c2185b; background: rgba(255,255,255,0.5); }
body.light-bg .icon-btn {
  background: rgba(255,255,255,0.55);
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.1);
}
body.light-bg .icon-btn:hover { background: rgba(255,255,255,0.8); }
body.light-bg .kbd-hint { color: rgba(26, 26, 46, 0.65); }
body.light-bg .kbd-hint kbd {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
  color: #1a1a2e;
}
body.light-bg .tabs-nav {
  background: rgba(255,255,255,0.5);
  border-bottom-color: rgba(0,0,0,0.08);
}
body.light-bg .tab-btn { color: rgba(26,26,46,0.7); }
body.light-bg .tab-btn:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }
body.light-bg .tab-btn.active { color: #c2185b; }
body.light-bg .tab-btn.active::after { background: #c2185b; }
body.light-bg .section-title { color: #1a1a2e; }
body.light-bg .section-title .count {
  background: rgba(0,0,0,0.08);
  color: rgba(26,26,46,0.7);
}
body.light-bg .input,
body.light-bg .textarea,
body.light-bg select {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.12);
  color: #1a1a2e;
}
body.light-bg .input:focus,
body.light-bg .textarea:focus,
body.light-bg select:focus { border-color: #c2185b; }
body.light-bg .btn {
  background: rgba(255,255,255,0.7);
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.12);
}
body.light-bg .btn:hover { background: rgba(255,255,255,0.9); }
body.light-bg .btn.primary { color: #fff; }
body.light-bg .btn.danger { background: rgba(239,68,68,0.15); color: #b91c1c; border-color: rgba(239,68,68,0.4); }
body.light-bg .preset-item {
  background: rgba(255,255,255,0.5);
  color: #1a1a2e;
}
body.light-bg .preset-item:hover { background: rgba(255,255,255,0.8); }
body.light-bg .preset-item.active {
  border-color: #c2185b;
  background: rgba(255,192,203,0.5);
}
body.light-bg .font-item {
  background: rgba(255,255,255,0.5);
  color: #1a1a2e;
}
body.light-bg .font-item:hover { background: rgba(255,255,255,0.8); }
body.light-bg .font-item.active { border-color: #c2185b; background: rgba(255,192,203,0.5); }
body.light-bg .font-item .preview { color: rgba(26,26,46,0.6); }
body.light-bg .toggle-row { color: #1a1a2e; }
body.light-bg .toggle-row + .toggle-row { border-top-color: rgba(0,0,0,0.08); }
body.light-bg .switch { background: rgba(0,0,0,0.18); }
body.light-bg .switch.on { background: #22c55e; }
body.light-bg .slider-row label { color: rgba(26,26,46,0.7); }
body.light-bg .slider-row label span { color: #c2185b; }
body.light-bg input[type="range"] { background: rgba(0,0,0,0.15); }
body.light-bg input[type="range"]::-webkit-slider-thumb { background: #c2185b; }
body.light-bg input[type="range"]::-moz-range-thumb { background: #c2185b; }
body.light-bg .item-row {
  background: rgba(255,255,255,0.55);
  color: #1a1a2e;
}
body.light-bg .item-row:hover { background: rgba(255,255,255,0.85); }
body.light-bg .item-row .drag-handle { color: rgba(26,26,46,0.5); }
body.light-bg .history-empty { color: rgba(26,26,46,0.55); }
body.light-bg .history-item {
  background: rgba(255,255,255,0.55);
  color: #1a1a2e;
}
body.light-bg .history-item .idx { color: #c2185b; }
body.light-bg .history-item .ts { color: rgba(26,26,46,0.55); }
body.light-bg .color-picker-row { color: rgba(26,26,46,0.8); }
body.light-bg .seo-section {
  background: rgba(255,255,255,0.6);
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.08);
}
body.light-bg .seo-section h1,
body.light-bg .seo-section h2,
body.light-bg .seo-section h3,
body.light-bg .seo-section strong { color: #1a1a2e; }
body.light-bg .seo-section h2 { border-left-color: #c2185b; }
body.light-bg .seo-section .faq-item { background: rgba(255,255,255,0.6); }
body.light-bg .template-card {
  background: rgba(255,255,255,0.7);
  color: #1a1a2e;
  border-color: rgba(0,0,0,0.1);
}
body.light-bg .template-card:hover {
  background: rgba(255,255,255,0.95);
  border-color: #c2185b;
}
body.light-bg .template-card p { color: rgba(26,26,46,0.7); }
body.light-bg .site-footer {
  background: rgba(255,255,255,0.5);
  color: rgba(26,26,46,0.75);
  border-top-color: rgba(0,0,0,0.08);
}
body.light-bg .site-footer a { color: rgba(26,26,46,0.8); }
body.light-bg .site-footer a:hover { color: #c2185b; }
body.light-bg .tpl-header p { color: rgba(26,26,46,0.75); }
body.light-bg a { color: #c2185b; }

/* ===== Top Gradient Bar ===== */
.top-gradient-bar {
  height: 5px;
  background: linear-gradient(90deg, #ff6ec4, #7873f5, #4ade80, #facc15, #ff6ec4);
  background-size: 200% 100%;
  animation: gradient-slide 6s linear infinite;
}
body.no-gradient-bar .top-gradient-bar { display: none; }
@keyframes gradient-slide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ===== Header / Nav ===== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  position: relative;
  z-index: 5;
  flex-wrap: wrap;
  gap: 10px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px;
  color: var(--text);
}
.logo-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: conic-gradient(#ff4d6d, #ffd84d, #4ade80, #60a5fa, #c084fc, #ff4d6d);
  box-shadow: 0 0 18px rgba(255,216,77,0.5);
  position: relative;
}
.logo-icon::after {
  content: ""; position: absolute; inset: 30%;
  background: #fff; border-radius: 50%;
}
nav.main-nav { display: flex; gap: 16px; flex-wrap: wrap; }
nav.main-nav a {
  color: var(--text-dim); font-weight: 500; font-size: 14px;
  padding: 6px 10px; border-radius: 8px;
  transition: var(--transition);
}
nav.main-nav a:hover { color: var(--text); background: rgba(255,255,255,0.08); text-decoration: none; }
nav.main-nav a.active { color: var(--accent); background: rgba(255,255,255,0.06); }

.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition);
  font-size: 15px;
  border: 1px solid rgba(255,255,255,0.1);
}
.icon-btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }

/* ===== Keyboard hint ===== */
.kbd-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 auto 10px;
  padding: 6px 14px;
  display: inline-block;
}
.kbd-hint kbd {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  margin: 0 2px;
}
.kbd-hint-wrap { text-align: center; }

/* ===== Main Layout ===== */
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  padding: 8px 28px 40px;
  max-width: 1500px;
  margin: 0 auto;
}

.wheel-col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  min-height: 560px;
}

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1 / 1;
  margin: 20px auto;
  display: flex; align-items: center; justify-content: center;
}

#wheelCanvas {
  width: 100%; height: 100%;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.55));
}
body.no-wheel-shadow #wheelCanvas { filter: none; }

/* Pointer */
.pointer {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 78px;
  z-index: 3;
  pointer-events: none;
  transition: transform 0.08s ease;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}
.pointer.tick { animation: pointer-tick 0.09s ease; }
@keyframes pointer-tick {
  0% { transform: translateX(-50%) rotate(0deg); }
  50% { transform: translateX(-50%) rotate(-8deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

/* Center Spin Button */
.spin-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 22%; height: 22%;
  min-width: 80px; min-height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe58a, #ffb300 60%, #c77700);
  color: #3a1f00;
  font-weight: 900; font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: 0.05em;
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.9),
    0 0 0 8px rgba(0,0,0,0.35),
    0 10px 22px rgba(0,0,0,0.45),
    inset 0 -6px 10px rgba(0,0,0,0.18),
    inset 0 6px 10px rgba(255,255,255,0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  z-index: 4;
  user-select: none;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.spin-btn:hover { transform: translate(-50%, -50%) scale(1.06); }
.spin-btn:active { transform: translate(-50%, -50%) scale(0.96); }
.spin-btn.disabled { opacity: 0.7; cursor: not-allowed; }

/* ===== Side Panel ===== */
.side-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
  position: sticky;
  top: 16px;
}

.tabs-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--panel-border);
}
.tab-btn {
  padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-dim);
  font-size: 12px; font-weight: 600;
  position: relative;
  transition: var(--transition);
}
.tab-btn i { font-size: 16px; }
.tab-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after {
  content: ""; position: absolute; bottom: 0; left: 10%; right: 10%; height: 3px;
  background: var(--accent); border-radius: 3px 3px 0 0;
}

.tab-panel {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  display: none;
}
.tab-panel.active { display: block; }
.tab-panel::-webkit-scrollbar { width: 8px; }
.tab-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 8px; }

/* Section heading inside panel */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 10px;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.02em;
}
.section-title:first-child { margin-top: 4px; }
.section-title .count {
  margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 500;
  background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 10px;
}

/* Form inputs */
.input, .textarea, select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, .textarea:focus, select:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 160px; line-height: 1.5; font-family: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.14);
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #ff5ca8, #c040ff); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.4); color: #fecaca; }
.btn.danger:hover { background: rgba(239,68,68,0.3); }
.btn.small { padding: 6px 10px; font-size: 12px; }

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

/* Preset Grid (color/background/effect options) */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.preset-item {
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 62px;
  justify-content: center;
  user-select: none;
}
.preset-item:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.preset-item.active { border-color: var(--accent); background: rgba(255,216,77,0.14); }

.color-dots { display: flex; gap: 2px; }
.color-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.bg-preview {
  width: 100%; height: 26px; border-radius: 6px;
  background: rgba(255,255,255,0.1);
}

.preset-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.preset-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Font list */
.font-list {
  display: grid; grid-template-columns: 1fr; gap: 6px;
  max-height: 260px; overflow-y: auto;
  padding-right: 4px;
}
.font-item {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-size: 14px;
  transition: var(--transition);
}
.font-item:hover { background: rgba(255,255,255,0.1); }
.font-item.active { border-color: var(--accent); background: rgba(255,216,77,0.12); }
.font-item .preview { color: var(--text-dim); font-size: 14px; }

/* Toggle Switch */
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px;
  font-size: 13px;
  color: var(--text);
}
.toggle-row + .toggle-row { border-top: 1px solid rgba(255,255,255,0.06); }
.switch {
  position: relative;
  width: 40px; height: 22px;
  background: rgba(255,255,255,0.18);
  border-radius: 22px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch.on { background: #4ade80; }
.switch.on::after { left: 20px; }

/* Slider */
.slider-row {
  margin: 10px 0;
}
.slider-row label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim); margin-bottom: 6px;
}
.slider-row label span { color: var(--accent); font-weight: 600; }
input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; background: rgba(255,255,255,0.18); border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent);
  cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
}

/* Color picker */
.color-picker-row {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0;
  font-size: 13px; color: var(--text-dim);
}
input[type="color"] {
  width: 40px; height: 30px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; padding: 0;
}
input[type="color"]::-webkit-color-swatch { border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 6px; }

/* Item list */
.item-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.item-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 13px;
  transition: var(--transition);
}
.item-row:hover { background: rgba(255,255,255,0.1); }
.item-row .drag-handle {
  cursor: grab; color: var(--text-muted); padding: 2px;
}
.item-row .item-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row .remove-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(239,68,68,0.2); color: #fecaca;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.item-row .remove-btn:hover { background: rgba(239,68,68,0.5); }
.item-row.dragging { opacity: 0.4; }

/* History */
.history-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 14px;
}
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 13px;
}
.history-item .idx { color: var(--accent); font-weight: 700; margin-right: 8px; }
.history-item .ts { font-size: 11px; color: var(--text-muted); }

/* ===== Result Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 0.25s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: linear-gradient(135deg, #4a148c, #7b1fa2);
  border-radius: 20px;
  padding: 40px 36px;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  animation: scale-in 0.45s cubic-bezier(0.3, 1.4, 0.4, 1);
  position: relative;
  border: 1px solid rgba(255,255,255,0.2);
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
.modal-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.modal-sub { font-size: 14px; color: var(--text-dim); margin-bottom: 18px; }
.modal-result {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
  background: linear-gradient(90deg, #ffd84d, #ff5ca8, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 18px 10px;
  word-wrap: break-word;
  line-height: 1.2;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 18px;
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: white;
  font-size: 18px;
}
.modal-close:hover { background: rgba(0,0,0,0.5); }

/* ===== Overlay Canvases for effects ===== */
#bgEffectCanvas, #confettiCanvas, #cursorTrailCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
#confettiCanvas { z-index: 1100; }
#cursorTrailCanvas { z-index: 1200; }

/* Ensure main app content is above background effects */
.site-header, .app-layout, .seo-section, .site-footer, .top-gradient-bar, .kbd-hint-wrap {
  position: relative;
  z-index: 2;
}

#customCursor {
  position: fixed;
  pointer-events: none;
  z-index: 1300;
  width: 32px; height: 32px;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  display: none;
  color: var(--accent);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.15);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== SEO Content ===== */
.seo-section {
  max-width: 960px;
  margin: 40px auto;
  padding: 30px 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  line-height: 1.75;
  color: var(--text-dim);
  font-size: 15px;
}
.seo-section h1 { font-size: 28px; margin: 0 0 20px; color: var(--text); }
.seo-section h2 {
  font-size: 22px; margin: 28px 0 12px; color: var(--text);
  border-left: 4px solid var(--accent); padding-left: 12px;
}
.seo-section h3 { font-size: 17px; margin: 18px 0 8px; color: var(--text); }
.seo-section p { margin: 0 0 14px; }
.seo-section ul, .seo-section ol { margin: 0 0 14px; padding-left: 26px; }
.seo-section li { margin-bottom: 6px; }
.seo-section strong { color: var(--text); }
.seo-section .faq-item { margin-bottom: 14px; padding: 12px 16px; background: rgba(255,255,255,0.04); border-radius: 10px; }
.seo-section .faq-item p:last-child { margin: 0; }

.templates-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-top: 14px;
}
.template-card {
  display: block;
  padding: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: var(--text);
  transition: var(--transition);
  text-decoration: none !important;
}
.template-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-3px); border-color: var(--accent); }
.template-card h4 { margin: 0 0 6px; font-size: 16px; }
.template-card p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ===== Footer ===== */
.site-footer {
  padding: 30px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
  margin-top: 40px;
}
.site-footer .footer-links {
  display: flex; gap: 16px; justify-content: center; margin-bottom: 12px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ===== Fullscreen ===== */
:fullscreen .site-header,
:fullscreen .side-panel,
:fullscreen .seo-section,
:fullscreen .site-footer,
:fullscreen .top-gradient-bar,
:fullscreen .kbd-hint-wrap { display: none !important; }
:fullscreen .app-layout { grid-template-columns: 1fr; padding: 0; }
:fullscreen .wheel-wrap { max-width: 92vmin; }

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .app-layout { grid-template-columns: 1fr; padding: 8px 16px 40px; }
  .side-panel {
    max-height: none;
    position: static;
  }
  .wheel-wrap { max-width: 520px; }
}
@media (max-width: 640px) {
  .site-header { padding: 10px 14px; }
  nav.main-nav { display: none; }
  .logo { font-size: 17px; }
  .wheel-wrap { max-width: 100%; margin: 10px auto; }
  .tab-panel { padding: 14px; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .seo-section { padding: 20px 16px; font-size: 14px; }
  .seo-section h1 { font-size: 22px; }
  .seo-section h2 { font-size: 18px; }
}

/* Utility */
.hide { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .input { flex: 1; }
.grow { flex: 1; }
.text-small { font-size: 12px; color: var(--text-muted); }
.mb-6 { margin-bottom: 6px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; }

/* Templates header */
.tpl-header {
  text-align: center; padding: 20px 20px 0;
}
.tpl-header h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin: 10px 0 6px;
  background: linear-gradient(90deg, #ffd84d, #ff5ca8, #60a5fa);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.tpl-header p { color: var(--text-dim); margin: 0 0 14px; font-size: 15px; }
