/* Hikari — удержание, фаза 1: календарь, задания дня, сезон, гардероб, декор комнаты */
#ret-overlay {
  position: fixed; inset: 0; z-index: 9150; background: rgba(8, 4, 20, .78);
  display: flex; align-items: center; justify-content: center; padding: 8px; box-sizing: border-box;
}
#ret-overlay .ret-sheet {
  width: min(420px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; padding: 16px 14px 10px;
}
#ret-overlay .ret-scroll { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
#ret-overlay .actions {
  flex: none; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 8px 0 2px;
  background: linear-gradient(180deg, transparent, rgba(22, 10, 40, .96) 30%);
}
#ret-overlay .actions .btn { min-height: 48px; }
#ret-overlay h2 { margin: 2px 0 6px; text-align: center; }
#ret-overlay .dim { opacity: .7; font-size: 12px; text-align: center; }
.ret-toast { position: fixed; left: 50%; bottom: 16%; transform: translateX(-50%); z-index: 9999; background: rgba(20, 12, 40, .94); color: #fff;
  padding: 8px 14px; border-radius: 14px; font: 700 13px/1.25 Comfortaa, system-ui; max-width: min(320px, 86vw); text-align: center; box-shadow: 0 0 0 1.5px #ffd56b; }
.ret-say { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.ret-say .ret-rico { width: 64px; height: 64px; flex: none; display: inline-block; }
.ret-say .rico-line { margin: 0; flex: 1; font-size: 13px; text-align: left; }

/* кнопки на главной */
.ret-home .mbtn { position: relative; min-height: 44px; }
.ret-home .ret-dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }

/* 1. календарь */
.cal-head { text-align: center; margin: 0 0 4px; font-weight: 700; color: #ffe7b0; }
.cal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; padding: 4px; }
.cal-cell { position: relative; aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, .08); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 2px; text-align: center; overflow: hidden; }
.cal-cell small { position: absolute; top: 2px; left: 5px; font-size: 10px; opacity: .8; }
.cal-cell b { font-size: 9px; line-height: 1.1; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cell b img { width: 12px; height: 12px; vertical-align: -2px; }
.cal-cell .cal-ico { font-size: 18px; line-height: 1; }
.cal-cell .cal-ico img { width: 24px; height: 24px; }
.cal-cell .cal-chest { width: 72%; height: auto; }
.cal-cell.chest { background: rgba(255, 200, 80, .16); }
.cal-cell.claimed { opacity: .55; }
.cal-cell.claimed::after { content: '✓'; position: absolute; right: 4px; bottom: 2px; color: #7dff9a; font-weight: 800; }
.cal-cell.today { box-shadow: 0 0 0 2px #ffd76a, 0 0 14px rgba(255, 200, 80, .6); animation: retPulse 1.4s ease-in-out infinite; }
@keyframes retPulse { 50% { transform: scale(1.06); } }
.cal-missed { display: flex; flex-direction: column; gap: 6px; align-items: center; margin: 4px 0 8px; padding: 10px; border-radius: 14px; background: rgba(120, 180, 255, .12); }
.cal-missed p { margin: 0; }
.cal-missed .cal-shield { width: 56px; height: 56px; }
.cal-missed .btn { width: 100%; min-height: 48px; }

/* 2. задания */
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.q-card.done { box-shadow: 0 0 0 2px #7dff9a; }
.q-card.claimed { opacity: .6; }
.q-card .q-ico { width: 44px; height: 44px; flex: none; }
.q-main { flex: 1; min-width: 0; }
.q-main b { display: block; font-size: 13px; }
.q-main small { font-size: 11px; opacity: .8; }
.q-bar { height: 8px; border-radius: 6px; background: rgba(0, 0, 0, .35); margin: 4px 0 2px; overflow: hidden; }
.q-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd76a, #ff9a3c); border-radius: 6px; }
.q-btn { min-height: 44px; min-width: 64px; padding: 0 10px; flex: none; }
.q-ok { color: #7dff9a; font-size: 22px; font-weight: 800; padding: 0 10px; }
.q-chest { display: flex; flex-direction: column; align-items: center; margin: 10px 0 2px; }
.q-chest img { width: 84px; height: 84px; object-fit: contain; }
.q-chest.ready img { animation: retPulse 1s ease-in-out infinite; filter: drop-shadow(0 0 10px gold); }

/* 5. сезон */
.sz-banner { width: 100%; border-radius: 14px; max-height: 120px; object-fit: cover; }
.sz-head { text-align: center; margin: 2px 0; }
.sz-xp { position: relative; height: 16px; border-radius: 10px; background: rgba(0, 0, 0, .35); overflow: hidden; margin: 4px 0; }
.sz-xp i { display: block; height: 100%; background: linear-gradient(90deg, #9ad8ff, #fff); }
.sz-xp small { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; color: #102040; font-weight: 800; }
.sz-lanes { display: flex; gap: 6px; align-items: stretch; }
.sz-lab { display: flex; flex-direction: column; justify-content: space-around; padding-top: 18px; width: 52px; flex: none; font-size: 10px; text-align: center; }
.sz-track { position: relative; flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 2px 8px; scroll-behavior: smooth; }
.sz-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.sz-col > b { font-size: 11px; opacity: .7; }
.sz-col.reached > b { color: #ffe7b0; opacity: 1; }
.sz-node { position: relative; width: 68px; height: 78px; gap: 3px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.sz-node img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .9; }
.sz-node .sz-ico { position: relative; font-size: 18px; }
.sz-node .sz-ico img { position: static; width: 22px; height: 22px; }
.sz-node small { position: relative; display: block; max-width: 64px; font-size: 9px; line-height: 1.05; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sz-node.prem { background: rgba(255, 200, 80, .14); }
.sz-node.open { box-shadow: 0 0 0 2px #ffd76a; animation: retPulse 1.4s ease-in-out infinite; }
.sz-node.locked { opacity: .45; }
.sz-node.claimed { opacity: .55; }
.sz-node.claimed::after { content: '✓'; position: absolute; right: 4px; bottom: 2px; color: #7dff9a; font-weight: 800; }

/* 7. гардероб */
.w-stage { display: flex; flex-direction: column; align-items: center; margin: 4px 0 8px; }
.w-stage .w-rico { width: 240px; height: 240px; max-width: 64vw; max-height: 64vw; display: inline-block; }
.w-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.w-tab { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #ffe9b0; font: 700 12px Comfortaa, system-ui;
  display: flex; align-items: center; justify-content: center; gap: 4px; }
.w-tab img { width: 24px; height: 24px; }
.w-tab.on { background: linear-gradient(180deg, #ffe08a, #c99a2a); color: #1a1008; }
.w-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.w-card { border-radius: 14px; background: rgba(255, 255, 255, .08); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.w-card.worn { box-shadow: 0 0 0 2px #7dff9a; }
.w-card.locked .w-art { opacity: .6; }
.w-art { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.w-art img { width: 100%; height: 100%; object-fit: contain; }
.w-card b { font-size: 12px; }
.w-card small { font-size: 11px; opacity: .85; }
.w-btns { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.w-btns .btn { min-height: 44px; padding: 0 6px; font-size: 12px; }
.rico-face { position: relative; }
.rico-face .rico-wear { position: absolute; pointer-events: none; height: auto; }

/* 7.4 декор в законченной комнате */
#meta-scene .ret-decor { position: absolute; right: 4%; bottom: 6%; width: 22%; height: auto; z-index: 6; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
#meta-scene .ret-decor-btn { position: absolute; right: 8px; top: 8px; z-index: 7; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(20, 12, 40, .75); color: #fff; font-size: 20px; box-shadow: 0 0 0 2px #ffd76a; }

/* ---------- фаза 2 ---------- */
/* 3. «Рико скучает» */
.cb-scene { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cb-scene .cb-box { width: 160px; height: 160px; object-fit: contain; animation: retPulse 1.2s ease-in-out infinite; font-size: 80px; }
.cb-gift { font: 800 15px/1.3 var(--tu-body, Comfortaa, system-ui); color: #ffe7b0; margin: 4px 0; }
/* 4. «Грядки Рико» */
.g-beds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.g-bed { border-radius: 14px; background: rgba(120, 80, 40, .28); padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-height: 150px; }
.g-bed.ripe { box-shadow: 0 0 0 2px #7dff9a, 0 0 14px rgba(120, 255, 150, .4); }
.g-art { width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.g-art img { width: 100%; height: 100%; object-fit: contain; }
.g-bed b { font-size: 12px; } .g-bed small { font-size: 11px; opacity: .85; min-height: 13px; }
.g-seeds { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.g-seed, .g-btn { min-height: 44px; font-size: 12px; padding: 0 6px; width: 100%; }
/* 6. наклейки */
.st-page { border-radius: 14px; background: rgba(255, 255, 255, .07); padding: 8px; margin: 6px 0; }
.st-page.done { box-shadow: 0 0 0 2px #7dff9a; }
.st-page > b { display: block; font-size: 13px; } .st-page > small { font-size: 11px; opacity: .8; }
.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.st-cell { position: relative; aspect-ratio: 1; border: 1.5px dashed rgba(255, 255, 255, .3); border-radius: 12px; background: rgba(0, 0, 0, .2); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; min-height: 64px; padding: 2px; }
.st-cell.got { border-style: solid; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .1); }
.st-cell.gold { border-color: #ffd76a; }
.st-cell img { width: 100%; height: 100%; object-fit: contain; }
.st-cell i { position: absolute; right: 3px; bottom: 2px; font: 800 11px/1 system-ui; font-style: normal; background: #ff9a3c; color: #1a1008; border-radius: 8px; padding: 1px 4px; }
.st-cell:not([disabled]).empty { border-color: #7dff9a; animation: retPulse 1.4s ease-in-out infinite; }
.st-swap-hint { text-align: center; color: #7dff9a; font-weight: 700; font-size: 12px; }
/* 8. испытания выходных */
.wk-list { display: flex; flex-direction: column; gap: 8px; }
.wk-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.wk-card.done { box-shadow: 0 0 0 2px #ffd76a; }
.wk-ico { width: 48px; height: 48px; flex: none; font-size: 30px; display: flex; align-items: center; justify-content: center; }
.wk-main { flex: 1; min-width: 0; } .wk-main b { display: block; font-size: 14px; } .wk-main small { font-size: 11px; opacity: .85; }
.wk-stars i { font-style: normal; color: rgba(255, 255, 255, .25); font-size: 18px; } .wk-stars i.on { color: #ffd76a; }
.wk-play { min-height: 44px; min-width: 76px; flex: none; padding: 0 8px; }
.cb-scene .cb-rico { width: 180px; height: 180px; object-fit: contain; }
.g-bed .g-art img { image-rendering: auto; }

/* ---------- фаза 3 ---------- */
.soc-ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255, 215, 106, .6); }
.sz-head .soc-ava { width: 24px; height: 24px; vertical-align: -6px; }
/* 9. лига */
.lg-table { display: flex; flex-direction: column; gap: 4px; max-height: 46dvh; overflow-y: auto; }
.lg-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); min-height: 48px; }
.lg-row b { width: 24px; text-align: center; font-size: 13px; }
.lg-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lg-row i { font-style: normal; font-weight: 800; color: #ffe7b0; }
.lg-row.up { background: rgba(80, 200, 120, .18); }
.lg-row.down { background: rgba(230, 80, 90, .18); }
.lg-row.me { box-shadow: 0 0 0 2px #ffd76a; position: sticky; top: 0; bottom: 0; z-index: 2; background: #3c1e5a !important; isolation: isolate; }
/* 10. друзья */
.fr-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); margin: 4px 0; }
.fr-main { flex: 1; min-width: 0; } .fr-main b { display: block; font-size: 13px; } .fr-main small { font-size: 11px; opacity: .8; }
.fr-btn { min-width: 48px; min-height: 48px; padding: 0; font-size: 20px; flex: none; }
.fr-code { letter-spacing: .08em; color: #ffe7b0; user-select: all; }
.fr-add { display: flex; gap: 6px; margin: 6px 0; }
.fr-add input { flex: 1; min-height: 44px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .25); color: #fff; padding: 0 10px; font: 700 15px system-ui; text-transform: uppercase; }
.fr-add .btn { min-height: 44px; flex: 0 0 auto; width: auto !important; padding: 0 14px; font-size: 14px; white-space: nowrap; }
/* 11. гости */
.gs-list { display: flex; flex-direction: column; gap: 6px; }
.gs-card { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #fff; text-align: left; min-height: 56px; }
.gs-card div { flex: 1; min-width: 0; } .gs-card b { display: block; font-size: 13px; } .gs-card small { font-size: 11px; opacity: .8; }
.gs-card i { font-style: normal; font-weight: 800; }
.gs-scene { position: relative; border-radius: 14px; overflow: hidden; margin: 6px 0; }
.gs-scene .meta-scene { position: relative; margin: 0; max-height: 46vh; }
.gs-scene .meta-scene img { object-fit: cover; }
.gs-scene .ret-decor { position: absolute; right: 4%; bottom: 6%; width: 22%; height: auto; z-index: 6; pointer-events: none; }
.gs-heart { min-height: 64px !important; font-size: 18px !important; }

/* 30.11: настоящий арт удержания (grok/hikari-retention-art, retention-art-NOTES.md) */
.rico-face, .rico-home { overflow: visible; }
.cal-grid { background: url(../assets/retention/calendar/cal_bg.webp) center / cover no-repeat; border-radius: 14px; }
.cal-cell { background: url(../assets/retention/calendar/cal_cell_locked.webp) center / 100% 100% no-repeat; }
.cal-cell.today { background-image: url(../assets/retention/calendar/cal_cell_today.webp); }
.cal-cell.claimed { background-image: url(../assets/retention/calendar/cal_cell_claimed.webp); opacity: .8; }
.cal-cell.missed { background-image: url(../assets/retention/calendar/cal_cell_missed.webp); opacity: .7; }
.cal-cell.chest { background-color: transparent; }
.q-card { background: none; border: 18px solid transparent; border-image: url(../assets/retention/quests/quest_card_bg.webp) 72 fill / 36px; padding: 2px 4px; border-radius: 0; }
