@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700&display=swap');

:root{
  --bg:radial-gradient(circle at 20% 20%, #ffe9fb 0%, #f5f7ff 45%, #fde7ff 100%);
  --card:#fff6ff;
  --text:#3a1f4b;
  --muted:#81608e;
  --line:rgba(143,88,194,.25);
  --accent:#19c3c3;
  --accent-dark:#0aa1a1;
  --shadow:0 18px 40px rgba(122, 80, 189, .18);
}
*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  font-family:"Baloo 2","Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  min-height:100%;
}
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 199, 135, .45) 0, rgba(255, 199, 135, 0) 55%),
    radial-gradient(circle at 82% 8%, rgba(255, 120, 168, .45) 0, rgba(255, 120, 168, 0) 50%),
    radial-gradient(circle at 70% 68%, rgba(108, 215, 255, .45) 0, rgba(108, 215, 255, 0) 55%),
    radial-gradient(circle at 18% 78%, rgba(255, 255, 171, .45) 0, rgba(255, 255, 171, 0) 55%);
  z-index:-1;
}
body, input, select, textarea, button{
  font-family:"Baloo 2","Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif;
}
a{color:var(--accent);text-decoration:none}
.wrap{max-width:900px;margin:0 auto;padding:24px}
.header{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:8px 0 16px;padding:24px;border-radius:28px;background:rgba(255,255,255,.72);box-shadow:var(--shadow);backdrop-filter:blur(8px)}
.title{
  font-weight:700;
  font-size:26px;
  color:#3a1f4b;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
}
.title-main{
  font-weight:800;
  font-size:28px;
  white-space:nowrap;
}
.title-sub{
  font-size:22px;
  font-weight:600;
  color:#584172;
  white-space:nowrap;
}
@media (max-width:640px){
  .title{
    align-items:flex-start;
  }
  .title-main,
  .title-sub{
    white-space:normal;
  }
}
.nav{display:flex;gap:12px;flex-wrap:wrap;margin-left:auto;justify-content:flex-end;align-items:center}
.nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 30px;
  border-radius:999px;
  background:linear-gradient(160deg, rgba(255,255,255,.95) 0%, rgba(255,210,255,.75) 100%);
  border:1px solid rgba(143,88,194,.18);
  color:#331b44;
  font-weight:700;
  font-size:15px;
  letter-spacing:.05em;
  text-transform:lowercase;
  box-shadow:0 12px 24px rgba(143,88,194,.18);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.nav a:hover{transform:translateY(-1px);box-shadow:0 16px 28px rgba(143,88,194,.24);filter:brightness(1.05)}
