/* ==========================================================================
   KAZIK! - ULTRA DESIGN SYSTEM & STYLES (GARDEN CARD GAME THEME V7)
   ========================================================================== */

:root {
  --font-main: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Color Palette - Vibrant Garden Theme */
  --bg-dark: #0a1f0d;
  --lawn-green: #2d6a31;
  --lawn-dark: #1b431e;
  --felt-green: #3ca345;
  --felt-shadow: #1e5c24;

  /* Scallop Cloth Colors */
  --cloth-cream: #faf5e8;
  --cloth-border: #e6dfc8;

  /* Card Colors */
  --c-pink: #e91e63;
  --c-blue: #0288d1;
  --c-green: #2e7d32;
  --c-yellow: #fbc02d;
  --c-wild: #37474f;

  /* Accent Glows */
  --neon-pink: #ff2a8d;
  --neon-gold: #ffc107;
  --neon-cyan: #00e5ff;
  --neon-green: #00e676;

  /* UI Glass */
  --glass-bg: rgba(18, 38, 20, 0.78);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: #ffffff;
}

/* ================= Ambient Background ================= */
.bg-garden {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 50% 40%, #2e6930 0%, #163818 60%, #0a1c0b 100%);
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.6) 100%);
  pointer-events: none;
}

.bg-leaves {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(76, 175, 80, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 90% 90%, rgba(76, 175, 80, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 85% 15%, rgba(0, 230, 118, 0.1) 0%, transparent 25%);
  pointer-events: none;
}

#particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  bottom: -10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: floatUp 15s linear infinite;
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-105vh) rotate(360deg); opacity: 0; }
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* ================= Glass Card Components ================= */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ultra-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.ultra-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.ultra-select {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 45, 22, 0.9);
  color: #fff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  outline: none;
}

