/* Je Lis, Je Parle, Je Brille – club components.
   Colours and fonts come from CSS variables so the theme can restyle everything. */

:root {
	--jlc-ink: #1b1f4b;
	--jlc-lantern: #ffc93c;
	--jlc-poppy: #ff5d73;
	--jlc-lagoon: #12b5a5;
	--jlc-lilac: #cdbfff;
	--jlc-sky: #eef3ff;
	--jlc-paper: #ffffff;
	--jlc-mint: #c8f4e0;
	--jlc-blush: #ffd3d9;
	--jlc-line: 3px;
}

.jlc-app { display: grid; gap: 1.25rem; font-family: var(--jlc-font-body, inherit); color: var(--jlc-ink); line-height: 1.55; }
.jlc-app *, .jlc-app *::before, .jlc-app *::after { box-sizing: border-box; }
.jlc-app [data-jlc="me"], .jlc-app[data-jlc="me"] { display: block; }

/* Cards: speech-bubble corner, thick outline, hard shadow */
.jlc-card {
	background: var(--jlc-paper);
	border: var(--jlc-line) solid var(--jlc-ink);
	border-radius: 26px 26px 26px 6px;
	box-shadow: 0 6px 0 var(--jlc-ink);
	padding: clamp(1rem, 3vw, 1.75rem);
}
.jlc-card > :first-child { margin-top: 0; }
.jlc-card > :last-child { margin-bottom: 0; }

.jlc-h { font-family: var(--jlc-font-display, inherit); font-weight: 700; line-height: 1.15; margin: 0 0 .6rem; color: var(--jlc-ink); }
h2.jlc-h { font-size: clamp(1.5rem, 4vw, 2rem); }
h3.jlc-h { font-size: clamp(1.2rem, 3vw, 1.5rem); }
h4.jlc-h { font-size: 1.05rem; margin-top: 1rem; }
.jlc-title { font-family: var(--jlc-font-display, inherit); font-weight: 600; font-size: 1.25rem; margin: .4rem 0; }

.jlc-en { display: block; font-family: var(--jlc-font-body, inherit); font-weight: 600; font-size: .78em; opacity: .75; line-height: 1.3; }
.jlc-h .jlc-en { font-size: .58em; font-weight: 700; margin-top: .15rem; }
.jlc-btn .jlc-en, .jlc-pill .jlc-en, .jlc-tab .jlc-en, .jlc-linkbtn .jlc-en { display: inline; margin-left: .35em; }
.jlc-lead { font-size: 1.1rem; }
.jlc-meta { font-size: .95rem; opacity: .85; margin: .25rem 0; }
.jlc-note { background: var(--jlc-lantern); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .55rem .85rem; margin: .6rem 0; font-weight: 700; }
.jlc-empty { background: var(--jlc-sky); border: 2px dashed var(--jlc-ink); border-radius: 14px; padding: 1rem; text-align: center; }
.jlc-loading { opacity: .7; }
.jlc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jlc-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.jlc-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

/* Buttons */
.jlc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .35em;
	min-height: 46px; padding: .55rem 1.3rem;
	font: 800 1rem/1.2 var(--jlc-font-body, inherit);
	color: var(--jlc-ink); background: var(--jlc-lantern);
	border: var(--jlc-line) solid var(--jlc-ink); border-radius: 999px;
	box-shadow: 0 4px 0 var(--jlc-ink);
	cursor: pointer; text-decoration: none;
	transition: transform .08s ease, box-shadow .08s ease;
}
.jlc-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--jlc-ink); }
.jlc-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--jlc-ink); }
.jlc-btn[disabled] { opacity: .5; cursor: not-allowed; }
.jlc-btn--ghost { background: var(--jlc-paper); }
.jlc-btn--danger { background: var(--jlc-poppy); }
.jlc-btn--small { min-height: 38px; padding: .3rem .9rem; font-size: .9rem; }
.jlc-linkbtn { background: none; border: 0; padding: .25rem .4rem; color: var(--jlc-ink); font: 700 .9rem var(--jlc-font-body, inherit); text-decoration: underline; cursor: pointer; }
.jlc-speak { border: 2px solid var(--jlc-ink); background: var(--jlc-sky); border-radius: 50%; width: 34px; height: 34px; font-size: 1rem; line-height: 1; cursor: pointer; vertical-align: middle; padding: 0; }
.jlc-speak:hover { background: var(--jlc-lantern); }

