/* Prediction activity pages — Figma panel chrome */
.predict-page {
  --pred-bg: var(--canvas-bg);
  --pred-panel: var(--surface-panel);
  --pred-panel-2: var(--surface-elev);
  --pred-border: var(--panel-border);
  --pred-green: var(--tiff-primary);
  --pred-green-dim: var(--tiff-muted);
  --pred-gold: var(--gold-bright);
  --pred-text: var(--text);
  --pred-muted: var(--text-muted);
  --pred-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --pred-ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --pred-expand-ms: 260ms;
  --pred-stagger-ms: 42ms;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 32px;
}

/* Collapsed while loading → expand when ready (transform + opacity only) */
.predict-section {
  transform-origin: top center;
  will-change: transform, opacity;
}

.predict-page.predict-is-loading .predict-section {
  opacity: 0;
  transform: scaleY(0.52);
  pointer-events: none;
}

.predict-page.predict-is-loading .predict-banner {
  min-height: 52px;
  margin-bottom: 12px;
}

.predict-page.predict-is-loading .predict-banner .placeholder {
  padding: 14px 16px;
  font-size: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .predict-page.predict-is-ready .predict-section {
    animation: predict-section-expand var(--pred-expand-ms) var(--pred-ease-expo) both;
    animation-delay: calc(var(--pred-i, 0) * var(--pred-stagger-ms));
    pointer-events: auto;
  }

  .predict-page.predict-is-ready .predict-banner.predict-banner--grow {
    animation: predict-banner-expand 320ms var(--pred-ease-quart) both;
    animation-delay: calc(var(--pred-i, 0) * var(--pred-stagger-ms) + 40ms);
  }

  @keyframes predict-section-expand {
    from {
      opacity: 0;
      transform: scaleY(0.52);
    }
    to {
      opacity: 1;
      transform: scaleY(1);
    }
  }

  @keyframes predict-banner-expand {
    from {
      opacity: 0.7;
      transform: scaleY(0.65);
    }
    to {
      opacity: 1;
      transform: scaleY(1);
    }
  }

  .predict-state-panel {
    animation: predict-section-expand var(--pred-expand-ms) var(--pred-ease-expo) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .predict-page.predict-is-loading .predict-section {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.predict-page.predict-is-loaded .predict-section {
  pointer-events: auto;
  opacity: 1;
  transform: none;
}

.predict-page .page-title {
  font-family: var(--font-display);
  font-size: var(--fs-title-md, 20px);
  font-weight: var(--fw-heading, 600);
  letter-spacing: var(--track-heading, -0.01em);
  line-height: var(--lh-heading-loose, 1.3);
  color: var(--type-primary, var(--pred-text));
  margin: 0 0 16px;
}

.predict-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.predict-countdown .unit {
  background: var(--pred-panel-2);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer-sm);
  padding: 12px 8px;
  text-align: center;
}

.predict-countdown .num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--pred-green);
  line-height: 1.1;
}

.predict-countdown .lbl {
  font-size: 11px;
  color: var(--pred-muted);
  margin-top: 4px;
}

.predict-banner {
  width: 100%;
  border-radius: var(--radius-outer);
  overflow: hidden;
  border: 1px solid var(--pred-border);
  margin-bottom: 16px;
  background: var(--pred-panel);
  min-height: 120px;
}

.predict-banner img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.predict-banner .placeholder {
  padding: 24px var(--labet-gutter-x, 6px);
  text-align: center;
  color: var(--pred-muted);
  font-size: 13px;
}

.predict-block-head .predict-section-title {
  margin-top: 0;
}

.predict-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pred-green);
  margin: 18px 0 10px;
}

.predict-hint {
  font-size: 12.5px;
  color: var(--pred-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.predict-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.predict-field {
  background: var(--pred-panel);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer-sm);
  padding: 14px;
}

.predict-field label {
  display: block;
  font-size: 11.5px;
  color: var(--pred-muted);
  margin-bottom: 8px;
  line-height: 1.35;
}

.predict-field input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-inner);
  padding: 12px 10px;
  font-family: var(--font-mono);
  font-size: 20px;
  text-align: center;
  color: var(--pred-text);
  letter-spacing: 0.15em;
}

.predict-field input:disabled {
  opacity: 0.6;
}

.predict-match-card {
  background: var(--pred-panel);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer);
  padding: 16px;
  margin-bottom: 16px;
}

.predict-match-meta {
  font-size: 12px;
  color: var(--pred-muted);
  text-align: center;
  margin-bottom: 14px;
}

.predict-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.predict-team {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-outer-sm);
  background: var(--pred-panel-2);
  border: 1px solid transparent;
}

.predict-team img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
}

.predict-team .nm {
  font-size: 12px;
  font-weight: 600;
  color: var(--pred-text);
}

.predict-vs {
  font-size: 13px;
  font-weight: 700;
  color: var(--pred-muted);
}

