/* ==========================================================================
   Chat Feed — results arrive as chat bubbles from the khaiwal.
   ========================================================================== */

:root {
    --bar: #075e54;
    --bar-2: #128c7e;
    --wall: #ded3c4;
    --bubble-in: #ffffff;
    --bubble-out: #d9fdd3;
    --ink: #111b21;
    --dim: #667781;
    --tick: #53bdeb;
    --accent: #25d366;
    --amber: #b7791f;
    --line: rgba(0, 0, 0, .1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--wall);
    /* Faint doodle-ish texture, same idea as a chat wallpaper. */
    background-image:
        radial-gradient(rgba(0, 0, 0, .035) 1.2px, transparent 1.2px),
        radial-gradient(rgba(0, 0, 0, .025) 1.2px, transparent 1.2px);
    background-size: 26px 26px, 26px 26px;
    background-position: 0 0, 13px 13px;
    background-attachment: fixed;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 72px;
    -webkit-font-smoothing: antialiased;
}

a { color: #027eb5; text-decoration: none; }
.thread { max-width: 720px; margin: 0 auto; padding: 14px 12px 20px; }

/* ------------------------------------------------------------------- bar */

.bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    background: var(--bar);
    color: #fff;
}

.ava {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: var(--bar-2);
    border-radius: 50%;
    font-size: 17px;
    font-weight: 700;
}

.who { min-width: 0; line-height: 1.25; }
.who b { display: block; font-size: 16px; font-weight: 600; }
.who span { display: flex; align-items: center; gap: 5px; color: #b9d6d1; font-size: 12px; }
.who .dot { width: 7px; height: 7px; background: #6ee7a8; border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.bar-links { display: flex; gap: 4px; margin-left: auto; }
.bar-links a { padding: 6px 11px; border-radius: 6px; color: #d6e8e4; font-size: 13px; font-weight: 600; }
.bar-links a:hover, .bar-links a.on { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------------------------------------------------------------- chips */

.day { display: flex; justify-content: center; margin: 14px 0; }
.day span { padding: 5px 14px; background: #e2f0f7; border-radius: 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); color: var(--dim); font-size: 12px; font-weight: 600; }

/* --------------------------------------------------------------- bubbles */

.msg { display: flex; margin-bottom: 9px; opacity: 0; animation: pop .35s ease forwards; }
.msg.out { justify-content: flex-end; }

@keyframes pop {
    from { opacity: 0; transform: translateY(10px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.bub {
    position: relative;
    max-width: 82%;
    padding: 7px 11px 18px;
    background: var(--bubble-in);
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .13);
    font-size: 15px;
}

.msg.out .bub { background: var(--bubble-out); }

/* Little tail on the first bubble of a run. */
.bub::before {
    content: "";
    position: absolute;
    top: 0;
    left: -7px;
    width: 0;
    height: 0;
    border-top: 8px solid var(--bubble-in);
    border-left: 8px solid transparent;
}

.msg.out .bub::before { left: auto; right: -7px; border-top-color: var(--bubble-out); border-left: 0; border-right: 8px solid transparent; }
.bub.no-tail::before { display: none; }

.bub .time { position: absolute; right: 9px; bottom: 4px; display: flex; align-items: center; gap: 3px; color: var(--dim); font-size: 11px; }
.bub .tick { color: var(--tick); font-size: 12px; line-height: 1; }

.bub .gname { display: block; margin-bottom: 3px; color: var(--bar-2); font-size: 17px; font-weight: 800; }
.bub .res { font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1.15; }
.bub .prev { color: var(--dim); font-size: 12px; }
.bub .link { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; }

/* Pending game — a typing indicator instead of the word WAIT. */
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 6px 2px; }
.typing i { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; animation: type 1.3s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

@keyframes type {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30%           { transform: translateY(-5px); opacity: 1; }
}

.typing-note { margin-top: 2px; color: var(--dim); font-size: 12px; }

/* -------------------------------------------------------------- sections */

.panel { margin: 16px 0; padding: 16px 18px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .13); }
.panel h3 { margin-bottom: 4px; font-size: 16px; font-weight: 700; color: var(--bar); }
.panel .rate { margin-bottom: 10px; color: var(--amber); font-size: 13px; font-weight: 700; }
.panel .note { margin-top: 10px; color: var(--dim); font-size: 12px; }

.plist { list-style: none; }
.plist li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.plist li:last-child { border-bottom: 0; }
.plist li i { flex: 1; border-bottom: 1px dotted #ccc; }
.plist b { color: var(--bar-2); }

.btn { display: inline-block; margin-top: 12px; padding: 10px 22px; background: var(--accent); border-radius: 24px; color: #fff; font-size: 14px; font-weight: 700; }
.btn.tg { background: #29a9eb; margin-left: 6px; }

.sec-h { margin: 20px 0 10px; color: var(--bar); font-size: 17px; font-weight: 700; text-align: center; }

/* faq as chat Q/A */
.faq-item { margin-bottom: 8px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); overflow: hidden; }
.faq-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.faq-ico { color: var(--bar-2); font-size: 18px; font-style: normal; }
.faq-item.open .faq-ico { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 14px 12px; color: var(--dim); font-size: 14px; }
.faq-item.open .faq-a { display: block; }

/* week table */
.rec-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.rec { width: 100%; border-collapse: collapse; font-size: 13px; }
.rec th, .rec td { padding: 9px 10px; border-bottom: 1px solid #eee; text-align: center; white-space: nowrap; }
.rec thead th { background: #f5f5f5; color: var(--dim); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }
.rt-date { color: var(--bar-2); font-weight: 700; }
.rt-dash { color: #ccc; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0; }
.step { padding: 14px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); text-align: center; }
.step-ico { display: block; font-size: 24px; }
.step b { display: block; margin: 5px 0 2px; font-size: 14px; color: var(--bar); }
.step span { color: var(--dim); font-size: 12px; }

.article { margin-bottom: 12px; padding: 16px 18px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.article h4 { margin-bottom: 8px; font-size: 16px; font-weight: 700; color: var(--bar); }
.article p { margin-bottom: 9px; color: #3b4a51; font-size: 14px; }
.article p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- footer */

.foot { padding: 20px 14px; color: #5b5348; text-align: center; }
.foot .fname { font-size: 17px; font-weight: 700; color: var(--bar); }
.foot p { max-width: 640px; margin: 6px auto; font-size: 12px; word-break: break-word; }

/* Composer bar pinned to the bottom, doubles as the WhatsApp call to action. */
.composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 720px;
    margin: 0 auto;
    padding: 9px 12px;
}

.composer .fake { flex: 1; padding: 11px 16px; background: #fff; border-radius: 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .16); color: var(--dim); font-size: 14px; }
.composer .send { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; background: var(--accent); border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); color: #fff; }

/* ------------------------------------------------------------ chart page */

.chart-wrap { max-width: 1000px; margin: 16px auto; padding: 0 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; padding: 14px; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.filters select, .filters input { padding: 9px 11px; background: #fff; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 14px; }
.btn-sm { display: inline-block; padding: 9px 18px; background: var(--bar-2); border: 0; border-radius: 8px; color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.btn-sm.ghost { background: #eceff1; color: var(--ink); }

@media (max-width: 640px) {
    .bub { max-width: 88%; }
    .bub .res { font-size: 25px; }
    .bar-links a { padding: 6px 8px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
    .msg { opacity: 1; }
}