.jlc-app :focus-visible, .jlc-pill:focus-visible {
	outline: 3px solid var(--jlc-ink); outline-offset: 3px; box-shadow: 0 0 0 7px var(--jlc-lantern);
}

/* Alerts, badges, pills */
.jlc-alert { background: var(--jlc-blush); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .7rem 1rem; font-weight: 700; margin-top: .75rem; }
.jlc-badge { display: inline-block; padding: .15rem .8rem; border: 2px solid var(--jlc-ink); border-radius: 999px; font-weight: 800; font-size: .9rem; }
.jlc-badge--soon { background: var(--jlc-lilac); }
.jlc-badge--live { background: var(--jlc-poppy); }
.jlc-badge--done { background: var(--jlc-sky); }
.jlc-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .9rem; background: var(--jlc-lantern); color: var(--jlc-ink); border: 3px solid var(--jlc-ink); border-radius: 999px; font: 800 .95rem/1 var(--jlc-font-body, inherit); text-decoration: none; }
.jlc-pill--me { background: var(--jlc-paper); }
.jlc-pill--fac { background: var(--jlc-lilac); }
.jlc-pill-avatar { font-size: 1.15rem; }
.jlc-pill-pts { background: var(--jlc-lantern); border-radius: 999px; padding: .15rem .5rem; }

/* Forms */
.jlc-form { display: grid; gap: 1rem; }
.jlc-field { display: grid; gap: .3rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.jlc-field legend, .jlc-field label { font-weight: 800; }
.jlc-field.jlc-inline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.jlc-app input[type="text"], .jlc-app input[type="number"], .jlc-app select {
	width: 100%; min-height: 46px; padding: .5rem .85rem;
	font: 600 1.05rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-paper);
	border: var(--jlc-line) solid var(--jlc-ink); border-radius: 14px;
}
.jlc-field.jlc-inline select { width: auto; min-width: 12rem; }
.jlc-help { opacity: .8; }
.jlc-consent { display: flex; gap: .7rem; align-items: flex-start; background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .8rem; font-weight: 600; }
.jlc-consent input { width: 1.4rem; height: 1.4rem; margin-top: .2rem; flex: none; accent-color: var(--jlc-ink); }
.jlc-avatars { display: flex; flex-wrap: wrap; gap: .5rem; }
.jlc-avatar-opt { position: relative; }
.jlc-avatar-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.jlc-avatar-opt label { display: grid; place-items: center; width: 54px; height: 54px; font-size: 1.7rem; background: var(--jlc-paper); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 16px 16px 16px 4px; cursor: pointer; }
.jlc-avatar-opt input:checked + label { background: var(--jlc-lantern); box-shadow: 0 4px 0 var(--jlc-ink); transform: translateY(-2px); }
.jlc-avatar-opt input:focus-visible + label { outline: 3px solid var(--jlc-ink); outline-offset: 3px; box-shadow: 0 0 0 7px var(--jlc-lantern); }
.jlc-hero-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .4rem; }
.jlc-kidcode { display: inline-block; font: 700 clamp(1.8rem, 6vw, 2.6rem)/1 var(--jlc-font-display, inherit); letter-spacing: .18em; background: var(--jlc-lantern); border: var(--jlc-line) dashed var(--jlc-ink); border-radius: 16px; padding: .55rem 1rem; margin: .4rem 0; }

