

body.at-koi .cell.ksym-koi { --glow: var(--lagoon-cell-ksym-koi-tone-76); }
body.at-koi .cell.ksym-planet { --glow: var(--lagoon-cell-ksym-planet-tone-77); }
body.at-koi .cell.ksym-lantern { --glow: var(--lagoon-cell-ksym-lantern-tone-78); }
body.at-koi .cell.ksym-lotus { --glow: var(--lagoon-cell-ksym-lotus-tone-79); }
body.at-koi .cell.ksym-moon { --glow: var(--lagoon-cell-ksym-moon-tone-80); }
body.at-koi .cell.ksym-crystal { --glow: var(--lagoon-cell-ksym-crystal-tone-81); }

body.at-koi .cell.ksym-koi .sym-face,
body.at-koi .cell.ksym-planet .sym-face,
body.at-koi .cell.ksym-crystal .sym-face,
body.at-koi .cell.ksym-lantern .sym-face,
body.at-koi .cell.ksym-lotus .sym-face,
body.at-koi .cell.ksym-moon .sym-face {
  font-size: calc(var(--cell) * 0.86);
}

body.at-koi .cell.wild .wild-tag {
  background: linear-gradient(180deg, var(--lagoon-wild-wild-tag-tone-82), var(--lagoon-wild-wild-tag-tone-83));
  color: var(--gold-light);
  text-shadow: 0 1px 0 #000;
}

body.at-koi .letter-A { --l1: var(--lagoon-at-koi-letter-tone-84); --l2: var(--lagoon-at-koi-letter-tone-85); --l3: var(--lagoon-at-koi-letter-tone-86); }
body.at-koi .letter-K { --l1: var(--lagoon-at-koi-letter-tone-87); --l2: var(--lagoon-at-koi-letter-tone-88); --l3: var(--lagoon-at-koi-letter-tone-89); }
body.at-koi .letter-Q { --l1: var(--lagoon-at-koi-letter-tone-90); --l2: var(--lagoon-at-koi-letter-tone-91); --l3: var(--lagoon-at-koi-letter-tone-92); }
body.at-koi .letter-J { --l1: var(--lagoon-at-koi-letter-tone-93); --l2: var(--lagoon-at-koi-letter-tone-94); --l3: var(--lagoon-at-koi-letter-tone-95); }
body.at-koi .letter-10 { --l1: var(--lagoon-at-koi-letter-tone-96); --l2: var(--lagoon-at-koi-letter-tone-97); --l3: var(--lagoon-at-koi-letter-tone-98); }

.cell.koi-pearl {
  --p1: #ffffff;
  --p2: var(--lagoon-cell-koi-pearl-tone-99);
  --p3: var(--lagoon-cell-koi-pearl-tone-100);
  --p4: var(--lagoon-cell-koi-pearl-tone-101);
  --p-glow: var(--lagoon-cell-koi-pearl-tone-102);
  isolation: isolate;
}

.koi-pearl-orb {
  position: absolute;
  inset: 9%;
  z-index: -1;
  background: url("../art/ui/pearl.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 5px var(--p-glow));
  pointer-events: none;
}

.koi-pearl-value {
  position: relative;
  max-width: calc(100% - 8px);
  color: var(--text);
  font-family: var(--display);
  font-size: calc(var(--cell) * 0.32);
  line-height: 1.1;
  white-space: nowrap;
  -webkit-text-stroke: 2px var(--lagoon-pearl-value-tone-106);
  paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--lagoon-pearl-value-tone-106), 0 0 8px rgba(0, 0, 0, 0.85);
}

.cell.koi-pearl.jp .koi-pearl-value {
  font-size: max(0.7rem, calc(var(--cell) * 0.24));
  letter-spacing: 0.03em;
}

