/* ===== Modern Light Theme for VN78 Predictions ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #f7fafc 0%, #eef2f7 100%);
  color: #0f172a; /* slate-900 */
  padding: 24px 12px 44px;
}
.container { max-width: 1000px; margin: 0 auto; }

/* Header */
header { text-align: center; margin-bottom: 22px; }
.teacher { font-size: 0.95rem; letter-spacing: 0.05em; color: #64748b; }
header h1 { margin-top: 6px; font-size: clamp(1.25rem, 2.5vw, 2rem); color: #0f172a; }
header .time { margin-top: 6px; font-size: clamp(0.85rem, 1.6vw, 0.95rem); color: #0ea5a4; }

/* Notes */
.update-note { margin-top: 10px; font-size: 0.92rem; text-align: center; color: #475569; }
.update-note.waiting { color: #64748b; }
.update-note.updating { color: #0ea5a4; }
.update-note.frozen { color: #b45309; }

.update-subnote { margin-top: 4px; font-size: 0.9rem; color: #64748b; text-align: center; }
.update-subnote.soon { color: #b45309; }
.update-subnote.urgent { color: #b91c1c; animation: blink 1.1s steps(2, jump-none) infinite; }

@keyframes blink { 50% { opacity: .55; } }

/* Countdown */
.countdown {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid #e5e7eb; background: #ffffff; display: inline-block;
  min-width: 280px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.countdown .cd-wrap { display: flex; align-items: center; gap: 12px; }
.countdown .cd-logo { width: clamp(56px, 12vw, 96px); height: clamp(56px, 12vw, 96px); object-fit: contain; flex: 0 0 auto; }
.countdown .cd-body { display: flex; flex-direction: column; }
.countdown .cd-label { font-size: 0.9rem; letter-spacing: 0.02em; color: #64748b; margin-bottom: 6px; }
.countdown .cd-time { font-variant-numeric: tabular-nums; font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 700; color: #0f172a; }
.countdown .cd-time .unit { display: inline-block; min-width: 2ch; text-align: center; }
.countdown .cd-status { margin-top: 6px; font-size: 0.9rem; color: #b45309; }
.countdown.live { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }

/* Cards grid */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 22px; }

/* Card */
.card {
  background: #ffffff; border-radius: 16px; border: 1px solid #e5e7eb;
  padding: 14px 14px 16px; box-shadow: 0 10px 24px rgba(15,23,42,0.06);
  position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(15,23,42,0.12); border-color: #d1d5db; }

.card-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; color: #0f172a; display: flex; align-items: center; gap: 6px; }
.card-title span.icon { font-size: 1.1rem; }
.card-title img.logo { width: 18px; height: 18px; object-fit: contain; display: inline-block; filter: none; margin-right: 2px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; border: 1px solid #e2e8f0; color: #0f172a; background: #f8fafc; margin-left: auto; }

/* Copy button next to card title */
.copy-btn { appearance: none; border: 1px solid #e2e8f0; background: #ffffff; color: #0f172a; border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 10px rgba(15,23,42,0.08); display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.copy-btn:hover { box-shadow: 0 8px 16px rgba(15,23,42,0.10); transform: translateY(-1px); }
.copy-btn .ico { font-size: 0.95rem; }
.copy-btn.success { border-color: #86efac; background: #ecfdf5; color: #065f46; }
.copy-btn.error { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }

/* Numbers */
.number-main { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; color: #111827; margin: 4px 0 2px; }
.number-main.green { color: #16a34a; }
.sub-label { font-size: 0.8rem; color: #64748b; }

.numbers-inline { font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 600; margin-top: 8px; color: #0f172a; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.numbers-inline .bullet { font-size: 1rem; margin-left: 4px; }

/* Pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pill { padding: 6px 10px; border-radius: 999px; background: #f1f5f9; border: 1px solid #e2e8f0; font-size: 0.95rem; min-width: 60px; text-align: center; }
.pill.bad { background: #fee2e2; border-color: #fecaca; color: #991b1b; }

/* Grids */
.numbers-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.numbers-grid-50 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 8px; font-size: 0.95rem; }
.cell { border-radius: 999px; background: linear-gradient(145deg, #ffffff, #f3f4f6); border: 1px solid #e5e7eb; font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; box-shadow: 4px 4px 10px rgba(15,23,42,0.10), -3px -3px 8px rgba(255,255,255,0.9), inset 0 1px 0 rgba(255,255,255,0.6); color: #0f172a; justify-self: center; align-self: center; }
.numbers-grid .cell { width: clamp(40px, 6vw, 50px); height: clamp(40px, 6vw, 50px); font-size: clamp(0.85rem, 2vw, 1.05rem); }
.numbers-grid-50 .cell { width: clamp(32px, 4.8vw, 40px); height: clamp(32px, 4.8vw, 40px); font-size: clamp(0.75rem, 1.8vw, 0.95rem); }
.cell.highlight { background: linear-gradient(145deg, #fff7ed, #fde68a); border-color: #f59e0b; box-shadow: 4px 4px 10px rgba(245, 158, 11, 0.18), -3px -3px 8px rgba(255,255,255,0.9), inset 0 1px 0 rgba(255,255,255,0.6); }

/* Micro countdown per card */
.micro-timer { display: inline-block; margin: 4px 0 8px 0; font-size: 0.9rem; font-weight: 700; color: #ffffff; background: #dc2626; border: 1px solid #ef4444; padding: 4px 12px; border-radius: 999px; pointer-events: none; box-shadow: 0 3px 10px rgba(220,38,38,0.25), inset 0 1px 0 rgba(255,255,255,0.35); backdrop-filter: blur(2px); }
.micro-timer.soon { background: #b91c1c; border-color: #dc2626; }
.micro-timer.urgent { background: #7f1d1d; border-color: #991b1b; animation: blink 1.1s steps(2, jump-none) infinite; }

/* Danger card */
.card.danger { border-color: #fbd38d; background: #fff8ed; }
.card.danger .card-title { color: #7c2d12; }
.card.danger .pill.bad { background: #fff7ed; border-color: #fbd38d; color: #7c2d12; }

/* Badge circles for numbers */
.badge-circle { display: inline-flex; align-items: center; justify-content: center; width: clamp(44px, 7vw, 56px); height: clamp(44px, 7vw, 56px); border-radius: 999px; background: linear-gradient(145deg, #ffffff, #f3f4f6); border: 1px solid #e5e7eb; box-shadow: 6px 6px 14px rgba(15,23,42,0.12), -4px -4px 10px rgba(255,255,255,0.9), inset 0 1px 0 rgba(255,255,255,0.6); font-weight: 700; color: #0f172a; }
.badge-circle.lg { width: clamp(56px, 8vw, 72px); height: clamp(56px, 8vw, 72px); font-size: clamp(1.6rem, 4.5vw, 2.2rem); }
.badge-circle.sm { width: clamp(36px, 6vw, 44px); height: clamp(36px, 6vw, 44px); font-size: clamp(1rem, 3.5vw, 1.3rem); }

/* Footer */
footer { margin-top: 30px; text-align: center; font-size: 0.85rem; color: #94a3b8; }

/* Responsive */
@media (max-width: 480px) {
  body { padding: 16px 8px 28px; }
  .grid-cards { grid-template-columns: 1fr; }
  .countdown { min-width: auto; width: 100%; }
  .pill { font-size: 0.9rem; padding: 6px 10px; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .numbers-grid-50 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 481px) and (max-width: 767px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .numbers-grid { grid-template-columns: repeat(3, 1fr); }
  .numbers-grid-50 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .numbers-grid { grid-template-columns: repeat(4, 1fr); }
  .numbers-grid-50 { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .card { transition: none !important; }
  .ai-fab { animation: none !important; }
}
@media (min-width: 481px) and (max-width: 767px) {
  .grid-cards { grid-template-columns: repeat(2, 1fr); }
  .numbers-grid { grid-template-columns: repeat(3, 1fr); }
  .numbers-grid-50 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .numbers-grid { grid-template-columns: repeat(4, 1fr); }
  .numbers-grid-50 { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1024px) {
  .grid-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .container { max-width: 1000px; }
}
@media (min-width: 1280px) {
  .container { max-width: 1100px; }
}

/* Reduce motion for users preferring it */
@media (prefers-reduced-motion: reduce) {
  .card, .card::before { animation: none !important; transition: none !important; }
}

/* ===== AI Tài Xỉu PK3 Popup ===== */
.ai-overlay{
  position:fixed; inset:0; background: rgba(15,23,42,0.45);
  opacity:0; pointer-events:none; transition: opacity .2s ease; z-index:9996;
}
.ai-overlay.open{ opacity:1; pointer-events:auto; }
.ai-fab {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(96px, 12vw, 140px); height: clamp(96px, 12vw, 140px);
  border-radius: 999px;
  /* Remove white inner circle */
  background: transparent;
  border: none;
  display: grid; place-items: center;
  cursor: pointer; z-index: 9999;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  /* Gentle breathing glow on the whole bubble */
  animation: ai-pulse 2.6s ease-in-out infinite;
}
/* Gradient ring effect without white fill */
.ai-fab::after{
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  padding: 2px; /* ring thickness */
  background: conic-gradient(
    from 0deg,
    #10b981 0deg,
    #2563eb 120deg,
    #f59e0b 240deg,
    #10b981 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 0px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 0px));
  filter: drop-shadow(0 8px 20px rgba(15,23,42,0.22));
  animation: ai-rotate 8s linear infinite;
  pointer-events: none;
}
.ai-fab:hover { transform: translateY(-50%) scale(1.06); filter: drop-shadow(0 22px 50px rgba(15,23,42,0.22)); }
.ai-fab img { width: 90%; height: 90%; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(37,99,235,0.28)); transition: transform .2s ease, filter .2s ease; }
.ai-fab:hover img { transform: scale(1.06); filter: drop-shadow(0 10px 20px rgba(37,99,235,0.36)); }

.ai-panel {
  position: fixed;
  left: 50%; top: 50%;
  width: clamp(360px, 60vw, 700px);
  max-height: min(80vh, 680px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15,23,42,0.22);
  transform: translate(-50%, -52%) scale(0.96);
  opacity: 0;
  transition: transform .26s ease, opacity .2s ease;
  z-index: 9998;
  overflow: hidden;
}
.ai-panel.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.ai-header {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e5e7eb; background: #f8fafc;
}
.ai-title { font-weight: 800; color: #0f172a; font-size: 1.05rem; letter-spacing:.01em; }
.ai-countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: #0f172a; }
.ai-countdown .mm, .ai-countdown .ss { display: inline-block; min-width: 2ch; text-align: center; }
.ai-close { appearance: none; border: none; background: transparent; font-size: 1.2rem; line-height: 1; padding: 6px; cursor: pointer; color: #64748b; }
.ai-close:hover { color: #0f172a; }
.ai-content { padding: 18px 18px 16px; text-align:center; position: relative; overflow: hidden; }
/* Subtle gradient background inside panel */
.ai-content::before{
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(99,102,241,0.10) 0%, rgba(99,102,241,0.00) 40%),
    radial-gradient(120% 120% at 100% 0%, rgba(16,185,129,0.10) 0%, rgba(16,185,129,0.00) 40%),
    radial-gradient(120% 120% at 50% 100%, rgba(245,158,11,0.10) 0%, rgba(245,158,11,0.00) 40%);
}
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; justify-items: center; }
.ai-suggestion {
  position: relative; z-index: 1;
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 10px 16px; border-radius: 14px;
  background: rgba(248,250,252,0.66);
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 10px 24px rgba(15,23,42,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
}
/* Animated gradient outline */
.ai-suggestion::before{
  content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px;
  background: linear-gradient(120deg, rgba(16,185,129,0.6), rgba(37,99,235,0.6), rgba(245,158,11,0.6));
  -webkit-mask: 
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ai-border 6s linear infinite;
}
.ai-suggestion.flash::after{
  content: ""; position: absolute; inset: 0; border-radius: 14px;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.7) 50%, transparent 100%);
  transform: translateX(-120%);
  animation: ai-shine 900ms ease forwards;
}
.ai-suggestion .pick { font-weight: 900; font-size: 1.25rem; }
.ai-suggestion .pick.tai { color: #16a34a; }
.ai-suggestion .pick.xiu { color: #2563eb; }
.ai-suggestion .pick.chan { color: #7c3aed; }
.ai-suggestion .pick.le { color: #d97706; }
.ai-suggestion .prob { color: #475569; font-weight: 800; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 8px; font-size: 0.9rem; }
.ai-suggestion .prob::before { content: "• "; color: #94a3b8; font-weight: 900; margin-right: 2px; }
.ai-dice { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(248,250,252,0.66); border: 1px solid #e5e7eb; box-shadow: 0 10px 24px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.6); }
.ai-dice img { width: clamp(56px, 9vw, 72px); height: clamp(56px, 9vw, 72px); object-fit: contain; filter: drop-shadow(0 6px 12px rgba(15,23,42,0.18)); border-radius: 10px; background: #ffffff; }
.ai-note { margin-top: 10px; font-size: 0.85rem; color: #94a3b8; text-align: center; }

@keyframes ai-roll { 0% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(12deg) translateY(-2px); } 100% { transform: rotate(0deg) translateY(0); } }
.ai-dice img.roll { animation: ai-roll 480ms ease; }

@media (max-width: 640px) {
  .ai-fab { right: 10px; width: 96px; height: 96px; }
  .ai-panel { width: calc(100% - 20px); left: 50%; top: 50%; }
}

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 14px 32px rgba(15,23,42,0.16); transform: translateY(-50%) scale(1); }
  50% { box-shadow: 0 18px 48px rgba(15,23,42,0.20); transform: translateY(-50%) scale(1.04); }
}

@keyframes ai-rotate { to { transform: rotate(360deg); } }
@keyframes ai-border { 0%{ filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes ai-shine { 0%{ transform: translateX(-120%); opacity:.0; } 30%{ opacity:.65; } 100%{ transform: translateX(120%); opacity: 0; } }
