/* Тема «Ренессанс как iOS»: картины-обои, матовое стекло, розовый Боттичелли вместо золота. */
:root {
  --lapis: #e0679c;
  --lapis-soft: rgba(224, 103, 156, .12);
  --sea: #5e8f82;
  --sea-soft: rgba(94, 143, 130, .14);
  --madder: #9e3a36;
  --madder-soft: rgba(158, 58, 54, .1);
  --ink: #16181d;
  --ink2: #3a3f4a;
  --muted: #5e6470;
  --hair: rgba(22, 24, 29, .1);
  --fill: rgba(118, 118, 128, .12);
  --glass: rgba(255, 255, 255, .74);
  --glass-strong: rgba(255, 255, 255, .84);
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 14px;
  --r-s: 10px;
  --ui: "Onest", -apple-system, "SF Pro Text", system-ui, sans-serif;
  --display: "Forum", "Onest", Georgia, serif;
  --shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 12px 40px rgba(20, 30, 60, .14);
  --blur: blur(28px) saturate(1.7);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font: 400 17px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background: #cfd6dc;
}
/* Обои: размытая картина за стеклом (меняется по вкладкам) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("../assets/ren/wall-main.jpg") center / cover no-repeat;
  transition: opacity .4s;
}
body::after { content: none; }
body[data-tab="journal"]::before { background-image: url("../assets/ren/wall-journal.jpg"); }

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(224, 103, 156, .55); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.12; letter-spacing: -.01em; }
h2 { font: 400 2.5rem/1.05 var(--display); color: var(--ink); letter-spacing: 0; }
h3 { font: 600 1.22rem/1.25 var(--ui); }
h4 { font: 600 1.08rem/1.3 var(--ui); }
a { color: var(--lapis); }
code { font: .85em ui-monospace, monospace; background: var(--fill); padding: 2px 6px; border-radius: 6px; }
.gilt-text { color: inherit; }

/* ——— Панель вкладок (как в iOS, снизу) ——— */
.top {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40;
  padding: 6px; border-radius: 26px;
  background: rgba(250, 250, 252, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 40px rgba(10, 20, 40, .25);
}
.tabs { display: flex; gap: 2px; }
.tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 74px;
  border: 0; background: none; padding: 6px 10px 5px; border-radius: 20px; cursor: pointer;
  color: var(--muted); font: 500 .72rem/1 var(--ui);
}
.tabs button svg { width: 24px; height: 24px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--lapis); background: rgba(224, 103, 156, .1); }

main { position: relative; padding: 34px 32px 130px; max-width: 1440px; margin: 0 auto; }
.tab { display: none; }
.tab.on { display: block; }

