:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg2: #0b0e14;
  --panel: rgba(255, 255, 255, 0.055);
  --panel2: rgba(255, 255, 255, 0.085);
  --line: rgba(255, 255, 255, 0.105);
  --line2: rgba(255, 255, 255, 0.17);
  --text: #f4f7fb;
  --muted: #9ca8b8;
  --soft: #667184;
  --blue: #72b8ff;
  --violet: #ad8cff;
  --green: #65e1b9;
  --amber: #ffc76d;
  --red: #ff7474;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
  --tile: clamp(86px, 12vw, 138px);
  --gap: clamp(6px, 1.1vw, 14px);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: Consolas, Menlo, Monaco, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 18% -10%, rgba(114, 184, 255, 0.18), transparent 34rem), radial-gradient(circle at 86% 0%, rgba(173, 140, 255, 0.14), transparent 34rem), linear-gradient(145deg, #05070a, #0a0d12 48%, #05070a); }
button, input, textarea, select { font: inherit; }
button { border: 0; color: inherit; cursor: pointer; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, 0.055); color: var(--text); outline: 0; transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
input, select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 210px; padding: 13px; resize: vertical; line-height: 1.48; }
select { background-color: #111722; }
option { background: #101522; color: var(--text); }
input:focus, textarea:focus, select:focus, button:focus-visible { border-color: rgba(114, 184, 255, 0.7); box-shadow: 0 0 0 3px rgba(114, 184, 255, 0.2); }
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }
.minimal-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.top-line { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; gap: 12px; align-items: center; padding: 14px clamp(10px, 2vw, 24px); border-bottom: 1px solid var(--line); background: rgba(7, 9, 13, 0.78); backdrop-filter: blur(22px) saturate(140%); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; font-weight: 850; letter-spacing: -0.06em; box-shadow: 0 14px 34px rgba(114, 184, 255, 0.18); }
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-size: 1.02rem; letter-spacing: -0.04em; }
.brand-text small { color: var(--soft); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.search { position: relative; min-width: 0; }
.search svg { position: absolute; top: 50%; left: 12px; color: var(--soft); transform: translateY(-50%); }
.search input { min-height: 44px; padding-left: 40px; border-radius: 999px; }
.top-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.plain-button, .primary-button, .danger-button, .round-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.055); color: var(--text); font-weight: 720; letter-spacing: -0.02em; transition: transform 140ms ease, background 140ms ease, border-color 140ms ease; }
.primary-button { border-color: rgba(114, 184, 255, 0.45); background: linear-gradient(135deg, rgba(114, 184, 255, 0.92), rgba(173, 140, 255, 0.86)); color: #fff; }
.danger-button { border-color: rgba(255, 116, 116, 0.32); background: rgba(255, 116, 116, 0.09); color: #ffd2d2; }
.round-button, .icon-only { width: 40px; padding: 0; border-radius: 999px; }
.plain-button:hover, .primary-button:hover, .danger-button:hover, .round-button:hover { transform: translateY(-1px); border-color: var(--line2); background: rgba(255, 255, 255, 0.09); }
.primary-button:hover { background: linear-gradient(135deg, #8bc7ff, #bda3ff); }
.deck-stage { display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 18px); width: min(1760px, 100%); margin: 0 auto; padding: clamp(10px, 2vw, 24px); }
.deck-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 0.74rem; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0; font-size: clamp(1.42rem, 3.1vw, 3.15rem); line-height: 0.98; letter-spacing: -0.065em; }
.stats { display: flex; gap: 8px; align-items: center; }
.stats span { min-width: 86px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.stats strong { display: block; font-size: 1.2rem; letter-spacing: -0.04em; }
.stats small { color: var(--soft); font-size: 0.7rem; font-weight: 780; letter-spacing: 0.08em; text-transform: uppercase; }
.filter-strip { min-width: 0; overflow: hidden; }
.filter-rail { display: flex; gap: 8px; min-width: 0; padding-bottom: 2px; overflow-x: auto; scrollbar-width: thin; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 760; font-size: 0.88rem; }
.filter-chip strong { color: var(--soft); font-size: 0.72rem; }
.filter-chip.is-active { border-color: rgba(114, 184, 255, 0.45); background: rgba(114, 184, 255, 0.12); color: var(--text); }
.deck-wrap { position: relative; min-height: 340px; }
.deck-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; min-height: var(--tile); padding: clamp(8px, 1.1vw, 14px); border: 1px solid var(--line); border-radius: clamp(14px, 2vw, 22px); background: linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.038)); box-shadow: 0 16px 50px rgba(0,0,0,0.18); overflow: hidden; transition: transform 170ms ease, border-color 170ms ease, background 170ms ease; }
.tile::before { position: absolute; inset: 0 0 auto; height: 3px; background: var(--blue); content: ""; opacity: 0.85; }
.tile[data-accent="violet"]::before { background: var(--violet); }
.tile[data-accent="emerald"]::before { background: var(--green); }
.tile[data-accent="cyan"]::before { background: #5bd8ff; }
.tile[data-accent="amber"]::before { background: var(--amber); }
.tile[data-accent="red"]::before { background: var(--red); }
.tile:hover, .tile.is-selected { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); background: linear-gradient(145deg, rgba(255,255,255,0.105), rgba(255,255,255,0.048)); }
.tile-title { display: -webkit-box; margin: 0; overflow: hidden; color: var(--text); font-size: clamp(0.72rem, 1.35vw, 1.02rem); font-weight: 810; line-height: 1.12; letter-spacing: -0.04em; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.mini-badge, .soft-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,0.075); color: var(--muted); font-size: clamp(0.54rem, 1.05vw, 0.72rem); font-weight: 780; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-badge.is-hot { color: #ffe1aa; background: rgba(255,199,109,0.12); }
.mini-badge.is-purple { color: #dccfff; background: rgba(173,140,255,0.13); }
.empty-card { display: grid; place-items: center; gap: 10px; min-height: 300px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-align: center; color: var(--muted); }
.empty-card strong { color: var(--text); font-size: 1.1rem; }
.detail-panel { position: fixed; inset: 74px 16px 16px auto; z-index: 50; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.detail-panel[hidden] { display: none; }
.detail-card { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 90px); padding: 16px; border: 1px solid var(--line2); border-radius: 28px; background: rgba(14,18,26,0.92); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(145%); pointer-events: auto; animation: detailIn 210ms ease both; }
.detail-head, .dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.detail-title-block { min-width: 0; }
.detail-title-block h2, .dialog-head h2 { margin: 8px 0 0; font-size: 1.25rem; line-height: 1.08; letter-spacing: -0.045em; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.field-list { display: grid; gap: 8px; }
.field-list label, .form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 0.76rem; font-weight: 780; letter-spacing: 0.05em; text-transform: uppercase; }
.text-preview-label { color: var(--muted); font-size: 0.76rem; font-weight: 780; letter-spacing: 0.05em; text-transform: uppercase; }
.prompt-preview { min-height: min(42vh, 420px); font-family: var(--mono); font-size: 0.84rem; }
.detail-actions, .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-card { width: min(820px, calc(100vw - 24px)); max-height: calc(100vh - 24px); margin: auto; padding: 0; border: 1px solid var(--line2); border-radius: 28px; background: rgba(14,18,26,0.96); color: var(--text); box-shadow: var(--shadow); }
.dialog-card::backdrop { background: rgba(0,0,0,0.58); backdrop-filter: blur(8px); }
.dialog-card form { margin: 0; }
.dialog-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 16px 18px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide, .output-box.wide { grid-column: 1 / -1; }
.form-grid textarea { min-height: 260px; }
.check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 0.9rem !important; }
.check input { width: 18px; min-width: 18px; min-height: 18px; accent-color: var(--blue); }
.option-list { display: grid; gap: 10px; }
.export-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.output-box { width: 100%; max-height: 46vh; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: rgba(0,0,0,0.28); color: #dbeafe; font-family: var(--mono); font-size: 0.76rem; line-height: 1.45; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.dialog-actions { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.toast-stack { position: fixed; right: 14px; bottom: 14px; z-index: 90; display: grid; gap: 8px; width: min(380px, calc(100vw - 28px)); }
.toast { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(14,18,26,0.95); box-shadow: var(--shadow); animation: toastIn 180ms ease both; }
.toast strong { font-size: 0.9rem; }
.toast span { color: var(--muted); font-size: 0.82rem; }
.clipboard-fallback, .download-link { position: fixed; left: 0; bottom: 0; z-index: -1; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { border-color: rgba(114,184,255,0.55) !important; }
@media (max-width: 1320px) { .deck-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1040px) { .deck-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .top-line { grid-template-columns: auto minmax(110px, 1fr); } .top-actions { grid-column: 1 / -1; justify-content: flex-end; } .deck-intro { grid-template-columns: 1fr; } .stats { justify-content: flex-start; } }
@media (max-width: 720px) { :root { --tile: 88px; --gap: 6px; } .deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .deck-stage { padding: 9px; } .brand-text small, .plain-button span, .primary-button span { display: none; } .top-line { gap: 8px; padding: 9px; } .brand-mark { width: 36px; height: 36px; border-radius: 12px; } .stats span { min-width: 70px; padding: 9px 10px; } .detail-panel { inset: auto 8px 8px 8px; width: auto; } .detail-card { max-height: 82vh; border-radius: 24px; animation: sheetIn 220ms ease both; } .form-grid, .export-grid { grid-template-columns: 1fr; } .dialog-actions, .detail-actions { justify-content: stretch; } .dialog-actions > *, .detail-actions > * { flex: 1 1 auto; } }
@media (max-width: 420px) { :root { --tile: 82px; } .tile { padding: 7px; border-radius: 14px; } .tile-title { font-size: 0.68rem; -webkit-line-clamp: 3; } .mini-badge { max-width: 100%; padding: 0 5px; font-size: 0.5rem; } .deck-intro h1 { font-size: 1.25rem; } .stats { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; } }
@keyframes detailIn { from { opacity: 0; transform: translateX(20px) scale(0.985); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
