@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');:root {
  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
  --yellow: #eab308;
  --bg-dark: #1e1e2e;
  --board-bg: #2a2a3b;
  --path-white: #f8fafc;
  --token-shadow: rgba(0, 0, 0, 0.3);
}

/* Global Lock for Mobile Viewport - Softened to avoid layout cover */
.ludo-game-active {
  overflow: hidden !important;
  position: relative;
  width: 100%;
  height: 100%;
}

.board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
  background: transparent;
  width: 100%;
  height: 100%;
}

.ludo-board {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  aspect-ratio: 1/1;
  /* Fluid sizing based on viewport width and height */
  width: clamp(280px, 45vw, 600px);
  height: clamp(280px, 45vw, 600px);
  /* Height constraint to prevent overflow on landscape mobile */
  max-width: calc(100vh - 200px);
  max-height: calc(100vh - 200px);

  background-image: url('/api/uploads/assets/ludo_bg/ludo2.png?v=2');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-origin: content-box;
  background-clip: content-box;
  background-color: var(--bg-dark);
  border-radius: clamp(12px, 4vw, 30px);
  padding: 4.5%;
  gap: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  box-sizing: border-box;

  grid-column: 2;
  grid-row: 1;
}

/* --- CELLS --- */
.center-star-icon {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
  animation: pulse-star 2s infinite ease-in-out;
  transform-origin: center;
  z-index: 50;
  pointer-events: none;
}

@keyframes pulse-star {

  0%,
  100% {
    transform: scale(1) translateZ(0);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
  }

  50% {
    transform: scale(1.15) translateZ(0);
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
  }
}