.cell.koi-pearl.jp-mini { --p2: var(--lagoon-pearl-jp-mini-tone-107); --p3: var(--lagoon-pearl-jp-mini-tone-108); --p4: var(--lagoon-pearl-jp-mini-tone-109); --p-glow: var(--lagoon-pearl-jp-mini-tone-110); }
.cell.koi-pearl.jp-minor { --p2: var(--lagoon-pearl-jp-minor-tone-111); --p3: var(--lagoon-pearl-jp-minor-tone-112); --p4: var(--lagoon-pearl-jp-minor-tone-113); --p-glow: var(--lagoon-pearl-jp-minor-tone-114); }
.cell.koi-pearl.jp-major { --p2: var(--lagoon-pearl-jp-major-tone-115); --p3: var(--lagoon-pearl-jp-major-tone-116); --p4: var(--lagoon-pearl-jp-major-tone-117); --p-glow: var(--lagoon-pearl-jp-major-tone-118); }
.cell.koi-pearl.jp-grand { --p2: var(--lagoon-pearl-jp-grand-tone-119); --p3: var(--lagoon-pearl-jp-grand-tone-120); --p4: var(--lagoon-pearl-jp-grand-tone-121); --p-glow: var(--lagoon-pearl-jp-grand-tone-122); }
.cell.koi-pearl.jp-grand .koi-pearl-value { color: var(--jp-grand); }
.cell.koi-pearl.jp-major .koi-pearl-value { color: var(--jp-major); }
.cell.koi-pearl.jp-minor .koi-pearl-value { color: var(--jp-minor); }
.cell.koi-pearl.jp-mini .koi-pearl-value { color: var(--jp-mini); }

.app.koi .grid.has-win .cell.koi-pearl,
.app.koi .grid.cycling .cell.koi-pearl {
  opacity: 1;
}

.cell.koi-pearl.hit .koi-pearl-orb {
  animation: koi-pearl-glow 600ms ease-in-out infinite alternate;
}

.cell.koi-pearl.locked::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 1px var(--gold-deep), inset 0 0 8px var(--lagoon-pearl-locked-after-tone-123);
  pointer-events: none;
}

.cell.koi-pearl.landed {
  animation: koi-pearl-land 520ms linear;
}

.cell.koi-pearl.collected {
  animation: koi-pearl-collect 420ms ease-out;
  filter: saturate(0.75) brightness(0.85);
}

.cell.koi-dark {
  border-radius: 6px;
  background:
    radial-gradient(60% 40% at 50% 50%, var(--lagoon-cell-koi-dark-tone-124), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.1));
  box-shadow: inset 0 0 0 1px var(--lagoon-reel-tone-30);
}

@keyframes koi-hold-dim { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes koi-hold-lock { 0% { transform: scale(1); } 35% { transform: scale(1.16); filter: brightness(1.5); } 100% { transform: scale(1); } }
.grid.hold-intro .cell.koi-dark { animation: koi-hold-dim 700ms ease-out 350ms backwards; }
.grid.hold-intro .cell.koi-pearl.locked { animation: koi-hold-lock 700ms ease-out; }


.koi-show {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe-top) 16px var(--safe-bottom);
  background: radial-gradient(circle at 50% 45%, var(--lagoon-screens-koi-show-tone-126), var(--lagoon-screens-koi-show-tone-127) 70%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
  touch-action: manipulation;
}

.koi-show.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 220ms ease;
}

.koi-show:not(.show) .koi-show-pearls i {
  animation: none;
}

.koi-show-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
  max-height: 100%;
  overflow-y: auto;
  padding: 18px 12px;
  text-align: center;
}

.koi-show.show .koi-show-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 360px);
  max-height: 100%;
  overflow-y: auto;
  padding: 18px 12px;
  text-align: center;
}

.koi-show-pearls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.koi-show-pearls i {
  width: 44px;
  height: 44px;
  background: url("../art/ui/pearl.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 10px var(--lagoon-hint-before-tone-67));
  animation: lagoon-bob 1.4s ease-in-out infinite alternate;
}

.koi-show-pearls i:nth-child(2) {
  width: 56px;
  height: 56px;
  animation-delay: -0.5s;
}

.koi-show-pearls i:nth-child(3) {
  animation-delay: -1s;
}

.koi-show-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 9vw, 2.6rem);
  line-height: 1.05;
  white-space: nowrap;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7));
}

