:root {
  --bg: #fff8f0;
  --fg: #222;
  --accent: #84cc16;
  --accent-2: #3b82f6;
  --danger: #ef4444;
  --muted: #6b7280;
  --border: rgba(0,0,0,0.1);
  --card: rgba(255,255,255,0.8);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0b1020; --fg:#f5f5f5; --border:rgba(255,255,255,0.12); --card:rgba(255,255,255,0.04); --muted:#9ca3af; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); overflow: hidden; }

.top {
  position: fixed; inset: 0 0 auto 0; height: 56px;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 1rem; border-bottom: 1px solid var(--border); background: var(--card); backdrop-filter: blur(8px);
  z-index: 10;
}
.lesson-title { font-size: 1.2rem; font-weight: 700; }
.status-chip { font-size: 0.8rem; color: var(--muted); padding: 0.15rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; }
.spacer { flex: 1; }

.btn {
  border: 1px solid var(--border); background: transparent; color: inherit;
  border-radius: 6px; padding: 0.5rem 1rem; font-size: 1rem; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.hint-btn { font-size: 1.4rem; font-weight: 700; width: 2.5rem; padding: 0; background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.done-btn { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }

.layout { position: fixed; inset: 56px 0 0 0; }
#blocklyArea { width: 100%; height: 100%; }

.hint-bubble {
  position: fixed; right: 1rem; bottom: 1rem;
  max-width: 360px; padding: 1rem; background: var(--card); backdrop-filter: blur(12px);
  border: 2px solid var(--accent-2); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 20;
}
.hint-text { font-size: 1.05rem; line-height: 1.4; margin-bottom: 0.75rem; }
.hint-close { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

.offline-chip {
  position: fixed; top: 70px; right: 1rem;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: rgba(239,68,68,0.1); color: var(--danger); font-size: 0.8rem;
  z-index: 15;
}

.lock-screen {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.lock-box {
  background: var(--card, #fff); color: var(--fg, #222);
  padding: 2rem 3rem; border-radius: 16px;
  text-align: center; max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.lock-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.lock-hint { color: var(--muted, #6b7280); margin-bottom: 1rem; }
.lock-countdown { font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--accent-2, #3b82f6); }