/* Session text */
.jlc-verse { margin: 0; padding: .9rem 1.1rem; background: var(--jlc-sky); border-left: 8px solid var(--jlc-lantern); border-radius: 6px 18px 18px 6px; font-size: 1.15rem; }
.jlc-verse p { margin: 0; }
.jlc-verse cite { display: block; margin-top: .4rem; font-style: normal; font-weight: 800; }
.jlc-rules { margin: .5rem 0; padding-left: 0; list-style: none; display: grid; gap: .5rem; }
.jlc-rules li { background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .55rem .85rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.jlc-rules--big { counter-reset: r; }
.jlc-rules--big li { counter-increment: r; font-size: 1.2rem; }
.jlc-rules--big li::before { content: counter(r); display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; background: var(--jlc-lantern); border: 2px solid var(--jlc-ink); border-radius: 50%; font-weight: 800; }
.jlc-rules--big li span { flex: 1; }

/* Quiz */
.jlc-score { font: 700 1.3rem var(--jlc-font-display, inherit); background: var(--jlc-lantern); border: 2px solid var(--jlc-ink); border-radius: 999px; padding: .1rem .8rem; }
.jlc-qlist { display: grid; gap: 1.1rem; }
.jlc-q { padding-bottom: 1.1rem; border-bottom: 2px dashed var(--jlc-ink); }
.jlc-q:last-child { border-bottom: 0; padding-bottom: 0; }
.jlc-qtext { font-size: 1.15rem; font-weight: 800; margin: 0 0 .6rem; }
.jlc-qn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: .3rem; background: var(--jlc-lilac); border: 2px solid var(--jlc-ink); border-radius: 50%; font-size: 1rem; }
.jlc-oral { background: var(--jlc-lilac); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .55rem .85rem; margin: 0 0 1rem; font-weight: 700; }
.jlc-oral-tag { display: inline-block; background: var(--jlc-lilac); border: 2px solid var(--jlc-ink); border-radius: 999px; padding: .05rem .75rem; font-weight: 800; font-size: .9rem; }
.jlc-options { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.jlc-option { display: flex; align-items: center; gap: .7rem; text-align: left; min-height: 52px; padding: .55rem .9rem; font: 700 1.05rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-paper); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 16px; cursor: pointer; box-shadow: 0 4px 0 var(--jlc-ink); }
.jlc-option:hover:not([disabled]) { background: var(--jlc-sky); }
.jlc-option[disabled] { cursor: default; }
.jlc-option.is-correct { background: var(--jlc-mint); }
.jlc-option.is-wrong { background: var(--jlc-blush); }
.jlc-letter { display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; background: var(--jlc-lantern); border: 2px solid var(--jlc-ink); border-radius: 50%; font-weight: 800; }
.jlc-feedback { margin: .7rem 0 0; padding: .55rem .85rem; border: 2px solid var(--jlc-ink); border-radius: 14px; background: var(--jlc-sky); font-weight: 700; }
.jlc-feedback.is-good { background: var(--jlc-mint); }
.jlc-feedback.is-bad { background: var(--jlc-blush); }

/* Leaderboard */
.jlc-board { list-style: none; margin: .8rem 0; padding: 0; display: grid; gap: .55rem; }
.jlc-board-row { display: grid; grid-template-columns: 2.4rem 2.2rem minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--jlc-paper); border: 2px solid var(--jlc-ink); border-radius: 16px; }
.jlc-board-row.is-me { background: var(--jlc-lantern); }
.jlc-rank { font: 700 1.4rem var(--jlc-font-display, inherit); text-align: center; }
.jlc-board-avatar { font-size: 1.6rem; }
.jlc-board-name { font-weight: 800; display: block; min-width: 0; overflow-wrap: anywhere; }
.jlc-board-name em { font-style: normal; font-weight: 600; opacity: .7; }
.jlc-bar { display: block; height: .5rem; margin-top: .3rem; background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 999px; overflow: hidden; }
.jlc-bar span { display: block; height: 100%; background: var(--jlc-lagoon); }
.jlc-board-pts { font: 700 1.2rem var(--jlc-font-display, inherit); white-space: nowrap; }
.jlc-winner { display: flex; gap: .8rem; align-items: center; background: var(--jlc-lantern); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 18px; padding: .8rem 1rem; margin: .8rem 0; }
.jlc-winner-icon { font-size: 2.4rem; }
.jlc-prize { margin-top: 1rem; padding-top: .8rem; border-top: 2px dashed var(--jlc-ink); }
.jlc-dots { display: flex; gap: .35rem; }
.jlc-dot { font-size: 1.6rem; color: var(--jlc-sky); -webkit-text-stroke: 2px var(--jlc-ink); }
.jlc-dot.is-on { color: var(--jlc-lantern); }

