/* ===============================================
   HOME - THE POOL PANEL ("a living table")
   Replaces the old banner. Loaded after Home.css and Polish-Home.css.
   Its left edge is the left board's left edge and its right edge is the right board's right edge
   (the same side space, set by Polish-Fluid). All motion stops for visitors who asked for less motion.
   =============================================== */

@property --ph-a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.pool-hero {
  width: 100%;
  flex: 0 0 auto;
  padding: 0 var(--kd-pad-x, 150px);
  margin-bottom: 22px;
  box-sizing: border-box;
}

.ph-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) 2fr;
  gap: 12px 24px;
  padding: 16px 22px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 146, 0.16);
  background:
    radial-gradient(ellipse 55% 130% at 12% 0%, rgba(0, 255, 146, 0.12), rgba(0, 0, 0, 0) 70%),
    radial-gradient(ellipse 45% 120% at 100% 100%, rgba(110, 0, 44, 0.35), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #0c0f0d, #060606);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.7), 0 0 26px rgba(0, 255, 146, 0.07);
  overflow: hidden;
  color: #e6e6e6;
  animation: ph-in 0.7s ease both;
}

@keyframes ph-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* a light that runs round the edge */
.ph-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--ph-a), transparent 0 70%, rgba(0, 255, 146, 0.95) 85%, rgba(245, 197, 66, 0.85) 93%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ph-spin 6s linear infinite;
  pointer-events: none;
}

@keyframes ph-spin {
  to { --ph-a: 360deg; }
}

/* two soft lights drifting behind everything */
.ph-orb {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.ph-orb-1 {
  left: -60px;
  top: -80px;
  background: radial-gradient(circle, rgba(0, 255, 146, 0.35), transparent 70%);
  animation: ph-drift-1 11s ease-in-out infinite alternate;
}

.ph-orb-2 {
  right: -50px;
  bottom: -100px;
  background: radial-gradient(circle, rgba(209, 48, 111, 0.4), transparent 70%);
  animation: ph-drift-2 13s ease-in-out infinite alternate;
}

@keyframes ph-drift-1 {
  to { transform: translate(180px, 60px); }
}

@keyframes ph-drift-2 {
  to { transform: translate(-220px, -40px); }
}

/* small gold dots that rise in the pool, like bubbles */
.ph-bubbles {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 38%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ph-bubbles i {
  position: absolute;
  bottom: -10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd864;
  box-shadow: 0 0 8px rgba(255, 216, 100, 0.8);
  opacity: 0;
  animation: ph-rise 7s ease-in infinite;
}

.ph-bubbles i:nth-child(1) { left: 8%; animation-delay: 0s; }
.ph-bubbles i:nth-child(2) { left: 24%; animation-delay: 1.6s; width: 4px; height: 4px; }
.ph-bubbles i:nth-child(3) { left: 41%; animation-delay: 3.1s; }
.ph-bubbles i:nth-child(4) { left: 58%; animation-delay: 4.4s; width: 3px; height: 3px; }
.ph-bubbles i:nth-child(5) { left: 74%; animation-delay: 5.6s; }
.ph-bubbles i:nth-child(6) { left: 90%; animation-delay: 2.3s; width: 4px; height: 4px; }

@keyframes ph-rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-230px); opacity: 0; }
}

/* ---- left: the big number ---- */
.ph-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}

.ph-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f5c542;
  border: 1px solid rgba(245, 197, 66, 0.5);
  background: rgba(245, 197, 66, 0.08);
}

.ph-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5c542;
  box-shadow: 0 0 7px #f5c542;
  animation: ph-pulse 2.2s ease-in-out infinite;
}

.ph-badge.live {
  color: #00ff92;
  border-color: rgba(0, 255, 146, 0.5);
  background: rgba(0, 255, 146, 0.08);
}

.ph-badge.live i {
  background: #00ff92;
  box-shadow: 0 0 7px #00ff92;
}

@keyframes ph-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.ph-label {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(205, 205, 205, 0.7);
}

.ph-big {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.05;
  color: #00ff92;
  text-shadow: 0 0 22px rgba(0, 255, 146, 0.35);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  animation: ph-glow 3.6s ease-in-out infinite;
}

@keyframes ph-glow {
  0%, 100% { text-shadow: 0 0 16px rgba(0, 255, 146, 0.25); }
  50% { text-shadow: 0 0 32px rgba(0, 255, 146, 0.6); }
}