.ultra-btn {
  padding: 14px 28px;
  border-radius: 16px;
  border: none;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.ultra-btn.small-btn {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 12px;
}

.ultra-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.ultra-btn:active {
  transform: translateY(1px) scale(0.98);
}

.primary-btn {
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #0b3010;
  box-shadow: 0 8px 25px rgba(0, 230, 118, 0.4);
}

.secondary-btn {
  background: linear-gradient(135deg, #00b0ff, #00e5ff);
  color: #042433;
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

.gold-btn {
  background: linear-gradient(135deg, #ffab00, #ffd600);
  color: #3e2723;
  box-shadow: 0 8px 25px rgba(255, 214, 0, 0.5);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ================= TOP HUD BAR ================= */
.hud-top-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 900px;
  height: 52px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(15, 35, 18, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hud-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #29b6f6, #0288d1);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-timer-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #fff8e7;
  color: #4a3800;
  border-radius: 20px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hud-timer-badge.turn-badge {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.timer-icon {
  font-size: 16px;
}

.hud-action-info {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  max-width: 35%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-exit-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ff1744;
  background: linear-gradient(135deg, #d50000, #ff1744);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(213, 0, 0, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hud-exit-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(213, 0, 0, 0.8);
}

/* Auto-Bot Takeover Banner */
.autobot-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 20px;
  background: rgba(230, 81, 0, 0.92);
  border: 1px solid #ff9100;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ================= AVATAR SELECTOR ================= */
.avatar-picker-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.avatar-picker-section label {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.avatar-grid {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.av-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.av-btn.active, .av-btn:hover {
  transform: scale(1.15);
  border-color: var(--neon-gold);
  background: rgba(255, 193, 7, 0.2);
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
}

/* ================= JOIN & LOBBY SCREENS ================= */
.join-container, .lobby-container {
  width: 90%;
  max-width: 480px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.logo-icon {
  font-size: 44px;
  margin-bottom: -6px;
}

.logo-title {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, #fff, #ffd54f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.logo-sub {
  font-size: 12px;
  font-weight: 800;
  color: var(--neon-gold);
  letter-spacing: 3px;
}

.join-tabs-outer {
  display: flex;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 16px;
}

.tab-btn2 {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn2.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tab2-content {
  display: none;
  width: 100%;
}

.tab2-content.active {
  display: block;
}

.join-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.input-group label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.row2 {
  display: flex;
  gap: 10px;
  width: 100%;
}

.room-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.rl-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rl-item:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--neon-cyan);
}

.lobby-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  width: 100%;
  margin: 16px 0;
}

.player-card {
  position: relative;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.player-card.host {
  border-color: var(--neon-gold);
  background: rgba(255, 193, 7, 0.1);
}

.player-card .avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  border: 2px solid;
}

/* ================= GAME TABLE LAYOUT ================= */
.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.table-surface {
  position: relative;
  width: min(78vw, 560px);
  height: min(78vw, 560px);
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.table-scallop-border {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: var(--cloth-cream);
  border: 6px solid var(--cloth-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 4px 8px rgba(0,0,0,0.15);
  background-image: radial-gradient(circle at 10px 10px, #e8e2d0 3px, transparent 4px);
}

.table-inner-felt {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #43a047 0%, #2e7d32 65%, #1b5e20 100%);
  border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.5);
}

.table-center {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Animated Circular Direction Arrows */
.turn-arrows-container {
  position: absolute;
  inset: -56px;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.turn-arrows-container.ccw {
  transform: scaleX(-1);
}

.arrows-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(255, 0, 127, 0.9));
  animation: rotateArrows 18s linear infinite;
}



@keyframes rotateArrows {
  0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 15px rgba(255, 0, 127, 0.6)); }
  50% { transform: rotate(180deg) scale(1.05); filter: drop-shadow(0 0 35px rgba(255, 0, 127, 1)); }
  100% { transform: rotate(360deg) scale(1); filter: drop-shadow(0 0 15px rgba(255, 0, 127, 0.6)); }
}

@keyframes rotateArrowsCCW {
  0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 15px rgba(255, 0, 127, 0.6)); }
  50% { transform: rotate(-180deg) scale(1.05); filter: drop-shadow(0 0 35px rgba(255, 0, 127, 1)); }
  100% { transform: rotate(-360deg) scale(1); filter: drop-shadow(0 0 15px rgba(255, 0, 127, 0.6)); }
}

.discard-pile {
  position: relative;
  width: 100px;
  height: 140px;
  border-radius: 14px;
  z-index: 2;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.discard-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.5);
}

.draw-pile {
  position: absolute;
  left: -40px;
  width: 90px;
  height: 130px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  border: 3px solid #fff;
  box-shadow: -4px 6px 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transform: rotate(-10deg);
  transition: transform 0.2s ease;
}

.draw-pile:hover {
  transform: rotate(-5deg) scale(1.05);
}

/* ================= 3D TACTILE KAZIK BUTTON ================= */
.shout-btn-3d {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #ffd700 0%, #ff8f00 100%);
  padding: 6px;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5), inset 0 3px 6px rgba(255, 255, 255, 0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shout-btn-3d:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 16px 30px rgba(255, 143, 0, 0.6);
}

.shout-btn-3d:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.sb-outer {
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffab00 0%, #e65100 100%);
  border: 3px solid #fff3e0;
  align-items: center;
  justify-content: center;
}

.sb-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3e2723;
  line-height: 1;
}

.sb-dot {
  font-size: 8px;
  color: #d50000;
  margin-bottom: 2px;
}

.sb-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.sb-sub {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.85;
}

.shout-btn-3d.pulse {
  animation: kazikPulse 1.2s infinite alternate;
}

@keyframes kazikPulse {
  0% { transform: translateY(-50%) scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
  100% { transform: translateY(-50%) scale(1.12); box-shadow: 0 0 35px rgba(255, 42, 141, 0.9); }
}

/* ================= EMOTE REACTION BAR & FLOATING EMOTES ================= */
.emote-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.em-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.em-btn:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.3);
}

.floating-emote {
  position: absolute;
  font-size: 42px;
  z-index: 150;
  pointer-events: none;
  animation: emoteFloat 2.5s ease-out forwards;
}

@keyframes emoteFloat {
  0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; }
  20% { transform: translate(-50%, -40px) scale(3.5); opacity: 1; }
  80% { transform: translate(-50%, -80px) scale(2.5); opacity: 1; }
  100% { transform: translate(-50%, -120px) scale(1.5); opacity: 0; }
}

/* ================= RADIAL PLAYER SLOTS & AVATARS ================= */
#player-slots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.player-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.ps-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #263238;
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  overflow: hidden;
}

.player-slot.active .ps-avatar-img {
  border-color: var(--neon-gold);
  box-shadow: 0 0 25px rgba(255, 193, 7, 0.9);
}

.turn-ring-svg {
  position: absolute;
  inset: -4px;
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
  pointer-events: none;
  display: none;
}

.player-slot.active .turn-ring-svg {
  display: block;
}

.turn-ring-circle {
  stroke: var(--neon-gold);
  stroke-dasharray: 220;
  stroke-dashoffset: 0;
  animation: turnTimer 10s linear forwards;
}

@keyframes turnTimer {
  to { stroke-dashoffset: 220; }
}

.ps-name-tag {
  margin-top: 4px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ps-card-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: #3e2723;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ================= LOCAL PLAYER HAND ================= */
.hand-section {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 30;
}

.join-error-msg {
  color: #ff5252;
  font-size: 14px;
  min-height: 20px;
  margin-top: 10px;
}

/* ================= CHAT BADGE ================= */
.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background: #ff1744;
  border-radius: 50%;
  border: 2px solid #0f2312;
  box-shadow: 0 0 10px rgba(255,23,68,0.8);
  animation: pulse-badge 1.5s infinite;
}
@keyframes pulse-badge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,23,68,0.7); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(255,23,68,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,23,68,0); }
}