.cell {
  border-radius: 4px;
  /* Slightly reduce radius for tighter grid */
  background: transparent;
  /* Default transparent for gap look */
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ... (skip unchanged) ... */

/* --- TOKENS (Image Based) --- */
.token {
  width: 90%;
  /* Tight fit */
  height: 90%;
  aspect-ratio: 1 / 1;
  /* Ensure perfect circle */
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* background-color: white; Remove white background to show image shape only if transparency is desired? User said "add tokens...". Let's keep white bg but border-radius fixes shape */
  background-color: transparent;
  /* User said "transparent circle... size of token". */
  z-index: 100;
  opacity: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

/* Base Token Overrides - Balanced size for home circles */
.home-base .token-slot .token {
  width: 100% !important;
  /* Match slot size exactly */
  height: 100% !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  background-color: transparent;
}

.token-slot {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  aspect-ratio: 1/1;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 5;
  width: 48%;
  /* Size of the transparent circle - larger to be closer */
  height: 48%;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Remove CSS gradients */
.token::after {
  display: none;
}

.token.red {
  background-image: url('/api/uploads/assets/red.png');
}

.token.green {
  background-image: url('/api/uploads/assets/green.png');
}

.token.yellow {
  background-image: url('/api/uploads/assets/yallow.png');
}

/* Base Token Layout Grid - Forced 2x2 */
.token-container {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  gap: 2% !important;
  /* Minimal gap to bring them very close */
  width: 70% !important;
  /* Balanced container size */
  height: 70% !important;
  justify-items: center !important;
  align-items: center !important;
  position: relative !important;
  margin: 0 !important;
}

/* Home Base Container */
.home-base {
  border-radius: 20px;
  padding: 0 !important;
  /* Allow inner to fill completely */
  position: relative;
  overflow: hidden;
  background-color: transparent;
}

/* Robust Flex Centering within Home Base */
.home-inner {
  position: absolute;
  inset: 0;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.token.blue {
  background-image: url('/api/uploads/assets/blue.png');
}

.token-icon {
  display: none;
}

/* Selection / Active State */
.token.clickable {
  cursor: pointer;
  animation: movable-glow 1.5s infinite alternate ease-in-out;
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  z-index: 1001 !important;
}

.token.clickable:hover {
  transform: scale(1.15);
  filter: brightness(1.2) drop-shadow(0 0 12px rgba(255, 255, 255, 1));
}

@keyframes movable-glow {
  0% {
    filter: brightness(1) drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
    transform: scale(1);
  }

  100% {
    filter: brightness(1.2) drop-shadow(0 0 12px rgba(255, 255, 255, 1));
    transform: scale(1.08);
  }
}

.token-stack-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
}

.token-wrapper.stacked {
  width: 90%;
  height: 90%;
}

.token.stacked {
  width: 100%;
  height: 100%;
}


/* --- LAYOUT & PLAYER PANELS --- */
.ludo-layout-wrapper {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  grid-template-rows: 1fr;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  gap: clamp(10px, 2vw, 30px);
  align-items: center;
  justify-items: center;
  position: relative;
  margin: 0 auto;
}

/* ... (Keep existing desktop styles for ludo-player-panel if unchanged) ... */
/* Actually, let's redefine the base .ludo-player-panel to ensure defaults are good */
.ludo-player-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: clamp(6px, 1.2vw, 15px);
  width: clamp(160px, 18vw, 210px);
  min-height: 140px;
  height: auto;
  gap: clamp(6px, 1vh, 12px);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Base Styles for Internal Components (Desktop First) */
.panel-user-info {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.panel-avatar-wrapper {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-text-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  /* Critical for truncation */
}

.panel-name {
  font-size: 0.95rem;
  font-weight: 800;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.mode-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.desktop-mode-tag {
  display: inline-block;
  margin-left: 6px;
}

.mobile-mode-tag {
  display: none;
}

/* Mode Tag Colors */
.red .mode-tag {
  background: var(--red);
}

.green .mode-tag {
  background: var(--green);
}

.blue .mode-tag {
  background: var(--blue);
}

.yellow .mode-tag {
  background: var(--yellow);
}

.ludo-player-panel.active {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

/* L-Shaped Glows for Active (Desktop & Base) */
.ludo-player-panel.active.red {
  border-left: 3px solid var(--red);
  border-top: 3px solid var(--red);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.ludo-player-panel.active.green {
  border-right: 3px solid var(--green);
  border-top: 3px solid var(--green);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.ludo-player-panel.active.blue {
  border-left: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.ludo-player-panel.active.yellow {
  border-right: 3px solid var(--yellow);
  border-bottom: 3px solid var(--yellow);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
}

/* Desktop Ordering - Dice Below Name */
.ludo-player-panel .panel-user-info {
  order: 1;
  flex-direction: row;
  justify-content: center;
  /* Center avatar and name group */
}

.ludo-player-panel .panel-dice-area {
  order: 2;
  margin-top: 5px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 5px;
}

.ludo-player-panel .panel-name {
  align-items: center;
  text-align: center;
}

/* Desktop Positions - Adding modest margins to prevent scale clipping */
.ludo-player-panel.red {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  margin-top: 10px;
}

.ludo-player-panel.green {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: start;
  margin-top: 10px;
}

.ludo-player-panel.blue {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  margin-bottom: 10px;
}

.ludo-player-panel.yellow {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: start;
  margin-bottom: 10px;
}

/* --- MOBILE LAYOUT (Vertical Stack) --- */
@media (max-width: 1024px) {
  .ludo-layout-wrapper {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    padding: 35px 10px 10px 10px;
    height: 100%;
    overflow-y: auto;
    /* Handle small screens */
  }

  /* Board - Center */
  .ludo-board {
    grid-column: 1 / span 2;
    grid-row: 2;
    width: clamp(280px, 85vw, 500px) !important;
    height: clamp(280px, 85vw, 500px) !important;
    max-width: calc(100vh - 180px) !important;
    max-height: calc(100vh - 180px) !important;
    margin: 5px auto;
    align-self: center;
  }

  /* Red & Green - Top */
  .ludo-player-panel.red {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 200px;
    justify-self: center;
    align-self: end;
    margin-bottom: 2px;
    margin-top: 2px;
  }

  .ludo-player-panel.green {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: 200px;
    justify-self: center;
    align-self: end;
    margin-bottom: 2px;
    margin-top: 2px;
  }

  /* Blue & Yellow - Bottom */
  .ludo-player-panel.blue {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    max-width: 200px;
    justify-self: center;
    align-self: start;
    margin-top: 2px;
  }

  .ludo-player-panel.yellow {
    grid-column: 2;
    grid-row: 3;
    width: 100%;
    max-width: 200px;
    justify-self: center;
    align-self: start;
    margin-top: 2px;
  }

  /* Compact Panel Styles for Mobile */
  .ludo-player-panel {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 10px;
    min-height: 52px;
    width: clamp(140px, 45vw, 185px);
    /* Fluid width */
    height: auto;
    gap: 4px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    transition: all 0.3s ease;
  }

  /* Color-coded inactive borders */
  .ludo-player-panel.red {
    border-left: 3px solid var(--red);
  }

  .ludo-player-panel.green {
    border-left: 3px solid var(--green);
  }

  .ludo-player-panel.blue {
    border-left: 3px solid var(--blue);
  }

  .ludo-player-panel.yellow {
    border-left: 3px solid var(--yellow);
  }

  .ludo-player-panel.active {
    background: rgba(15, 23, 42, 0.85);
    /* Slightly darker */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
  }

  /* Specific left & top border indicator for active player from color (L-shape) */
  .ludo-player-panel.active.red {
    border-left: 3px solid var(--red);
    border-top: 3px solid var(--red);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
  }

  .ludo-player-panel.active.green {
    border-left: 3px solid var(--green);
    border-top: 3px solid var(--green);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
  }

  .ludo-player-panel.active.blue {
    border-left: 3px solid var(--blue);
    border-top: 3px solid var(--blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
  }

  .ludo-player-panel.active.yellow {
    border-left: 3px solid var(--yellow);
    border-top: 3px solid var(--yellow);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
  }

  /* Mirroring for Mobile */
  .ludo-player-panel.red .panel-user-info,
  .ludo-player-panel.blue .panel-user-info {
    order: 1;
    flex-direction: row;
  }

  .ludo-player-panel.red .panel-dice-area,
  .ludo-player-panel.blue .panel-dice-area {
    order: 2;
  }

  .ludo-player-panel.red .panel-name,
  .ludo-player-panel.blue .panel-name {
    align-items: flex-start;
  }

  .ludo-player-panel.green .panel-user-info,
  .ludo-player-panel.yellow .panel-user-info {
    order: 2;
    flex-direction: row-reverse;
  }

  .ludo-player-panel.green .panel-dice-area,
  .ludo-player-panel.yellow .panel-dice-area {
    order: 1;
  }

  .ludo-player-panel.green .panel-name,
  .ludo-player-panel.yellow .panel-name {
    align-items: flex-end;
  }

  /* Specific L-borders based on screen position (mobile) */
  .ludo-player-panel.active.red {
    border-left: 3px solid var(--red);
    border-top: 3px solid var(--red);
    border-right: 0;
    border-bottom: 0;
  }

  .ludo-player-panel.active.green {
    border-right: 3px solid var(--green);
    border-top: 3px solid var(--green);
    border-left: 0;
    border-bottom: 0;
  }

  .ludo-player-panel.active.blue {
    border-left: 3px solid var(--blue);
    border-bottom: 3px solid var(--blue);
    border-right: 0;
    border-top: 0;
  }

  .ludo-player-panel.active.yellow {
    border-right: 3px solid var(--yellow);
    border-bottom: 3px solid var(--yellow);
    border-left: 0;
    border-top: 0;
  }

  .panel-user-info {
    flex-direction: row;
    margin-bottom: 0;
    margin-left: 0;
    /* Reset */
    gap: 2px;
    /* Extremely tight as requested */
    order: 2;
    /* Right */
    justify-content: flex-start;
    align-items: center;
    flex: 1;
    min-width: 0;
    /* Allow inner content to shrink for truncation */
  }

  .panel-avatar-wrapper {
    width: 38px;
    height: 38px;
    position: relative;
    padding: 0;
    flex-shrink: 0;
    /* Don't squash avatar */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .panel-name {
    font-size: 0.8rem;
    /* Slightly smaller to fit more */
    font-weight: 800;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
    width: 100%;
    overflow: hidden;
    line-height: 1.1;
  }

  .desktop-mode-tag {
    display: none;
  }

  .mobile-mode-tag {
    display: block;
    font-size: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 3px;
    max-width: fit-content;
  }

  .panel-timer {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8) !important;
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .panel-time-mode {
    display: none;
  }

  .desktop-mode-tag {
    display: none;
  }

  .mobile-mode-tag {
    display: block;
    font-size: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: #3b82f6;
    max-width: fit-content;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 900;
    margin-top: 3px;
  }

  .red .mobile-mode-tag {
    background: #ef4444;
  }

  .green .mobile-mode-tag {
    background: #22c55e;
  }

  .blue .mobile-mode-tag {
    background: #3b82f6;
  }

  .yellow .mobile-mode-tag {
    background: #eab308;
  }

  .panel-dice-area {
    min-height: 44px;
    max-height: 44px;
    min-width: 44px;
    max-width: 44px;
    flex-shrink: 0;
    padding: 3px;
    order: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    position: relative;
    transition: all 0.3s ease;
  }

  /* Absolute reposition markers so they don't push the dice */
  .six-indicator {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 110;
  }

  .roll-history {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    z-index: 110;
    white-space: nowrap;
  }

  .history-pip {
    font-size: 10px;
    font-weight: 900;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* Inactive Dice Box */
  .ludo-player-panel:not(.active) .panel-dice-area {
    background: transparent !important;
    opacity: 0.5;
  }

  .dice-wrapper {
    width: 38px;
    height: 38px;
  }

  .dice-scene {
    width: 38px;
    height: 38px;
    z-index: 100;
    position: relative;
  }
}

/* --- GOAL AREA & TRIANGLES --- */
.center-goal {
  position: relative;
  width: 100%;
  height: 100%;
  background: transparent;
  /* Image provides the triangles */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.goal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.goal-triangles {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.goal-triangle {
  position: absolute;
  width: 50%;
  height: 50%;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Position Triangles according to color */
.goal-triangle.red {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.goal-triangle.green {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.goal-triangle.yellow {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.goal-triangle.blue {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.finished-tokens-grid {
  display: grid !important;
  gap: 4px;
  justify-items: center;
  align-items: center;
}

.indicator-star-wrapper {
  transition: opacity 0.5s ease;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

/* --- 3D DICE CSS --- */
.dice-scene {
  width: 36px;
  height: 36px;
  perspective: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  position: relative;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease-out;
}

.dice-scene.rolling .cube {
  animation: spin 0.5s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }

  100% {
    transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
  }
}

.cube__face {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid #999;
  border-radius: 4px;
  background: white;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
  box-sizing: border-box;
  backface-visibility: hidden;
}

/* Face Transforms */
.cube__face--1 {
  transform: rotateY(0deg) translateZ(18px);
}

.cube__face--2 {
  transform: rotateY(90deg) translateZ(18px);
}

.cube__face--3 {
  transform: rotateY(180deg) translateZ(18px);
}

.cube__face--4 {
  transform: rotateY(-90deg) translateZ(18px);
}

.cube__face--5 {
  transform: rotateX(90deg) translateZ(18px);
}

.cube__face--6 {
  transform: rotateX(-90deg) translateZ(18px);
}

/* Pips */
.pip {
  background-color: #333;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
}

/* Face 1 */
.cube__face--1 .pip:nth-child(1) {
  grid-area: 2 / 2;
}

/* Face 2 */
.cube__face--2 .pip:nth-child(1) {
  grid-area: 1 / 3;
}

.cube__face--2 .pip:nth-child(2) {
  grid-area: 3 / 1;
}

/* Face 3 */
.cube__face--3 .pip:nth-child(1) {
  grid-area: 1 / 3;
}

.cube__face--3 .pip:nth-child(2) {
  grid-area: 2 / 2;
}

.cube__face--3 .pip:nth-child(3) {
  grid-area: 3 / 1;
}

/* Face 4 */
.cube__face--4 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--4 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--4 .pip:nth-child(3) {
  grid-area: 3 / 1;
}

.cube__face--4 .pip:nth-child(4) {
  grid-area: 3 / 3;
}

/* Face 5 */
.cube__face--5 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--5 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--5 .pip:nth-child(3) {
  grid-area: 2 / 2;
}

.cube__face--5 .pip:nth-child(4) {
  grid-area: 3 / 1;
}

.cube__face--5 .pip:nth-child(5) {
  grid-area: 3 / 3;
}

/* Face 6 */
.cube__face--6 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--6 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--6 .pip:nth-child(3) {
  grid-area: 2 / 1;
}

.cube__face--6 .pip:nth-child(4) {
  grid-area: 2 / 3;
}

.cube__face--6 .pip:nth-child(5) {
  grid-area: 3 / 1;
}

.cube__face--6 .pip:nth-child(6) {
  grid-area: 3 / 3;
}

/* Show Specific Value */
.show-1 {
  transform: rotateX(0deg) rotateY(0deg);
}

.show-2 {
  transform: rotateX(0deg) rotateY(-90deg);
}

.show-3 {
  transform: rotateX(0deg) rotateY(-180deg);
}

.show-4 {
  transform: rotateX(0deg) rotateY(90deg);
}

.show-5 {
  transform: rotateX(-90deg) rotateY(0deg);
}

.show-6 {
  transform: rotateX(90deg) rotateY(0deg);
}

.ludo-game-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}

/* --- 3D DICE CSS --- */
.dice-scene {
  width: 36px;
  height: 36px;
  perspective: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  position: relative;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease-out;
}

.dice-scene.rolling .cube {
  animation: spin 0.5s infinite linear;
}

@keyframes spin {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }

  100% {
    transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
  }
}

.cube__face {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid #999;
  border-radius: 4px;
  background: white;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 4px;
  /* Space for pips */
  box-sizing: border-box;
  backface-visibility: hidden;
}

/* Face Transforms */
.cube__face--1 {
  transform: rotateY(0deg) translateZ(18px);
}

.cube__face--2 {
  transform: rotateY(90deg) translateZ(18px);
}

.cube__face--3 {
  transform: rotateY(180deg) translateZ(18px);
}

.cube__face--4 {
  transform: rotateY(-90deg) translateZ(18px);
}

.cube__face--5 {
  transform: rotateX(90deg) translateZ(18px);
}

.cube__face--6 {
  transform: rotateX(-90deg) translateZ(18px);
}

/* Pips */
.pip {
  background-color: #333;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
}

/* Face 1 */
.cube__face--1 .pip:nth-child(1) {
  grid-area: 2 / 2;
}

/* Face 2 */
.cube__face--2 .pip:nth-child(1) {
  grid-area: 1 / 3;
}

.cube__face--2 .pip:nth-child(2) {
  grid-area: 3 / 1;
}

/* Face 3 */
.cube__face--3 .pip:nth-child(1) {
  grid-area: 1 / 3;
}

.cube__face--3 .pip:nth-child(2) {
  grid-area: 2 / 2;
}

.cube__face--3 .pip:nth-child(3) {
  grid-area: 3 / 1;
}

/* Face 4 */
.cube__face--4 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--4 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--4 .pip:nth-child(3) {
  grid-area: 3 / 1;
}

.cube__face--4 .pip:nth-child(4) {
  grid-area: 3 / 3;
}

/* Face 5 */
.cube__face--5 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--5 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--5 .pip:nth-child(3) {
  grid-area: 2 / 2;
}

.cube__face--5 .pip:nth-child(4) {
  grid-area: 3 / 1;
}

.cube__face--5 .pip:nth-child(5) {
  grid-area: 3 / 3;
}

/* Face 6 */
.cube__face--6 .pip:nth-child(1) {
  grid-area: 1 / 1;
}

.cube__face--6 .pip:nth-child(2) {
  grid-area: 1 / 3;
}

.cube__face--6 .pip:nth-child(3) {
  grid-area: 2 / 1;
}

.cube__face--6 .pip:nth-child(4) {
  grid-area: 2 / 3;
}

.cube__face--6 .pip:nth-child(5) {
  grid-area: 3 / 1;
}

.cube__face--6 .pip:nth-child(6) {
  grid-area: 3 / 3;
}

/* Show Specific Value */
.show-1 {
  transform: rotateX(0deg) rotateY(0deg);
}

.show-2 {
  transform: rotateX(0deg) rotateY(-90deg);
}

.show-3 {
  transform: rotateX(0deg) rotateY(-180deg);
}

.show-4 {
  transform: rotateX(0deg) rotateY(90deg);
}

.show-5 {
  transform: rotateX(-90deg) rotateY(0deg);
}

.show-6 {
  transform: rotateX(90deg) rotateY(0deg);
}

/* Reset & Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Premium Palette */

:root {
  --bg-dark: #0f172a;
  /* Slate 900 */
  --bg-darker: #020617;
  /* Slate 950 */

  --primary: #6366f1;
  /* Indigo 500 */
  --primary-glow: rgba(99, 102, 241, 0.4);

  --accent: #d946ef;
  /* Fuchsia 500 */
  --accent-glow: rgba(217, 70, 239, 0.4);

  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-surface: rgba(15, 23, 42, 0.6);
}

/* Mobile Touch Optimizations */

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-darker);
  color: var(--text-main);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(217, 70, 239, 0.15) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-x: hidden;
  touch-action: manipulation;
  /* Improves tap response */
}

/* Force Font Inheritance for Form Elements */

button,
input,
optgroup,
select,
textarea {
  font-family: 'Tajawal', sans-serif;
}

/* Prevent text selection on UI elements for App-like feel */

button,
.btn-primary,
.btn-secondary,
.auth-tab,
nav,
.room-card,
img {
  user-select: none;
  -webkit-user-select: none;
}

/* IOS Fixes */

.platform-ios body {
  cursor: pointer;
  /* Fixes event bubbling issues */
}

/* Safe Area Insets */

:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Modern Viewport Fix */
  min-height: 100dvh;
}

.platform-ios #root {
  padding-bottom: var(--safe-area-bottom);
}

.platform-android #root {
  /* Android-specific tweaks if needed */
  display: flex;
}

/* --- Global Premium Utilities --- */

.glass-panel-premium {
  background: var(--glass-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transform: translateZ(0);
  /* Force GPU */
  will-change: backdrop-filter;
}

.glass-panel {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
  transform: translateZ(0);
  /* Force GPU */
}

.text-gradient {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(129, 140, 248, 0.3);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

/* Buttons */

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  border: none;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px var(--primary-glow), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Inputs */

.input-premium {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  width: 100%;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.input-premium:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  background: rgba(15, 23, 42, 0.8);
}

/* Animations */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse-soft {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.animate-slide-in {
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

.animate-pulse {
  animation: pulse-soft 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Sprite Animation Master - GPU Accelerated */

@keyframes sprite-transform-master {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

@keyframes sprite-x {
  to { transform: translateX(-100%); }
}

@keyframes sprite-y {
  to { transform: translateY(-100%); }
}

.sprite-container {
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  contain: strict;
  /* Maximum isolation for Recalculate Style & Paint */
}

.sprite-sheet-inner {
  height: 100% !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  image-rendering: pixelated !important;
  animation: sprite-transform-master var(--sprite-duration) steps(var(--sprite-frames)) infinite !important;
}

.sprite-visible {
  transform: translateZ(0);
  /* Conditional GPU Layer promotion */
  will-change: transform;
}

.sprite-paused {
  animation-play-state: paused !important;
}

/* Redundant but kept for backward compat in static previews if any */

.sprite-anim-master {
  background-size: auto 100% !important;
  background-repeat: no-repeat !important;
  image-rendering: pixelated !important;
}

/* Custom Scrollbar */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout Helpers */

.center-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Shake Animation for Errors */

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px);
  }
}

.animate-shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Auth Tabs */

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}

.auth-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: linear-gradient(to top, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
}

/* Activation Code Input Grid */

.activation-grid {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.activation-digit {
  width: 3rem;
  height: 3.5rem;
  font-size: 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  outline: none;
  transition: all 0.2s;
}

.activation-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  transform: translateY(-2px);
}

/* Mobile Optimizations - App Feel (No Scroll) */

@media (max-width: 640px) {

  #root,
  body,
  html {
    height: 100dvh;
    /* Dynamic viewport height */
    overflow: hidden;
    /* Prevent page scroll */
    position: fixed;
    /* Lock body */
    width: 100%;
  }

  .center-container {
    height: 100dvh;
    padding: 0.5rem;
    /* Minimal padding */
    align-items: center;
    /* Center strictly */
    justify-content: center;
  }

  .glass-panel-premium {
    padding: 0 !important;
    border-radius: 16px !important;
    max-height: 95dvh;
    /* Ensure card fits */
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Compact header */
  .glass-panel-premium>div:first-child {
    padding-bottom: 1rem !important;
    margin-bottom: 0 !important;
  }

  h1 {
    font-size: 1.75rem !important;
    /* Smaller title */
  }

  p {
    margin-top: 0.25rem !important;
  }

  .auth-tab {
    padding: 0.75rem !important;
  }

  /* Compact form groups */
  form {
    gap: 0.75rem !important;
  }

  /* Compact Activation */
  .activation-grid {
    gap: 0.25rem;
    margin: 1rem 0 !important;
  }

  .activation-digit {
    width: 2.25rem;
    height: 2.75rem;
    font-size: 1.25rem;
  }

  .input-premium {
    padding: 0.75rem;
    font-size: 16px !important;
    /* Prevent zoom on iOS */
  }

  .btn-primary {
    padding: 0.875rem;
    margin-top: 0.25rem !important;
  }

  /* Enhanced Chat Input for Mobile */
  .chat-input-field {
    font-size: 1.15rem !important;
    padding: 12px !important;
  }
}

/* Icon Animations */

@keyframes iconPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(251, 191, 36, 0));
  }
}

@keyframes iconWiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}

@keyframes iconFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes iconPulseRed {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-icon-pulse {
  display: inline-block;
  animation: iconPulse 2s infinite ease-in-out;
}

.animate-icon-wiggle {
  display: inline-block;
  animation: iconWiggle 1s infinite ease-in-out;
}

.animate-icon-float {
  display: inline-block;
  animation: iconFloat 2s infinite ease-in-out;
}

.animate-icon-pulse-red {
  display: inline-block;
  animation: iconPulseRed 1.5s infinite ease-in-out;
}

/* Premium Tooltip System */

[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  pointer-events: none;
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Circular Icon Buttons */

.btn-icon-premium {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn-icon-premium:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.btn-icon-premium:active {
  transform: scale(0.95);
}

.btn-icon-premium.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Voice UI Enhancements */

@keyframes voiceWave {

  0%,
  100% {
    transform: scaleY(0.4);
  }

  50% {
    transform: scaleY(1);
  }
}

.voice-wave-container {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}

.voice-wave-bar {
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  animation: none;
}

.voice-wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.voice-wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.voice-wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.voice-wave-bar:nth-child(5) {
  animation-delay: 0.4s;
}

.active-speaker-premium {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(217, 70, 239, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: titleSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 15px rgba(217, 70, 239, 0.1);
  margin-top: 10px;
}

.speaker-avatar-glow {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  padding: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.speaker-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(217, 70, 239, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(217, 70, 239, 0.2);
}

.gaming-btn-glow {
  position: relative;
  overflow: hidden;
}

.gaming-btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.gaming-btn-glow:hover::after {
  opacity: 1;
}

/* Glassmorphism Voice Pill UI */

.voice-pill-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.4);
  /* Neutral dark glass */
  /* backdrop-filter removed */
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  padding: 6px 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  width: fit-content;
  margin: 10px auto;
  min-height: 64px;
}

.pill-avatar-container {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.pill-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mic-pill-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px;
  height: 48px;
  border-radius: 25px;
  border: none;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.mic-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

.mic-pill-btn:active {
  transform: scale(0.95);
}

.mic-pill-btn.is-active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.icon-side-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  /* Glass circles */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-side-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.icon-side-btn.muted {
  background: rgba(239, 68, 68, 0.8) !important;
  color: white;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.pill-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  margin: 0 10px;
  min-width: 60px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.vertical-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 15px;
}

.vertical-wave-bar {
  width: 3px;
  border-radius: 2px;
  background: white;
  animation: voiceWave 0.8s infinite ease-in-out;
}

.vertical-wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.vertical-wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.vertical-wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}

/* Custom SweetAlert Input */

.swal-wide-input {
  width: 90% !important;
  max-width: 600px !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid var(--glass-border) !important;
  color: white !important;
  border-radius: 12px !important;
  font-size: 1.1rem !important;
  padding: 0.8rem !important;
  margin: 1rem auto !important;
}

/* Ensure focus state matches theme */

.swal-wide-input:focus {
  box-shadow: 0 0 0 2px var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Mobile Compact Voice UI */

.is-mobile .voice-pill-bar {
  min-height: 52px;
  gap: 8px;
  padding: 4px 8px;
  margin: 5px auto;
}

.is-mobile .pill-avatar-container {
  width: 44px;
  height: 44px;
  border-width: 2px;
}

.is-mobile .mic-pill-btn {
  height: 40px;
  padding: 0 16px;
  gap: 6px;
}

.is-mobile .icon-side-btn {
  width: 36px;
  height: 36px;
}

.is-mobile .pill-timer {
  font-size: 0.9rem;
  margin: 0 5px;
}

/* Liquid Feature Buttons */

.btn-feature-liquid {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.btn-feature-liquid:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-feature-liquid:active {
  transform: scale(0.92);
}

/* Animations */

@keyframes buttonPopIn {
  from {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes inputFocus {
  from {
    border-color: rgba(255, 255, 255, 0.1);
  }

  to {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
  }
}

.chat-input-field:focus {
  animation: inputFocus 0.3s forwards;
}

/* Tooltip Adjustments for Liquid Buttons */

.btn-feature-liquid[data-tooltip]::before {
  bottom: 140%;
}

/* LCP OPTIMIZATION: Block animations during load */

body.js-loading *,
body.js-loading *::before,
body.js-loading *::after {
  animation: none !important;
  transition: none !important;
}/* Modern SweetAlert Customizations */
div:where(.swal2-container) div:where(.swal2-popup) {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    padding: 1.5rem !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(239, 68, 68, 0.2) !important;
    width: 320px !important;
    /* Compact Standard Width */
}

/* Title Styling */
div:where(.swal2-container) h2:where(.swal2-title) {
    color: #ef4444 !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 0.5rem !important;
}

/* Content Styling */
div:where(.swal2-container) div:where(.swal2-html-container) {
    color: #cbd5e1 !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    margin: 1rem 0 !important;
    font-weight: 500 !important;
}

/* Icon Styling */
div:where(.swal2-icon).swal2-warning,
div:where(.swal2-icon).swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    width: 3.5em !important;
    height: 3.5em !important;
    margin: 0.5em auto 1em !important;
}

div:where(.swal2-icon).swal2-warning .swal2-icon-content,
div:where(.swal2-icon).swal2-error .swal2-icon-content {
    font-size: 2.2em !important;
}

/* Button Styling */
div:where(.swal2-container) button.swal2-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
    padding: 0.8em 2em !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

div:where(.swal2-container) button.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5) !important;
}

/* Footer Styling */
div:where(.swal2-container) div:where(.swal2-footer) {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin-top: 1rem !important;
    padding-top: 0.8rem !important;
    color: #64748b !important;
    font-size: 0.75rem !important;
}