.ph-line {
  max-width: 340px;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(205, 205, 205, 0.72);
}

.ph-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  color: #060606;
  background: linear-gradient(180deg, #19ffa0, #00c273);
  box-shadow: 0 0 16px rgba(0, 255, 146, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ph-cta span {
  display: inline-block;
  animation: ph-nudge 1.8s ease-in-out infinite;
}

@keyframes ph-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.ph-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 255, 146, 0.45);
}

/* ---- right: three rows of small cards: the XP, the pool, the coins ---- */
.ph-cards {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.ph-row {
  display: flex;
  gap: 8px;
}

.ph-row > .ph-card {
  flex: 1 1 0;
  min-width: 0;
}

.ph-card {
  position: relative;
  overflow: hidden;
  padding: 9px 12px;
  border-radius: 4px;
  border: 1px solid rgba(205, 205, 205, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  animation: ph-in 0.6s ease both;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ph-card:nth-child(1) { animation-delay: 0.15s; }
.ph-card:nth-child(2) { animation-delay: 0.25s; }
.ph-card:nth-child(3) { animation-delay: 0.35s; }
.ph-card:nth-child(4) { animation-delay: 0.45s; }

.ph-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 146, 0.4);
}

/* a diagonal shine that crosses each card now and then */
.ph-card::after {
  content: ;
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  transform: skewX(-18deg);
  animation: ph-shine 7s ease-in-out infinite;
  pointer-events: none;
}

.ph-card:nth-child(2)::after { animation-delay: 1.2s; }
.ph-card:nth-child(3)::after { animation-delay: 2.4s; }
.ph-card:nth-child(4)::after { animation-delay: 3.6s; }

@keyframes ph-shine {
  0% { left: -60%; }
  35%, 100% { left: 130%; }
}

.ph-k {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(205, 205, 205, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-v {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-gold .ph-v {
  color: #f5c542;
  animation: ph-gold 3.2s ease-in-out infinite;
}

@keyframes ph-gold {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 14px rgba(245, 197, 66, 0.55); }
}

.ph-s {
  margin-top: 2px;
  font-size: 9.5px;
  line-height: 1.4;
  color: rgba(205, 205, 205, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* a number that just changed lights up for a moment */
.ph-flash {
  animation: ph-flash 1s ease-out;
}

@keyframes ph-flash {
  0% { color: #fff; text-shadow: 0 0 18px rgba(255, 255, 255, 0.9); transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* the week bar inside "Next weekly close" */
.ph-prog {
  height: 4px;
  margin-top: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.ph-prog i {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #00c273, #19ffa0);
  overflow: hidden;
  transition: width 0.6s ease;
}

.ph-prog i::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: ph-bar 2.2s linear infinite;
}

@keyframes ph-bar {
  from { left: -40%; }
  to { left: 100%; }
}

/* the pool wallet card is a link to Polygonscan */
a.ph-fwallet {
  display: block;
  text-decoration: none;
  color: inherit;
  border-color: rgba(0, 255, 146, 0.4);
  animation: ph-in 0.6s ease both, ph-wallet 3s ease-in-out infinite;
}

.ph-fwallet .ph-v {
  color: #00ff92;
}

@keyframes ph-wallet {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 146, 0); }
  50% { box-shadow: 0 0 18px rgba(0, 255, 146, 0.28); }
}

/* ===============================================
   PHONE (max-width: 768px) - one column, same side space as the boards
   =============================================== */
@media (max-width: 768px) {
  .pool-hero {
    padding: 0 20px;
    margin-bottom: 30px;
  }

  .ph-panel {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 16px;
    padding: 18px 16px;
    max-width: 352px;
    margin: 0 auto;
  }

  .ph-big {
    font-size: 40px;
  }

  .ph-row {
    flex-wrap: wrap;
  }

  .ph-row > .ph-card {
    flex: 1 1 calc(50% - 4px);
  }

  .ph-k,
  .ph-s {
    white-space: normal;
  }

  .ph-fwallet .ph-v {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-panel,
  .ph-panel::after,
  .ph-orb,
  .ph-bubbles i,
  .ph-badge i,
  .ph-big,
  .ph-cta span,
  .ph-card,
  .ph-card::after,
  .ph-gold .ph-v,
  .ph-prog i::after,
  a.ph-fwallet,
  .ph-flash {
    animation: none;
  }

  .ph-bubbles,
  .ph-card::after {
    display: none;
  }
}
