/* ═══════════════════════════════════════════════════
   PAK CLUB — PREDICTION PAGE v5
   App-like, hero-colored prediction, horizontal results
═══════════════════════════════════════════════════ */

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

@font-face {
    font-family: "Poppins";
    src: url("../poppins.ttf") format("truetype");
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --big:        #16a34a;
    --big-dark:   #15803d;
    --big-light:  #dcfce7;
    --big-mid:    #86efac;
    --small:      #dc2626;
    --small-dark: #b91c1c;
    --small-light:#fee2e2;
    --small-mid:  #fca5a5;
    --blue:       #1d4ed8;
    --blue-light: #eff6ff;
    --blue-border:#bfdbfe;
    --text:       #111827;
    --text-2:     #4b5563;
    --text-3:     #9ca3af;
    --border:     #e5e7eb;
    --card:       #ffffff;
    --bg:         #f3f4f6;
    --radius-lg:  18px;
    --radius:     12px;
    --header-h:   54px;
    --tabs-h:     60px;
    --shadow:     0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
    --shadow-md:  0 4px 20px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }

body {
    font-family: "Poppins", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ══════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
}

/* Hamburger toggle */
.app-header__toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    border-radius: 8px;
    padding: 0;
    transition: background .15s;
}
.app-header__toggle:hover { background: var(--bg); }
.app-header__toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

/* Brand: logo + title stack */
.app-header__brand {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-header__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
    background: #000;
}

.app-header__titles {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    line-height: 1.2;
}

.app-header__sub {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.2;
}

/* ── Sidebar Drawer ── */
.side-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: #fff;
    z-index: 400;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.side-drawer.is-open { transform: translateX(0); }

.side-drawer__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #dc2626;
}
.side-drawer__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
    flex-shrink: 0;
}
.side-drawer__title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.side-drawer__close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.side-drawer__close:hover { background: rgba(255,255,255,.25); }

.side-drawer__nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}
.side-drawer__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.side-drawer__item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}
.side-drawer__item:hover,
.side-drawer__item--active {
    background: var(--small-light);
    color: var(--small);
}
.side-drawer__divider {
    height: 1px;
    background: var(--border);
    margin: 6px 16px;
}

/* Overlay behind drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 390;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.drawer-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.app-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--small-light);
    border: 1px solid var(--small-mid);
    color: var(--small);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .6px;
    padding: 4px 10px;
    border-radius: 99px;
    flex-shrink: 0;
    min-width: 62px;
    justify-content: center;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--small);
    border-radius: 50%;
    animation: live-pulse 1.2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .3; transform: scale(1.6); }
}

/* ══════════════════════════════════════════════
   MODE TABS STRIP
══════════════════════════════════════════════ */
.mode-strip {
    position: sticky;
    top: var(--header-h);
    z-index: 190;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
}

.mode-strip__inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.time-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 8px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
    color: var(--text-3);
    min-height: 48px;
}

.time-btn:hover {
    border-color: var(--small-mid);
    color: var(--small);
    background: var(--small-light);
}

.time-btn.active {
    background: var(--small);
    border-color: var(--small);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,38,38,.35);
}

.time-icon {
    font-size: 14px;
    font-weight: 800;
    font-family: 'Monaco', 'Courier New', monospace;
    line-height: 1;
}

.time-label {
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .3px;
}

/* ══════════════════════════════════════════════
   CONTAINER
══════════════════════════════════════════════ */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 12px 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ══════════════════════════════════════════════
   PREDICTION CARD — hero changes color with prediction
══════════════════════════════════════════════ */
.pred-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* ── Hero area ── */
.pred-hero {
    padding: 24px 20px 20px;
    text-align: center;
    background: #f9fafb;
    transition: background .4s ease;
}

.pred-card--big    .pred-hero { background: linear-gradient(160deg, var(--big-dark) 0%, var(--big) 100%); }
.pred-card--small  .pred-hero { background: linear-gradient(160deg, var(--small-dark) 0%, var(--small) 100%); }
.pred-card--analyzing .pred-hero { background: #f9fafb; }

/* Issue row */
.pred-hero__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.pred-hero__issue-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    transition: color .4s;
}

