/* ===== Daftarix — uslublar ===== */
:root {
  --bg: #12051f;
  --accent: #ff3cac;
  --accent2: #00f5d4;
  --text: #f5f0ff;
  --muted: #b9a7d6;
  --surface: rgba(22, 12, 38, .72);
  --surface2: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .13);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 20px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
}
body.light {
  --text: #1e1b2e;
  --muted: #5b5670;
  --surface: rgba(255, 255, 255, .74);
  --surface2: rgba(255, 255, 255, .7);
  --border: rgba(30, 27, 46, .1);
  --shadow: 0 18px 50px rgba(60, 40, 90, .18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: color .4s;
}
body.anim-bg { background-size: 400% 400%; animation: bgflow 22s ease infinite; }
body.anim-stripes { animation: stripes 3s linear infinite; }
@keyframes bgflow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes stripes { to { background-position: 96px 0; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

#fx-back { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#stage { position: fixed; inset: 0; z-index: 30; pointer-events: none; mix-blend-mode: screen; overflow: hidden; }
#fx-front { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

/* ---------- Sahna chiroqlari ---------- */
#stage .beam { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform, opacity; }
#stage .cone {
  position: absolute; left: -110px; top: 0; width: 220px; height: 400px;
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom, var(--c), color-mix(in srgb, var(--c) 35%, transparent) 55%, transparent 96%);
  filter: blur(3px); opacity: .55; transition: background .4s;
}
#stage .lamp {
  position: absolute; left: -14px; top: -6px; width: 28px; height: 20px; border-radius: 6px 6px 12px 12px;
  background: #222; box-shadow: 0 0 0 2px #444, 0 8px 22px 6px var(--c);
}
#stage .lamp::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 14px 6px var(--c); }
#stage .pool {
  position: absolute; left: 0; top: 0; width: 340px; height: 200px; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--c, #fff) 55%, white) 0%, color-mix(in srgb, var(--c, #fff) 30%, transparent) 40%, transparent 70%);
  opacity: .5; filter: blur(6px); transition: background .5s;
}
#stage .bulbs { position: absolute; left: 0; right: 0; height: 12px; display: flex; justify-content: space-between; padding: 0 8px; }
#stage .bulbs.top { top: 2px; }
#stage .bulbs.bottom { bottom: 3px; }
#stage .bulbs i { width: 8px; height: 8px; border-radius: 50%; background: #ffd36b; box-shadow: 0 0 8px 3px #ffb703; animation: chase 1.4s infinite; animation-delay: calc(var(--i) * -0.07s); }
#stage .bulbs.bottom i { background: #ff7ad9; box-shadow: 0 0 8px 3px #ff3cac; animation-direction: reverse; }
@keyframes chase { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px clamp(12px, 3vw, 28px);
  background: var(--surface); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .3)); animation: wiggle 6s ease-in-out infinite; }