/* ================= JOIN FOOTER & INFO MODALS ================= */
.join-footer {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
}
.info-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.info-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.info-modal-box {
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 30px;
  background: rgba(15, 35, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 24px;
  text-align: left;
}
.info-modal-box h2 {
  color: #00e5ff;
  margin-bottom: 20px;
  text-align: center;
  font-size: 28px;
}
.info-modal-box h3 {
  color: #ffcc80;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 20px;
}
.info-modal-box p, .info-modal-box ul {
  color: #e0e0e0;
  font-size: 15px;
  line-height: 1.6;
}
.info-modal-box ul {
  padding-left: 20px;
  margin-bottom: 15px;
}
.info-modal-box li {
  margin-bottom: 8px;
}
.info-close-btn {
  margin-top: 25px;
  width: 100%;
}

.hand-msg {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.hand-fan {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 150px;
  width: 100%;
  padding-bottom: 10px;
}

/* ================= CARDS DESIGN SYSTEM ================= */
.card {
  position: relative;
  width: 90px;
  height: 135px;
  border-radius: 14px;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
}

@keyframes dropIn {
  0% { transform: translateY(-50px) scale(1.2); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.animate-drop {
  animation: dropIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-28px) scale(1.12) !important;
    z-index: 100 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  }
}

.card.unplayable {
  filter: brightness(0.6) grayscale(0.3);
  cursor: not-allowed;
}

.card-inner {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 8px;
  color: #fff;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

/* Card Color Variants */
.card.red .card-inner { background: linear-gradient(135deg, #ff2a55, #c2185b); }
.card.blue .card-inner { background: linear-gradient(135deg, #00b0ff, #0288d1); }
.card.green .card-inner { background: linear-gradient(135deg, #00e676, #2e7d32); }
.card.yellow .card-inner { background: linear-gradient(135deg, #ffd600, #f57f17); color: #3e2723; }
.card.wild .card-inner { background: linear-gradient(135deg, #37474f, #212121); }

.ci-top { font-size: 16px; line-height: 1; align-self: flex-start; }
.ci-center {
  font-size: 38px;
  line-height: 1;
  align-self: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.ci-bottom { font-size: 16px; line-height: 1; align-self: flex-end; transform: rotate(180deg); }

/* Mascot Icon Illustration in Background of Cards */
.card-inner::after {
  content: '🐱';
  position: absolute;
  right: -6px;
  bottom: -6px;
  font-size: 42px;
  opacity: 0.18;
  pointer-events: none;
}

.card.red.card-inner::after { content: '🐱'; }
.card.blue.card-inner::after { content: '🦉'; }
.card.green.card-inner::after { content: '🐸'; }
.card.yellow.card-inner::after { content: '🦊'; }
.card.wild.card-inner::after { content: '👑'; }

/* ================= BOTTOM FLOATING CONTROL BAR ================= */
.bottom-floating-bar {
  position: absolute;
  bottom: 16px;
  left: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.bar-left, .bar-right {
  pointer-events: auto;
  display: flex;
  gap: 12px;
}

.ctrl-btn-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 38, 20, 0.85);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ctrl-btn-round:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.ctrl-btn-round.off {
  opacity: 0.5;
  background: rgba(255, 0, 0, 0.3);
}

.action-btn-draw {
  padding: 14px 28px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, #ff9100, #ff6d00);
  color: #fff;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 109, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.action-btn-draw:hover {
  transform: translateY(-2px) scale(1.04);
}

/* ================= CHAT DRAWER ================= */
.chat-drawer {
  position: absolute;
  left: 24px;
  bottom: 76px;
  width: 320px;
  height: 360px;
  z-index: 60;
  background: rgba(15, 32, 16, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.chat-msgs {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-size: 13px;
}

.chat-msg.me {
  background: rgba(0, 230, 118, 0.15);
  align-self: flex-end;
}

.chat-emoji-picker {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: center;
}

.chat-input-row {
  padding: 10px;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  outline: none;
}

.chat-send, .chat-emoji-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: var(--neon-green);
  color: #0b3010;
  font-weight: 800;
  cursor: pointer;
}

/* ================= OVERLAYS & MODALS ================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-box {
  width: 90%;
  max-width: 420px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.cbtn {
  padding: 16px;
  border-radius: 16px;
  border: 3px solid #fff;
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.cbtn:hover { transform: scale(1.05); }
.cbtn.red { background: linear-gradient(135deg, #ff2a55, #c2185b); }
.cbtn.blue { background: linear-gradient(135deg, #00b0ff, #0288d1); }
.cbtn.green { background: linear-gradient(135deg, #00e676, #2e7d32); }
.cbtn.yellow { background: linear-gradient(135deg, #ffd600, #f57f17); color: #3e2723; }

.target-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.target-btn {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.target-btn:hover {
  background: var(--neon-cyan);
  color: #a4b0be;
}

/* ================= MOBILE RESPONSIVENESS ================= */
@media (max-width: 768px) {
  .table-surface {
    width: 560px !important;
    height: 560px !important;
    max-width: none !important;
    max-height: none !important;
    transform: scale(min(calc(100vw / 580), calc(70vh / 580)));
  }
  
  .emote-bar {
    transform: translateX(-50%) scale(0.75);
    transform-origin: bottom center;
    bottom: 75px;
    width: max-content;
  }
  
  .bottom-floating-bar {
    transform: scale(0.85);
    transform-origin: bottom center;
    bottom: 10px;
  }
  
  .hud-top-bar {
    transform: translateX(-50%) scale(0.85);
    transform-origin: top center;
    top: 5px;
  }

  .chat-drawer {
    width: calc(100% - 32px);
    left: 16px;
    bottom: 90px;
    height: 300px;
  }

  .join-container, .lobby-container, .result-container {
    width: 95%;
    padding: 24px 16px;
  }
  
  .logo-title {
    font-size: 32px;
  }
}

.modal-btns {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

/* ================= RESULT & SCOREBOARD ================= */
.result-container {
  width: 90%;
  max-width: 500px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.victory-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.crown-icon {
  font-size: 56px;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  to { transform: translateY(-10px); }
}

.winner-name {
  font-size: 32px;
  font-weight: 900;
  color: var(--neon-gold);
}

.scoreboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sb-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-weight: 700;
}

/* Toasts */
#toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(18, 38, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--neon-cyan);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