/* ——— Стекло ——— */
.step, .picker, .panel, .spread-list, .spread-detail, .catalog, .deck, .jentry, .home-card, .home-lock, .widget {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.modal-box { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: 0 -10px 50px rgba(10, 20, 40, .3); }

/* Картины — как фото в виджетах */
.frame { display: block; border-radius: var(--r-l); overflow: hidden; box-shadow: 0 10px 30px rgba(10, 20, 40, .25); }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame.thin { border-radius: var(--r-m); }
.label { font: 400 .8rem/1.35 var(--ui); color: var(--muted); margin-top: 8px; }
.label b { font-weight: 600; color: var(--ink2); }
.fleuron { display: none; }
.illum::first-letter { float: left; font: 400 3.4em/.8 var(--display); color: var(--lapis); margin: 6px 10px 0 0; }

/* ——— Элементы управления ——— */
.input {
  width: 100%; padding: 11px 14px; border: 0; border-radius: var(--r-m); background: rgba(255, 255, 255, .78); outline: none; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.input:focus { box-shadow: inset 0 0 0 2px rgba(224, 103, 156, .6); background: #fff; }
.input.small { max-width: 340px; }
select.input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%235e6470' stroke-width='2' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.btn {
  border: 0; background: var(--lapis); color: #fff; font: 600 .98rem var(--ui);
  padding: 10px 18px; border-radius: var(--r-m); cursor: pointer; transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--lapis-soft); color: var(--lapis); }
.btn.gold { background: var(--lapis); color: #fff; }
.btn.danger { background: var(--madder-soft); color: var(--madder); }
.btn:disabled { opacity: .45; cursor: default; }
.hint { color: var(--muted); font-size: .9rem; margin: .45em 0; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
/* Сегменты/пилюли */
.chips, .suit-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  border: 0; background: var(--fill); padding: 6px 13px; border-radius: 999px; cursor: pointer; font: 500 .9rem var(--ui); color: var(--ink2);
}
.chip:hover { background: rgba(118, 118, 128, .2); }
.chip.on { background: #fff; color: var(--lapis); box-shadow: 0 2px 8px rgba(20, 30, 60, .15), inset 0 0 0 1.5px rgba(224, 103, 156, .5); }
/* Переключатель как в iOS */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink2); font-size: .95rem; margin-bottom: 12px; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: rgba(118, 118, 128, .3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked { background: var(--sea); }
.switch input:checked::after { transform: translateX(18px); }

/* ——— Стартовая страница: экран блокировки ——— */
#tab-home { color: #fff; }
.home { display: flex; justify-content: center; padding-top: 4vh; }
.home-lock { margin-top: 12vh; padding: 22px 26px 26px; color: var(--ink); }
.home-date { font: 500 1.05rem var(--ui); color: var(--muted); }
.home-title { font: 400 clamp(3.6rem, 8vw, 7rem)/0.95 var(--display); margin: 6px 0 14px; letter-spacing: -.01em; animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .home-title { animation: none; } }
.home-sub { font: 400 1.08rem/1.5 var(--ui); max-width: 34ch; margin: 0; color: var(--ink2); }
.home-card { padding: 22px; color: var(--ink); width: 480px; max-width: 100%; }
.home-card h3 { margin: 4px 0 10px; }
.home-card textarea { min-height: 92px; font-size: 1.05rem; resize: vertical; }
.home-card .theme-auto { font-size: .88rem; color: var(--muted); min-height: 1.3em; margin: 10px 0 6px; }
.home-card .go { width: 100%; padding: 14px; font-size: 1.05rem; margin-top: 16px; border-radius: var(--r-l); }
.spread-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.spread-pick button { text-align: left; padding: 9px 12px; border: 0; background: var(--fill); cursor: pointer; border-radius: var(--r-m); line-height: 1.2; color: var(--ink); font-weight: 500; }
.spread-pick button small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 2px; }
.spread-pick button.on { background: #fff; box-shadow: 0 2px 8px rgba(20, 30, 60, .14), inset 0 0 0 1.5px rgba(224, 103, 156, .5); }
.home-widgets { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 26px; max-width: 760px; }
.widget { padding: 16px; color: var(--ink); }
.widget h4 { margin: 0 0 10px; font-size: .95rem; color: var(--muted); font-weight: 500; }
.daycard { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; cursor: pointer; }
.daycard .img { aspect-ratio: 3 / 5; border-radius: var(--r-s); overflow: hidden; box-shadow: 0 6px 16px rgba(10, 20, 40, .25); }
.daycard .img img { width: 100%; height: 100%; object-fit: cover; }
.daycard .img img.rev { transform: rotate(180deg); }
.daycard b { font-size: 1.15rem; display: block; }
.daycard .keys { margin: 4px 0 0; }
.home-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.home-cards figure { margin: 0; }
.home-cards .frame { aspect-ratio: 1 / 2; border-radius: var(--r-s); box-shadow: 0 4px 12px rgba(10, 20, 40, .2); }
.home-cards .label { display: none; }
.home-art img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 170px); margin: 0 auto; border-radius: var(--r-xl); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }

/* ——— Расклад ——— */
.read-grid { display: grid; grid-template-columns: 370px 1fr; gap: 20px; align-items: start; }
.setup { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 130px); overflow: auto; padding: 2px 6px 6px 2px; }
.step { padding: 18px; border-radius: var(--r-l); }
.step h3 { display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--lapis); color: #fff; font: 600 .85rem var(--ui); }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 7px 9px; background: rgba(255, 255, 255, .6); cursor: pointer; border-radius: var(--r-m); box-shadow: inset 0 0 0 1px var(--hair); }
.slot.active { box-shadow: inset 0 0 0 2px var(--lapis); background: #fff; }
.slot.fixed { cursor: default; opacity: .85; }
.slot .mini { width: 36px; height: 58px; border-radius: 6px; background: var(--fill); overflow: hidden; display: grid; place-items: center; color: var(--muted); font: 600 .85rem var(--ui); }
.slot .mini img { width: 100%; height: 100%; object-fit: cover; }
.slot .mini img.rev { transform: rotate(180deg); }
.slot .lbl { font-size: .9rem; line-height: 1.3; }
.slot .lbl b { display: block; font-weight: 600; }
.slot .lbl span { color: var(--muted); }
.slot .acts { display: flex; gap: 4px; }
.icon-btn { width: 30px; height: 30px; border: 0; background: var(--fill); cursor: pointer; display: grid; place-items: center; font-size: .9rem; color: var(--ink2); border-radius: 50%; }
.icon-btn:hover { background: rgba(118, 118, 128, .22); }
.icon-btn.on { background: var(--madder); color: #fff; }

.picker { padding: 18px 20px; min-width: 0; border-radius: var(--r-l); }
.picker-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 6px; }
.picker-head .suit-tabs { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; max-height: 62vh; overflow: auto; padding: 6px 4px; }
.card-grid.lib { max-height: none; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; }
.pick { position: relative; border: 0; padding: 0; background: none; cursor: pointer; text-align: center; color: var(--ink2); font-size: .82rem; line-height: 1.25; }
.pick .img { aspect-ratio: 3 / 5; border-radius: var(--r-s); overflow: hidden; background: var(--fill); box-shadow: 0 4px 12px rgba(10, 20, 40, .18); transition: transform .15s; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick:hover .img { transform: scale(1.04); }
.pick:active .img { transform: scale(.97); }
.pick.used { opacity: .3; }
.pick .cap { margin-top: 6px; display: block; }
.pick .note-mark { position: absolute; top: 6px; right: 6px; background: var(--lapis); color: #fff; font-size: .7rem; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
#tab-cards .picker-head { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: 12px 14px; border-radius: var(--r-l); box-shadow: var(--shadow); margin-bottom: 20px; }
#tab-cards .pick .cap { color: var(--ink2); background: rgba(255, 255, 255, .7); border-radius: var(--r-s); padding: 6px 8px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#tab-cards .pick .cap b { color: var(--ink); font-size: .98rem; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; padding: 8px; font: 400 1.05rem/1.15 var(--display); color: var(--lapis); background: linear-gradient(160deg, #fff, #e6eaf0); text-align: center; }

/* ——— Результат ——— */
.result { margin-top: 26px; }
.result:empty { display: none; }
.panel { padding: 26px 30px; margin-bottom: 20px; }
.panel h2 { margin-bottom: .1em; }
.panel .sub { color: var(--muted); margin: 0 0 12px; }
.panel-art { float: right; width: 170px; margin: 0 0 14px 22px; }
.panel-art .frame { aspect-ratio: 4 / 5; }
.board-wrap { overflow: auto; padding: 16px 0; clear: both; }
.board { position: relative; margin: 0 auto; }
.bcard { position: absolute; }
.bcard .face { width: 100%; height: 100%; border-radius: var(--r-s); overflow: hidden; background: var(--fill); box-shadow: 0 10px 24px rgba(10, 20, 40, .28); }
.bcard .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bcard .face img.rev { transform: rotate(180deg); }
.bcard .face.empty { border: 2px dashed rgba(94, 100, 112, .4); display: grid; place-items: center; color: var(--muted); font: 400 1.6rem var(--display); background: rgba(255, 255, 255, .35); box-shadow: none; }
.bcard .badge { position: absolute; top: -9px; left: -9px; width: 24px; height: 24px; border-radius: 50%; background: var(--lapis); color: #fff; font: 600 .78rem/24px var(--ui); text-align: center; z-index: 2; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }

.cardblock { display: grid; grid-template-columns: 128px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--hair); }
.cardblock:first-of-type { border-top: 0; }
.cardblock .img { aspect-ratio: 3 / 5; border-radius: var(--r-m); overflow: hidden; background: var(--fill); cursor: zoom-in; box-shadow: 0 8px 22px rgba(10, 20, 40, .22); }
.cardblock .img img { width: 100%; height: 100%; object-fit: cover; }
.cardblock .img img.rev { transform: rotate(180deg); }
.cardblock h3 { font: 400 1.75rem/1.1 var(--display); margin-bottom: 2px; }
.cardblock p { margin: .45em 0; max-width: 72ch; }
.pos { display: inline-block; font: 600 .85rem var(--ui); color: var(--lapis); background: var(--lapis-soft); border-radius: 999px; padding: 3px 11px; margin-bottom: 8px; }
.meta { color: var(--muted); font-size: .84rem; margin: 2px 0 8px; }
.keys { color: var(--madder); font: 500 1.05rem/1.35 var(--ui); margin-bottom: 6px; }
.tone { display: inline-block; font: 600 .74rem var(--ui); padding: 3px 9px; border-radius: 999px; margin-left: 10px; vertical-align: middle; }
.tone.p { background: var(--sea-soft); color: #3d7365; }
.tone.n { background: var(--madder-soft); color: var(--madder); }
.tone.z { background: var(--fill); color: var(--muted); }
.general { color: var(--ink2); font-size: .95rem; margin-top: 6px; }
.general b { font-weight: 600; }
.mynote { margin-top: 12px; padding: 12px 14px; background: var(--lapis-soft); border-radius: var(--r-m); white-space: pre-wrap; }
.mynote b { color: var(--lapis); font-weight: 600; }
.note-edit { margin-top: 10px; }
.note-edit textarea { min-height: 84px; resize: vertical; }
.link-btn { background: none; border: 0; padding: 0; color: var(--lapis); cursor: pointer; font: 500 .92rem var(--ui); margin-top: 8px; }

.pairblock { padding: 20px 0; border-top: 1px solid var(--hair); }
.pairblock:first-of-type { border-top: 0; }
.pairhead { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.pairhead .duo { display: flex; }
.pairhead .duo div { width: 40px; height: 66px; border-radius: 7px; overflow: hidden; background: var(--fill); box-shadow: 0 4px 10px rgba(10, 20, 40, .25); border: 2px solid #fff; }
.pairhead .duo div:last-child { margin-left: -12px; transform: rotate(8deg); }
.pairhead .duo img { width: 100%; height: 100%; object-fit: cover; }
.pairhead .duo img.rev { transform: rotate(180deg); }
.pairhead h4 { margin: 0; }
.pairhead .lbl { color: var(--muted); font-size: .85rem; }
.line { display: grid; grid-template-columns: 26px 1fr; gap: 6px; margin: 7px 0; max-width: 88ch; }
.line .ic { color: var(--lapis); text-align: center; opacity: .75; }
.line.combo { background: var(--madder-soft); border-radius: var(--r-m); padding: 10px 12px 10px 0; }
.line.combo .ic { color: var(--madder); opacity: 1; }
.line.reflect { background: var(--lapis-soft); border-radius: var(--r-m); padding: 10px 12px 10px 0; }
.notes { width: 100%; min-height: 100px; resize: vertical; }

/* ——— Схемы ——— */
.spreads-grid { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; }
.spread-list { padding: 12px; position: sticky; top: 20px; max-height: calc(100vh - 130px); overflow: auto; border-radius: var(--r-l); }
.spread-list h4 { font: 600 .82rem var(--ui); color: var(--muted); margin: 14px 10px 4px; }
.spread-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: var(--r-s); cursor: pointer; color: var(--ink); font-size: .95rem; line-height: 1.25; }
.spread-list button:hover { background: var(--fill); }
.spread-list button.on { background: var(--lapis); color: #fff; }
.spread-list .cnt { color: var(--muted); font-size: .8rem; white-space: nowrap; padding-top: 2px; }
.spread-list button.on .cnt { color: rgba(255, 255, 255, .8); }
.spread-detail { padding: 28px 34px; min-width: 0; }
.spread-detail p { max-width: 72ch; }
.spread-detail ol { padding-left: 1.4em; }
.spread-detail li { margin: 5px 0; }
.spread-detail li span { color: var(--muted); }
.tips { background: var(--lapis-soft); border-radius: var(--r-m); padding: 6px 16px; }
.tips p { margin: 8px 0; }
.guide h3 { margin-top: 1.2em; }

/* ——— Модалка-шторка ——— */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 15, 25, .35); display: grid; align-items: end; justify-items: center; padding: 30px 20px 0; }
.modal[hidden] { display: none; }
.modal-box { position: relative; max-width: 1040px; width: 100%; max-height: 88vh; overflow: auto; padding: 34px 34px 40px; animation: sheet .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .modal-box { animation: none; } }
.modal-box::before { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 3px; background: rgba(60, 60, 67, .3); }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--fill); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--muted); z-index: 3; }
.cardinfo { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }
.cardinfo .big { aspect-ratio: 3 / 5; border-radius: var(--r-l); overflow: hidden; background: var(--fill); box-shadow: 0 14px 34px rgba(10, 20, 40, .3); }
.cardinfo .big img { width: 100%; height: 100%; object-fit: cover; }
.cardinfo h2 { margin-bottom: 4px; }
.cardinfo table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.cardinfo td, .cardinfo th { vertical-align: top; padding: 9px 9px; border-top: 1px solid var(--hair); text-align: left; }
.cardinfo th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.cardinfo thead th { color: var(--muted); border-top: 0; font-weight: 500; }
.notes-box { margin: 16px 0 20px; padding: 14px 16px; background: var(--lapis-soft); border-radius: var(--r-l); }
.notes-box h3 { color: var(--lapis); margin-bottom: 4px; }
.notes-box label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink2); margin: 10px 0 4px; }
.notes-box textarea { min-height: 76px; resize: vertical; }
.saved { color: #3d7365; font-size: .85rem; min-height: 1.2em; margin-top: 4px; }

/* ——— Колоды ——— */
.on-wall { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); padding: 18px 22px; border-radius: var(--r-l); margin-bottom: 20px; box-shadow: var(--shadow); }
.on-wall h2 { margin: 0; }
.on-wall .hint { margin-bottom: 0; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.deck { padding: 16px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--r-l); }
.deck.on { box-shadow: inset 0 0 0 2.5px var(--lapis), var(--shadow); }
.deck .fan { display: flex; justify-content: center; height: 140px; }
.deck .fan div { width: 78px; height: 130px; border-radius: 8px; overflow: hidden; margin: 0 -14px; border: 2px solid #fff; box-shadow: 0 6px 14px rgba(10, 20, 40, .3); background: var(--fill); }
.deck .fan div:nth-child(1) { transform: rotate(-10deg) translateY(6px); }
.deck .fan div:nth-child(3) { transform: rotate(10deg) translateY(6px); }
.deck .fan img { width: 100%; height: 100%; object-fit: cover; }
.deck h4 { font-size: 1rem; margin: 0; }
.deck .warn { color: var(--madder); font-size: .85rem; }
.deck .tag { font-size: .85rem; color: var(--lapis); font-weight: 500; }
.deck .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.catalog { margin-top: 20px; padding: 22px 24px; border-radius: var(--r-l); }
.catalog-list { max-height: 420px; overflow: auto; margin-top: 10px; }
.catalog-list div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--hair); font-size: .95rem; }
.progress { height: 6px; background: var(--fill); overflow: hidden; margin-top: 8px; border-radius: 999px; }
.progress div { height: 100%; background: var(--lapis); width: 0; transition: width .3s; }
.mapper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.mapper-grid .pick .cap { font-size: .78rem; }
.pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; max-height: 60vh; overflow: auto; }
.mapper-tools { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin: 10px 0 16px; }
.mapper-tools label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.drop { border: 2px dashed rgba(94, 100, 112, .35); border-radius: var(--r-l); padding: 18px; text-align: center; color: var(--muted); margin: 10px 0; cursor: pointer; }
.drop.over { background: var(--lapis-soft); border-color: var(--lapis); }