.predict-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.predict-scores input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 22px;
  text-align: center;
  color: var(--pred-text);
}

.predict-draw-btn {
  padding: 10px 14px;
  border-radius: var(--radius-outer-sm);
  border: 1px solid var(--pred-border);
  background: var(--pred-panel-2);
  color: var(--pred-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.predict-draw-btn:disabled,
.predict-first-score button:disabled,
.predict-scores input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.predict-draw-btn.active {
  border-color: var(--pred-green);
  color: var(--pred-green);
  background: rgba(74, 222, 128, 0.12);
}

.predict-first-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.predict-first-score button {
  padding: 12px;
  border-radius: var(--radius-outer-sm);
  border: 1px solid var(--pred-border);
  background: var(--pred-panel-2);
  color: var(--pred-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.predict-first-score button.active {
  border-color: var(--pred-green);
  color: var(--pred-green);
  box-shadow: 0 0 0 1px var(--pred-green);
}

.predict-submit {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(244, 201, 93, 0.45);
  border-radius: var(--radius-outer-sm);
  background: linear-gradient(135deg, #f0d48a 0%, #e8c468 38%, var(--gold, #f4c95d) 100%);
  color: var(--on-dark, #15130d);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 22px rgba(201, 169, 97, 0.38);
  text-shadow: none;
}

.predict-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(201, 169, 97, 0.5);
  color: var(--on-dark, #15130d);
}

.predict-submit:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: linear-gradient(180deg, rgba(244, 201, 93, 0.28), rgba(196, 154, 58, 0.2));
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(244, 201, 93, 0.22);
  box-shadow: none;
}

.predict-terms {
  margin-top: 20px;
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer-sm);
  overflow: hidden;
  background: var(--pred-panel);
}

.predict-terms summary {
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--pred-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.predict-terms summary::-webkit-details-marker {
  display: none;
}

.predict-terms .body {
  padding: 0 16px 14px;
  font-size: 12.5px;
  color: var(--pred-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.predict-status {
  padding: 12px 14px;
  border-radius: var(--radius-outer-sm);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.predict-status.ok {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid var(--pred-green);
  color: var(--pred-green);
}

.predict-status.warn {
  background: rgba(245, 215, 110, 0.1);
  border: 1px solid rgba(245, 215, 110, 0.35);
  color: var(--pred-gold);
}

.predict-status.err {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.predict-empty {
  text-align: center;
  padding: 48px var(--labet-gutter-x, 6px);
  color: var(--pred-muted);
  font-size: 14px;
}

.predict-state-panel {
  text-align: center;
  padding: var(--labet-gutter-y) var(--labet-gutter-x) var(--labet-gutter-bottom);
  border-radius: var(--radius-outer);
  border: 1px solid var(--pred-border);
  background: linear-gradient(180deg, var(--pred-panel), var(--pred-bg));
  margin-top: 8px;
}

.predict-state-ic {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 12px;
}

.predict-state-msg {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--pred-text);
}

.predict-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.predict-state-actions .predict-submit {
  min-width: 160px;
}

.predict-state-actions .predict-draw-btn {
  min-width: 120px;
}

.predict-aggregate {
  margin-top: 20px;
  border-radius: var(--radius-outer-sm);
  overflow: hidden;
  border: 1px solid var(--pred-border);
}

.predict-aggregate summary {
  padding: 14px 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #1a5c32, #228b3d);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.predict-aggregate summary::-webkit-details-marker {
  display: none;
}

.predict-aggregate .agg-total {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

.predict-aggregate .agg-list {
  background: var(--bg-2);
  max-height: 320px;
  overflow-y: auto;
}

.predict-aggregate .agg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tiff-soft);
  font-size: 13px;
  color: var(--pred-text);
}

.predict-aggregate .agg-row:last-child {
  border-bottom: 0;
}

.predict-aggregate .agg-row .cnt {
  font-family: var(--font-mono);
  color: var(--pred-green);
  white-space: nowrap;
}

.predict-history-page .hist-card {
  background: var(--pred-panel);
  border: 1px solid var(--pred-border);
  border-radius: var(--radius-outer-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.predict-history-page .hist-card .type {
  font-size: 11px;
  color: var(--pred-green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.predict-history-page .hist-card .title {
  font-size: 15px;
  font-weight: 600;
  margin: 4px 0;
  color: var(--pred-text);
}

.predict-history-page .hist-card .pick {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--pred-gold);
  margin-top: 6px;
}

.predict-history-page .hist-card .time {
  font-size: 11px;
  color: var(--pred-muted);
  margin-top: 8px;
}

.content.predict-wrap {
  background: linear-gradient(180deg, var(--pred-bg) 0%, var(--bg-0) 120px);
}

/* ── Prediction activity atmosphere (lottery · football · muay) ── */
body[data-page="predict-lottery"] .predict-wrap,
body[data-page="predict-football"] .predict-wrap,
body[data-page="predict-muay"] .predict-wrap {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(255, 215, 106, 0.1), transparent 58%),
    radial-gradient(ellipse 80% 55% at 100% 35%, rgba(177, 18, 18, 0.08), transparent 52%),
    radial-gradient(ellipse 70% 50% at 0% 75%, rgba(0, 196, 106, 0.06), transparent 48%),
    linear-gradient(180deg, #070604 0%, #111008 42%, #070604 100%);
  border-radius: var(--radius-outer);
  padding-top: 8px;
}

body[data-page="predict-lottery"] .predict-wrap::before,
body[data-page="predict-football"] .predict-wrap::before,
body[data-page="predict-muay"] .predict-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(rgba(214, 168, 63, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 168, 63, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, #000 20%, transparent 75%);
  opacity: 0.65;
}

body[data-page="predict-lottery"] .predict-page,
body[data-page="predict-football"] .predict-page,
body[data-page="predict-muay"] .predict-page {
  position: relative;
  z-index: 1;
}

body[data-page="predict-lottery"] .predict-page .page-title,
body[data-page="predict-football"] .predict-page .page-title,
body[data-page="predict-muay"] .predict-page .page-title {
  text-align: center;
  font-size: clamp(22px, 5vw, 26px);
  margin-bottom: 12px;
  background: linear-gradient(90deg, var(--tiff-bright), #fff 50%, var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body[data-page="predict-lottery"] #predict-sub,
body[data-page="predict-football"] #predict-sub,
body[data-page="predict-muay"] #predict-sub {
  text-align: center;
  color: var(--text-dim);
  margin: -6px 0 14px;
}

body[data-page="predict-lottery"] .predict-banner,
body[data-page="predict-football"] .predict-banner,
body[data-page="predict-muay"] .predict-banner {
  border-color: rgba(201, 173, 106, 0.28);
  box-shadow:
    0 0 0 1px rgba(129, 216, 208, 0.08) inset,
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(201, 173, 106, 0.08);
}

body[data-page="predict-lottery"] .predict-countdown .unit,
body[data-page="predict-football"] .predict-countdown .unit,
body[data-page="predict-muay"] .predict-countdown .unit {
  background: linear-gradient(180deg, rgba(16, 31, 36, 0.95), rgba(8, 18, 20, 0.92));
  border-color: rgba(129, 216, 208, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

body[data-page="predict-football"] .predict-match-card,
body[data-page="predict-muay"] .predict-match-card {
  border-color: rgba(201, 173, 106, 0.22);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(129, 216, 208, 0.06), transparent 58%),
    linear-gradient(165deg, rgba(16, 31, 36, 0.96), rgba(6, 14, 12, 0.98));
  box-shadow:
    0 0 0 1px rgba(129, 216, 208, 0.06) inset,
    0 10px 32px rgba(0, 0, 0, 0.35);
}

body[data-page="predict-football"] .predict-match-meta,
body[data-page="predict-muay"] .predict-match-meta {
  font-size: 13px;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.predict-prize-panel {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-outer);
  border: 1px solid rgba(201, 173, 106, 0.28);
  background:
    radial-gradient(ellipse 90% 80% at 50% 0%, rgba(201, 173, 106, 0.12), transparent 62%),
    linear-gradient(165deg, rgba(16, 31, 36, 0.96), rgba(6, 14, 12, 0.98));
  box-shadow:
    0 0 0 1px rgba(129, 216, 208, 0.06) inset,
    0 10px 36px rgba(0, 0, 0, 0.38),
    0 0 40px rgba(201, 173, 106, 0.06);
  text-align: center;
}

.predict-prize-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.04) 50%, transparent 65%);
}

.predict-prize-line {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #c9ad6a 0%, #f5e6b8 42%, #fff8e7 55%, #e8d49a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(201, 173, 106, 0.15);
}

.predict-prize-line + .predict-prize-line {
  margin-top: 6px;
}

.predict-prize-round {
  position: relative;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(201, 173, 106, 0.18);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--tiff-muted);
  letter-spacing: 0.02em;
}

.predict-hero-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  margin: 16px 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(129, 216, 208, 0.22);
  background:
    linear-gradient(180deg, rgba(16, 31, 36, 0.98), rgba(8, 18, 20, 0.94));
  box-shadow:
    0 0 0 1px rgba(129, 216, 208, 0.06) inset,
    0 6px 24px rgba(0, 0, 0, 0.32);
}

.predict-hero-chip__icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(129, 216, 208, 0.35));
}

.predict-hero-chip__text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--tiff-bright), #fff 55%, var(--tiff-muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.predict-instructions {
  margin: 0 0 14px;
  padding: 0 4px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  text-align: center;
}

body[data-page="predict-lottery"] .predict-submit,
body[data-page="predict-football"] .predict-submit,
body[data-page="predict-muay"] .predict-submit {
  color: #1a1408;
  font-weight: 700;
  letter-spacing: 0.02em;
}
