/**!
 * @file    IdiomPuzzle.css  (students)
 * @desc    Idiom Puzzle game (esl_idiomPuzzle.php) — Wheel-of-Fortune-style letter
 *          tiles, on-screen keyboard, and a "guesses left" star row. Light page on
 *          a white card, student brand green (#18823e / #0e6630). Overrides the
 *          brand-green body from sw_common.css so the tiles read cleanly.
 * @version v6 2026-08-20 - Initial version.
 * @author  Charlie Samra
 * @see     esl_idiomPuzzle.php, IdiomPuzzle.js
 */
body.idiom-puzzle { background-color: #eef2ef !important; }

.ip-page { max-width: 900px; margin: 0 auto; padding: 22px 16px 60px; }

.ip-hero { margin-bottom: 14px; text-align: center; }
.ip-hero__title { margin: 0 0 6px; font-size: 1.9rem; font-weight: 800; color: #16241d; display: inline-flex; align-items: center; gap: 12px; }
.ip-hero__title i { color: #18823e; font-size: 1.4rem; }
.ip-hero__dek { margin: 0 auto; color: #4a5a52; font-size: .95rem; line-height: 1.5; max-width: 66ch; }

/* ---- Toolbar ---- */
.ip-toolbar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	justify-content: center; margin: 16px 0 10px;
}
.ip-btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 9px 16px; border-radius: 9px; border: 1px solid #cfe0d5; background: #fff;
	color: #18823e; font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer;
	transition: background .12s ease;
}
.ip-btn:hover { background: #eef5f0; }
.ip-btn--primary { background: linear-gradient(135deg, #18823e 0%, #0e6630 100%); border-color: #0e6630; color: #fff; }
.ip-btn--primary:hover { filter: brightness(1.06); }
.ip-lives { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: .82rem; color: #6b7d72; }
.ip-lives__label { font-weight: 600; }
.ip-star { font-size: .95rem; }
.ip-star.is-live { color: #f0b400; }
.ip-star.is-lost { color: #d7ddd9; }

.ip-status { text-align: center; min-height: 1.4em; margin: 6px 0; font-size: 1.05rem; font-weight: 700; color: #6b7d72; }
.ip-status.is-ok   { color: #0e6630; }
.ip-status.is-warn { color: #b25b00; }

/* ---- Puzzle board (Wheel-of-Fortune tiles) ---- */
.ip-board {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
	gap: 12px 36px; margin: 20px auto 22px; padding: 18px 14px;
	background: #fff; border: 1px solid #e1e6eb; border-radius: 14px;
	box-shadow: 0 1px 2px rgba(20,50,30,.05); min-height: 70px;
}
.ip-word { display: inline-flex; gap: 5px; }
.ip-tile {
	width: 34px; height: 42px; border-radius: 6px;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 1.3rem; font-weight: 800; color: #16241d;
	background: #f1f5f2; border: 1px solid #d3ddd6; box-sizing: border-box;
}
.ip-tile.is-filled { background: linear-gradient(135deg, #18823e 0%, #0e6630 100%); border-color: #0e6630; color: #fff; }
.ip-tile.is-miss   { background: #f6e0dd; border-color: #e3b7b0; color: #b23b2c; }  /* revealed on loss */
.ip-punct { min-width: 12px; text-align: center; font-size: 1.3rem; font-weight: 800; color: #7a8a82; align-self: center; }

/* ---- Clue ---- */
.ip-clue { text-align: center; max-width: 60ch; margin: 0 auto 16px; font-size: 1rem; line-height: 1.5; color: #3a4a42; }
.ip-clue__label { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #18823e; background: #e8f3ec; padding: 2px 9px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }

/* ---- Result ---- */
.ip-result { max-width: 520px; margin: 0 auto 18px; }
.ip-result__card { background: #fff; border: 1px solid #e1e6eb; border-radius: 14px; box-shadow: 0 1px 2px rgba(20,50,30,.05); padding: 18px 20px; text-align: center; }
.ip-result__idiom { font-size: 1.35rem; font-weight: 800; color: #16241d; margin-bottom: 10px; }
.ip-result__row { font-size: .92rem; color: #4a5a52; line-height: 1.5; margin: 4px 0; }
.ip-result__row span { font-weight: 700; color: #0e6630; }
.ip-result__row--jp { color: #5a6b62; }
.ip-result__card .ip-btn { margin-top: 14px; }

/* ---- On-screen keyboard ---- */
.ip-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 640px; margin: 6px auto 0; }
.ip-key {
	width: 40px; height: 46px; border-radius: 8px; border: 1px solid #cdd8d1; background: #fff;
	font-size: 1.05rem; font-weight: 700; color: #2f4a3b; font-family: inherit; cursor: pointer;
	transition: background .1s ease, color .1s ease, opacity .1s ease;
}
.ip-key:hover:not(:disabled) { background: #eef5f0; border-color: #18823e; }
.ip-key.is-correct { background: #18823e; border-color: #0e6630; color: #fff; }
.ip-key.is-wrong { background: #f3f5f4; color: #b9c2bc; border-color: #e2e7e4; }
.ip-key:disabled { cursor: default; }

@media (max-width: 560px) {
	.ip-tile { width: 28px; height: 36px; font-size: 1.1rem; }
	.ip-key { width: 32px; height: 42px; font-size: .95rem; }
	.ip-hero__title { font-size: 1.5rem; }
}
