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

:root {
  --pink-50: #fff4f8; --pink-100: #ffe3ee; --pink-200: #fcc8dc; --pink-400: #f7a3c6; --pink-600: #c92a7c;
  --lila-100: #f4eefb; --lila-400: #cdb4f5; --lila-600: #7a3fc6; --lila-800: #5e2ea0;
  --ink: #3a1a36; --muted: #6e4a69; --paper: #fffdfb; --bg: #fff8fb;
  --grid-line: #fbe0ec; --line: #f3dde8;
  --ok: #1f8a5b; --danger: #c0364f;
  --radius: 14px; --shadow: 0 6px 24px rgba(110, 69, 176, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Quicksand', system-ui, sans-serif; font-weight: 600; color: var(--ink); background: var(--bg); }
h1, h2, h3, .brand { font-family: 'Baloo 2', 'Quicksand', sans-serif; font-weight: 600; margin: 0; }
a { color: var(--lila-600); }
button, input, textarea, select { font: inherit; color: inherit; }
.btn { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--lila-100); color: var(--lila-800); cursor: pointer; font-weight: 700; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: linear-gradient(135deg, var(--pink-600), var(--lila-600)); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: #fde8ec; color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { padding: 5px 10px; font-size: 14px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
input:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 3px solid var(--lila-400); outline-offset: 2px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.err { color: var(--danger); min-height: 1.2em; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--lila-100); color: var(--lila-800); }
.pill.live { background: #ffe3ee; color: var(--danger); }
.pill.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 20px; background: linear-gradient(135deg, var(--pink-600), var(--lila-600)); -webkit-background-clip: text; background-clip: text; color: transparent; text-decoration: none; }

/* négyzetrácsos papír */
.gridpaper { background-color: var(--paper); background-image:
  linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid, 20px) var(--grid, 20px); }
.board { position: relative; width: 100%; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
  background-color: #fff; background-image:
  linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid) var(--grid); }
.board canvas { display: block; cursor: crosshair; }

.task { white-space: pre-wrap; font-size: 18px; line-height: 1.55; padding: 12px 16px; background: #fff; border-radius: 10px; border-left: 4px solid var(--pink-400); margin-bottom: 10px; }
.task:empty { display: none; }
.solution { white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
.list { list-style: none; margin: 0; padding: 0; }
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; }
.pill.paused { background: #fff1d6 !important; color: #8a5a00 !important; }

/* feladat-ábrák (SVG) */
.figure-wrap { display: flex; justify-content: center; margin: 10px 0; white-space: normal; }
.figure { width: 100%; max-width: 460px; height: auto; background: #fff; border-radius: 10px; }
.figure text { font-family: 'Quicksand', sans-serif; }

/* tankönyvi feladat képe a feladat helyén */
.task .tk-img { display: block; width: 100%; max-width: 820px; height: auto; margin: 8px auto 0; border-radius: 8px; background: #fff; }
