/* In-phone Ludo — dark felt table matching refs */

.wondalife-phone-screen.is-app:has(.ludo-app) {
  background: #0a1410;
}
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-status {
  color: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-signal::before {
  background: #f5f7f4;
  box-shadow: 4px 0 0 #f5f7f4, 8px -2px 0 #f5f7f4, 12px -4px 0 #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-battery {
  border-color: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-battery::before,
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-battery::after {
  background: #f5f7f4;
}
.wondalife-phone-screen.is-app:has(.ludo-app) .wondalife-phone-homebar {
  background: rgba(245, 247, 244, 0.35);
}
.wondalife-phone-screen.is-app .wondalife-phone-body:has(.ludo-app) {
  padding: 0 0 22px;
  overflow: hidden;
  height: 100%;
}

.ludo-app {
  --ludo-yellow: #f5c518;
  --ludo-blue: #2b7cff;
  --ludo-green: #2db84b;
  --ludo-red: #e53935;
  --ludo-gold: #f5c518;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 80% at 50% 0%, #13261c 0%, #0a1410 55%);
  color: #f5f7f4;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  z-index: 4;
}

.ludo-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}
.ludo-head > div:first-child {
  min-width: 0;
}
.ludo-head h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ludo-head__icon {
  display: inline-block;
  width: 1.55em;
  height: 1.55em;
  margin: -0.4em 0 0 -0.15em;
  vertical-align: -0.42em;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.45));
}
.ludo-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(245, 247, 244, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ludo-head__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ludo-x {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.ludo-hold {
  position: relative;
  flex: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #e8f0e9;
  background: rgba(20, 56, 34, 0.85);
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.ludo-hold span {
  position: relative;
}
.ludo-hold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #c62f3d, #e5484d);
  transform: scaleX(0);
  transform-origin: left center;
}
.ludo-hold.is-holding::before {
  animation: ludo-hold 1.2s linear both;
  animation-delay: var(--hold-delay, 0ms);
}
@keyframes ludo-hold {
  to { transform: scaleX(1); }
}

.ludo-seats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 10px 6px;
  flex-shrink: 0;
}
.ludo-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid transparent;
  min-width: 0;
}
.ludo-seat.is-active {
  border-color: var(--ludo-gold);
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.35), 0 0 14px rgba(245, 197, 24, 0.25);
}
.ludo-seat.is-out {
  opacity: 0.45;
  filter: grayscale(0.85);
}
.ludo-av {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: hsl(var(--h, 140) 45% 38%);
}
.ludo-seat.is-active .ludo-av {
  box-shadow: 0 0 0 2px var(--ludo-gold), 0 0 10px rgba(245, 197, 24, 0.55);
}
.ludo-seat strong {
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ludo-seat__meta {
  font-size: 10px;
  color: rgba(245, 247, 244, 0.75);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ludo-seat__meta b {
  color: var(--ludo-gold);
}
.ludo-out {
  font-size: 10px;
  color: #9aa;
}
.ludo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.ludo-dot--red { background: var(--ludo-red); }
.ludo-dot--green { background: var(--ludo-green); }
.ludo-dot--yellow { background: var(--ludo-yellow); }
.ludo-dot--blue { background: var(--ludo-blue); }

.ludo-log {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  flex-shrink: 0;
}
.ludo-log span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ludo-react {
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 0;
}

.ludo-board-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Same look and entrance as the Whot "GENERAL MARKET!" flash. */
.ludo-miss-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.05;
  font-size: clamp(22px, 7vw, 34px);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #f5c518;
  text-shadow:
    0 2px 0 #3a2a00,
    0 4px 0 #2a1e00,
    0 8px 18px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  pointer-events: none;
  animation: ludo-miss-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes ludo-miss-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ludo-board {
  width: min(100%, 320px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  border-radius: 16px;
  overflow: hidden;
  background: #f4f4f4;
  border: 2px solid #c8c8c8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

.ludo-cell {
  position: relative;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}
.ludo-cell.is-empty { background: #eee; border: 0; }
.ludo-cell.is-path { background: #fff; }
.ludo-cell.is-base {
  z-index: 0;
  border-color: transparent;
}
.ludo-cell.is-base.is-yellow { background: var(--ludo-yellow); }
.ludo-cell.is-base.is-blue { background: var(--ludo-blue); }
.ludo-cell.is-base.is-green { background: var(--ludo-green); }
.ludo-cell.is-base.is-red { background: var(--ludo-red); }

/* Yard overlays — one white rounded pad + 4 outlined pale circles (ref) */
.ludo-yard {
  position: absolute;
  width: calc(100% * 6 / 15);
  height: calc(100% * 6 / 15);
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
}
.ludo-yard--yellow { left: 0; top: 0; --yard-ring: var(--ludo-yellow); --yard-fill: #fff4b8; }
.ludo-yard--blue { right: 0; top: 0; --yard-ring: var(--ludo-blue); --yard-fill: #d4e6ff; }
.ludo-yard--green { left: 0; bottom: 0; --yard-ring: var(--ludo-green); --yard-fill: #c8f0d2; }
.ludo-yard--red { right: 0; bottom: 0; --yard-ring: var(--ludo-red); --yard-fill: #ffd0ce; }

.ludo-yard__pad {
  position: absolute;
  inset: 14%;
  background: #fff;
  border-radius: 18%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 9%;
  padding: 11%;
  box-sizing: border-box;
}

.ludo-yard__slot {
  position: relative;
  border-radius: 50%;
  border: 2.5px solid var(--yard-ring);
  background: var(--yard-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  pointer-events: auto;
  box-sizing: border-box;
}

/* Glossy dented discs inside yard slots only */
.ludo-yard__slot .ludo-tok {
  width: 78%;
  height: 78%;
  max-width: none;
  max-height: none;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.28);
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 48% at 50% 26%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.35) 38%, transparent 62%),
    radial-gradient(circle at 50% 58%, var(--tok-mid) 0%, var(--tok-deep) 78%);
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.38),
    inset 0 -2.5px 3px rgba(0, 0, 0, 0.22),
    inset 0 2px 2px rgba(255, 255, 255, 0.35);
}
.ludo-yard__slot .ludo-tok--green { --tok-mid: #3cc85a; --tok-deep: #1a8a32; border-color: #0f5c20; }
.ludo-yard__slot .ludo-tok--red { --tok-mid: #ef5350; --tok-deep: #c62828; border-color: #8b1515; }
.ludo-yard__slot .ludo-tok--yellow { --tok-mid: #ffd54f; --tok-deep: #e6a800; border-color: #8a6a00; }
.ludo-yard__slot .ludo-tok--blue { --tok-mid: #5b9cff; --tok-deep: #1565c0; border-color: #0d3d7a; }
.ludo-yard__slot .ludo-tok.is-glow {
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.38),
    inset 0 -2.5px 3px rgba(0, 0, 0, 0.22),
    inset 0 2px 2px rgba(255, 255, 255, 0.35),
    0 0 0 2px var(--ludo-gold),
    0 0 10px rgba(245, 197, 24, 0.75);
  animation: ludo-glow 1s ease-in-out infinite;
}

.ludo-cell.is-home-lane.is-yellow,
.ludo-cell.is-start.is-yellow { background: var(--ludo-yellow); }
.ludo-cell.is-home-lane.is-blue,
.ludo-cell.is-start.is-blue { background: var(--ludo-blue); }
.ludo-cell.is-home-lane.is-green,
.ludo-cell.is-start.is-green { background: var(--ludo-green); }
.ludo-cell.is-home-lane.is-red,
.ludo-cell.is-start.is-red { background: var(--ludo-red); }
.ludo-cell.is-center,
.ludo-cell.is-center-edge {
  background: #fff;
  border: 0;
}

.ludo-home-tri {
  position: absolute;
  left: calc(100% * 6 / 15);
  top: calc(100% * 6 / 15);
  width: calc(100% * 3 / 15);
  height: calc(100% * 3 / 15);
  pointer-events: none;
  z-index: 1;
}
.ludo-home-tri i {
  position: absolute;
  inset: 0;
  display: block;
}
.ludo-home-tri__y {
  background: var(--ludo-yellow);
  clip-path: polygon(0 0, 50% 50%, 0 100%);
}
.ludo-home-tri__b {
  background: var(--ludo-blue);
  clip-path: polygon(0 0, 100% 0, 50% 50%);
}
.ludo-home-tri__r {
  background: var(--ludo-red);
  clip-path: polygon(100% 0, 100% 100%, 50% 50%);
}
.ludo-home-tri__g {
  background: var(--ludo-green);
  clip-path: polygon(0 100%, 100% 100%, 50% 50%);
}

.ludo-star {
  position: absolute;
  width: 70%;
  height: 70%;
  color: #9aa3b2;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ludo-star svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ludo-star.is-on-color {
  color: #fff;
}

.ludo-tok {
  width: 68%;
  height: 68%;
  max-width: 20px;
  max-height: 20px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.35);
  padding: 0;
  cursor: pointer;
  z-index: 3;
  position: relative;
}
.ludo-tok--green {
  background: #2db84a;
  border-color: #145c24;
}
.ludo-tok--red {
  background: #e53935;
  border-color: #8b1515;
}
.ludo-tok--yellow {
  background: #f5c518;
  border-color: #8a6a00;
}
.ludo-tok--blue {
  background: #2a7de1;
  border-color: #0d3d7a;
}
.ludo-tok.is-glow {
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    0 0 0 2px var(--ludo-gold),
    0 0 10px rgba(245, 197, 24, 0.75);
  animation: ludo-glow 1s ease-in-out infinite;
  z-index: 4;
}

.ludo-cell.has-stack .ludo-tok {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: calc(-50% + var(--dx, 0%)) calc(-50% + var(--dy, 0%));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    inset 0 -1px 2px rgba(0, 0, 0, 0.18),
    0 1px 3px rgba(0, 0, 0, 0.55);
}
.ludo-cell.has-stack .ludo-tok.is-glow {
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.4),
    0 0 0 2px var(--ludo-gold),
    0 0 10px rgba(245, 197, 24, 0.75);
}

@keyframes ludo-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.ludo-hud {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  max-width: 46%;
}
.ludo-hud--tl { top: 4px; left: 4px; }
.ludo-hud--tr { top: 4px; right: 4px; align-items: flex-end; }
.ludo-hud--bl { bottom: 4px; left: 4px; }
.ludo-hud--br { bottom: 4px; right: 4px; align-items: flex-end; }
.ludo-hud__name {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  white-space: nowrap;
}
.ludo-hist {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}
.ludo-hist__n {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid #ddd;
  font-size: 8px;
  font-weight: 800;
  color: #222;
  display: grid;
  place-items: center;
}
.ludo-hist__n.is-six {
  background: var(--ludo-gold);
  border-color: #d4a400;
}

.ludo-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 10px;
  flex-shrink: 0;
}
.ludo-dice {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ludo-die {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 0;
  background: #fff;
  box-shadow: 0 3px 0 #c5c5c5, 0 6px 14px rgba(0, 0, 0, 0.25);
  padding: 6px;
  cursor: default;
  transform: rotate(-8deg);
}
.ludo-dice.is-armed .ludo-die {
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--ludo-gold), 0 3px 0 #c5c5c5, 0 0 16px rgba(245, 197, 24, 0.45);
}
.ludo-die__face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  gap: 2px;
}
.ludo-pip {
  border-radius: 999px;
  background: transparent;
}
.ludo-pip.is-on {
  background: #1a1a1a;
}
.ludo-die:first-child .ludo-pip.is-on:only-child,
.ludo-die .ludo-pip.is-on:nth-child(5):only-of-type {
  background: #e53935;
}
/* Single pip (center) red accent */
.ludo-die__face:has(.ludo-pip.is-on:nth-child(5)):not(:has(.ludo-pip.is-on:nth-child(1))) .ludo-pip.is-on {
  background: #e53935;
}

.ludo-die.is-used {
  opacity: 0.35;
}
.ludo-dice.is-choosing .ludo-die:not(.is-used) {
  cursor: pointer;
}
.ludo-die.is-picked {
  box-shadow: 0 0 0 3px var(--ludo-gold), 0 3px 0 #c5c5c5, 0 0 16px rgba(245, 197, 24, 0.6);
  transform: translateY(-3px);
}
.ludo-die.is-spin .ludo-die__face {
  animation: ludo-ccw 0.7s linear;
}
.ludo-dice.is-rolling .ludo-die {
  animation: ludo-ccw-box 0.7s linear;
}

@keyframes ludo-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-720deg); }
}
@keyframes ludo-ccw-box {
  from { transform: rotate(-8deg); }
  to { transform: rotate(calc(-8deg - 720deg)); }
}

.ludo-prompt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ludo-prompt strong {
  font-size: 13px;
  text-transform: none;
}
.ludo-prompt span {
  font-size: 12px;
  color: rgba(245, 247, 244, 0.7);
}

.ludo-prompt .turn-skip {
  align-self: flex-start;
  margin-top: 4px;
}

.ludo-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 16px;
}
.ludo-modal__panel {
  width: min(100%, 280px);
  border-radius: 18px;
  background: linear-gradient(180deg, #0f281a, #08160e);
  border: 1px solid rgba(180, 210, 160, 0.25);
  padding: 18px;
  text-align: center;
}
.ludo-modal__icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: -6px auto 4px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}
.ludo-modal__panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.ludo-modal__panel p {
  margin: 0 0 14px;
  font-size: 12px;
  color: rgba(245, 247, 244, 0.7);
}
.ludo-btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}
.ludo-btn--green { background: #1f9d55; color: #fff; }
.ludo-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ludo-empty {
  padding: 24px;
  text-align: center;
}
