/* ---- Fun / AI / Game / School zones (loaded per-page on top of app.css) ---- */

/* shared */
.zone-head { display: flex; align-items: center; gap: 12px; margin: 24px 0 6px; flex-wrap: wrap; }
.zone-head h1 { font-family: var(--display); font-size: 26px; margin: 0; flex: 1; }
.zone-sub { color: var(--ink-soft); margin: 0 0 18px; }
.time-chip { display: inline-flex; align-items: center; gap: 7px; background: #E8F1FF;
  color: #1E4FA3; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 14px; }
.time-chip.low { background: #FDF1EE; color: #B3261E; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.zone-tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.zone-tabs a { text-decoration: none; font-weight: 800; font-size: 14px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--rule); border-radius: 999px; padding: 8px 16px; }
.zone-tabs a.on, .zone-tabs a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pending-chip { background: #FFF3E2; color: #9A6215; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 800; }

/* time's-up page */
.timesup { max-width: 520px; margin: 60px auto; text-align: center; background: var(--card);
  border-radius: var(--radius); padding: 38px 30px; box-shadow: 0 8px 24px rgba(30,42,74,.10); }
.timesup .big { font-size: 64px; }
.timesup h1 { font-family: var(--display); margin: 10px 0 6px; }
.timesup p { color: var(--ink-soft); margin: 4px 0; }

/* fun zone — video + music */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.media-card { background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 12px rgba(30,42,74,.08); display: flex; flex-direction: column; }
.media-card .frame { aspect-ratio: 16/9; background: #10131C; }
.media-card iframe { width: 100%; height: 100%; border: 0; display: block; }
.media-card .meta { padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.media-card .meta strong { flex: 1; font-family: var(--display); font-size: 14.5px; line-height: 1.25; }
.track { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 10px; box-shadow: 0 3px 8px rgba(30,42,74,.07); flex-wrap: wrap; }
.track strong { font-family: var(--display); min-width: 160px; }
.track audio { flex: 1; min-width: 220px; height: 36px; }

/* painting studio */
.paint-wrap { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.paint-tools { display: flex; flex-direction: column; gap: 10px; background: var(--card);
  border-radius: var(--radius); padding: 14px; width: 172px; flex: none; align-self: flex-start; }
.paint-tools h3 { font-family: var(--display); font-size: 13px; margin: 4px 0 0; color: var(--ink-soft); }
.swatches { display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #fff; cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--rule); }
.swatch.on { box-shadow: 0 0 0 2.5px var(--accent); }
.brush-row { display: flex; gap: 6px; align-items: center; }
.brush-dot { border-radius: 50%; background: var(--ink); flex: none; cursor: pointer; border: 2px solid transparent; }
.brush-dot.on { border-color: var(--accent); }
.tool-btn { border: 1.5px solid var(--rule); background: #F3F6FB; border-radius: 10px; padding: 8px 10px;
  font-weight: 800; font-size: 13.5px; cursor: pointer; text-align: left; }
.tool-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
#paint-canvas { background: #fff; border-radius: var(--radius); box-shadow: 0 6px 18px rgba(30,42,74,.12);
  cursor: crosshair; touch-action: none; max-width: 100%; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.art-card { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 10px rgba(30,42,74,.08); }
.art-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; background: #fff; }
.art-card .meta { padding: 8px 10px; display: flex; align-items: center; gap: 6px; }
.art-card .meta strong { flex: 1; font-size: 13.5px; font-family: var(--display); }

/* AI zone */
.ai-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ai-side { width: 250px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.ai-main { flex: 1; min-width: 300px; }
.chat-box { background: var(--card); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(30,42,74,.08);
  display: flex; flex-direction: column; height: 62vh; min-height: 420px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; font-size: 15px;
  white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: #F0F3FA; border-bottom-left-radius: 4px; }
.bubble.ai.thinking { color: var(--ink-soft); font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1.5px solid var(--rule); }
.chat-input textarea { flex: 1; resize: none; height: 52px; font-size: 15px; }
.chat-list { display: flex; flex-direction: column; gap: 4px; }
.chat-list a { text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-list a:hover { background: #E0E9F7; }
.chat-list a.on { background: var(--accent); color: #fff; font-weight: 700; }
.starter { border: 1.5px dashed var(--rule); background: #FFFDF5; border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; cursor: pointer; text-align: left; font-weight: 700; }
.starter:hover { background: #FFF4D6; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.app-tile { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 12px;
  padding: 14px; text-decoration: none; color: var(--ink); box-shadow: 0 3px 10px rgba(30,42,74,.08);
  transition: transform .12s; }
.app-tile:hover { transform: translateY(-2px); }
.app-tile .ico { font-size: 30px; }
.app-tile strong { font-family: var(--display); display: block; }
.app-tile small { color: var(--ink-soft); line-height: 1.35; display: block; }

/* game zone */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.game-card { background: var(--card); border-radius: var(--radius); padding: 18px; text-align: center;
  text-decoration: none; color: var(--ink); box-shadow: 0 4px 12px rgba(30,42,74,.08); transition: transform .12s; }
.game-card:hover { transform: translateY(-3px); }
.game-card .ico { font-size: 44px; display: block; }
.game-card strong { font-family: var(--display); font-size: 17px; display: block; margin: 8px 0 2px; }
.game-card small { color: var(--ink-soft); display: block; }
.game-card .madeby { margin-top: 8px; display: inline-block; background: #EFE7FB; color: #6C3FA0;
  border-radius: 999px; font-size: 11.5px; font-weight: 800; padding: 3px 10px; }
.game-frame { width: 100%; height: 74vh; min-height: 480px; border: 0; border-radius: var(--radius);
  background: #10131C; box-shadow: 0 8px 22px rgba(30,42,74,.16); }
.builder-card { background: linear-gradient(135deg, #2B2350, #6C3FA0); color: #fff; border-radius: var(--radius);
  padding: 22px; margin: 20px 0; }
.builder-card h2 { font-family: var(--display); margin: 0 0 6px; }
.builder-card p { margin: 0 0 12px; opacity: .85; }
.builder-card textarea, .builder-card input { width: 100%; border: 0; }
.busy-note { display: none; align-items: center; gap: 10px; font-weight: 800; margin-top: 10px; }
.busy-note.show { display: flex; }
.spin { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
.spin.dark { border-color: rgba(30,42,74,.2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* school zone */
.cal-month { margin-bottom: 26px; }
.cal-month h2 { font-family: var(--display); font-size: 18px; margin: 0 0 10px; }
.cal-line { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; }
.cal-line:hover { background: #F3F6FB; }
.cal-line.today-line { background: #FFF9EC; border: 1.5px solid #F2B23A; }
.cal-date { flex: none; width: 52px; text-align: center; background: var(--card); border: 1.5px solid var(--rule);
  border-radius: 10px; padding: 4px 0; }
.cal-date b { display: block; font-family: var(--display); font-size: 19px; line-height: 1.1; }
.cal-date small { font-size: 10.5px; color: var(--ink-soft); font-weight: 800; text-transform: uppercase; }
.cal-body { flex: 1; }
.cal-body strong { font-family: var(--display); }
.ev-kind { border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 800; }
.ev-Holiday { background: #E5F5EC; color: #1B7A46; }
.ev-Exam { background: #FDF1EE; color: #B3261E; }
.ev-PTM { background: #E8EAF9; color: #3B4CB8; }
.ev-Event { background: #FFF3E2; color: #9A6215; }
.ev-Deadline { background: #FBEAE9; color: #B3261E; }
.file-line { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 3px 8px rgba(30,42,74,.07); flex-wrap: wrap; }
.file-line .ico { font-size: 26px; }
.file-line .info { flex: 1; min-width: 180px; }
.file-line .info strong { font-family: var(--display); display: block; }
.file-line .info small { color: var(--ink-soft); }

/* zones settings (parent) */
.zone-set { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.usage-bar { height: 10px; background: var(--rule); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.usage-bar i { display: block; height: 100%; background: var(--accent); }
.usage-bar i.over { background: #E4573D; }
