/* main.css - Index page styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a1a;
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
}

/* Animated background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(79, 172, 254, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(233, 69, 96, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 242, 254, 0.05) 0%, transparent 70%),
    linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0f0f23 100%);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 15px 20px;
  position: relative;
}

/* Top bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.lang-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-select:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-select option {
  background: #1a1a2e;
  color: #fff;
}

/* Auth buttons */
.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.auth-btn.login {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.auth-btn.login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.auth-btn.register {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #0a0a1a;
}

.auth-btn.register:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.auth-btn.guest {
  background: transparent;
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #ffc107;
}

.auth-btn.guest:hover {
  background: rgba(255, 193, 7, 0.1);
  border-color: #ffc107;
}

/* User info (logged in state) */
.user-info {
  display: none;
  align-items: center;
  gap: 15px;
}

.user-info.show {
  display: flex;
}

.auth-buttons.hide {
  display: none;
}

.user-avatar-link {
  text-decoration: none;
  transition: transform 0.2s;
}
.user-avatar-link:hover {
  transform: scale(1.1);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #0a0a1a;
  cursor: pointer;
}

.user-name {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
}

.logout-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #8892b0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(233, 69, 96, 0.2);
  border-color: #e94560;
  color: #e94560;
}

.guest-badge {
  display: none;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.guest-badge.show {
  display: inline-block;
}

.user-avatar.guest {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #8892b0;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #8892b0;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #4facfe;
  background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder {
  color: #5a6178;
}

.form-error {
  color: #e94560;
  font-size: 13px;
  margin-top: 5px;
  display: none;
}

.form-error.show {
  display: block;
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border: none;
  border-radius: 10px;
  color: #0a0a1a;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-switch {
  text-align: center;
  margin-top: 25px;
  color: #8892b0;
  font-size: 14px;
}

.modal-switch a {
  color: #4facfe;
  text-decoration: none;
  font-weight: 500;
}

.modal-switch a:hover {
  text-decoration: underline;
}

.alert {
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.alert.show {
  display: block;
}

.alert.error {
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: #e94560;
}

.alert.success {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #00f2fe;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 20px;
  padding-top: 10px;
}

.logo-container {
  margin-bottom: 20px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #4facfe 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

.subtitle {
  color: #8892b0;
  font-size: 1rem;
  font-weight: 400;
}

.online-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  color: #00ff88;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Intro section */
.intro-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 25px 30px;
  margin-bottom: 30px;
  line-height: 1.8;
}

.intro-section p {
  color: #a8b2d1;
  font-size: 0.95rem;
}

/* Games grid - 3 columns layout (desktop) */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.game-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-radius: 20px;
  padding: 25px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 24px;
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 172, 254, 0.3);
  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.2),
    0 0 40px rgba(79, 172, 254, 0.1);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card > * {
  position: relative;
  z-index: 1;
}

/* Game icons */
.game-icon {
  font-size: 2.5rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.game-icon-img {
  width: 143px;
  height: 94px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.game-card h2 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.game-card .tagline {
  font-size: 0.8rem;
  color: #8892b0;
  margin-bottom: 12px;
}

.game-card .description {
  font-size: 0.85rem;
  color: #a8b2d1;
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
  text-align: center;
}

.game-card-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
}

.guide-link {
  font-size: 0.85rem;
  color: #4facfe;
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid rgba(79, 172, 254, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.guide-link:hover {
  background: rgba(79, 172, 254, 0.1);
  border-color: #4facfe;
}

/* Omok icon - realistic stones on wooden board */
.omok-icon {
  position: relative;
  width: 110px;
  height: 85px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(0,0,0,0.3) 49%, rgba(0,0,0,0.3) 51%, transparent 52%),
    linear-gradient(0deg, transparent 48%, rgba(0,0,0,0.3) 49%, rgba(0,0,0,0.3) 51%, transparent 52%),
    linear-gradient(135deg, #e8c896 0%, #d4a86a 50%, #c49a5a 100%);
  background-size: 22px 22px, 22px 22px, 100% 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.3);
  padding: 8px;
}

.omok-icon .stone {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.omok-icon .stone.black {
  background:
    radial-gradient(circle at 35% 25%, rgba(120,120,120,0.8) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 100%);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.6),
    inset 0 -2px 4px rgba(0,0,0,0.8),
    inset 0 2px 4px rgba(255,255,255,0.1);
}

.omok-icon .stone.white {
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, #f5f5f5 0%, #d0d0d0 100%);
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.4),
    inset 0 -2px 4px rgba(0,0,0,0.1),
    inset 0 2px 4px rgba(255,255,255,0.8);
}

.omok-icon .stone:nth-child(1) { top: 8px; left: 30px; }
.omok-icon .stone:nth-child(2) { top: 18px; left: 52px; }
.omok-icon .stone:nth-child(3) { top: 32px; left: 22px; }
.omok-icon .stone:nth-child(4) { top: 38px; left: 58px; }
.omok-icon .stone:nth-child(5) { top: 50px; left: 40px; }

/* Janggi icon - realistic octagonal wooden pieces */
.janggi-icon {
  position: relative;
  width: 130px;
  height: 85px;
}

.janggi-piece {
  position: absolute;
  width: 48px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  font-family: 'Noto Serif KR', serif;
  /* Octagonal shape */
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4) 0%, transparent 50%),
    linear-gradient(180deg, #f5e6c8 0%, #d4b896 30%, #c4a070 70%, #a08050 100%);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.3);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.janggi-piece::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  border: 2px solid;
  border-radius: 2px;
}

.janggi-piece.cho {
  color: #004d00;
}

.janggi-piece.cho::before {
  border-color: #006400;
}

.janggi-piece.han {
  color: #8b0000;
}

.janggi-piece.han::before {
  border-color: #a00000;
}

.janggi-piece:nth-child(1) { left: 0; top: 18px; z-index: 1; transform: rotate(-5deg); }
.janggi-piece:nth-child(2) { left: 40px; top: 5px; z-index: 2; }
.janggi-piece:nth-child(3) { left: 80px; top: 22px; z-index: 1; transform: rotate(5deg); }

/* Chess card image */
.chess-card-img {
  width: 143px;
  height: 94px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Chess icon - ivory carved pieces style */
.chess-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark wooden board background */
.chess-icon::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 80px;
  background:
    linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 50%),
    repeating-conic-gradient(
      from 0deg at 20px 20px,
      #2a2218 0deg 90deg,
      #1a1510 90deg 180deg
    );
  background-size: 100% 100%, 40px 40px;
  border-radius: 4px;
  box-shadow:
    0 8px 25px rgba(0,0,0,0.7),
    inset 0 1px 2px rgba(255,255,255,0.1);
  border: 3px solid #3a3025;
}

