/* ==================================================================
   WORLD KARMA GAME (2.0.0)
   The family card: warm ink on cream, one accent (a leaf green, for
   growing good), round buttons. The scoreboard keeps its dark face.
   The Hermitage's colours and its dark mode are here for the embed.
================================================================== */
.wkg {
    --k-ink: #3b2f22; --k-muted: #7a6a55; --k-line: #e2d6c3; --k-chip: #f7f0e4; --k-card: #fffdf8;
    --k-accent: #4f7a3a; --k-accent-ink: #f6fbf2; --k-soft: #e6efdf;
    --k-board: #1b1712; --k-wheel: #2a241d; --k-digit: #f6e7c8;
    --k-digit-h: 36px;
    color: var(--k-ink);
    text-align: center;
    max-width: 480px;
    margin: 1.5rem auto;
    padding: 0 0 1rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--k-card);
    border: 1px solid var(--k-line);
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
}
.wkg *, .wkg *::before, .wkg *::after { box-sizing: border-box; }
.wkg.is-embed, .wkg.is-hermitage { margin: 0 auto; }

/* inside the Hermitage the widget takes the Hermitage's own colours */
.wkg.is-hermitage {
    --k-ink: #2c2a26; --k-muted: #6f6a60; --k-line: #d4ccbd; --k-chip: #f1ede4; --k-card: #fbfaf6;
    --k-accent: #6d7f6a; --k-accent-ink: #fbfaf6; --k-soft: #e5eae1;
}
html[data-hscheme="dark"] .wkg.is-hermitage {
    --k-ink: #ece7dd; --k-muted: #aaa293; --k-line: #403c33; --k-chip: #26241f; --k-card: #1e1d19;
    --k-accent: #a3b69f; --k-accent-ink: #1b1a17; --k-soft: #2b312a;
    --k-board: #0f0e0c; --k-wheel: #1c1a16;
}
@media (prefers-color-scheme: dark) {
    html:not([data-hscheme]) .wkg.is-hermitage {
        --k-ink: #ece7dd; --k-muted: #aaa293; --k-line: #403c33; --k-chip: #26241f; --k-card: #1e1d19;
        --k-accent: #a3b69f; --k-accent-ink: #1b1a17; --k-soft: #2b312a;
        --k-board: #0f0e0c; --k-wheel: #1c1a16;
    }
}

/* ---- head: name and the scoreboard ---- */
.k-head { padding: 1rem 1.1rem 0; }
.k-app { margin: 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--k-muted); }
.k-label { margin: 4px 0 0; font-size: .9rem; color: var(--k-accent); }
.k-board {
    display: inline-flex; gap: 4px; margin: .7rem auto 0; padding: 8px 12px;
    background: var(--k-board); border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 10px rgba(0,0,0,.18);
}
.k-wheels { display: flex; gap: 4px; }
.k-wheel {
    width: 26px; height: var(--k-digit-h); overflow: hidden; position: relative;
    background: var(--k-wheel); border: 1px solid rgba(255,255,255,.08); border-radius: 5px;
}
.k-wheel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.45), transparent 28%, transparent 72%, rgba(0,0,0,.45)); }
.k-strip { position: absolute; top: 0; left: 0; width: 100%; transition: transform .9s cubic-bezier(.25,.6,.3,1.2); }
.k-digit { height: var(--k-digit-h); line-height: var(--k-digit-h); text-align: center;
    color: var(--k-digit); font: 600 26px/var(--k-digit-h) "Courier New", ui-monospace, monospace; }
.k-strip.is-bounce { animation: kWheelBounce .25s ease-out; }
@keyframes kWheelBounce {
    0%   { transform: translateY(var(--target)); }
    60%  { transform: translateY(calc(var(--target) + 4px)); }
    100% { transform: translateY(var(--target)); }
}
.k-boardnote { margin: .35rem 0 0; font-size: .78rem; color: var(--k-muted); }

