/* EssentialGame.uz — unit va kitob sahifalari uslubi (style.css ranglariga mos) */
:root {
    --bg: #e9f0f8; --surface: #ffffff; --surface-2: #f3f7fc; --line: #c8d6e6;
    --text: #0c1b4a; --muted: #4d5f86; --accent: #1f4fd8; --accent-soft: #eef3ff;
    --on-accent: #ffffff; --mark: #fff1c7; --speak: #d6e4ff;
    --font-display: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #071030; --surface: #0f1d49; --surface-2: #142457; --line: #2a3d80;
        --text: #e8eeff; --muted: #a3b5e3; --accent: #7aa0ff; --accent-soft: #1b2f73;
        --on-accent: #071030; --mark: #4a3a0d; --speak: #2c4799;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 17px; line-height: 1.6; }
a { color: var(--accent); }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1100px; margin: 0 auto; padding: 14px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-display); font-size: 20px; }
.brand img { border-radius: 50%; }
.brand-name b { font-weight: 800; }
.top-links { display: flex; gap: 8px; }
.top-links a { text-decoration: none; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 15px; }
.top-links a:hover { border-color: var(--accent); }

.page { max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 8px 0 12px; }
h1 small { display: block; font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 6px; }
h2 { font-family: var(--font-display); font-size: 22px; margin: 32px 0 12px; }
.lead { max-width: 70ch; color: var(--muted); margin: 0 0 16px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 8px; }

.cta-row { margin: 18px 0; }
.cta { display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none; font-family: var(--font-display); font-weight: 700; padding: 12px 22px; border-radius: 12px; }
.cta:hover { filter: brightness(1.08); }
.cta.alt { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); padding: 10px 20px; margin-left: 6px; }

table.words { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table.words th { text-align: left; font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); padding: 10px 12px; }
table.words td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.en { font-family: var(--font-display); font-size: 18px; }
.pos { font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; }
.ipa { color: var(--muted); white-space: nowrap; }
.uz { font-weight: 700; }
.say { border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 6px; color: var(--text); font-family: inherit; }
.say:hover { background: var(--accent-soft); }

.story { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 20px 20px; margin-top: 28px; }
.story h2 { margin-top: 16px; }
.story p { max-width: 70ch; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px 14px; }
.ex-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ex-card h3 .en { font-size: 20px; }
.ex-card h3 .uz { font-weight: 600; color: var(--muted); }
.ex-card ul { list-style: none; margin: 0; padding: 0; }
.ex-card li { padding: 5px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.ex-card li:first-child { border-top: 0; }
.ex-card .tr { display: block; color: var(--muted); font-size: 15px; line-height: 1.4; }
mark.w { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 3px; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 700; color: var(--accent); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.pager a { text-decoration: none; font-weight: 700; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }

.unit-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.unit-list a { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; height: 100%; }
.unit-list a:hover { border-color: var(--accent); }
.unit-list b { font-family: var(--font-display); }
.unit-list .nm { color: var(--accent); margin-left: 6px; font-size: 14px; }
.unit-list .sample { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

.site-footer { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }

@media (max-width: 760px) {
    table.words thead { display: none; }
    table.words, table.words tbody, table.words tr, table.words td { display: block; width: 100%; }
    table.words tr { border-top: 1px solid var(--line); padding: 10px 0; }
    table.words tr:first-child { border-top: 0; }
    table.words td { border: 0; padding: 3px 14px; }
    table.words td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
    table.words td:first-child::before { content: ""; }
    .ipa { white-space: normal; }
}

.ico { display: inline-block; margin-right: 4px; white-space: nowrap; }

/* So'z, tarjima, gap va hikoya matnini sichqoncha bilan belgilab ko'chirib bo'lmaydi */
.nocopy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.report { margin: 22px 0 0; font-size: 15px; color: var(--muted); }
.report a { color: var(--muted); text-underline-offset: 3px; }
.report a:hover { color: var(--accent); }

/* Chop etish uchun PDF havolalari */
.pdf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.pdf-row a.pdf { text-decoration: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.pdf-row a.pdf:hover { border-color: var(--accent); color: var(--accent); }

/* Hikoya audiosi */
.story-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; max-width: none; }
.story-tools[hidden] { display: none; }
.story-tools button { font: inherit; font-weight: 700; font-size: 15px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.story-tools button:hover { border-color: var(--accent); }
.story-tools button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.story-sent { cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .15s ease; }
.story-sent.speaking { background: var(--speak); }
@media (prefers-reduced-motion: reduce) { .story-sent { transition: none; } }