/* ——— Дневник ——— */
.jentry { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 16px 20px; margin-bottom: 12px; border-radius: var(--r-l); }
.jentry .thumbs { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.jentry .thumbs div { width: 28px; height: 46px; border-radius: 5px; overflow: hidden; background: var(--fill); }
.jentry .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.jentry .thumbs img.rev { transform: rotate(180deg); }
.jentry .when { color: var(--muted); font-size: .85rem; }
.empty-state { text-align: center; color: var(--ink2); padding: 26px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: var(--r-xl); box-shadow: var(--shadow); max-width: 520px; margin: 0 auto; }
.empty-state .frame { aspect-ratio: 1.25; margin-bottom: 6px; }

.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: rgba(30, 32, 38, .86); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 500; z-index: 70; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }

@media (max-width: 1050px) {
  .home-card, .home-lock { margin-top: 0; }
  .home-widgets { grid-template-columns: 1fr; }
  .read-grid, .spreads-grid { grid-template-columns: 1fr; }
  .setup, .spread-list { position: static; max-height: none; }
  .cardinfo { grid-template-columns: 1fr; }
  .cardinfo .big { max-width: 240px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 20px 14px 120px; }
  .top { left: 8px; right: 8px; transform: none; bottom: 10px; }
  .tabs { justify-content: space-between; }
  .tabs button { min-width: 0; flex: 1; padding: 6px 2px 5px; font-size: .64rem; }
  .cardblock { grid-template-columns: 84px 1fr; gap: 14px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .panel, .spread-detail { padding: 20px 16px; }
  .panel-art { width: 110px; }
  h2 { font-size: 2rem; }
  .modal { padding: 20px 0 0; }
  .modal-box { padding: 30px 16px 40px; }
}
.daycard .hint { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass: rgba(255, 255, 255, .92); } }
