/* Import Google Handwriting Fonts with Full Vietnamese Diacritics Support */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Mali:ital,wght@0,600;0,700;1,600&family=Patrick+Hand&family=Playpen+Sans:wght@600;700&display=swap');

/* Mobile Portrait App Frame & Custom Styling */
:root {
  --app-bg: #0d1117;
  --card-radius: 16px;
  --accent-gold: #fbbf24;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --ink-blue: #144ec8;
}

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

body {
  background-color: #090d16;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Mobile Frame Container (Portrait 9:16 optimized) */
.mobile-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  max-height: 960px;
  background-image: url('/asset/room_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

@media (min-width: 640px) {
  .mobile-container {
    height: 94vh;
    border-radius: 32px;
  }
}

.glass-card {
  background: rgba(24, 32, 54, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--card-radius);
}

/* 3D Card Flip Styles (Compact to prevent page scrolling) */
.card-perspective-container {
  perspective: 1200px;
  width: 185px;
  height: 248px;
  margin: 0 auto;
}

.flipper-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.65);
}

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

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px solid rgba(251, 191, 36, 0.35);
}

/* Front Card (Mặt trước - Thuần hình ảnh gốc, không bị chữ đè lên) */
.card-face-front {
  background-image: url('/asset/frontcard.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transform: rotateY(0deg);
}

/* Back Card (Mặt trong - Hiển thị từ khóa chữ viết tay mực xanh) */
.card-face-back {
  background-image: url('/asset/backbard.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transform: rotateY(180deg);
  border: 2px solid rgba(239, 68, 68, 0.4);
}

/* Handwriting Blue Ink Typography (Chữ viết tay mực xanh) */
.handwriting-ink-blue {
  font-family: 'Patrick Hand', 'Caveat', 'Mali', 'Segoe Print', cursive;
  color: #174ec8; /* Màu mực bút bi xanh truyền thống */
  font-size: 1.8rem;
  line-height: 1.25;
  font-weight: 700;
  text-shadow: 0 0 0.6px rgba(23, 78, 200, 0.45);
  letter-spacing: 0.5px;
  transform: rotate(-2deg);
  display: inline-block;
  word-break: break-word;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

/* Glowing text effects */
.text-glow-gold {
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.6), 0 0 20px rgba(251, 191, 36, 0.3);
}

.text-glow-red {
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.7), 0 0 20px rgba(239, 68, 68, 0.4);
}

.text-glow-blue {
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.7), 0 0 20px rgba(59, 130, 246, 0.4);
}

/* Custom Local Scrollbar for Players List */
.custom-scroll {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 191, 36, 0.45) rgba(15, 23, 42, 0.3);
}

.custom-scroll::-webkit-scrollbar {
  width: 4px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.45);
  border-radius: 4px;
}

/* Global scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Floating Badges */
.badge-spy {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-civilian {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #111827;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.btn-danger:active {
  transform: translateY(1px) scale(0.98);
}