/* Ivory chess pieces - Knight */
.chess-icon .chess-piece {
  position: absolute;
  z-index: 2;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.8));
}

.chess-icon .chess-piece.knight {
  left: 8px;
  top: 12px;
  width: 28px;
  height: 52px;
}
.chess-icon .chess-piece.knight .piece-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f0e6 0%, #e8dcc8 30%, #d4c4a8 60%, #c8b898 100%);
  clip-path: polygon(
    50% 0%, 70% 5%, 85% 15%, 90% 30%, 85% 45%, 75% 55%,
    80% 65%, 75% 75%, 70% 85%, 80% 90%, 85% 95%, 80% 100%,
    20% 100%, 15% 95%, 20% 90%, 30% 85%, 25% 75%, 20% 65%,
    25% 55%, 15% 45%, 10% 30%, 15% 15%, 30% 5%
  );
  box-shadow: inset 2px 2px 8px rgba(255,255,255,0.6), inset -2px -2px 8px rgba(0,0,0,0.15);
}

/* Ivory chess pieces - Queen */
.chess-icon .chess-piece.queen {
  left: 52px;
  top: 8px;
  width: 26px;
  height: 56px;
}
.chess-icon .chess-piece.queen .piece-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f0e6 0%, #e8dcc8 30%, #d4c4a8 60%, #c8b898 100%);
  border-radius: 50% 50% 20% 20% / 15% 15% 10% 10%;
  box-shadow: inset 2px 2px 8px rgba(255,255,255,0.6), inset -2px -2px 8px rgba(0,0,0,0.15);
}
.chess-icon .chess-piece.queen .piece-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 18px;
  background: linear-gradient(135deg, #f5f0e6 0%, #d4c4a8 100%);
  clip-path: polygon(10% 100%, 0% 50%, 20% 0%, 35% 60%, 50% 0%, 65% 60%, 80% 0%, 100% 50%, 90% 100%);
}
.chess-icon .chess-piece.queen .piece-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 8px;
  background: linear-gradient(180deg, #d4c4a8 0%, #c8b898 100%);
  border-radius: 2px;
}