@keyframes wiggle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-8deg); } 96% { transform: rotate(6deg); } }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: 'Pacifico', cursive; font-weight: 400; font-size: 26px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 4px; }
.brand-text small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.tabs { display: flex; gap: 4px; background: var(--surface2); padding: 4px; border-radius: 999px; border: 1px solid var(--border); margin: 0 auto; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 800; transition: .25s; }
.tab:hover { background: var(--surface2); }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.mini-select { display: flex; align-items: center; gap: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 4px 2px 10px; }
.mini-select select { border: 0; background: transparent; padding: 6px 2px; }
select option, select optgroup { color: #1e1b2e; background: #fff; }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  padding: 9px 16px; border-radius: 14px; font-weight: 800; transition: transform .15s, box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 18px; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 11px; }
.btn.icon { padding: 8px 11px; }
.btn.danger { color: #ef4444; }
.btn.on { background: var(--grad); color: #fff; animation: pulseGlow 1.2s infinite; }
@keyframes pulseGlow { 50% { box-shadow: 0 0 22px 4px color-mix(in srgb, var(--accent) 60%, transparent); } }
.link { border: 0; background: none; color: var(--accent); font-weight: 800; text-decoration: underline; padding: 0; }

main { position: relative; z-index: 2; padding: clamp(12px, 2.5vw, 28px); max-width: 1560px; margin: 0 auto; }
.view { display: none; animation: viewIn .45s ease; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.glass { background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0; }
.muted { color: var(--muted); }

/* ---------- Bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: clamp(18px, 4vw, 44px); border-radius: 28px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(30px, 5vw, 58px); line-height: 1.05; margin: 0 0 14px; font-weight: 900; }
.rainbow-text { font-family: 'Pacifico', cursive; font-weight: 400; background: linear-gradient(90deg, #ff5fa2, #ffb86b, #fde047, #4ade80, #22d3ee, #a78bfa, #ff5fa2); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rb 4s linear infinite; padding-right: 6px; }
@keyframes rb { to { background-position: 200% center; } }
.hero p { font-size: clamp(15px, 1.5vw, 19px); color: var(--muted); max-width: 640px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-art { position: relative; height: 260px; display: grid; place-items: center; }
.hero-art img { width: 190px; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px) rotate(-3deg); } }
.orbit { position: absolute; font-size: 34px; left: 50%; top: 50%; animation: orbit 12s linear infinite; }
.o2 { animation-delay: -2.4s; } .o3 { animation-delay: -4.8s; } .o4 { animation-delay: -7.2s; } .o5 { animation-delay: -9.6s; }
@keyframes orbit { from { transform: translate(-50%, -50%) rotate(0) translateX(140px) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg) translateX(140px) rotate(-360deg); } }
.section-title { margin: 34px 4px 16px; font-size: 24px; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; perspective: 1200px; }
.nb-card {
  position: relative; aspect-ratio: 3 / 4; border: 0; border-radius: 8px 18px 18px 8px; padding: 16px 14px 16px 34px; text-align: left;
  background: linear-gradient(140deg, var(--c1), var(--c2)); color: #fff;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, .18), 0 14px 30px rgba(0, 0, 0, .3), 6px 6px 0 -1px #f8f8f8, 6px 6px 0 0 rgba(0,0,0,.15), 11px 11px 0 -1px #eee;
  transform-origin: left center; transition: transform .45s cubic-bezier(.2, .8, .2, 1.2), box-shadow .3s;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  animation: cardIn .6s backwards; animation-delay: var(--d);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) rotate(-4deg); } }
.nb-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, .35), transparent 45%), repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px); pointer-events: none; }
.nb-card:hover { transform: rotateY(-18deg) translateY(-8px) scale(1.03); box-shadow: inset 6px 0 0 rgba(0, 0, 0, .18), 18px 24px 40px rgba(0, 0, 0, .35); }
.nb-spiral { position: absolute; left: 6px; top: 10px; bottom: 10px; width: 16px; background: radial-gradient(circle at 8px 8px, #e5e7eb 0 4px, #6b7280 4.5px 5.5px, transparent 6px) 0 0 / 16px 20px repeat-y; }
.nb-emoji { font-size: 52px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); transition: transform .4s; }
.nb-card:hover .nb-emoji { transform: scale(1.18) rotate(-10deg); }
.nb-label { background: rgba(255, 255, 255, .92); color: #1e1b2e; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.nb-label b { font-size: 15px; line-height: 1.15; }
.nb-label small { color: #6b6880; font-size: 12px; }
.nb-peek { position: absolute; left: 34px; right: 12px; top: 84px; font-family: 'Caveat', cursive; font-size: 18px; opacity: .9; line-height: 1.1; max-height: 3.4em; overflow: hidden; }
.nb-del { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .35); border-radius: 10px; padding: 4px 6px; font-size: 14px; }
.nb-card.add { background: var(--surface2); color: var(--text); border: 2px dashed var(--border); box-shadow: none; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.nb-card.add .nb-label { background: transparent; color: var(--text); text-align: center; box-shadow: none; }
.nb-card.add .nb-label small { color: var(--muted); }

/* ---------- Muharrir ---------- */
.editor-layout { display: grid; grid-template-columns: 290px 1fr; gap: 20px; align-items: start; }
.side { position: sticky; top: 84px; padding: 14px; max-height: calc(100vh - 100px); overflow: auto; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.side details { border-top: 1px solid var(--border); padding: 8px 0; }
.side summary { font-weight: 800; cursor: pointer; padding: 4px 0; list-style: none; }
.side summary::-webkit-details-marker { display: none; }
.side summary::after { content: '▾'; float: right; opacity: .6; }
.chips-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip-btn { border: 1px solid var(--border); background: var(--surface2); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 700; transition: .2s; }
.chip-btn:hover { transform: translateY(-1px); }
.chip-btn.on { background: var(--grad); color: #fff; border-color: transparent; }
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, 32px); gap: 7px; margin: 6px 0; }
.sw { aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(0, 0, 0, .12); transition: .2s; }
.sw:hover { transform: scale(1.12); }
.sw.on { outline: 3px solid var(--accent); outline-offset: 2px; }
.range { display: grid; grid-template-columns: 90px 1fr; align-items: center; font-size: 13px; color: var(--muted); margin: 4px 0; }
input[type=range] { accent-color: var(--accent); }
.sticker-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.sticker-tray button { border: 0; background: var(--surface2); border-radius: 10px; font-size: 22px; padding: 4px 0; transition: transform .15s; }
.sticker-tray button:hover { transform: scale(1.3) rotate(-8deg); }
.stack { display: flex; flex-direction: column; gap: 6px; }

.toolbar { padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: 76px; z-index: 10; }
.tgroup { display: flex; align-items: center; gap: 4px; background: var(--surface2); border: 1px solid var(--border); padding: 4px; border-radius: 12px; }
.tgroup select { border: 0; background: transparent; padding: 6px 4px; max-width: 150px; font-weight: 700; }
.tgroup input[type=range] { width: 76px; }
.tlabel { font-size: 12px; font-weight: 800; color: var(--muted); padding: 0 2px; }
.tbtn { border: 0; background: transparent; min-width: 32px; height: 32px; border-radius: 9px; font-size: 15px; transition: .15s; }
.tbtn:hover { background: var(--grad); color: #fff; }
.tbtn.wide { padding: 0 10px; font-weight: 800; font-size: 13px; }
.tbtn.rec { background: #ef4444; color: #fff; animation: pulseGlow 1s infinite; }
.color-pick { position: relative; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; font-weight: 900; cursor: pointer; overflow: hidden; }
.color-pick:hover { background: var(--surface2); }
.color-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.color-pick::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 4px; height: 4px; border-radius: 2px; background: var(--grad); }
.mini-swatches { display: flex; gap: 3px; }
.mini-sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); padding: 0; transition: .15s; }
.mini-sw:hover { transform: scale(1.3); }
.presets { display: flex; gap: 6px; overflow-x: auto; width: 100%; padding: 4px 2px 2px; scrollbar-width: thin; }
.preset { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: #333; transition: .2s; }
body.dark .preset { background: #1b1430; color: #ddd; }
.preset:hover { transform: translateY(-3px) rotate(-2deg); box-shadow: 0 8px 18px rgba(0, 0, 0, .2); }
.preset .pv { font-size: 24px; line-height: 1.2; }
.preset.dark-pv { background: #1f2937 !important; color: #eee; }
.preset small { font-size: 11px; font-weight: 700; opacity: .75; }

/* Qog'oz */
.paper-wrap { position: relative; margin: 18px auto 12px; max-width: 900px; padding-left: 18px; }
.rings { position: absolute; left: 0; top: 20px; bottom: 20px; width: 40px; z-index: 5; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; pointer-events: none; }
.rings i { display: block; width: 38px; height: 10px; border-radius: 6px; background: linear-gradient(180deg, #f1f5f9, #94a3b8 60%, #475569); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); flex: 0 0 auto; margin: 9px 0; }
.paper {
  --paper: #fff; --line: rgba(59, 130, 246, .25); --ink: #1f2937; --margin: #f87171;
  position: relative; min-height: 1080px; background-color: var(--paper); color: var(--ink);
  border-radius: 6px 18px 18px 6px; padding: 34px 44px 80px 84px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 24px 60px rgba(0, 0, 0, .35), inset 0 0 80px rgba(0, 0, 0, .03);
  transition: background-color .4s, color .4s;
}
.paper::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.paper::after { content: ''; position: absolute; top: 0; bottom: 0; left: 64px; width: 2px; background: var(--margin); opacity: .55; z-index: 0; }
.paper[data-paper=blank]::after, .paper[data-paper=dots]::after, .paper[data-paper=music]::after, .paper[data-paper=iso]::after { display: none; }
.paper[data-paper=grid]::before { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
.paper[data-paper=dots]::before { background-image: radial-gradient(circle, var(--line) 1.6px, transparent 2px); background-size: 24px 24px; filter: saturate(1.6) contrast(1.4); }
.paper[data-paper=iso]::before { background-image: repeating-linear-gradient(30deg, var(--line) 0 1px, transparent 1px 24px), repeating-linear-gradient(150deg, var(--line) 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 27.7px); }
.paper[data-paper=music]::before { background-image: linear-gradient(to bottom, transparent 0 40px, var(--line) 40px 41.5px, transparent 41.5px 50px, var(--line) 50px 51.5px, transparent 51.5px 60px, var(--line) 60px 61.5px, transparent 61.5px 70px, var(--line) 70px 71.5px, transparent 71.5px 80px, var(--line) 80px 81.5px, transparent 81.5px 104px); background-size: 100% 104px; filter: contrast(1.8); }
.paper-content { position: relative; z-index: 2; outline: none; min-height: 900px; font-family: 'Neucha', 'Caveat', cursive; font-size: 24px; line-height: 36px; caret-color: var(--accent); word-wrap: break-word; }
.paper[data-paper=lined] .paper-content, .paper[data-paper=vocab] .paper-content, .paper[data-paper=planner] .paper-content {
  margin: 0 -44px 0 -84px; padding: 0 44px 0 84px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px); background-attachment: local;
}
.paper[data-paper=vocab] .paper-content { background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px), linear-gradient(90deg, transparent calc(50% + 20px), var(--margin) calc(50% + 20px), var(--margin) calc(50% + 21.5px), transparent calc(50% + 21.5px)); }
.paper[data-paper=planner] .paper-content { background-image: repeating-linear-gradient(to bottom, transparent 0 35px, var(--line) 35px 36px), repeating-linear-gradient(to bottom, transparent 0 9px, var(--line) 9px 27px, transparent 27px 36px); background-size: 100% 100%, 18px 100%; background-position: 0 0, 92px 0; background-repeat: repeat, repeat-y; }
.paper[data-paper=handwriting] .paper-content {
  line-height: 54px; margin: 0 -44px 0 -84px; padding: 0 44px 0 84px;
  background-image: linear-gradient(to bottom, transparent 0 13px, var(--line) 13px 14px, transparent 14px 25px, color-mix(in srgb, var(--line) 60%, transparent) 25px 26px, transparent 26px 38px, var(--line) 38px 40px, transparent 40px 54px), repeating-linear-gradient(65deg, transparent 0 34px, color-mix(in srgb, var(--line) 50%, transparent) 34px 35px);
  background-size: 100% 54px, 100% 100%; background-attachment: local;
}
.paper-content p, .paper-content div { margin: 0; }
.paper-content ul { margin: 0; padding-left: 28px; }
.paper-title { position: relative; z-index: 2; margin: 0 0 18px; font-family: 'Pacifico', cursive; font-weight: 400; font-size: 34px; line-height: 1.3; outline: none; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; min-width: 200px; }
.paper.dark .paper-title { filter: brightness(1.3); }
.paper.dark .paper-content { font-family: 'Neucha', cursive; }
.paper[data-paper=blank]:not(.dark) { background-image: radial-gradient(circle at 20% 10%, rgba(0,0,0,.015), transparent 40%); }
.scatter { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.scatter span { position: absolute; transform: translate(-50%, -50%) rotate(var(--r)); font-size: var(--s); opacity: var(--o); animation: bob 6s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes bob { 50% { transform: translate(-50%, calc(-50% - 4px)) rotate(calc(var(--r) + 6deg)); } }
.ustickers { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.usticker { position: absolute; pointer-events: auto; cursor: grab; user-select: none; touch-action: none; transform: translate(-50%, -50%) rotate(var(--r)); font-size: var(--s); line-height: 1; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .28)); transition: filter .2s; animation: stickIn .4s cubic-bezier(.2, 1.6, .4, 1); }
.usticker:hover { filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .35)) brightness(1.08); }
.usticker.drag { cursor: grabbing; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .4)); }
@keyframes stickIn { from { transform: translate(-50%, -50%) scale(0) rotate(-90deg); } }
.chk { cursor: pointer; font-size: 1.1em; user-select: none; color: var(--accent); }
.chk.done { color: #16a34a; }
.chk.done + * , .chk.done ~ * { text-decoration: line-through; }
.date-stamp { display: inline-block; font-family: 'Kelly Slab', sans-serif; font-size: 16px; padding: 2px 10px; border: 2px dashed var(--accent); border-radius: 8px; color: var(--accent); transform: rotate(-2deg); }
hr.doodle { border: 0; height: 14px; margin: 10px 0; background: radial-gradient(circle at 10px -6px, transparent 9px, var(--accent) 10px 11.5px, transparent 12px) 0 0 / 20px 14px repeat-x; }
.statusbar { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 8px 16px; font-size: 13px; font-weight: 700; max-width: 900px; margin: 0 auto; color: var(--muted); }

body.focus .topbar, body.focus .side, body.focus .statusbar { display: none; }
body.focus .editor-layout { grid-template-columns: 1fr; }
body.focus .toolbar { top: 8px; opacity: .25; transition: opacity .3s; }
body.focus .toolbar:hover { opacity: 1; }

/* ---------- Matn effektlari ---------- */
.fx-neon { text-shadow: 0 0 1px #fff, 0 0 6px currentColor, 0 0 16px currentColor, 0 0 32px currentColor; }
.paper.dark .fx-neon, .board .fx-neon { -webkit-text-fill-color: #fff; }
.fx-pulse { text-shadow: 0 0 6px currentColor, 0 0 18px currentColor; animation: npulse 1.6s ease-in-out infinite; }
@keyframes npulse { 50% { text-shadow: 0 0 2px currentColor, 0 0 6px currentColor; opacity: .85; } }
.fx-3d { text-shadow: 1px 1px 0 #c0392b, 2px 2px 0 #e67e22, 3px 3px 0 #f1c40f, 4px 4px 0 #27ae60, 5px 5px 8px rgba(0, 0, 0, .35); }
.fx-pop { text-shadow: 3px 3px 0 #1b1b3a, 5px 5px 0 rgba(0, 0, 0, .15); }
.fx-gradient, .fx-rainbow, .fx-gold, .fx-candy, .fx-galaxy { -webkit-background-clip: text !important; background-clip: text !important; -webkit-text-fill-color: transparent; }
.fx-gradient { background-image: linear-gradient(90deg, #ff6a00, #ee0979, #7f00ff); }
.fx-rainbow { background-image: linear-gradient(90deg, #ff3c3c, #ff9f1c, #ffe14d, #3cd35c, #1ea7ff, #a14dff, #ff3c3c); background-size: 200% auto; animation: rb 3s linear infinite; }
.fx-gold { background-image: linear-gradient(180deg, #fff6a9 0%, #f5c518 45%, #b8860b 55%, #ffe680 100%); filter: drop-shadow(1px 2px 0 rgba(120, 80, 0, .45)); }
.fx-candy { background-image: repeating-linear-gradient(45deg, #ff5fa2 0 8px, #fff 8px 12px, #6ee7f9 12px 20px, #fff 20px 24px); background-size: 34px 34px; animation: candyMove 2s linear infinite; filter: drop-shadow(2px 2px 0 rgba(190, 24, 93, .5)); }
@keyframes candyMove { to { background-position: 34px 0; } }
.fx-galaxy { background-image: radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px), linear-gradient(90deg, #4c1d95, #db2777, #2563eb, #4c1d95); background-size: 22px 22px, 31px 31px, 300% 100%; animation: galaxyMove 6s linear infinite; }
@keyframes galaxyMove { to { background-position: 22px 0, -31px 0, 300% 0; } }
.fx-fire { color: #ffd54a !important; text-shadow: 0 -1px 4px #fff59d, 0 -3px 8px #ffb300, 0 -8px 16px #ff6d00, 0 -14px 26px #dd2c00; animation: flicker 1.2s infinite alternate; }
@keyframes flicker { 30% { text-shadow: 0 -1px 4px #fff59d, 0 -4px 10px #ffb300, 0 -10px 18px #ff6d00, 0 -16px 30px #dd2c00; } 70% { text-shadow: 0 -1px 3px #fff59d, 0 -2px 7px #ffb300, 0 -6px 14px #ff6d00, 0 -11px 22px #dd2c00; } }
.fx-ice { text-shadow: 0 0 8px #81d4fa, 0 0 2px #fff; }
.fx-retro { text-shadow: 3px 3px 0 #ff3d7f, 6px 6px 0 #3dd5ff; }
.fx-glitch { position: relative; text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; animation: glitch 1.8s infinite steps(1); }
@keyframes glitch { 0%, 100% { text-shadow: 2px 0 #ff00c1, -2px 0 #00fff9; } 20% { text-shadow: -3px 1px #ff00c1, 3px -1px #00fff9; } 40% { text-shadow: 1px -2px #ff00c1, -1px 2px #00fff9; } 60% { text-shadow: 4px 0 #ff00c1, -4px 0 #00fff9; } 80% { text-shadow: -1px 0 #ff00c1, 1px 0 #00fff9; } }
.fx-marker { background-image: linear-gradient(100deg, transparent 2%, rgba(253, 224, 71, .85) 4%, rgba(253, 224, 71, .7) 96%, transparent 98%); background-size: 100% 45%; background-position: 0 85%; background-repeat: no-repeat; padding: 0 3px; }
.fx-shadow { text-shadow: 2px 4px 8px rgba(0, 0, 0, .35); }
.fx-outline { -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.6px currentColor; }
.fx-sticker { color: #fff; -webkit-text-stroke: 8px currentColor; paint-order: stroke fill; -webkit-text-fill-color: #fff; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3)); }
.fx-chalk { text-shadow: 0 0 1px rgba(255, 255, 255, .9), 1px 1px 2px rgba(255, 255, 255, .4); opacity: .92; letter-spacing: .5px; }
.fx-wave .wv { display: inline-block; animation: wv 1.4s ease-in-out infinite; white-space: pre; }
@keyframes wv { 50% { transform: translateY(-6px) rotate(-3deg); } }

/* ---------- PDF studiya ---------- */
.dropzone { display: flex; align-items: center; gap: 18px; padding: 18px 24px; cursor: pointer; border: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); transition: .25s; margin-bottom: 18px; }
.dropzone:hover, .dropzone.over { transform: scale(1.01); border-color: var(--accent2); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent2) 25%, transparent), var(--shadow); }
.dz-icon { font-size: 40px; animation: float 3s ease-in-out infinite; }
.dz-text small { color: var(--muted); }
.panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.panel { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 15px; }
.pager { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.pdf-view { background: var(--surface2); border-radius: 14px; max-height: 420px; overflow: auto; padding: 10px; border: 1px solid var(--border); }
.pdf-empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.big-emoji { font-size: 54px; }
.canvas-box { position: relative; width: fit-content; margin: 0 auto; }
.canvas-box canvas { display: block; max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 8px 26px rgba(0, 0, 0, .3); background: #fff; }
.canvas-box.cropping { cursor: crosshair; }
.canvas-box.cropping canvas { outline: 3px dashed var(--accent2); }
.crop-rect { position: absolute; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); pointer-events: none; }
.p1-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.p1-tools input[type=search] { flex: 1; min-width: 120px; padding: 7px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface2); }
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--grad); color: #fff; }
.chips-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; max-height: 460px; min-height: 160px; overflow: auto; padding: 10px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--border); }
.chip {
  --h: 280; border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 85% 60%), hsl(calc(var(--h) + 40) 85% 55%));
  box-shadow: 0 4px 0 hsl(var(--h) 60% 38%), 0 8px 14px rgba(0, 0, 0, .18);
  cursor: grab; touch-action: none; user-select: none; transition: transform .15s, box-shadow .15s, opacity .2s;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.chip:hover { transform: translateY(-3px) rotate(-2deg); }
.chip:active { cursor: grabbing; transform: translateY(2px); box-shadow: 0 1px 0 hsl(var(--h) 60% 38%); }
.chip.chip-line { border-radius: 14px; text-align: left; font-size: 14px; max-width: 100%; }
.chip.chip-img { padding: 4px; border-radius: 12px; background: #fff; box-shadow: 0 4px 0 #cbd5e1, 0 8px 14px rgba(0, 0, 0, .18); }
.chip.chip-img img { display: block; height: 84px; max-width: 160px; object-fit: cover; border-radius: 9px; pointer-events: none; }
.chip.sel { outline: 3px solid var(--accent2); outline-offset: 2px; transform: translateY(-3px) scale(1.05); }
.chip.used { opacity: .55; }
.chip.dragging { opacity: .3; }
.drag-ghost { position: fixed !important; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: .95; box-shadow: 0 18px 30px rgba(0, 0, 0, .35) !important; }
.ghost-n { position: absolute; top: -10px; right: -10px; background: #ef4444; color: #fff; border-radius: 999px; padding: 2px 7px; font-size: 12px; }

.board-tools { position: static; padding: 8px; background: transparent; }
.board {
  position: relative; min-height: 460px; border-radius: 16px; overflow: auto; outline: none;
  background-color: #fffdf8; color: #111;
  background-image: radial-gradient(circle, rgba(124, 58, 237, .18) 1.2px, transparent 1.6px); background-size: 22px 22px;
  border: 2px solid transparent; transition: border-color .2s, box-shadow .2s;
}
body.dark .board { background-color: #fdfbff; }
.board.drop-hover { border-color: var(--accent2); box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--accent2) 30%, transparent), 0 0 30px color-mix(in srgb, var(--accent2) 40%, transparent); }
.board-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #8b84a3; font-weight: 800; font-size: 18px; padding: 20px; pointer-events: none; }
.board-empty small { font-weight: 600; font-size: 13px; display: block; margin-top: 6px; }
.item { position: absolute; cursor: move; user-select: none; touch-action: none; transform: rotate(var(--rot, 0deg)); padding: 3px; border-radius: 14px; }
.item .item-text { display: inline-block; white-space: nowrap; line-height: 1.25; outline: none; }
.item .item-text[contenteditable=true] { cursor: text; user-select: text; background: #fff; box-shadow: 0 0 0 2px var(--accent); border-radius: 8px; }
.item.pill .item-text { background-color: #fff; border-radius: 16px; padding: 4px 16px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12), 0 6px 16px rgba(0, 0, 0, .12); }
.item.is-img img { display: block; width: var(--w, 160px); border-radius: 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); pointer-events: none; }
.item.sel { outline: 2.5px dashed var(--accent); outline-offset: 2px; }
.item.pop-in { animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes popIn { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.lasso { position: absolute; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 6px; pointer-events: none; z-index: 50; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- Tarjimon ---------- */
.tr { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--border); }
.tr-head { display: flex; align-items: center; justify-content: space-between; }
.tr-head h3 { margin: 0; }
.wave { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.wave i { width: 4px; height: 4px; border-radius: 2px; background: var(--grad); transition: height .2s; }
.wave.on i { animation: eq .6s ease-in-out infinite; }
.wave.on i:nth-child(2) { animation-delay: -.2s; } .wave.on i:nth-child(3) { animation-delay: -.4s; } .wave.on i:nth-child(4) { animation-delay: -.1s; } .wave.on i:nth-child(5) { animation-delay: -.3s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 22px; } }
.tr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tr-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: center; transition: .2s; }
.tr-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0, 0, 0, .18); }
.tr-card.hired { border-color: transparent; box-shadow: 0 0 0 2.5px var(--accent), 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.tr-av { font-size: 36px; transition: transform .2s; }
.tr-card.talking .tr-av { animation: talk .35s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.12) rotate(3deg); } }
.tr-name { font-weight: 800; font-size: 14px; }
.tr-card small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.tr-hire { margin-top: 4px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--grad); color: #fff; }
.tr-box { display: flex; flex-direction: column; gap: 8px; }
.tr-box textarea { width: 100%; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 16px; }
.tr-row { display: flex; gap: 6px; align-items: center; }
.tr-row.wrap { flex-wrap: wrap; }
.tr-row select { flex: 1; min-width: 0; padding: 7px 8px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); }
.tr-out { min-height: 52px; padding: 12px 14px; border-radius: 12px; background: var(--grad); color: #fff; font-size: 20px; font-weight: 800; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); white-space: pre-wrap; }
.tr-out .muted { color: rgba(255, 255, 255, .8); font-size: 14px; font-weight: 600; }
.karaoke { font-size: 18px; line-height: 1.6; max-height: 120px; overflow: auto; padding: 0 4px; }
.karaoke:empty { display: none; }
.karaoke span { border-radius: 6px; padding: 0 2px; transition: .15s; }
.karaoke span.on { background: var(--accent); color: #fff; box-shadow: 0 0 12px var(--accent); }
.tr-params summary { font-weight: 800; cursor: pointer; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.field select, .field input:not([type=range]) { padding: 8px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; }
.field b { color: var(--text); }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--text); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
body.light .modal { background: rgba(255, 255, 255, .92); }
.modal::backdrop { background: rgba(5, 0, 15, .55); backdrop-filter: blur(3px); }
.modal[open] { animation: modalIn .35s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes modalIn { from { transform: scale(.9) translateY(20px); opacity: 0; } }
.modal.small { width: min(460px, calc(100vw - 24px)); }
.modal form { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.modal form .modal-head { padding: 0; }
.modal-head h3 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px 18px 20px; }
.theme-card { position: relative; height: 112px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, .25); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 10px; overflow: hidden; color: #1e1b2e; text-align: left; transition: transform .2s, box-shadow .2s; background-size: cover !important; }
.theme-card.dark { color: #fff; }
.theme-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.theme-card.on { outline: 3px solid var(--accent); outline-offset: 3px; }
.tc-emoji { position: absolute; top: 8px; right: 10px; font-size: 30px; transition: transform .3s; }
.theme-card:hover .tc-emoji { transform: scale(1.3) rotate(12deg); }
.tc-name { font-weight: 900; font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.tc-badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 900; background: #fde047; color: #1e1b2e; padding: 2px 8px; border-radius: 999px; }
.tc-dots { display: flex; gap: 4px; margin-top: 4px; }
.tc-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 400; background: var(--grad); color: #fff; padding: 12px 20px; border-radius: 16px; font-weight: 800; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); max-width: calc(100vw - 32px); text-align: center; }
#toast.show { transform: translate(-50%, 0); }

/* ---------- Moslashuvchan ---------- */
@media (max-width: 1100px) {
  .panels { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; order: 2; }
  .editor-main { order: 1; min-width: 0; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .tabs { order: 3; width: 100%; justify-content: space-around; }
  .tab span, .btn span { display: none; }
  .tab { padding: 8px 10px; font-size: 18px; }
  .brand-text small { display: none; }
  .top-actions { margin-left: auto; }
  .toolbar { top: 108px; }
  .paper { padding: 24px 16px 60px 52px; min-height: 800px; }
  .paper::after { left: 40px; }
  .paper[data-paper=lined] .paper-content, .paper[data-paper=vocab] .paper-content, .paper[data-paper=planner] .paper-content, .paper[data-paper=handwriting] .paper-content { margin: 0 -16px 0 -52px; padding: 0 16px 0 52px; }
  .paper-wrap { padding-left: 12px; }
  .rings i { width: 26px; }
  .shelf { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .nb-emoji { font-size: 38px; }
  .nb-peek { display: none; }
  .dropzone { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ---------- Chop etish ---------- */
@media print {
  body { background: #fff !important; }
  #fx-back, #fx-front, #stage, .topbar, .side, .toolbar, .statusbar, #view-home, #view-pdf, #toast, .rings { display: none !important; }
  main { padding: 0; }
  .editor-layout { display: block; }
  .paper { box-shadow: none; border-radius: 0; min-height: 0; }
  #view-editor { display: block !important; }
}
