/* Кабінет батьків — «Я в Грі» */
:root { --ink: #1B1F3B; --ink2: #555B7A; --ink3: #8A8FAA; --bg: #F3F1FA; --card: #fff; --pink: #FF3D8B; --violet: #8B6CFF; --coral: #FF6A3D; --cyan: #2DD4E8; --lime: #C8F545; --amber: #FFC53D; --green: #2FB24C; --red: #E5484D; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.45 "Golos Text", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: Unbounded, sans-serif; margin: 0; letter-spacing: -.02em; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 14px 60px; }

.bt-top { position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; padding: calc(10px + env(safe-area-inset-top)) max(14px, calc((100% - 1080px) / 2 + 14px)) 10px; display: flex; align-items: center; gap: 12px; }
.bt-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 3px solid var(--amber); }
.bt-top b { display: block; font: 800 17px Unbounded, sans-serif; }
.bt-top small { color: #B9B4D0; font-weight: 600; }
.bt-top .sp { flex: 1; }
.bt-live { display: inline-flex; align-items: center; gap: 6px; font: 700 12px "Golos Text", sans-serif; color: #C9F7A0; }
.bt-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,245,69,.2); animation: pl 1.6s infinite; }
@keyframes pl { 50% { box-shadow: 0 0 0 7px rgba(200,245,69,0); } }
.bt-kid { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; background: #2C2F55; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 16px; }
.c { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: 0 14px 30px -24px rgba(27,31,59,.45); grid-column: span 12; }
@media (min-width: 900px) { .c.w6 { grid-column: span 6; } .c.w4 { grid-column: span 4; } .c.w8 { grid-column: span 8; } }
.c h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.c h2 .n { min-width: 24px; height: 24px; border-radius: 12px; background: var(--pink); color: #fff; font: 800 12px Unbounded; display: inline-grid; place-items: center; padding: 0 7px; }
.muted { color: var(--ink2); font-size: 14px; }

/* баланс */
.bal { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .t b { font: 900 26px Unbounded, sans-serif; letter-spacing: -.03em; display: block; }
.ring .t span { font-size: 12px; color: var(--ink2); font-weight: 700; }
.bal-side { flex: 1; min-width: 0; }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 99px; margin-bottom: 10px; }
.state.ok { background: #DFF7E5; color: #14783A; } .state.no { background: #FFE3E5; color: #B4232A; } .state.night { background: #E6E9FF; color: #3B44A8; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.q { min-height: 52px; border: 0; border-radius: 16px; background: #EFFAD5; color: #2E5A00; font: 800 16px Unbounded, sans-serif; cursor: pointer; box-shadow: 0 4px 0 #D3EBA4; }
.q:active { transform: translateY(3px); box-shadow: 0 1px 0 #D3EBA4; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.q2 { min-height: 46px; border: 2px solid #ECE8F5; border-radius: 14px; background: #fff; font-weight: 800; font-size: 14px; cursor: pointer; }
.q2.danger { color: var(--red); }
.q2.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* заявки */
.req { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: #FFF4F8; margin-bottom: 8px; animation: in .3s ease-out; }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.req .ico { width: 44px; height: 44px; border-radius: 14px; background: #fff; display: grid; place-items: center; flex: none; }
.req .ico svg { width: 28px; height: 28px; }
.req .tx { flex: 1; min-width: 0; }
.req .tx b { display: block; font-weight: 800; }
.req .tx span { font-size: 13px; color: var(--ink2); }
.yes, .no2 { width: 48px; height: 48px; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center; }
.yes { background: var(--green); color: #fff; } .no2 { background: #fff; color: var(--red); border: 2px solid #F3D3D5; }
.yes svg, .no2 svg { width: 22px; height: 22px; }
.done { font-size: 13px; color: var(--ink3); padding: 6px 2px; display: flex; gap: 8px; align-items: center; }
.done b { color: var(--ink2); }
.empty { color: var(--ink3); font-size: 14px; padding: 8px 0; }

/* сьогодні */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--bg); border-radius: 16px; padding: 12px; }
.kpi b { display: block; font: 900 clamp(15px, 4.4vw, 20px) Unbounded, sans-serif; letter-spacing: -.02em; white-space: nowrap; }
.kpi span { font-size: 12px; color: var(--ink2); font-weight: 700; }
.games-list .gl { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gl .nm { width: 42%; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl .bar { flex: 1; height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.gl .bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--pink)); }
.gl .tm { width: 56px; text-align: right; font-weight: 800; font-size: 13px; }

/* тиждень */
.week svg { width: 100%; height: 190px; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 700; color: var(--ink2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* завдання */
.task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0EEF6; }
.task:last-child { border-bottom: 0; }
.task .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex: none; }
.task .ico svg { width: 24px; height: 24px; }
.task .tx { flex: 1; font-weight: 700; }
.task .mn { font: 800 14px Unbounded; color: var(--green); white-space: nowrap; }
.del { width: 40px; height: 40px; border: 0; background: transparent; color: var(--ink3); cursor: pointer; border-radius: 12px; }
.del:hover { background: #FFE3E5; color: var(--red); }
.add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.add input { flex: 1 1 160px; min-height: 48px; border: 2px solid #ECE8F5; border-radius: 14px; padding: 0 14px; font: 600 15px "Golos Text"; outline: none; }
.add input:focus { border-color: var(--violet); }
.add select { min-height: 48px; border: 2px solid #ECE8F5; border-radius: 14px; padding: 0 10px; font: 700 15px "Golos Text"; background: #fff; }
.add .btn { min-height: 48px; padding: 0 18px; font-size: 14px; border-radius: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1.5px dashed #CFC8E6; background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }

/* правила */
.rule { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F0EEF6; }
.rule:last-child { border-bottom: 0; }
@media (max-width: 560px) { .rule { flex-wrap: wrap; } .rule .tx { flex: 1 1 calc(100% - 70px); } .rule .seg { flex: 1 1 100%; } .rule .seg button { flex: 1; } .rule .times { flex: 1 1 100%; } .rule .times input { flex: 1; } }
@media (max-width: 480px) { .bt-live { display: none; } .bt-kid { padding: 0 10px; font-size: 13px; } }
.rule .tx { flex: 1; }
.rule .tx b { display: block; font-weight: 800; }
.rule .tx span { font-size: 13px; color: var(--ink2); }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 3px 8px rgba(27,31,59,.12); }
.sw { width: 52px; height: 32px; border-radius: 16px; background: #DAD6E8; border: 0; position: relative; cursor: pointer; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.sw.on { background: var(--green); } .sw.on::after { left: 23px; }
.times { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 13px; }
.times input { width: 92px; min-height: 38px; border: 2px solid #ECE8F5; border-radius: 10px; padding: 0 6px; font: 700 14px "Golos Text"; }

/* історія */
.ev { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #F4F2F9; }
.ev:last-child { border-bottom: 0; }
.ev .d { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ev .tx { flex: 1; }
.ev .tm { color: var(--ink3); font-size: 12px; white-space: nowrap; }
.ev .v { font-weight: 800; white-space: nowrap; }

/* посилання дитини */
.link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link code { flex: 1 1 200px; background: var(--bg); border-radius: 12px; padding: 12px; font: 600 13px ui-monospace, monospace; overflow-wrap: anywhere; }

.welcome { background: linear-gradient(135deg, #8B6CFF, #FF3D8B); color: #fff; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.welcome > div { flex: 1 1 260px; }
.welcome h2 { font-size: 20px; margin-bottom: 4px; }
.welcome .muted { color: #FCE9FF; }
.welcome .btn { --c: #1B1F3B; flex: 1 1 200px; }

.embed .bt-top { padding-top: 52px; }

/* PIN */
.pin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #1B1F3B, #3A2E7A); }
.pin-card { width: 100%; max-width: 360px; background: #fff; border-radius: 30px; padding: 28px 22px; text-align: center; }
.pin-card img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; border: 4px solid var(--amber); }
.pin-card h1 { font-size: 21px; margin: 12px 0 6px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 18px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--ink); }
.pin-dots i.f { background: var(--ink); }
.pin-dots.bad { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { min-height: 60px; border: 0; border-radius: 18px; background: var(--bg); font: 800 22px Unbounded; cursor: pointer; }
.pad button:active { background: #E2DEF0; }
.pad .x { background: transparent; font-size: 15px; font-family: "Golos Text"; }
.demo-bar { background: var(--amber); color: var(--ink); text-align: center; font-weight: 800; font-size: 13px; padding: 8px 12px; }
.demo-bar a { color: var(--ink); }
/* кілька дітей: вкладки під шапкою (js/batky.js перемикач) */
.bt-kids { display: flex; gap: 8px; overflow-x: auto; padding: 10px max(14px, calc((100% - 1080px) / 2 + 14px)); background: #2C2F55; }
.bt-kid-tab { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; background: rgba(255,255,255,.08); }
.bt-kid-tab.on { background: #fff; color: var(--ink); }
