/* App screens: sign in, setup, who's learning, PIN, courses, dashboard.
   Colors and fonts come from player.css so everything looks like one app. */
.app-wrap { max-width: 920px; margin: 0 auto; padding: 22px 20px 70px; }
.view h1 { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.view h2 { font-size: 21px; font-weight: 900; }
.muted { color: var(--muted); font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; margin-bottom: 22px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #ffd25a; display: grid; place-items: center; font-size: 17px; }

.panel { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 28px; margin-top: 18px; }
.panel.narrow { max-width: 560px; margin: 10px auto 0; }
.panel h1 { margin-bottom: 14px; }
.panel > p { margin-bottom: 14px; }
.note { background: var(--blue-soft); color: #1d4fb8; border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: 15px; margin: 14px 0; }
.setup-step { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.setup-step b { color: var(--blue); }

/* forms */
.field { display: block; margin: 14px 0 0; }
.field > span { display: block; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-weight: 600; margin-top: 5px; font-size: 13.5px; }
.field input, .field select, .inline select {
  width: 100%; font: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
  border: 2px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-weight: 600; font-size: 15px; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.check a, .linkish { color: var(--blue); }
.form-msg { color: var(--red); font-weight: 800; min-height: 22px; margin: 12px 0 4px; }
.linkish { background: none; border: none; text-decoration: underline; font-weight: 700; font-size: 15px; margin-top: 14px; }
.tabs { display: flex; gap: 6px; background: #f1ede4; border-radius: 14px; padding: 5px; margin-bottom: 16px; }
.tabs button { flex: 1; border: none; background: none; border-radius: 10px; padding: 10px; font-size: 16px; font-weight: 800; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.btn { border: none; background: var(--blue); color: #fff; border-radius: 14px; font-size: 17px; font-weight: 800; padding: 12px 20px; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.wide { width: 100%; margin-top: 6px; }
.btn.secondary { background: #ece8df; color: var(--ink); }
.btn.danger { background: var(--red); }
.btn.small, .ghost.small { font-size: 14px; padding: 8px 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* avatars */
.av { display: inline-grid; place-items: center; border-radius: 50%; flex: none; line-height: 1; }
.av.sm { width: 34px; height: 34px; font-size: 19px; }
.av.md { width: 58px; height: 58px; font-size: 32px; }
.av.lg { width: 104px; height: 104px; font-size: 58px; }
.av.lock { background: #ece8df; font-size: 46px; }
.av-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.av-opt { position: relative; display: grid; place-items: center; padding: 6px; border-radius: 16px; border: 3px solid transparent; cursor: pointer; }
.av-opt input { position: absolute; opacity: 0; pointer-events: none; }
.av-opt:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.av-opt:has(input:focus-visible) { outline: 3px solid var(--orange); }

/* who's learning */
.big-title { text-align: center; font-size: 36px !important; margin: 18px 0 26px; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 30px; }
.who-tile { width: 170px; background: var(--card); border: 3px solid transparent; border-radius: 26px; box-shadow: var(--shadow);
  padding: 22px 12px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: transform .12s, border-color .12s; }
.who-tile:hover { transform: translateY(-3px); border-color: var(--blue); }
.who-tile b { font-size: 21px; font-weight: 900; overflow-wrap: anywhere; }

/* PIN pad */
.pin-box { max-width: 360px; margin: 6px auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pin-box h1 { margin-top: 12px; }
.dots { display: flex; gap: 16px; margin: 22px 0 6px; }
.dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); }
.dots i.on { background: var(--ink); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.pin-msg { min-height: 24px; color: var(--red); font-weight: 800; margin-bottom: 8px; }
.pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; }
.pad button { height: 74px; border-radius: 20px; border: none; background: var(--card); box-shadow: var(--shadow); font-size: 30px; font-weight: 900; }
.pad button:active { transform: scale(0.96); background: var(--blue-soft); }

/* a learner's courses */
.kid-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.course-grid { display: grid; gap: 14px; }
.course-card { display: flex; align-items: center; gap: 18px; text-align: left; background: var(--card); border: 3px solid transparent;
  border-radius: 22px; box-shadow: var(--shadow); padding: 18px 22px; transition: transform .12s, border-color .12s; }
.course-card:hover { transform: translateY(-2px); border-color: var(--blue); }
.cc-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); display: grid; place-items: center; font-size: 36px; flex: none; }
.mini-calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 42px; height: 42px; }
.mini-calc span { background: #fff; border-radius: 2px; }
.mini-calc span:nth-child(3n) { background: var(--orange); }
.cc-body { flex: 1; min-width: 0; }
.cc-body b { display: block; font-size: 21px; font-weight: 900; }
.cc-body small { display: block; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.bar { height: 10px; background: #ece8df; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.cc-go { font-weight: 900; color: var(--blue); white-space: nowrap; font-size: 17px; }

/* course page header (inside the player's home) */
.course-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.whoami { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.course-emoji { width: 64px; height: 64px; margin: 0 auto 14px; background: var(--ink); border-radius: 18px; display: grid; place-items: center; font-size: 36px; }

/* dashboard */
.dash-top { display: flex; align-items: center; gap: 16px; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.kid-card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 22px 24px; margin-top: 18px; }
.kc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kc-head .muted { font-size: 14.5px; }
.course-block { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.cb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cb-head h3 { font-size: 18px; font-weight: 900; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.dtable th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.dtable td { padding: 8px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.dtable td:first-child { white-space: normal; min-width: 200px; }
.dtable .chip { font-size: 13px; padding: 4px 10px; }
.chip.none { background: #f1ede4; color: var(--muted); }
.cb-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px; }
.inline select { width: auto; font-size: 14.5px; padding: 7px 10px; }
.activity { list-style: none; margin-top: 10px; }
.activity li { padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.activity .when { display: inline-block; min-width: 170px; color: var(--muted); font-size: 14px; }
.privacy p { margin: 8px 0 14px; line-height: 1.5; }

/* toast and loading */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; font-weight: 800;
  padding: 13px 20px; border-radius: 14px; box-shadow: var(--shadow); z-index: 40; max-width: calc(100% - 40px); }
.toast.bad { background: var(--red); }
.loading { display: flex; justify-content: center; gap: 10px; padding: 120px 0; }
.loading span { width: 14px; height: 14px; border-radius: 50%; background: var(--blue); animation: bob 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; }
.loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-10px); opacity: 1; } }

@media (max-width: 600px) {
  .two { grid-template-columns: 1fr; }
  .av-pick { grid-template-columns: repeat(4, 1fr); }
  .who-tile { width: 140px; }
  .av.lg { width: 84px; height: 84px; font-size: 46px; }
  .pad { grid-template-columns: repeat(3, 74px); }
  .dash-top, .kid-top { flex-wrap: wrap; }
  .course-card { flex-wrap: wrap; }
}