.koi-show-main {
  max-width: 100%;
  overflow: hidden;
  padding: 10px 16px;
  margin: -10px 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 16vw, 4.4rem);
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  text-shadow: 0 1px 0 #000;
}

.koi-show.end .koi-show-main {
  font-size: clamp(2rem, 11vw, 3.2rem);
  background-image: var(--gold-bevel);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.7));
}

.koi-show-sub {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  text-shadow: 0 1px 0 #000;
}

.koi-show-jackpots {
  width: 100%;
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 1px 0 #000;
}
.koi-show-jackpot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.koi-show-jackpot-amount {
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}
.koi-show-jackpot-name { text-shadow: var(--jp-outline); }
.koi-show-jackpot.grand .koi-show-jackpot-name { color: var(--jp-grand); }
.koi-show-jackpot.major .koi-show-jackpot-name { color: var(--jp-major); }
.koi-show-jackpot.minor .koi-show-jackpot-name { color: var(--jp-minor); }
.koi-show-jackpot.mini .koi-show-jackpot-name { color: var(--jp-mini); }

.koi-show-jackpots:empty {
  display: none;
}

.koi-show-tap {
  width: min(100%, 240px);
  min-height: 56px;
  margin-top: 4px;
  padding: 8px 16px;
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--go-light), var(--go-dark));
  box-shadow: 0 0 0 1px var(--gold-deep), 0 4px 0 var(--gold-deep);
  color: var(--text);
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 0 #000;
  touch-action: manipulation;
}
.koi-show-tap:active { transform: translateY(3px); }
.koi-show-tap:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }


.pt-koi-jackpots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.pt-koi-jackpot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  text-shadow: 0 1px 0 #000;
}


.pt-koi-jackpot-name {
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text);
}
.pt-koi-jackpot.grand .pt-koi-jackpot-name { color: var(--jp-grand); }
.pt-koi-jackpot.major .pt-koi-jackpot-name { color: var(--jp-major); }
.pt-koi-jackpot.minor .pt-koi-jackpot-name { color: var(--jp-minor); }
.pt-koi-jackpot.mini .pt-koi-jackpot-name { color: var(--jp-mini); }

.pt-koi-jackpot-amount {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--gold-light);
  text-shadow: 0 1px 0 #000;
}

.pt-koi-pearls {
  flex-wrap: wrap;
  --cell: 46px;
}


@keyframes lagoon-swim {
  from { transform: translateX(-1%) rotate(-1deg); }
  to { transform: translateX(1%) rotate(1deg); }
}

@keyframes lagoon-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

@keyframes lagoon-jackpot-hit {
  0% { transform: scale(1); filter: brightness(1); }
  30% { transform: scale(1.08); filter: brightness(1.6); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes lagoon-pip-reset {
  0% { transform: scale(1.6); }
  100% { transform: scale(1); }
}

@keyframes koi-pearl-glow {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}

@keyframes koi-pearl-land {
  0% { transform: translateY(-85%) scale(0.92); opacity: 0.4; animation-timing-function: cubic-bezier(0.3, 0, 0.8, 0.6); }
  52% { transform: translateY(7%) scale(1.06, 0.94); opacity: 1; animation-timing-function: ease-out; }
  76% { transform: translateY(-3%) scale(0.98, 1.02); animation-timing-function: ease-in-out; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes koi-pearl-collect {
  0% { transform: scale(1); filter: brightness(1); }
  40% { transform: scale(1.15); filter: brightness(1.8); }
  100% { transform: scale(1); filter: saturate(0.75) brightness(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .lagoon-koi,
  .lagoon-lantern,
  .lagoon-jackpot.hit,
  .lagoon-pip.reset,
  .cell.koi-pearl.hit .koi-pearl-orb,
  .cell.koi-pearl.landed,
  .cell.koi-pearl.collected,
  .grid.hold-intro .cell.koi-dark,
  .grid.hold-intro .cell.koi-pearl.locked,
  .koi-show-pearls i,
  .koi-show.show .koi-show-title {
    animation: none;
  }
  .koi-show,
  .koi-show.show {
    transition: none;
  }
}
