/* Font styling */
:root {
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

/* Link Styles for Glass Theme */
a {
  color: #fbbf24 !important; /* Warm amber color */
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

a:hover {
  color: #f59e0b !important; /* Darker amber on hover */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  text-decoration: underline;
}

a:visited {
  color: #d97706 !important; /* Orange for visited links */
}

body {
  font-family: var(--font-body);
}

h1, h2, h3, .card-front, .card-back {
  font-family: var(--font-heading);
}

h1 {
  letter-spacing: 0.02em;
}

/* Styles for the Join Screen */
#join-screen h1 {
  font-weight: 700;
  letter-spacing: 0.05em;
}

button {
  font-family: var(--font-heading);
  font-weight: 600;
}

/* Card Styles */
.card {
  perspective: 1000px;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  border-radius: 0.75rem;
  background-color: transparent;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 0.75rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: transparent;
}
.card.flipped .card-inner {
  transform: rotateY(180deg);
}
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 3px solid white;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(1rem, 5vw, 2rem);
  word-break: break-word;
  text-align: center;
}

.card-front.risk, .card-back.risk {
  font-size: 1rem;
}

/* Responsive font sizing for different card content lengths */
.card-front span, .card-back span {
  display: inline-block;
  max-width: 100%;
  line-height: 1.2;
}

/* For longer text content */
.card-front:has(span:nth-child(1):not(:only-child)),
.card-back:has(span:nth-child(1):not(:only-child)) {
  font-size: clamp(0.875rem, 4vw, 1.5rem);
}

.card-front {
  color: white;
}
.card-back {
  background-color: white;
  transform: rotateY(180deg);
}

/* Default card styles (used as fallback) */
.card-front:not([class*="bg-"]) {
  background-color: #4f46e5;
}
.card-back:not([class*="border-"]) {
  color: #1e293b;
  border: 2px solid #4f46e5;
}

/* Animation Styles */
.fade-in {
  animation: fadeIn 0.5s;
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Mobile Header & Menu Styles */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  #mobile-menu {
    transform-origin: top;
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
  }

  #mobile-menu:not(.hidden) {
    max-height: 500px;
    padding-top: 0.75rem;
    margin-top: 1rem;
  }

  /* Ensure leave room button is properly sized */
  #leave-room-btn {
    min-width: 40px;
    justify-content: center;
  }
}

/* Mobile menu animation */
@keyframes slideDown {
  from { max-height: 0; opacity: 0; }
  to { max-height: 500px; opacity: 1; }
}

@keyframes slideUp {
  from { max-height: 500px; opacity: 1; }
  to { max-height: 0; opacity: 0; }
}

#mobile-menu:not(.hidden) {
  animation: slideDown 0.3s ease-in-out forwards;
}

#mobile-menu.hidden {
  animation: slideUp 0.3s ease-in-out forwards;
}

/* Current Story Styles */
#current-story-title {
  font-family: var(--font-heading);
  font-weight: 600;
}

#current-story-description {
  font-family: var(--font-body);
  line-height: 1.5;
}

/* User Pill Styles */
.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  margin: 0.25rem;
  background-color: #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.user-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.user-pill.has-voted {
  background-color: #f0fdf4;
  border: 1px solid #86efac;
}

.user-pill.is-host {
  background-color: #eff6ff;
  border: 1px solid #93c5fd;
}

.user-pill.is-host.has-voted {
  background-color: #ecfdf5;
  border: 1px solid #6ee7b7;
}

.user-name {
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

/* Ensure user names in voted pills have dark color */
.user-pill.has-voted .user-name {
  color: #111827; /* Dark color for better visibility */
}

.user-host-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background-color: #3b82f6;
  color: white;
  border-radius: 50%;
  font-size: 0.625rem;
  margin-left: 0.5rem;
}

.vote-status {
  position: absolute;
  top: 0;
  left: 0;
  height: 0.25rem;
  transition: width 0.5s ease-out;
}

.vote-status.voted {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
  width: 100%;
  animation: pulse 2s infinite;
}

.vote-status.not-voted {
  background: #e5e7eb;
  width: 100%;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

/* For the user pills container */
.users-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
}

/* Collapsible stories panel */
#stories-panel {
  transition: all 0.3s ease;
}