/* Reading log */
.jlc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .8rem 0 1.2rem; }
.jlc-stats div { background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 16px; padding: .6rem; text-align: center; }
.jlc-stats strong { display: block; font: 700 1.8rem/1.1 var(--jlc-font-display, inherit); }
.jlc-words { display: grid; gap: .5rem; }
.jlc-wordrow { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.jlc-badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.jlc-badgecard { display: grid; justify-items: center; text-align: center; gap: .15rem; padding: .8rem .5rem; background: var(--jlc-sky); border: 2px dashed var(--jlc-ink); border-radius: 16px; opacity: .55; filter: grayscale(1); }
.jlc-badgecard.is-earned { opacity: 1; filter: none; background: var(--jlc-lantern); border-style: solid; }
.jlc-badgecard-icon { font-size: 2rem; }
.jlc-badgecard small { opacity: .8; }
.jlc-history { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.jlc-history li { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; padding: .65rem .85rem; background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 14px; }
.jlc-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.jlc-chip { background: var(--jlc-paper); border: 2px solid var(--jlc-ink); border-radius: 999px; padding: .05rem .6rem; font-size: .9rem; font-weight: 700; }

/* Calendar */
.jlc-sched { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .6rem; }
.jlc-sched li { display: flex; gap: .8rem; align-items: center; padding: .65rem .85rem; background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 14px; }

/* Games */
.jlc-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
.jlc-tab { min-height: 44px; padding: .4rem 1rem; font: 800 1rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-paper); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 999px; cursor: pointer; }
.jlc-tab[aria-selected="true"] { background: var(--jlc-lantern); box-shadow: 0 4px 0 var(--jlc-ink); }
.jlc-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; justify-items: center; text-align: center; padding: 1rem; background: var(--jlc-sky); border: 2px solid var(--jlc-ink); border-radius: 20px; min-height: 18rem; align-content: start; }
.jlc-stage .jlc-actions { justify-content: center; margin-top: 0; }
.jlc-clue { font-size: clamp(3.5rem, 14vw, 5.5rem); line-height: 1; }
.jlc-stars { display: flex; gap: .35rem; font-size: 1.8rem; }
.jlc-star:not(.is-on) { opacity: .35; }
.jlc-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.jlc-slot { display: grid; place-items: center; width: 2.4rem; height: 3rem; background: var(--jlc-paper); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 10px; font: 700 1.6rem var(--jlc-font-display, inherit); text-transform: uppercase; }
.jlc-slot.is-fixed { background: none; border: 0; }
.jlc-slot.is-missed { background: var(--jlc-blush); }
.jlc-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(2.6rem, 1fr)); justify-self: center; gap: .4rem; width: 100%; max-width: 560px; }
.jlc-key { min-height: 2.8rem; font: 800 1.05rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-paper); border: 2px solid var(--jlc-ink); border-radius: 10px; cursor: pointer; }
.jlc-key[disabled] { opacity: .35; cursor: default; }
.jlc-win { margin: 0; padding: .6rem 1rem; background: var(--jlc-mint); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 16px; font-weight: 800; font-size: 1.1rem; }
.jlc-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.jlc-tile { display: grid; place-items: center; width: 3rem; height: 3.3rem; font: 700 1.5rem var(--jlc-font-display, inherit); color: var(--jlc-ink); background: var(--jlc-lantern); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--jlc-ink); cursor: pointer; padding: 0; }
.jlc-tile.is-empty { background: var(--jlc-paper); box-shadow: none; border-style: dashed; cursor: default; }
.jlc-tile.is-placed { background: var(--jlc-lilac); }
.jlc-memory { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; width: 100%; max-width: 520px; }
.jlc-mcard { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: .2rem; font: 800 1.05rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-lilac); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 14px; cursor: pointer; overflow-wrap: anywhere; }
.jlc-mcard.is-open { background: var(--jlc-paper); }
.jlc-mcard.is-matched { background: var(--jlc-mint); }
.jlc-memoji { font-size: 2.2rem; line-height: 1; }
.jlc-flash { display: grid; gap: .6rem; justify-items: center; width: 100%; max-width: 420px; padding: 1.2rem; background: var(--jlc-paper); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 22px 22px 22px 6px; box-shadow: 0 5px 0 var(--jlc-ink); }
.jlc-flash.is-back { background: var(--jlc-lantern); }
.jlc-flash-word { font: 700 2.2rem var(--jlc-font-display, inherit); }