.nav a:active{transform:scale(.97)}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:22px;
  padding:22px;
  margin:16px auto;
  box-shadow:var(--shadow);
  width:min(100%, 780px);
}
.grid{display:grid;gap:12px;grid-template-columns:1fr 1fr}
@media (max-width: 720px){.grid{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:6px}
label{font-size:14px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
input,select,textarea{padding:12px 12px;border:2px solid transparent;border-radius:16px;background:rgba(255,255,255,.9);font-size:16px;box-shadow:0 6px 14px rgba(98, 74, 173, .08);transition:border-color .15s ease, box-shadow .15s ease}
input:focus,select:focus,textarea:focus{border-color:#ff93d6;box-shadow:0 10px 20px rgba(255, 147, 214, .25);outline:none}
textarea{min-height:100px;resize:vertical}
.small-notes{
  min-height:70px;
}
.badge-row{
  display:flex;
  flex-wrap:wrap;
  gap:18px;
  align-items:flex-start;
  justify-content:flex-start;
  margin-bottom:18px;
}
.homework-badges{
  justify-content:flex-start;
}
.homework-badges .submit-badge{
  width:140px;
}
.badge-field{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:flex-start;
  text-align:left;
  flex:0 0 140px;
}
.badge-field label{
  color:#584172;
  font-weight:700;
  letter-spacing:.08em;
  font-size:13px;
  text-transform:uppercase;
}
.submit-badge{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:120px;
  height:110px;
  border-radius:20px;
  background:linear-gradient(160deg, rgba(255,255,255,.95) 0%, rgba(255,210,255,.75) 100%);
  border:1px solid rgba(143,88,194,.18);
  box-shadow:0 12px 24px rgba(143,88,194,.18);
  padding:12px 10px;
  gap:8px;
  margin:0;
}
.submit-badge input,
.submit-badge select{
  width:100%;
  border:1px solid rgba(143,88,194,.28);
  border-radius:18px;
  background:rgba(255,255,255,.88);
  box-shadow:inset 0 4px 10px rgba(143,88,194,.12);
  text-align:center;
  font-size:18px;
  font-weight:600;
  color:#331b44;
  padding:10px 12px;
}
.submit-badge input::placeholder{
  color:rgba(51,27,68,.35);
}
.pages-badge input{
  height:44px;
  font-size:48px;
  font-weight:700;
  padding:0;
}
.pages-badge,
.reader-badge{
  align-items:center;
}
.title-field{
  flex:1 1 260px;
  min-width:260px;
}
.title-field .submit-badge{
  width:100%;
  min-width:0;
  height:110px;
}
.title-badge input{
  font-size:18px;
  padding:12px 16px;
  text-align:left;
  width:100%;
}
.reader-badge select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  padding-right:36px;
  cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23643ab0' d='M6 8a1 1 0 0 1-.7-.29l-5-5A1 1 0 0 1 1.7.29L6 4.59 10.3.29a1 1 0 0 1 1.4 1.42l-5 5A1 1 0 0 1 6 8Z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:12px 8px;
}
.submit-badge .page-label{
  font-size:12px;
  letter-spacing:0.32em;
  text-transform:uppercase;
  color:#81608e;
}
@media (max-width:720px){
  .badge-row{
    flex-direction:column;
    align-items:stretch;
  }
  .badge-field{
    flex:1 1 auto;
  }
  .submit-badge{
    width:100%;
  }
}
.note-field{margin-top:4px}
.note-field textarea{
  width:100%;
  min-height:80px;
  box-shadow:0 10px 24px rgba(143,88,194,.12);
}
.photo-field{margin-top:18px}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.photo-actions{
  width:100%;
  flex-wrap:nowrap;
  gap:16px;
}
.photo-actions #photoStatus{
  flex:1;
  min-width:140px;
}
.photo-actions #btnSubmit{
  margin-left:auto;
  white-space:nowrap;
}
.btn{
  background:linear-gradient(135deg, #19c3c3 0%, #6ceaab 100%);
  color:#fff;
  border:0;
  border-radius:999px;
  padding:12px 26px;
  font-weight:700;
  font-size:15px;
  cursor:pointer;
  transition:background .15s ease, box-shadow .15s ease, transform .15s ease;
  box-shadow:0 10px 24px rgba(25, 195, 195, .35);
}
.btn:hover{background:var(--accent-dark);box-shadow:0 14px 28px rgba(25, 195, 195, .4)}
.btn:active{transform:scale(.98)}
.btn.secondary{
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  color:var(--text);
  box-shadow:none;
}
.btn.secondary:hover{border-color:rgba(0,0,0,.24);background:#f3f4f6}
.hint{font-size:13px;color:var(--muted)}
.hint.err{color:#c02e2e}
.status{margin-top:8px;font-size:14px}
.status.ok{color:#0a7f42}.status.err{color:#c02e2e}
.list{display:flex;flex-direction:column;gap:10px}
.item{display:flex;gap:12px;border:1px solid rgba(122, 80, 189, .12);border-radius:18px;padding:16px;background:#ffffffcf;backdrop-filter:blur(4px);align-items:flex-start}
.feed-card .list{margin-top:14px}
.feed-card .item{align-self:stretch}
.dashboard-grid{
  display:grid;
  gap:16px;
  margin-top:18px;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
}
.chart-grid{grid-template-columns:repeat(auto-fit, minmax(260px, 1fr))}
.stat-card{
  background:rgba(255,255,255,.9);
  border:1px solid rgba(143,88,194,.18);
  border-radius:18px;
  padding:16px 18px;
  box-shadow:0 12px 24px rgba(122, 80, 189, .16);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.stat-title{
  font-size:16px;
  font-weight:700;
  color:#3a1f4b;
}
.stat-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.stat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
  border-bottom:1px dashed rgba(143,88,194,.15);
}
.stat-row:last-child{border-bottom:0}
.stat-value{
  font-weight:700;
  color:#19c3c3;
  white-space:nowrap;
}
.chart-card{gap:16px}
.chart-bars{
  display:flex;
  align-items:flex-end;
  gap:12px;
  height:160px;
}
.chart-bar-wrapper{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.chart-value{
  min-height:20px;
  font-weight:700;
  color:#331b44;
  font-size:13px;
}
.chart-bar{
  width:100%;
  border-radius:16px 16px 12px 12px;
  background:linear-gradient(160deg, rgba(255,255,255,.95) 0%, rgba(25,195,195,.7) 100%);
  box-shadow:0 12px 20px rgba(25,195,195,.18);
  transition:height .25s ease;
}
.chart-bar.empty{
  background:rgba(255,255,255,.7);
  border:1px dashed rgba(143,88,194,.25);
  box-shadow:none;
}
.chart-week{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}
.page-badge{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:160px;
  min-width:160px;
  height:160px;
  border-radius:20px;
  background:linear-gradient(160deg, rgba(255,255,255,.95) 0%, rgba(255,210,255,.75) 100%);
  border:1px solid rgba(143,88,194,.18);
  box-shadow:0 12px 24px rgba(143,88,194,.18);
  text-align:center;
  padding:18px 12px;
  gap:8px;
  margin:0 auto;
}
.page-count{
  font-size:clamp(53px, 9.3vw, 80px);
  font-weight:900;
  line-height:.8;
  color:#331b44;
  letter-spacing:-0.02em;
}
.page-label{
  font-size:8px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:0.24em;
  color:#81608e;
}
.reader-name{
  font-size:24px;
  font-weight:600;
  color:#584172;
}
.thumb{width:80px;height:80px;border-radius:16px;object-fit:cover;background:#fdf2ff;border:2px dashed rgba(143,88,194,.4)}
.thumb-large{width:160px;height:160px}
.thumb-homework{
  width:min(100%, 400px);
  height:min(100%, 400px);
}
.interactions{display:flex;flex-direction:column;gap:8px;margin-top:8px;width:100%}
.entry-header{display:flex;align-items:center;gap:12px}
.entry-header .date{margin-left:auto;text-align:right;font-size:13px;font-weight:600;color:#81608e}
.entry-header .kid{flex:1;min-width:0}
.comment-section{display:flex;flex-direction:column;gap:8px;padding:8px 0}
.comment-list{display:flex;flex-direction:column;gap:0;max-height:200px;overflow:auto}
.comment{font-size:13px;color:#4a2f58;padding:0;white-space:pre-wrap;line-height:1.2}
.comment-header{font-weight:600;font-size:12px}
.comment-body{margin-top:3px;white-space:pre-wrap}
.comment-form{display:grid;grid-template-columns:1fr 140px;gap:4px;font-size:12px;align-items:flex-start}
.comment-form textarea{grid-column:1/2;font-size:12px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;min-height:60px;resize:vertical}
.comment-form .comment-side{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:stretch;
  width:100%;
}
.comment-form .comment-side input{
  font-size:12px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  width:100%;
  max-width:100%;
}
.comment-form .comment-side .btn{
  align-self:stretch;
  width:100%;
  max-width:100%;
}
.comment-section .status{margin:0;font-size:12px}
.btn.small{padding:6px 10px;font-size:12px}
.meta{display:flex;flex-direction:column;gap:6px;flex:1}
.kid{font-weight:700;color:#331b44}
.date{color:var(--muted);font-size:13px;font-weight:600}
.small{font-size:13px;color:#4a2f58}
hr.sep{border:0;border-top:1px solid var(--line);margin:8px 0}
.badge{display:inline-block;padding:6px 12px;border-radius:999px;background:#ffefff;color:#8a3ba2;font-size:12px;border:1px solid rgba(138,59,162,.35)}
.icon-btn{background:#fff;border:2px solid transparent;border-radius:999px;padding:10px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 12px rgba(88, 58, 150, .12);transition:transform .15s ease, box-shadow .15s ease}
.icon-btn:hover{transform:translateY(-1px);box-shadow:0 10px 18px rgba(88,58,150,.18)}
.icon{width:18px;height:18px;display:inline-block;background-size:contain;background-repeat:no-repeat}
.icon-heart{background-image:url('./assets/heart.svg')}
.icon-camera{background-image:url('./assets/camera.svg')}
.icon-trash{background-image:url('./assets/trash.svg')}
.icon-btn.photo-btn{
  background:linear-gradient(135deg, #19c3c3 0%, #6ceaab 100%);
  border:0;
  border-radius:18px;
  padding:12px 20px;
  box-shadow:0 12px 24px rgba(25,195,195,.28);
  color:#fff;
}
.icon-btn.photo-btn .icon-emoji{
  font-size:26px;
  line-height:1;
}
.icon-btn.photo-btn:hover{transform:translateY(-1px);box-shadow:0 16px 28px rgba(25,195,195,.34)}
.icon-btn.photo-btn:active{transform:scale(.97)}
.hidden{display:none}

@media (max-width:640px){
  .wrap{padding:16px}
  .card{padding:18px;margin:12px auto;width:100%}
  .dashboard-grid{grid-template-columns:1fr;margin-top:12px}
  .chart-bars{height:140px}
  .item{flex-direction:column;align-items:stretch;gap:18px}
  .page-badge{
    width:100%;
    min-width:0;
    height:auto;
    padding:16px 12px;
    margin:0;
  }
  .page-count{font-size:44px}
  .thumb-large{width:100%;height:200px}
  .entry-header{flex-direction:column;align-items:flex-start;gap:6px}
  .entry-header .date{margin-left:0;text-align:left}
  .comment-form{grid-template-columns:1fr;gap:10px}
  .comment-form textarea{grid-column:1/2}
  .comment-form .comment-side{width:100%}
  .comment-form .comment-side input,
  .comment-form .comment-side .btn{width:100%}
}
