:root{
  --max: 720px;

  /* Controlled kid-friendly accents */
  --c-ok: #2ecc71;
  --c-bad: #e74c3c;
  --c-prog-a: #4a90e2;
  --c-prog-b: #2ecc71;
  --c-warm: #fff8e1;
  --c-warm-b: #f4c542;

  --ink: #1b1f2a;
  --line: rgba(27,31,42,.22);
}

*{ box-sizing:border-box; }

html, body{
  height: 100%;
}

body{
  margin:0;
  font-family: Verdana, Arial, sans-serif;

  /* Radial glow background WITHOUT visible "split" */
  /* Key: repeat + fixed attachment + full height + base colour */
  background-color: #f6f6f6;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(74,144,226,.18) 0%, rgba(74,144,226,0) 55%),
    radial-gradient(circle at 80% 30%, rgba(46,204,113,.15) 0%, rgba(46,204,113,0) 55%),
    radial-gradient(circle at 50% 90%, rgba(244,196,66,.18) 0%, rgba(244,196,66,0) 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 140% 140%;
}

/* Container */
.app{
  max-width: var(--max);
  margin:0 auto;
  padding:16px;
}

/* Card */
.card{
  position:relative;
  z-index:0;
  background:#fff;
  border-radius:18px;
  padding:16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.12);
}

/* Helpers */
.row{
  display:flex;
  gap:10px;
  align-items:center;
  margin:12px 0;
  flex-wrap:wrap;
}

label{ min-width:60px; }

input{
  padding:10px;
  font-size:16px;
  width:180px;
  border-radius:14px;
  border:1px solid var(--line);
}

/* Nav */
.topbar{
  display:flex;
  justify-content:space-between;
  margin-bottom:10px;
}

.link{
  color: var(--ink);
  text-decoration:none;
  font-weight:700;
}

/* Buttons */
.btn{
  padding:12px 14px;
  font-size:16px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:14px;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
}

.btn:active{
  transform: scale(.98);
  box-shadow:none;
}

.btn.primary{
  border: none;
  background: linear-gradient(135deg, var(--c-prog-a), var(--c-prog-b));
  color:#fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
  position:relative;
  overflow:hidden;
}

.btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,.18);
}

.btn.primary:active{
  transform: scale(.98);
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}

/* Subtle shine on primary buttons */
.btn.primary::after{
  content:"";
  position:absolute;
  top:-40%;
  left:-60%;
  width:50%;
  height:180%;
  background: rgba(255,255,255,.18);
  transform: rotate(20deg);
  animation: btnShine 5.5s ease-in-out infinite;
}

@keyframes btnShine{
  0%   { left:-60%; opacity:0; }
  10%  { opacity:.55; }
  25%  { left:120%; opacity:0; }
  100% { left:120%; opacity:0; }
}

/* Text blocks */
.k{ font-size:12px; opacity:.75; }
.v{ font-size:22px; font-weight:800; }
.muted{ opacity:.7; }

hr{
  border:none;
  border-top:1px solid #ddd;
  margin:14px 0;
}

/* Prompt + choices */
.prompt{
  font-size:28px;
  padding:12px 0 16px;
}

.choices{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.choice{
  min-height:64px;
  padding:14px;
  font-size:18px;
  border-radius:20px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fff7e6);
  cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.choice:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
  border-color: rgba(74,144,226,.55);
}

.choice:active{
  transform: scale(.97);
}

.choice:disabled{
  opacity:.6;
  cursor:default;
  transform:none;
  box-shadow:none;
}

/* Feedback */
.feedback{
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
}

.feedback.ok{ border-color: rgba(46,204,113,.55); background: rgba(46,204,113,.07); }
.feedback.bad{ border-color: rgba(231,76,60,.55); background: rgba(231,76,60,.06); }

/* Generic grids/panels (progress page etc.) */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.panel{
  border:1px solid var(--line);
  border-radius:18px;
  padding:10px;
  background:#fff;
}

/* --------------------------
   Kidbar (play screen)
--------------------------- */

.kidbar{ margin-bottom:14px; }

.kidbar-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.kid-title{
  font-size:20px;
  font-weight:900;
}

.kid-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.stat{
  border:1px solid var(--line);
  border-radius:18px;
  padding:10px 12px;
  background:#fff;
  min-width:130px;
}

.stat:first-child{
  background: linear-gradient(135deg, #fff8e1, #ffffff);
  border-color: rgba(244,196,66,.6);
}

.stat .k{ font-size:12px; opacity:.8; }
.stat .v{ font-size:22px; font-weight:900; }

/* Progress bar */
.kidbar-progress{ margin-top:10px; }

.qmeta{
  font-size:14px;
  font-weight:800;
  margin-bottom:6px;
}

.pwrap{
  height:16px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  overflow:hidden;
}

.pfill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--c-prog-a), var(--c-prog-b));
  transition: width 220ms ease;
}

/* Badges */
.badges{
  display:flex;
  gap:8px;
  margin-top:10px;
  flex-wrap:wrap;
}

.badge{
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
  font-size:14px;
  font-weight:900;
  background:#fff;
}

.badge.locked{
  opacity:.55;
  background:#eee;
  border-color:#ccc;
}

.badge.unlocked{
  background: linear-gradient(135deg, var(--c-ok), #27ae60);
  color:#fff;
  border:none;
}

/* Answer animations */
.flash-ok{ animation: flashok .25s ease; }
.flash-bad{ animation: flashbad .25s ease; }

@keyframes flashok{
  from{ transform: scale(1.02); }
  to{ transform: scale(1); }
}

@keyframes flashbad{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-3px); }
  50%{ transform: translateX(3px); }
  75%{ transform: translateX(-2px); }
  100%{ transform: translateX(0); }
}

/* --------------------------
   Home page extras (if using the upgraded home.php)
--------------------------- */

.home-card{ overflow:hidden; }

.home-hero{ padding: 6px 2px 10px; }

.home-title{
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 900;
}

.home-subtitle{
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  opacity: .8;
}

.mission{
  margin: 14px 0 14px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(27,31,42,.18);
  background: linear-gradient(135deg, #fff8e1, #f7fbff);
}

.mission-badge{
  display: inline-block;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(27,31,42,.18);
  background: #fff;
  margin-bottom: 8px;
}

.mission-text{
  font-size: 16px;
  font-weight: 800;
}

.mode-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.big-btn{
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border-radius: 20px;
  line-height: 1.15;
}

.big-btn .btn-sub{
  display: block;
  font-size: 13px;
  font-weight: 800;
  opacity: .9;
  margin-top: 6px;
}

/* --------------------------
   Summary modal (fixed + celebratory)
--------------------------- */

.hidden{ display:none !important; }

.summary{
  position:fixed;
  inset:0;
  z-index:999999;
  background: rgba(0,0,0,.65);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.summary-card{
  position:relative;
  z-index:1000000;
  width: min(640px, 100%);
  background:#fff;
  border-radius:20px;
  padding:16px;
  border:1px solid var(--line);
  box-shadow: 0 10px 34px rgba(0,0,0,.22);
  opacity:1;
  animation: popIn .25s ease;
}

@keyframes popIn{
  from{ transform: scale(.92); opacity:0; }
  to{ transform: scale(1); opacity:1; }
}

.summary-title{
  font-size:22px;
  font-weight:900;
  margin-bottom:10px;
}

.summary-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}

.summary-item{
  border:1px solid var(--line);
  border-radius:18px;
  padding:10px;
  background:#fff;
}

.summary-note{
  font-size:16px;
  font-weight:800;
  margin:10px 0 14px;
}