#stories-panel.collapsed {
  width: 50px !important;
  min-width: 50px;
  padding: 0.5rem;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* Adjust main content when stories panel is collapsed */
#stories-panel.collapsed + div {
  width: calc(100% - 50px) !important;
  transition: all 0.3s ease;
}

#stories-panel.collapsed .stories-content,
#stories-panel.collapsed #host-controls {
  display: none;
}

#stories-panel.collapsed h2 {
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-align: center;
  margin-top: 25px; /* Add space below the toggle button */
}

#stories-panel.collapsed #toggle-stories-btn {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  #stories-panel.collapsed {
    width: 100% !important;
    height: 50px;
    min-height: 50px;
  }

  #stories-panel.collapsed h2 {
    display: flex;
    position: static;
    margin-left: 0.5rem;
    flex-direction: row;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    top: auto;
    left: auto;
    transform: none;
    align-items: center; /* Center text vertically */
    margin-top: 0; /* Remove top margin that might be affecting centering */
    height: 100%; /* Take full height of container */
  }

  #stories-panel.collapsed #toggle-stories-btn {
    transform: rotate(0deg);
    position: static;
    margin-right: 0.5rem;
  }

  /* Adjust layout for collapsed panel on mobile */
  #stories-panel.collapsed + div {
    width: 100% !important;
    margin-top: 0.5rem;
  }
}

/* Results Summary Styling */
#consensus, #average {
  font-family: var(--font-body);
  font-weight: 500;
  margin-top: 5px;
  line-height: 1.5;
}

/* Join Screen Glass Effect and Animations */
.glass-container {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: glassFloat 6s ease-in-out infinite;
}

.glass-inner {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.glass-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

.input-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.glass-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-input:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.6);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.1),
              0 0 20px rgba(147, 197, 253, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.glass-button {
  position: relative;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.glass-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
}

.glass-button:active {
  transform: translateY(0);
}

.button-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.glass-button:hover .button-glow {
  left: 100%;
}

/* Floating Shapes */
.floating-shape {
  position: absolute;
  opacity: 0.1;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.shape-1 {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #06b6d4, #3b82f6);
  border-radius: 50%;
  top: 20%;
  left: 10%;
  animation: float1 8s infinite;
}

.shape-2 {
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #8b5cf6, #ec4899);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  top: 60%;
  right: 15%;
  animation: float2 6s infinite;
}

.shape-3 {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #f59e0b, #ef4444);
  border-radius: 20px;
  top: 80%;
  left: 5%;
  animation: float3 10s infinite;
}

.shape-4 {
  width: 70px;
  height: 70px;
  background: linear-gradient(45deg, #10b981, #06b6d4);
  border-radius: 50%;
  top: 15%;
  right: 25%;
  animation: float4 7s infinite;
}

.shape-5 {
  width: 90px;
  height: 90px;
  background: linear-gradient(45deg, #6366f1, #8b5cf6);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  top: 40%;
  left: 20%;
  animation: float5 9s infinite;
}

.shape-6 {
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, #ec4899, #f59e0b);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  top: 70%;
  right: 30%;
  animation: float6 5s infinite;
}

/* Particles */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: particle 4s linear infinite;
}

.particle-1 { left: 20%; animation-delay: 0s; animation-duration: 6s; }
.particle-2 { left: 40%; animation-delay: 1s; animation-duration: 4s; }
.particle-3 { left: 60%; animation-delay: 2s; animation-duration: 5s; }
.particle-4 { left: 80%; animation-delay: 0.5s; animation-duration: 7s; }
.particle-5 { left: 10%; animation-delay: 1.5s; animation-duration: 3s; }
.particle-6 { left: 30%; animation-delay: 2.5s; animation-duration: 6s; }
.particle-7 { left: 70%; animation-delay: 3s; animation-duration: 4s; }
.particle-8 { left: 90%; animation-delay: 3.5s; animation-duration: 5s; }

/* Keyframe Animations */
@keyframes glassFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes float1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes float2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-30px) rotate(-120deg); }
}

@keyframes float3 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-25px) rotate(90deg); }
}

@keyframes float4 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-35px) rotate(-180deg); }
}

@keyframes float5 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(45deg); }
}

@keyframes float6 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-40px) rotate(-90deg); }
}

