/* Language Quest – word book, wardrobe, parents' corner, morning (screens without a play frame) */

/* ================================================================ word book */
.lq-book { position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 10px 10px; background: linear-gradient(135deg, #FFF0CC, #FFE3EE); }
.lq-book-tabs { display: grid; grid-template-columns: repeat(2, 52px); grid-auto-rows: 52px; gap: 6px; align-content: start; }
.lq-tab { width: 52px; height: 52px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; padding: 5px; box-shadow: var(--shadow-sm); }
.lq-tab svg { width: 100%; height: 100%; }
.lq-tab.lq-on { background: var(--sun); transform: translateY(-2px); }
.lq-book-page { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #FFFBF1; border: 4px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 10px; }
.lq-book-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lq-book-grid[data-mode="compact"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lq-book-grid[data-mode="port"] { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); }
.lq-book-grid.lq-badges { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-template-rows: none; grid-auto-rows: minmax(0, 1fr); align-content: start; overflow: hidden; }
.lq-wcard2 { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm); }
.lq-wc-pic { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.lq-wc-pic { position: relative; }
.lq-wc-pic svg { position: absolute; inset: 0; margin: auto; height: 100%; max-height: 110px; width: auto; max-width: 100%; }
.lq-wc-en { font-weight: 900; font-size: .8rem; line-height: 1.1; text-align: center; }
.lq-level[data-band] .lq-wc-en, html .lq-book .lq-wc-en { font-size: clamp(.8rem, 1.6vmin, 1.1rem); }
.lq-st-unseen { background: var(--lq-sleep-paper); }
.lq-st-unseen .lq-wc-pic svg { filter: brightness(0) opacity(.18); }
.lq-wc-q { position: absolute; top: 6px; right: 10px; font-style: normal; font-weight: 1000; color: var(--lq-sleep); font-size: 1.2rem; }
.lq-st-drowsy .lq-wc-pic svg, .lq-st-gold-drowsy .lq-wc-pic svg { filter: grayscale(1) sepia(.12) brightness(1.1) contrast(.85); }
.lq-wc-z { position: absolute; top: 4px; right: 8px; font-style: normal; font-weight: 1000; color: var(--lq-sleep); background: #fff; border-radius: 8px; padding: 0 4px; }
.lq-st-gold, .lq-st-gold-drowsy { border-color: var(--lq-gold); box-shadow: 0 0 0 3px var(--ink), 0 4px 0 6px var(--ink); background: linear-gradient(135deg, #FFF6C2, #fff 45%, #FFE9A0); animation: lq-shimmer 3s ease-in-out infinite; }
@keyframes lq-shimmer { 50% { filter: brightness(1.08); } }
.lq-wc-star { position: absolute; top: 2px; left: 6px; font-style: normal; color: var(--lq-gold); font-size: 1.1rem; }
.lq-wc-turtle { position: absolute; right: 3px; bottom: 28px; width: 34px; height: 30px; padding: 2px; border-radius: 10px; background: #F0FAE8; border: 2px solid var(--ink); display: inline-flex; }
.lq-wc-turtle svg { width: 100%; height: 100%; }
.lq-book-nav { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 8px; min-height: 0; }
.lq-book-pg { font-weight: 900; }
.lq-book-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: flex; align-items: center; justify-content: center; opacity: .5; }
.lq-book-empty svg { width: 120px; }
.lq-book-count { gap: .35em; white-space: nowrap; }
.lq-book-count .lq-ico { width: 1.4em; height: 1.4em; }
.lq-medalcard { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; font-weight: 900; text-align: center; }
.lq-medalcard svg { width: 64px; height: auto; }
.lq-medalcard.lq-off { opacity: .55; }
.lq-book-tika { position: absolute; left: 4px; bottom: 4px; width: 112px; pointer-events: none; z-index: 3; }
.lq-bbubble { position: absolute; left: 90%; bottom: 60%; width: max-content; max-width: min(22rem, 60vw); }
html.lq-port .lq-book { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
html.lq-port .lq-book-tabs { grid-template-columns: repeat(8, 1fr); grid-auto-rows: 44px; }
html.lq-port .lq-tab { width: 100%; height: 44px; padding: 3px; }
html.lq-port .lq-book-tika { width: 84px; }
html.lq-compact .lq-book-tabs { grid-template-columns: repeat(3, 46px); grid-auto-rows: 46px; }
html.lq-compact .lq-tab { width: 46px; height: 46px; }
html.lq-compact .lq-book-tika { display: none; }
.lq-land .lq-book-tika { left: 6px; }

/* ================================================================ wardrobe */
.lq-wardrobe { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; background: radial-gradient(circle at 30% 40%, #FFF6E5, #E7E0FF); }
.lq-ward-tika { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.lq-wtika { width: min(100%, 410px); max-height: 100%; aspect-ratio: 164 / 208; }
.lq-ward-tika { min-width: 0; overflow: hidden; }
.lq-wtika .tika { width: 100%; }
.lq-wbubble { position: absolute; left: 60%; top: 4%; width: max-content; max-width: min(20rem, 40vw); }
.lq-ward-rows { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lq-ward-row { display: flex; align-items: center; gap: 8px; min-height: 100px; padding: 8px; background: rgba(255,255,255,.7); border: 3px solid var(--ink); border-radius: 20px; min-width: 0; }
.lq-wchip { width: 82px; height: 82px; flex: 0 0 auto; background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 6px; }
.lq-wchip svg { width: 100%; height: 100%; overflow: visible; }
.lq-wchip.lq-on { background: var(--lq-mint-soft); outline: 4px solid var(--lq-mint); }
.lq-ward-lock { display: flex; align-items: center; gap: 8px; opacity: .55; font-weight: 900; }
.lq-ward-lock svg { width: 48px; }
html.lq-port .lq-wardrobe { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
html.lq-port .lq-wtika { width: auto; height: min(100%, 360px); }
html.lq-port .lq-wbubble { left: 56%; max-width: 44vw; }
html.lq-compact .lq-ward-row { min-height: 80px; padding: 4px; }
html.lq-compact .lq-wchip { width: 64px; height: 64px; }

/* ================================================================ parents' corner (adult screen: may scroll inside) */
.lq-parents { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-content: start; background: #F6F3EC; user-select: text; }
.lq-psec { padding: 12px 14px; }
.lq-psec h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 1000; }
.lq-psec p { margin: .3em 0; font-weight: 600; font-size: .9rem; }
.lq-plabel { font-size: .85rem; font-weight: 900; margin: 10px 0 4px; color: var(--ink-2); }
.lq-seg3 { display: flex; flex-wrap: wrap; gap: 6px; }
.lq-segb { min-height: 44px; font-size: .9rem; padding: .3em .8em; background: #fff; }
.lq-segb.lq-on { background: var(--go); color: #fff; }
.lq-prow { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.lq-pav { width: 56px; height: 56px; display: inline-flex; }
.lq-pav svg { width: 100%; height: 100%; }
.lq-pavs { display: flex; flex-wrap: wrap; gap: 6px; }
.lq-pavs .lq-avatar-chip { width: 52px; height: 52px; }
.lq-del { position: relative; margin-top: 12px; }
.lq-del .lq-holdring { border-radius: 18px; }
.lq-pstats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; }
.lq-ptable { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .85rem; }
.lq-ptable th, .lq-ptable td { border-bottom: 1px solid #E6DFD0; padding: 3px 4px; text-align: left; }
.lq-ptable td:not(:first-child), .lq-ptable th:not(:first-child) { text-align: center; }
.lq-missed { display: flex; flex-wrap: wrap; gap: 6px; }
.lq-mword { min-height: 44px; gap: .3em; }
.lq-mword small { font-weight: 600; opacity: .7; }
.lq-muted { opacity: .6; font-size: .85rem; }

/* ================================================================ morning / wishes: things sleep on pillows */
.lq-pv-morning .lq-thing::before { content: ""; position: absolute; left: -12%; right: -12%; bottom: -10%; height: 34%; background: #DCE8FF; border: 3px solid var(--ink); border-radius: 40% 40% 30% 30%; z-index: -1; }
.lq-pv-morning .lq-thing { z-index: 3; }
.lq-later { min-height: 48px; padding: .2em .8em; }

/* 5-1 the family photo wall: every person hangs in a wooden frame */
.lq-sc-photos .lq-thing-in { background: #FFF6E5; border: 6px solid #9A6033; border-radius: 6px; box-shadow: inset 0 0 0 3px #D9A066, 0 4px 0 rgba(36,38,59,.25); padding: 6%; }
.lq-sc-photos .lq-thing-in .lq-gshadow { display: none; }
.lq-sc-photos .lq-thing::before { content: ""; position: absolute; left: 50%; top: -14%; width: 30%; height: 16%; translate: -50% 0; border: 3px solid var(--ink); border-bottom: 0; border-radius: 50% 50% 0 0; }

/* title in portrait: Tika at the left, the bubble fits the rest of the width */
html.lq-port .lq-title-tika { left: 3%; transform: none; width: clamp(110px, 30vw, 190px); }
html.lq-port .lq-tbubble { left: 100%; right: auto; bottom: 46%; max-width: calc(64vw - 24px); }

/* top-bar titles (region, wardrobe, parents) */
.lq-region-title { background: var(--sky); color: #fff; }
/* map: Tika in the bottom-right corner, her bubble to the left (keeps the region nodes free) */
.lq-map-tika { left: auto; right: 1%; }
.lq-mbubble { left: auto; right: 94%; }
.lq-mbubble.tk-tail-left::after { left: auto; right: -11px; border: 0; border-right: var(--line) solid var(--ink); border-top: var(--line) solid var(--ink); }
.lq-bell { left: auto; right: clamp(110px, 16vw, 190px); }
/* region: Tika up in the sky, top-left */
.lq-region-tika { bottom: auto; top: 1%; }
.lq-rbubble { bottom: auto; top: 30%; }
html.lq-port .lq-region-tika { top: 1%; }
/* wardrobe: the bubble belongs to the whole screen, so it is never clipped */
.lq-wardrobe .lq-wbubble { position: absolute; left: 30%; top: 3%; z-index: 5; }
html.lq-port .lq-wardrobe .lq-wbubble { left: 40%; }
.lq-del { width: 100%; white-space: normal; }

/* Zevko drifts across the sky but always stays on the screen */
.lq-title-zevko { --zw: clamp(110px, 16vw, 200px); width: var(--zw); left: 2%; animation: lq-driftl 40s ease-in-out infinite alternate; }
.lq-map-zevko { --zw: clamp(90px, 13vw, 150px); width: var(--zw); left: 2%; animation: lq-driftl 40s ease-in-out infinite alternate; }
@keyframes lq-driftl { from { left: 2%; } to { left: calc(98% - var(--zw)); } }

/* Tika's speech bubbles never block taps on the game */
.lq-say, .lq-tbubble, .lq-pro-bubble, .lq-mbubble, .lq-rbubble, .lq-bbubble, .lq-wbubble, .lq-pbubble { pointer-events: none; }
.lq-prologue[data-panel="4"] .lq-pro-bubble { bottom: auto; top: 12px; }

/* map on a phone/tablet held upright: the island leaves a strip of sea at the bottom for Tika and her bubble,
   so the first region (bottom-left) is never covered while she speaks */
html.lq-port .lq-map-isl, html.lq-port .lq-map-nodes { bottom: 112px; top: 3%; }
html.lq-port .lq-map-tika { bottom: 6px; }
html.lq-port .lq-mbubble { bottom: 10%; }