/* Ivory chess pieces - King */
.chess-icon .chess-piece.king {
  left: 88px;
  top: 6px;
  width: 28px;
  height: 58px;
}
.chess-icon .chess-piece.king .piece-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f0e6 0%, #e8dcc8 30%, #d4c4a8 60%, #c8b898 100%);
  border-radius: 40% 40% 20% 20% / 20% 20% 10% 10%;
  box-shadow: inset 2px 2px 8px rgba(255,255,255,0.6), inset -2px -2px 8px rgba(0,0,0,0.15);
}
.chess-icon .chess-piece.king .piece-body::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 14px;
  background: linear-gradient(135deg, #f5f0e6 0%, #d4c4a8 100%);
  border-radius: 2px;
}
.chess-icon .chess-piece.king .piece-body::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 4px;
  background: linear-gradient(135deg, #f5f0e6 0%, #d4c4a8 100%);
  border-radius: 2px;
}

/* Rook piece */
.chess-icon .chess-piece.rook {
  left: 112px;
  top: 20px;
  width: 18px;
  height: 44px;
}
.chess-icon .chess-piece.rook .piece-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f0e6 0%, #e8dcc8 30%, #d4c4a8 60%, #c8b898 100%);
  clip-path: polygon(
    15% 0%, 15% 15%, 0% 15%, 0% 25%, 15% 25%, 15% 85%,
    5% 90%, 5% 100%, 95% 100%, 95% 90%, 85% 85%, 85% 25%,
    100% 25%, 100% 15%, 85% 15%, 85% 0%, 60% 0%, 60% 15%,
    40% 15%, 40% 0%
  );
  box-shadow: inset 2px 2px 8px rgba(255,255,255,0.6), inset -2px -2px 8px rgba(0,0,0,0.15);
}