/* Facilitator console */
.jlc-fac { display: grid; gap: 1.25rem; }
.jlc-fac-side { display: grid; gap: 1.25rem; align-content: start; }
.jlc-tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin-top: .8rem; }
.jlc-ptile { display: grid; gap: .5rem; padding: .8rem; background: var(--jlc-sky); border: var(--jlc-line) solid var(--jlc-ink); border-radius: 18px 18px 18px 4px; }
.jlc-ptile.is-present { background: var(--jlc-mint); }
.jlc-ptile header { display: flex; align-items: center; gap: .5rem; min-width: 0; overflow-wrap: anywhere; }
.jlc-ptile-avatar { font-size: 1.6rem; }
.jlc-ptile-pts span { font: 700 1.5rem var(--jlc-font-display, inherit); }
.jlc-ptile-pts small { display: block; opacity: .8; }
.jlc-ptile-btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.jlc-pt { min-width: 2.7rem; min-height: 2.6rem; font: 800 1rem var(--jlc-font-body, inherit); color: var(--jlc-ink); background: var(--jlc-lantern); border: 2px solid var(--jlc-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--jlc-ink); cursor: pointer; }
.jlc-pt.is-neg { background: var(--jlc-paper); }
.jlc-pt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--jlc-ink); }
.jlc-presence { font-weight: 700; display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.jlc-presence input { width: 1.2rem; height: 1.2rem; accent-color: var(--jlc-ink); }
.jlc-hostq { margin: .3rem 0 0; padding-left: 1.3rem; display: grid; gap: .5rem; }
.jlc-log { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.jlc-log li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; border-bottom: 1px dashed var(--jlc-ink); padding: .2rem 0; }

@media (min-width: 1000px) {
	.jlc-fac { grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; align-items: start; }
	.jlc-fac > .jlc-card { grid-column: 1; }
	.jlc-fac > .jlc-fac-side { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 520px) {
	.jlc-wordrow { grid-template-columns: 1fr; }
	.jlc-memory { gap: .4rem; }
	.jlc-board-row { grid-template-columns: 2rem 1.8rem minmax(0, 1fr) auto; gap: .4rem; padding: .5rem; }
}

/* Toasts */
.jlc-toasts { position: fixed; z-index: 9999; left: 50%; bottom: 1rem; transform: translateX(-50%); display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.jlc-toast { background: var(--jlc-ink); color: #fff; border: 3px solid var(--jlc-ink); border-radius: 16px; padding: .7rem 1rem; font-weight: 800; text-align: center; box-shadow: 0 4px 0 rgba(27, 31, 75, .35); }
.jlc-toast.is-bad { background: var(--jlc-poppy); color: var(--jlc-ink); }
.jlc-noscript { background: var(--jlc-blush); border: 2px solid var(--jlc-ink); border-radius: 14px; padding: .7rem 1rem; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
	.jlc-app *, .jlc-pill { transition: none !important; animation: none !important; }
}
