/* Versed Study — shared styles. Same family as Versed Play: dark, loud, playful. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0E0D17; --bg2: #16152A; --card: #1E1C33; --card2: #262445; --line: #2E2B4A; --text: #F4F2FF; --muted: #9A97B8; --dim: #5E5B7E;
  --lime: #C6FF3D; --pink: #FF4FA3; --cyan: #3DF2FF; --amber: #FFB020; --violet: #8B7BFF; --green: #3DFF9A; --red: #FF5C5C; --ink: #0E0D17;
  --radius: 18px; --shadow: 0 10px 30px rgba(0,0,0,.35); --pop: 4px 4px 0 var(--pink);
  --ease: cubic-bezier(.16,1,.3,1);
  --display: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  --body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body); background: var(--bg); color: var(--text); min-height: 100dvh; line-height: 1.45;
  -webkit-font-smoothing: antialiased; touch-action: manipulation;
  background-image: radial-gradient(60% 40% at 80% -10%, rgba(139,123,255,.25), transparent 60%), radial-gradient(50% 35% at 0% 100%, rgba(198,255,61,.12), transparent 60%);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--cyan); }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.01em; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1.4rem; border-radius: 14px; font-weight: 700; transition: transform .12s var(--ease), box-shadow .12s, background .15s; user-select: none; white-space: nowrap; border: 2px solid transparent; text-decoration: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--lime); color: var(--ink); border-color: var(--lime); box-shadow: var(--pop); }
.btn-primary:hover { background: #d6ff6b; }
.btn-dark { background: var(--text); color: var(--ink); border-color: var(--text); box-shadow: var(--pop); }
.btn-coral { background: var(--pink); color: #fff; border-color: var(--pink); box-shadow: 4px 4px 0 var(--lime); }
.btn-coral:hover { background: #ff6cb3; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--violet); }
.btn-ghost:active { box-shadow: none; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

.input { width: 100%; padding: .9rem 1rem; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); outline: none; transition: border-color .15s, box-shadow .15s; color: var(--text); }
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(198,255,61,.15); }
.input-code { text-transform: uppercase; letter-spacing: .35em; font-weight: 800; font-size: 1.6rem; text-align: center; font-family: var(--display); }
label.field { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: .9rem 0 .35rem; text-transform: uppercase; letter-spacing: .08em; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.err { color: var(--red); font-weight: 600; font-size: .9rem; min-height: 1.3em; margin-top: .6rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: rgba(198,255,61,.15); color: var(--lime); }
.pill.pink { background: rgba(255,79,163,.15); color: var(--pink); }
.pill.cyan { background: rgba(61,242,255,.15); color: var(--cyan); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; text-decoration: none; color: var(--text); font-family: var(--display); font-size: .95rem; letter-spacing: .02em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-size: 1rem; box-shadow: 2px 2px 0 var(--pink); }
.brand .teal { color: var(--lime); }

/* promo strip — small, static, bottom of page; entries live in /ads.json */
.ad-slot { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; background: var(--bg2); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 0 .75rem; z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
.ad-slot .ad-label { position: absolute; top: 2px; left: 8px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.ad-house { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-size: .8rem; max-width: 720px; width: 100%; }
.ad-house img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.ad-house strong { display: block; font-size: .8rem; }
.ad-house span { color: var(--muted); font-size: .72rem; display: block; }
.ad-house .ad-cta { margin-left: auto; flex: none; padding: .35rem .8rem; border-radius: 999px; background: var(--lime); color: var(--ink); font-weight: 700; font-size: .75rem; }
.has-ad { padding-bottom: 70px; }
.toast { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--ink); padding: .6rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 700; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: 92vw; text-align: center; }

/* ---------- layout ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 1rem 1rem 0; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap.wide { max-width: 900px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .25rem 0 1rem; }
.top nav { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 700; padding: .35rem .6rem; border-radius: 999px; }
.top nav a:hover, .top nav a[aria-current] { background: var(--card); color: var(--text); }
.hero h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.05; margin: .5rem 0 .4rem; }
.hero h1 span { color: var(--lime); }
.hero p { color: var(--muted); margin-bottom: 1rem; }
.section { margin-top: 1.5rem; }
.section h2 { font-size: 1rem; font-weight: 800; margin-bottom: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.section h2 a { font-size: .8rem; font-weight: 700; }
.foot { text-align: center; color: var(--dim); font-size: .78rem; padding: 2rem 0 1rem; }
.foot a { color: var(--muted); }

/* ---------- home ---------- */
.pets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pets button { aspect-ratio: 1; border-radius: 14px; background: var(--card); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .1rem; padding: .3rem; transition: transform .12s var(--ease), border-color .15s; position: relative; }
.pets button canvas { width: 64px; height: 64px; image-rendering: pixelated; image-rendering: crisp-edges; margin: auto; }
.pets button span { font-size: .7rem; font-weight: 700; color: var(--muted); }
.pets button:hover { transform: translateY(-2px); border-color: var(--violet); }
.pets button[aria-pressed="true"] { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(198,255,61,.2); background: var(--card2); }
.pets button[aria-pressed="true"] span { color: var(--lime); }
.actions { display: grid; gap: .6rem; margin-top: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.row .input { flex: 1; }
.live { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; }
.live b { color: var(--lime); font-family: var(--display); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.links a { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; transition: border-color .15s, transform .12s var(--ease); }
.links a:hover { border-color: var(--violet); transform: translateY(-2px); }
.links a b { display: block; font-family: var(--display); font-size: .9rem; margin-bottom: .2rem; }
.links a span { color: var(--muted); font-size: .8rem; }
.links a i { font-style: normal; font-size: 1.3rem; display: block; margin-bottom: .3rem; }

/* ---------- cork board ---------- */
.cork { position: relative; border-radius: var(--radius); padding: 1rem; min-height: 180px; border: 6px solid #6b4a2b; box-shadow: inset 0 0 0 2px #3f2a17, var(--shadow);
  background-color: #a8783f;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.14) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(0,0,0,.1) 0 1px, transparent 2px),
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.07) 0 1px, transparent 2px),
    repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 7px);
  background-size: 23px 19px, 31px 27px, 17px 29px, 37px 23px, auto, auto; }
.pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; }
.pin { position: relative; padding: 1.1rem .8rem .7rem; color: #1c1a10; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: .82rem; line-height: 1.3; min-height: 110px; box-shadow: 3px 4px 0 rgba(0,0,0,.28); overflow-wrap: anywhere; image-rendering: pixelated;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }
.pin::before { content: ''; position: absolute; top: 6px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #e63c3c; box-shadow: inset -2px -2px 0 rgba(0,0,0,.35), 1px 2px 0 rgba(0,0,0,.3); }
.pin.lime { background: #d9ff6b; } .pin.pink { background: #ffa5d0; } .pin.cyan { background: #9ff3ff; } .pin.amber { background: #ffd66b; } .pin.violet { background: #c7bdff; } .pin.green { background: #9dffc6; }
.pin:nth-child(3n) { transform: rotate(-1.5deg); } .pin:nth-child(3n+1) { transform: rotate(1.2deg); } .pin:nth-child(5n) { transform: rotate(2deg); }
.pin .meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; font-size: .68rem; font-weight: 700; opacity: .75; }
.pin .meta a { color: inherit; }
.pin .del { position: absolute; top: 2px; right: 4px; font-size: .8rem; opacity: .5; }
.pin-form { display: grid; gap: .5rem; margin-top: 1rem; }
.colours { display: flex; gap: .4rem; }
.colours button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; }
.colours button[aria-pressed="true"] { border-color: var(--text); }
.colours .lime { background: #d9ff6b; } .colours .pink { background: #ffa5d0; } .colours .cyan { background: #9ff3ff; } .colours .amber { background: #ffd66b; } .colours .violet { background: #c7bdff; } .colours .green { background: #9dffc6; }
.count { font-size: .75rem; color: var(--dim); text-align: right; }

/* ---------- sounds ---------- */
.sound { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.sound:last-child { border-bottom: 0; }
.sound .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--card2); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.sound b { display: block; font-family: var(--display); font-size: .85rem; }
.sound span { color: var(--muted); font-size: .78rem; display: block; }
.sound .grow { flex: 1; min-width: 0; }
.sound .btn { flex: none; }
.sound .btn[aria-pressed="true"] { background: var(--lime); color: var(--ink); border-color: var(--lime); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--card2); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--lime); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--lime); border: 3px solid var(--bg); cursor: pointer; }
.yt { display: grid; gap: .6rem; }
.yt .vid { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: var(--card2); border: 1px solid var(--line); }
.yt .vid button { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--text); font-weight: 700; }
.yt .vid button i { font-style: normal; font-size: 2rem; width: 64px; height: 44px; border-radius: 12px; background: var(--pink); display: grid; place-items: center; }
.yt .vid iframe { width: 100%; height: 100%; border: 0; }
.tip { font-size: .78rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: .6rem .8rem; }

/* ---------- grade calculator ---------- */
.grid-rows { display: grid; gap: .4rem; }
.grid-rows .r { display: grid; grid-template-columns: 1fr 70px 70px 32px; gap: .4rem; align-items: center; }
.grid-rows .r .input { padding: .6rem .7rem; border-radius: 10px; }
.grid-rows .h { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 700; padding: 0 .3rem; }
.grid-rows .x { color: var(--dim); font-size: 1.1rem; }
.stat { text-align: center; padding: 1rem; border-radius: 14px; background: var(--card2); }
.stat b { display: block; font-family: var(--display); font-size: 2.4rem; color: var(--lime); line-height: 1; }
.stat span { color: var(--muted); font-size: .8rem; }
.stat.warn b { color: var(--amber); } .stat.bad b { color: var(--red); } .stat.good b { color: var(--green); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