/* Holdem icon - realistic playing cards */
.holdem-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Green felt table background */
.holdem-icon::before {
  content: '';
  position: absolute;
  width: 125px;
  height: 80px;
  background: radial-gradient(ellipse at 50% 50%, #1a6b35 0%, #0d4d22 100%);
  border-radius: 40px;
  border: 4px solid #5c3d2e;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

.holdem-icon .card-img {
  position: absolute;
  width: 42px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0,0,0,0.3);
  z-index: 2;
}

.holdem-icon .card-img:nth-child(1) {
  left: 8px;
  top: 14px;
  transform: rotate(-15deg);
  z-index: 1;
}

.holdem-icon .card-img:nth-child(2) {
  left: 44px;
  top: 8px;
  transform: rotate(0deg);
  z-index: 3;
}

.holdem-icon .card-img:nth-child(3) {
  left: 80px;
  top: 14px;
  transform: rotate(15deg);
  z-index: 2;
}

/* Pool icon - triangle rack formation */
.pool-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Green felt table background */
.pool-icon::before {
  content: '';
  position: absolute;
  width: 125px;
  height: 80px;
  background: radial-gradient(ellipse at 50% 50%, #1a6b35 0%, #0d4d22 100%);
  border-radius: 8px;
  border: 4px solid #5c3d2e;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.4);
}

/* Ball rack container */
.ball-rack {
  position: absolute;
  width: 70px;
  height: 65px;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.pool-ball {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow:
    0 4px 8px rgba(0,0,0,0.6),
    0 1px 2px rgba(0,0,0,0.4),
    inset -4px -4px 8px rgba(0,0,0,0.4),
    inset 4px 4px 8px rgba(255,255,255,0.4);
}

/* Number circle on balls - 3D effect */
.pool-ball::before {
  content: attr(data-num);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: radial-gradient(circle at 40% 35%, #fff 0%, #f0f0f0 60%, #ddd 100%);
  border-radius: 50%;
  font-size: 7px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* Highlight on all balls */
.pool-ball::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 6px;
  height: 5px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.9) 0%, transparent 70%);
  border-radius: 50%;
}

/* Solid balls with 3D gradient */
.ball-1 {
  background: radial-gradient(circle at 30% 25%, #ffff66 0%, #ffdd00 40%, #ccaa00 100%);
  top: 0; left: 26px;
}
.ball-2 {
  background: radial-gradient(circle at 30% 25%, #4488ff 0%, #0055cc 40%, #003399 100%);
  top: 10px; left: 16px;
}
.ball-3 {
  background: radial-gradient(circle at 30% 25%, #ff4444 0%, #cc0000 40%, #990000 100%);
  top: 10px; left: 36px;
}
.ball-4 {
  background: radial-gradient(circle at 30% 25%, #9944dd 0%, #6600aa 40%, #440077 100%);
  top: 20px; left: 6px;
}
.ball-5 {
  background: radial-gradient(circle at 30% 25%, #ff9944 0%, #ff6600 40%, #cc4400 100%);
  top: 20px; left: 26px;
}
.ball-6 {
  background: radial-gradient(circle at 30% 25%, #22bb66 0%, #008844 40%, #005522 100%);
  top: 20px; left: 46px;
}
.ball-7 {
  background: radial-gradient(circle at 30% 25%, #bb4444 0%, #880000 40%, #550000 100%);
  top: 30px; left: -4px;
}
.ball-8 {
  background: radial-gradient(circle at 30% 25%, #555 0%, #222 40%, #000 100%);
  top: 30px; left: 16px;
}

/* Stripe balls with white band and 3D */
.ball-9 {
  background:
    linear-gradient(180deg,
      transparent 0%, transparent 25%,
      rgba(255,255,255,0.95) 25%, rgba(255,255,255,0.95) 75%,
      transparent 75%, transparent 100%),
    radial-gradient(circle at 30% 25%, #ffff66 0%, #ffdd00 40%, #ccaa00 100%);
  top: 30px; left: 36px;
}
.ball-10 {
  background:
    linear-gradient(180deg,
      transparent 0%, transparent 25%,
      rgba(255,255,255,0.95) 25%, rgba(255,255,255,0.95) 75%,
      transparent 75%, transparent 100%),
    radial-gradient(circle at 30% 25%, #4488ff 0%, #0055cc 40%, #003399 100%);
  top: 30px; left: 56px;
}

/* Cue ball - glossy white */
.cue-ball {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 30% 25%, #fff 0%, #f5f5f5 30%, #ddd 70%, #ccc 100%);
  border-radius: 50%;
  box-shadow:
    0 4px 10px rgba(0,0,0,0.5),
    0 1px 3px rgba(0,0,0,0.3),
    inset -3px -3px 8px rgba(0,0,0,0.15),
    inset 3px 3px 8px rgba(255,255,255,1);
  z-index: 2;
}
.cue-ball::before { display: none; }
.cue-ball::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 8px;
  height: 6px;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.95) 0%, transparent 70%);
  border-radius: 50%;
}

/* Gostop icon - realistic hwatu cards */
.gostop-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gostop-icon .hwatu-img {
  position: absolute;
  width: 36px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.gostop-icon .hwatu-img:nth-child(1) {
  left: 18px;
  top: 10px;
  transform: rotate(-15deg);
  z-index: 1;
}

.gostop-icon .hwatu-img:nth-child(2) {
  left: 48px;
  top: 4px;
  transform: rotate(0deg);
  z-index: 3;
}

.gostop-icon .hwatu-img:nth-child(3) {
  left: 78px;
  top: 10px;
  transform: rotate(15deg);
  z-index: 2;
}

/* Yut icon */
.yut-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.yut-icon .yut-stick {
  width: 18px;
  height: 70px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  position: relative;
}

.yut-icon .yut-stick.front {
  background: linear-gradient(90deg, #d4a574 0%, #f5e6d3 30%, #fff8f0 50%, #f5e6d3 70%, #d4a574 100%);
  border: 1px solid #a67c52;
}

.yut-icon .yut-stick.back {
  background: linear-gradient(90deg, #4a2c0f 0%, #6b3d1a 50%, #4a2c0f 100%);
  border: 1px solid #3d2409;
}

.yut-icon .yut-stick:nth-child(1) { transform: rotate(-12deg); }
.yut-icon .yut-stick:nth-child(2) { transform: rotate(-4deg); }
.yut-icon .yut-stick:nth-child(3) { transform: rotate(4deg); }
.yut-icon .yut-stick:nth-child(4) { transform: rotate(12deg); }

/* Fishing icon */
.fishing-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  background: linear-gradient(180deg, #87CEEB 0%, #1a5f7a 60%, #0d4d5e 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(26, 95, 122, 0.4);
  overflow: hidden;
}

.fishing-icon::before {
  content: '🐟';
  position: absolute;
  font-size: 24px;
  bottom: 12px;
  left: 20px;
  opacity: 0.7;
  animation: fishSwim 3s ease-in-out infinite;
}

.fishing-icon::after {
  content: '🐠';
  position: absolute;
  font-size: 18px;
  bottom: 18px;
  right: 25px;
  opacity: 0.6;
  animation: fishSwim 2.5s ease-in-out infinite reverse;
}

@keyframes fishSwim {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

.game-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.game-card p {
  color: #8892b0;
  margin-bottom: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.play-btn {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #0a0a1a;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.game-card:hover .play-btn {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(79, 172, 254, 0.5);
}

/* Footer */
footer {
  text-align: center;
  color: #5a6178;
  padding: 30px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  line-height: 1.8;
}

footer a {
  color: #4facfe;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #00f2fe;
}

.footer-links {
  margin-bottom: 15px;
}

.footer-links a {
  margin: 0 15px;
}

.footer-disclaimer {
  color: #3d4250;
  font-size: 0.8rem;
  max-width: 600px;
  margin: 15px auto 0;
}

.footer-contact {
  color: #5a6178;
  font-size: 0.85rem;
  margin-top: 15px;
}

/* Ad container */
.ad-container {
  width: 100%;
  max-width: 728px;
  margin: 30px auto;
  text-align: center;
  min-height: 90px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

@media (max-width: 768px) {
  .ad-container {
    max-width: 320px;
    min-height: 100px;
  }
}

/* Hamburger menu for lobby */
.hamburger-btn {
  display: block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Side Menu */
.side-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}
.side-menu-overlay.active {
  display: block;
}
.side-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border-left: 1px solid rgba(79, 172, 254, 0.3);
  z-index: 9999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.side-menu.active {
  right: 0;
}
.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(79, 172, 254, 0.1);
}
.side-menu-header h3 {
  margin: 0;
  color: #4facfe;
  font-size: 1.1rem;
}
.side-menu-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}
.side-menu-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.side-menu-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  color: #8892b0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.side-menu-tab.active {
  color: #4facfe;
  background: rgba(79, 172, 254, 0.1);
  border-bottom: 2px solid #4facfe;
}
.side-menu-tab .badge {
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.side-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.side-menu-panel {
  display: none;
}
.side-menu-panel.active {
  display: block;
}
.side-menu-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.side-menu-logout-btn {
  width: 100%;
  padding: 12px;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: 8px;
  color: #e74c3c;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.side-menu-logout-btn:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: #e74c3c;
}
.friend-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.friend-search input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
}
.friend-search input::placeholder {
  color: #666;
}
.friend-search button {
  padding: 10px 16px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  border: none;
  border-radius: 8px;
  color: #0a0a1a;
  font-weight: 600;
  cursor: pointer;
}
.friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: background 0.2s;
}
.friend-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}
.friend-info {
  flex: 1;
}
.friend-name {
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
}
.friend-status {
  font-size: 0.75rem;
  color: #8892b0;
}
.friend-status.online {
  color: #2ecc71;
}
.friend-actions {
  display: flex;
  gap: 4px;
}
.friend-actions button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.btn-accept {
  background: #2ecc71;
  color: #fff;
}
.btn-reject {
  background: #e74c3c;
  color: #fff;
}
.btn-remove {
  background: rgba(255, 255, 255, 0.1);
  color: #e74c3c;
}
.btn-add {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: #0a0a1a;
}
.btn-invite {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  font-size: 0.9rem;
}
.friend-avatar.online {
  box-shadow: 0 0 0 3px #2ecc71;
}
/* Invite Modal */
.invite-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.invite-modal-overlay.active {
  display: flex;
}
.invite-modal {
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 1px solid rgba(79, 172, 254, 0.3);
  border-radius: 16px;
  padding: 24px;
  width: 320px;
  max-width: 90vw;
}
.invite-modal h3 {
  margin: 0 0 20px;
  color: #fff;
  text-align: center;
}
.invite-games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.invite-game-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.invite-game-btn:hover {
  background: rgba(79, 172, 254, 0.2);
  border-color: #4facfe;
}
.invite-game-btn .icon {
  font-size: 2rem;
}
.invite-game-btn .name {
  font-size: 0.9rem;
}
.invite-modal-close {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #8892b0;
  cursor: pointer;
}
/* Invite Notification */
.invite-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  animation: slideInRight 0.3s ease;
  max-width: 300px;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.invite-notification h4 {
  margin: 0 0 8px;
  color: #fff;
}
.invite-notification p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}
.invite-notification-actions {
  display: flex;
  gap: 8px;
}
.invite-notification-actions button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.invite-accept {
  background: #2ecc71;
  color: #fff;
}
.invite-decline {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.empty-message {
  text-align: center;
  color: #8892b0;
  padding: 30px 10px;
  font-size: 0.9rem;
}
.login-required {
  text-align: center;
  padding: 40px 20px;
  color: #8892b0;
}
.login-required button {
  margin-top: 15px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  border: none;
  border-radius: 8px;
  color: #0a0a1a;
  font-weight: 600;
  cursor: pointer;
}

/* Responsive - Tablet (820px) - Mobile layout starts here */
@media (max-width: 820px) {
  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .game-card {
    padding: 20px 15px;
  }

  .game-icon {
    height: 70px;
    transform: scale(0.8);
  }

  .game-icon-img,
  .chess-card-img {
    width: 114px;
    height: 75px;
  }

  .game-card h2 {
    font-size: 1.1rem;
  }

  .game-card .tagline {
    font-size: 0.75rem;
  }

  .game-card .description {
    font-size: 0.85rem;
  }

  .game-card-footer {
    flex-wrap: wrap;
  }

  .play-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .guide-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .intro-section {
    padding: 20px;
  }

  .intro-section p {
    font-size: 0.9rem;
  }

  .auth-buttons {
    gap: 6px;
  }

  .auth-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .auth-btn.guest {
    display: none;
  }

  /* Pool table smaller on mobile */
  .pool-icon::before {
    width: 100px;
    height: 60px;
  }

  .pool-ball {
    width: 14px;
    height: 14px;
  }

  .pool-ball::before {
    width: 8px;
    height: 8px;
    font-size: 5px;
  }

  .pool-ball::after {
    width: 4px;
    height: 3px;
  }

  .cue-ball {
    width: 16px;
    height: 16px;
  }

  .poker-chip {
    width: 22px;
    height: 22px;
  }
}

/* Responsive - Small Mobile (550px) */
@media (max-width: 550px) {
  .lang-select {
    width: 50px;
    padding: 8px 8px;
    text-overflow: clip;
    overflow: hidden;
  }
}

/* Responsive - Mobile (480px) */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  header {
    margin-bottom: 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .games-grid {
    gap: 12px;
  }

  .game-card {
    padding: 15px 12px;
  }

  .game-icon {
    height: 60px;
    transform: scale(0.7);
  }

  .game-icon-img,
  .chess-card-img {
    width: 100px;
    height: 66px;
  }

  .game-card h2 {
    font-size: 1rem;
  }

  .game-card .tagline {
    font-size: 0.7rem;
  }

  .game-card .description {
    font-size: 0.8rem;
  }

  .play-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .guide-link {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .intro-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .intro-section p {
    font-size: 0.85rem;
  }
}