@keyframes particle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 1;
  }
  10% {
    opacity: 1;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 1;
    transform: translateY(10vh) scale(1);
  }
  100% {
    transform: translateY(0vh) scale(0);
    opacity: 0;
  }
}


/* Glass Panel Components for Main App */
.glass-panel {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.02), transparent);
  animation: panelShimmer 8s infinite;
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.glass-badge {
  background: rgba(99, 102, 241, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-users-container {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-height: 120px;
  overflow-y: auto;
}

.glass-icon-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-icon-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.glass-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='white' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.65rem;
}

.glass-select:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.6);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.1);
}

.glass-select option {
  background: rgba(0, 0, 0, 0.9);
  color: white;
}

/* Button Variants */
.glass-button-secondary {
  position: relative;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.8), rgba(107, 114, 128, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.glass-button-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(75, 85, 99, 0.3);
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.9), rgba(107, 114, 128, 0.9));
}

.glass-button-success {
  position: relative;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.glass-button-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
}

.glass-button-danger {
  position: relative;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.glass-button-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
}

/* Button Glow Effects */
.button-glow-secondary {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.glass-button-secondary:hover .button-glow-secondary {
  left: 100%;
}

.button-glow-success {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.glass-button-success:hover .button-glow-success {
  left: 100%;
}

.button-glow-danger {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.glass-button-danger:hover .button-glow-danger {
  left: 100%;
}

/* Elegant Poker Table */
.poker-table {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.12) 0%,
    rgba(139, 92, 246, 0.12) 50%,
    rgba(168, 85, 247, 0.12) 100%);
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  padding: 1.5rem;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.poker-table::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(45deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(99, 102, 241, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%,
    transparent 100%);
  animation: tableGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}

.poker-results {
  background: linear-gradient(135deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 50%,
    rgba(168, 85, 247, 0.1) 100%);
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Fun Bright Playing Cards - Completely Rebuilt */
.card {
  perspective: 1000px;
  cursor: pointer;
  border-radius: 16px;
  background-color: transparent;
  position: static;
  min-height: 80px;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  border-radius: 16px;
  min-height: 80px;
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-weight: 700;
  font-size: clamp(1.2rem, 4vw, 2rem);
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
              0 4px 6px rgba(0, 0, 0, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.8);
}

/* Elegant Card Front - Face Down State */
.card-front {
  background: linear-gradient(135deg,
    #6366f1 0%,
    #8b5cf6 50%,
    #a855f7 100%);
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-front::before {
  content: '';
  position: absolute;
  inset: 4px;
  background: linear-gradient(45deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 100%);
  border-radius: 12px;
  pointer-events: none;
}

.card-front::after {
  content: '♠';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1rem;
  opacity: 0.6;
}

/* Selected Card Back - Shows Value Clearly */
.card-back {
  background: linear-gradient(135deg,
    #f0f9ff 0%,
    #dbeafe 50%,
    #bfdbfe 100%);
  color: #1e40af !important;
  transform: rotateY(180deg);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
  border: 3px solid #3b82f6;
  font-weight: 800 !important;
  font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid #93c5fd;
  border-radius: 10px;
  background: linear-gradient(45deg, #f0f9ff 0%, #dbeafe 100%);
  z-index: -1;
  pointer-events: none;
}

/* Selected card highlight */
.card.flipped .card-back {
  background: linear-gradient(135deg,
    #dbeafe 0%,
    #bfdbfe 50%,
    #93c5fd 100%);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4),
              inset 0 0 20px rgba(147, 197, 253, 0.3);
}

/* Card value styling */
.card-front span, .card-back span {
  position: relative;
  z-index: 10;
  font-family: var(--font-heading);
}

/* Ensure card back text is always visible */
.card-back {
  z-index: 10 !important;
}

.card-back span {
  z-index: 20 !important;
  position: relative !important;
}

/* Enhanced hover effects */
.card:hover .card-inner {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2),
              0 0 20px rgba(147, 51, 234, 0.3);
}

/* Selected card styling */
.card.flipped {
  transform: translateY(-6px);
}

.card.flipped .card-inner {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25),
              0 0 30px rgba(34, 197, 94, 0.4);
}

/* Custom Scrollbar */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Glass Header Styles */
.glass-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.glass-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.015), transparent);
  animation: headerShimmer 10s infinite;
}

.glass-card-compact {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.75rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

.glass-copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem;
  margin-left: 0.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.glass-copy-button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.02);
}

/* Enhanced User Pills for Glass Theme */
.user-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.user-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.user-pill.has-voted {
  background: rgba(251, 191, 36, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.user-pill.is-host {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.user-pill.is-host.has-voted {
  background: rgba(251, 191, 36, 0.3);
  border: 1px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.user-name {
  color: white !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.user-host-badge {
  background: rgba(99, 102, 241, 0.8);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* App Background Animations - Subtle */
.app-floating-shape {
  position: absolute;
  opacity: 0.03;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.app-shape-1 {
  width: 120px;
  height: 120px;
  background: linear-gradient(45deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  top: 15%;
  left: 5%;
  animation: appFloat1 12s infinite;
}

.app-shape-2 {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #10b981, #06b6d4);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  top: 70%;
  right: 10%;
  animation: appFloat2 8s infinite;
}

.app-shape-3 {
  width: 150px;
  height: 150px;
  background: linear-gradient(45deg, #8b5cf6, #ec4899);
  border-radius: 30px;
  top: 50%;
  left: 85%;
  animation: appFloat3 15s infinite;
}

.app-shape-4 {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #f59e0b, #ef4444);
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  top: 25%;
  right: 30%;
  animation: appFloat4 10s infinite;
}

/* App Particles - Very Subtle */
.app-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: appParticle 8s linear infinite;
}

.app-particle-1 { left: 25%; animation-delay: 0s; animation-duration: 12s; }
.app-particle-2 { left: 55%; animation-delay: 3s; animation-duration: 8s; }
.app-particle-3 { left: 75%; animation-delay: 6s; animation-duration: 10s; }
.app-particle-4 { left: 15%; animation-delay: 9s; animation-duration: 14s; }

/* Glass Story Cards */
.glass-story-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-story-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.glass-story-card-active {
  background: rgba(99, 102, 241, 0.2) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.glass-story-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid transparent;
}

.glass-story-status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: rgb(34, 197, 94);
  border-color: rgba(34, 197, 94, 0.3);
}

.glass-story-status-active {
  background: rgba(251, 191, 36, 0.25);
  color: rgb(251, 191, 36);
  border-color: rgba(251, 191, 36, 0.4);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.glass-delete-button {
  color: rgba(239, 68, 68, 0.7);
  padding: 0.25rem;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-delete-button:hover {
  color: rgb(239, 68, 68);
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

/* Elegant Result Cards */
.glass-result-card {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(251, 191, 36, 0.15) 50%,
    rgba(245, 158, 11, 0.15) 100%);
  border: 2px solid rgba(251, 191, 36, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.12),
              0 0 12px rgba(139, 92, 246, 0.08);
}

.glass-result-card:hover {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(251, 191, 36, 0.2) 50%,
    rgba(245, 158, 11, 0.2) 100%);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.18),
              0 0 16px rgba(245, 158, 11, 0.12);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.18),
              0 0 20px rgba(139, 92, 246, 0.12);
}

/* Animation Keyframes */
@keyframes panelShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes tableGlow {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

@keyframes headerShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes appFloat1 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(120deg); }
}

@keyframes appFloat2 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(-90deg); }
}

@keyframes appFloat3 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-10px) rotate(60deg); }
}

@keyframes appFloat4 {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-25px) rotate(-45deg); }
}

@keyframes appParticle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0.3;
  }
  15% {
    opacity: 0.3;
    transform: translateY(85vh) scale(1);
  }
  85% {
    opacity: 0.3;
    transform: translateY(15vh) scale(1);
  }
  100% {
    transform: translateY(0vh) scale(0);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .floating-shape {
    opacity: 0.05;
  }

  .glass-container {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }

  .glass-inner {
    padding: 1.5rem;
  }

  .glass-panel {
    padding: 1rem;
  }

  .poker-table {
    padding: 1rem;
  }

  .card {
    min-height: 60px;
  }

  .card-front, .card-back {
    font-size: clamp(0.875rem, 4vw, 1.2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-floating-shape,
  .app-particle {
    animation: none;
  }
}