/* ---- tabs ---- */
.k-tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: .9rem 1.1rem 0; }
.k-tab {
    font: inherit; font-size: .9rem; color: var(--k-ink); cursor: pointer;
    padding: 6px 14px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-chip);
    transition: background .2s ease, border-color .2s ease;
}
.k-tab:hover { border-color: var(--k-accent); }
.k-tab.is-active { background: var(--k-accent); color: var(--k-accent-ink); border-color: var(--k-accent); }
.k-tab:focus-visible, .k-chip:focus-visible, .k-btn:focus-visible, .k-link:focus-visible, .k-social:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 2px; }

/* ---- screens ---- */
.k-screen { padding: 1rem 1.1rem 0; text-align: left; opacity: 1; transition: opacity .35s ease; }
.k-screen.is-out { opacity: 0; }
.k-loading { color: var(--k-muted); text-align: center; }
.k-title { margin: 0 0 .4rem; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.k-lead { margin: 0 0 .6rem; color: var(--k-muted); font-size: .92rem; line-height: 1.5; }
.k-screen h4 { margin: 1rem 0 .3rem; font-size: 1rem; }
.k-screen p { line-height: 1.55; }
.k-screen ol, .k-screen ul { padding-left: 1.2rem; line-height: 1.55; }

/* today */
.k-count { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap;
    margin: 0 0 .4rem; padding: 8px 12px; border-radius: 10px; background: var(--k-soft); font-size: .95rem; }
.k-count b { font-weight: 600; }
.k-count .k-streak { color: var(--k-accent); }
.k-cat { margin: .9rem 0 .4rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--k-muted); font-weight: 600; }
.k-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.k-chip {
    font: inherit; font-size: .9rem; color: var(--k-ink); cursor: pointer;
    padding: 7px 12px; border-radius: 999px; border: 1px solid var(--k-line); background: var(--k-chip);
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.k-chip:hover { border-color: var(--k-accent); }
.k-chip:active { transform: scale(.97); }
.k-chip[aria-pressed="true"] { background: var(--k-accent); color: var(--k-accent-ink); border-color: var(--k-accent); }
.k-chip[aria-pressed="true"]::before { content: "\2713\00a0"; }
.k-chip:disabled { opacity: .55; cursor: default; }
.k-msg { margin: .6rem 0 0; min-height: 1.3em; color: var(--k-muted); font-size: .85rem; text-align: center; }

/* share */
.k-share { margin: 1rem 0 0; padding: .9rem 1rem; border-radius: 12px; background: var(--k-chip); border: 1px solid var(--k-line); text-align: center; }
.k-share h4 { margin: 0 0 .4rem; }
.k-sharetext { margin: 0 0 .7rem; font-size: .92rem; color: var(--k-ink); }
.k-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.k-socials { display: flex; justify-content: center; gap: 8px; margin-top: .7rem; }
.k-social { width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: transform .15s ease; }
.k-social:hover { transform: scale(1.08); }
.k-social svg { width: 22px; height: 22px; fill: currentColor; }
.k-social.is-tumblr { background: #001935; }
.k-social.is-x { background: #000; }
.k-social.is-whatsapp { background: #25d366; }
.k-social.is-facebook { background: #1877f2; }

/* buttons */
.k-btn {
    font: inherit; font-size: .95rem; min-width: 8.5rem; min-height: 42px; padding: 7px 16px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--k-accent); background: transparent; color: var(--k-ink);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.k-btn.is-main { background: var(--k-accent); color: var(--k-accent-ink); }
.k-btn:disabled { opacity: .5; cursor: default; }
.k-btn.is-danger { border-color: #a0521d; }
.k-link { font: inherit; font-size: .88rem; background: none; border: 0; padding: 4px 6px; color: var(--k-muted); text-decoration: underline; cursor: pointer; }
.k-link:hover { color: var(--k-ink); }
.k-actions { display: flex; justify-content: center; gap: 12px; margin-top: .8rem; flex-wrap: wrap; }

/* the world */
.k-big { margin: .2rem 0 0; font-size: 2.2rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.k-sub { margin: 0 0 .8rem; text-align: center; color: var(--k-muted); font-size: .85rem; }
.k-bars { list-style: none; margin: 0; padding: 0; }
.k-bars li { margin: 0 0 .55rem; }
.k-bars .k-barrow { display: flex; justify-content: space-between; font-size: .92rem; gap: 8px; }
.k-bars .k-barrow b { font-weight: 600; font-variant-numeric: tabular-nums; }
.k-bar { height: 8px; border-radius: 999px; background: var(--k-chip); border: 1px solid var(--k-line); overflow: hidden; margin-top: 3px; }
.k-bar i { display: block; height: 100%; background: var(--k-accent); border-radius: 999px; transition: width .8s ease; }
.k-list { list-style: none; margin: 0; padding: 0; }
.k-list li { display: flex; justify-content: space-between; gap: 8px; padding: .35rem 0; border-bottom: 1px solid var(--k-line); font-size: .92rem; }
.k-list li:last-child { border-bottom: 0; }
.k-list b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* me */
.k-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 .8rem; }
.k-stat { padding: .7rem .6rem; border-radius: 12px; background: var(--k-chip); border: 1px solid var(--k-line); text-align: center; }
.k-stat b { display: block; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--k-accent); }
.k-stat span { font-size: .8rem; color: var(--k-muted); }

/* safety and privacy */
.k-box { margin: .6rem 0 0; padding: 10px 12px; border-radius: 10px; background: var(--k-chip); border: 1px solid var(--k-line); font-size: .9rem; line-height: 1.5; }
.k-box p { margin: 0; }
.k-box p + p { margin-top: .5rem; }
.k-screen a, .k-home a { color: var(--k-accent); }
.k-version { margin: 1rem 0 0; font-size: .78rem; color: var(--k-muted); text-align: center; }

.k-privacy { margin: .9rem 1.1rem 0; font-size: .78rem; line-height: 1.4; color: var(--k-muted); }
.k-home { margin: .7rem 0 0; font-size: .85rem; }
.k-home a { color: var(--k-muted); }

@media (prefers-reduced-motion: reduce) {
    .k-screen, .k-strip, .k-chip, .k-tab, .k-bar i { transition: none; }
    .k-strip.is-bounce { animation: none; }
}
@media (max-width: 360px) {
    .wkg { --k-digit-h: 30px; }
    .k-wheel { width: 22px; }
    .k-digit { font-size: 22px; }
    .k-stats { grid-template-columns: 1fr 1fr; }
}

/* 2.1.0: the turning share words, the next karma check, the volume row */
.k-sharetext { transition: opacity .3s ease; min-height: 2.6em; }
.k-sharetext.is-out { opacity: 0; }
.k-sched { margin: 1rem 0 0; padding: .9rem 1rem; border-radius: 12px; border: 1px dashed var(--k-line); text-align: center; }
.k-sched h4 { margin: 0 0 .2rem; }
.k-sched .k-sub { margin: 0 0 .6rem; font-size: .85rem; }
.k-sched .k-row + .k-row { margin-top: .6rem; }
.k-field { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: .8rem; color: var(--k-ink); opacity: .9; }
.k-field select, .k-field input { font: inherit; font-size: .95rem; padding: .4rem .6rem; border-radius: 10px; border: 1px solid var(--k-line); background: var(--k-chip); color: var(--k-ink); }
.k-count + .hv { margin: 2px auto 10px; }
@media (prefers-reduced-motion: reduce) { .k-sharetext { transition: none; } }
.k-full { margin: -4px 0 10px; padding: .55rem .8rem; border-radius: 10px; background: var(--k-chip); border: 1px solid var(--k-line); font-size: .88rem; text-align: center; }