.pred-card--analyzing .pred-hero__issue-label { color: var(--text-3); }

.pred-hero__issue-num {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Monaco', 'Courier New', monospace;
    background: rgba(255,255,255,.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    padding: 3px 12px;
    border-radius: 99px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background .4s, color .4s, border-color .4s;
}

.pred-card--analyzing .pred-hero__issue-num {
    background: var(--bg);
    color: var(--text-2);
    border-color: var(--border);
}

/* ── Prediction value — JS sets: "prediction-value big|small|analyzing" ── */
.prediction-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    color: #fff;
    min-height: 100px;
    margin-bottom: 12px;
    transition: all .35s ease;
}

.prediction-value.big,
.prediction-value.small {
    /* Text is white on the colored hero background */
    color: #fff;
    background: transparent;
    border: none;
}

.prediction-value.analyzing {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0;
    min-height: 80px;
}

/* Hint text */
.pred-hero__hint {
    font-size: 11px;
    color: rgba(255,255,255,.65);
    margin-bottom: 16px;
    transition: color .4s;
}

.pred-card--analyzing .pred-hero__hint { color: var(--text-3); }

/* CTA Button */
.pred-hero__cta { min-height: 0; }

.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.5);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 99px;
    cursor: pointer;
    transition: background .2s, transform .15s;
    font-family: inherit;
    backdrop-filter: blur(4px);
    text-decoration: none;
}
.pred-card--analyzing .hero-cta-btn {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.pred-card--analyzing .hero-cta-btn:hover { background: #b91c1c; }
.hero-cta-btn::after { content: '▶'; font-size: 10px; }
.hero-cta-btn:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
.hero-cta-btn:active { transform: translateY(0); }

/* ── Countdown footer ── */
.pred-footer {
    background: #fff;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.pred-footer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pred-footer__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pred-footer__time {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--blue);
    background: var(--blue-light);
    border: 1px solid var(--blue-border);
    padding: 4px 14px;
    border-radius: 8px;
    font-family: 'Monaco', monospace;
    min-width: 78px;
    text-align: center;
    display: inline-block;
}

.pred-footer__time.warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.pred-footer__time.urgent  { color: #991b1b; background: var(--small-light); border-color: var(--small-mid); }

.countdown-progress {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.countdown-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--big), #4ade80);
    border-radius: 99px;
    transition: width .3s ease-out;
    width: 0%;
}

.countdown-bar.warning { background: linear-gradient(90deg, #d97706, #fbbf24); }
.countdown-bar.urgent  { background: linear-gradient(90deg, var(--small), #f87171); }

/* ══════════════════════════════════════════════
   SECTION CARDS
══════════════════════════════════════════════ */
.section-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.section-card__head i { color: var(--small); font-size: 13px; }

.section-card__hint {
    margin-left: auto;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-3);
}

/* ══════════════════════════════════════════════
   RESULTS — horizontal scroll row
══════════════════════════════════════════════ */
.results-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding: 14px 14px;
}

.results-grid::-webkit-scrollbar { display: none; }

/* result-card: rendered by JS */
.result-card {
    flex-shrink: 0;
    width: 76px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 6px 10px;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    cursor: default;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.result-number.big   { background: var(--big); }
.result-number.small { background: var(--small); }

.result-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
}

.result-type.big   { color: var(--big); }
.result-type.small { color: var(--small); }

.result-issue {
    font-size: 8.5px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.result-time {
    font-size: 8px;
    color: var(--text-3);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════
   HISTORY TABLE
══════════════════════════════════════════════ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

.modern-table th {
    background: var(--bg);
    color: var(--text-2);
    padding: 11px 10px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
}

.modern-table td {
    padding: 10px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-2);
    background: #fff;
}

.modern-table tr:last-child td { border-bottom: none; }
.modern-table tr:hover td { background: var(--bg); }

.prediction-badge, .actual-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.prediction-badge.big, .actual-badge.big {
    background: var(--big-light);
    color: var(--big);
    border: 1px solid var(--big-mid);
}

.prediction-badge.small, .actual-badge.small {
    background: var(--small-light);
    color: var(--small);
    border: 1px solid var(--small-mid);
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
}

.status-badge.correct { background: var(--big-light); color: var(--big); border: 1px solid var(--big-mid); }
.status-badge.wrong   { background: var(--small-light); color: var(--small); border: 1px solid var(--small-mid); }
.status-badge.pending { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.status-cell { background: transparent !important; }

.win-status      { color: var(--big); font-weight: 700; font-size: 12px; }
.multiplier-base { color: #d97706; font-weight: 700; font-size: 12px; }
.multiplier-high { color: var(--small); font-weight: 700; font-size: 12px; }

/* ══════════════════════════════════════════════
   FLOATING — Telegram only (no visit button - it's in hero)
══════════════════════════════════════════════ */
.floating-wrapper {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 1200;
}

.fab-telegram { display: block; background: transparent; padding: 0; }

.fab-icon-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* Hide the JS-created floating visit wrapper — visit is now in hero */
.floating-visit-wrapper { display: none !important; }

/* ══════════════════════════════════════════════
   NOTIFICATION TOAST
══════════════════════════════════════════════ */
.notify-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    max-width: 340px;
    width: calc(100% - 32px);
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 600;
    background: #111827;
    color: rgba(255,255,255,.9);
    border-radius: 99px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 2000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notify-bar.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ══════════════════════════════════════════════
   LOADING
══════════════════════════════════════════════ */
.loading-cell { padding: 0; text-align: center; }
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    min-height: 80px;
}

.loading-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid var(--border);
    border-top-color: var(--small);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   IFRAME PREVIEW
══════════════════════════════════════════════ */
.prediction-preview {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: stretch;
    justify-content: stretch;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s;
    z-index: 1100;
}

.prediction-preview.is-visible { display: flex; opacity: 1; pointer-events: auto; }
.prediction-preview-inner { width: 100%; height: 100%; background: #000; overflow: hidden; }
.prediction-preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
html.prediction-preview-open, body.prediction-preview-open { overflow: hidden; height: 100%; }
body.prediction-preview-open * { pointer-events: none !important; }
body.prediction-preview-open .prediction-preview,
body.prediction-preview-open .prediction-preview * { pointer-events: auto !important; }
body.prediction-preview-open .floating-wrapper,
body.prediction-preview-open #notificationBar { display: none !important; }

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */
@keyframes pulse-anim {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.03); }
}
.pulse-animation { animation: pulse-anim .5s ease; }

/* Hide legacy elements */
.scroll-progress, .status-indicator, .algorithm-info,
.header, #algorithmInfo, .bottom-nav { display: none !important; }

/* ══════════════════════════════════════════════
   MOBILE  ≤ 480px
══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .container { padding: 10px 10px 32px; gap: 10px; }

    .prediction-value { font-size: 4rem; min-height: 80px; }
    .prediction-value.analyzing { font-size: 1rem; min-height: 70px; }

    .pred-hero { padding: 20px 14px 16px; }
    .pred-footer { padding: 12px 14px; }
    .pred-footer__time { font-size: 1.15rem; min-width: 70px; }

    .mode-strip { padding: 8px 10px; }
    .time-btn { padding: 8px 4px; min-height: 44px; }
    .time-icon { font-size: 13px; }
    .time-label { font-size: 8px; }

    .result-card { width: 68px; padding: 10px 4px 8px; }
    .result-number { width: 36px; height: 36px; font-size: 1rem; }

    .modern-table th, .modern-table td { padding: 9px 7px; font-size: 11px; }
    .app-header__sub { display: none; }
}

/* ══════════════════════════════════════════════
   DESKTOP  ≥ 700px
══════════════════════════════════════════════ */
@media (min-width: 700px) {
    .container { padding: 20px 20px 48px; }

    .prediction-value { font-size: 6rem; min-height: 120px; letter-spacing: -3px; }
    .prediction-value.analyzing { font-size: 1.2rem; min-height: 100px; letter-spacing: 0; }

    .pred-hero { padding: 36px 32px 28px; }
    .pred-footer { padding: 18px 32px; }

    .result-card { width: 90px; }
    .result-number { width: 48px; height: 48px; font-size: 1.2rem; }
    .result-type { font-size: 11px; }

    .modern-table th, .modern-table td { padding: 12px 14px; font-size: 13px; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
