/* ==========================================================================
   BoardWorld (보드월드) - Bright, Cheerful & Fun Party Board Game Theme
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Dongle:wght@700&display=swap');

:root {
  /* Bright, Vibrant Party Palette */
  --bg-primary: #f0f4fd;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --border-color: #e2e8f0;
  --border-glow: #cbd5e1;

  --accent-gold: #ff9f1c;
  --accent-yellow: #ffd166;
  --accent-cyan: #06d6a0;
  --accent-blue: #3a86ff;
  --accent-purple: #8338ec;
  --accent-pink: #ff006e;
  --accent-emerald: #10b981;
  --accent-rose: #ef476f;
  --accent-orange: #fb5607;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --shadow-toy: 0 8px 0 rgba(0, 0, 0, 0.08), 0 15px 25px rgba(58, 134, 255, 0.1);
  --shadow-card: 0 10px 25px -5px rgba(100, 116, 139, 0.12), 0 8px 10px -6px rgba(100, 116, 139, 0.08);
  --shadow-float: 0 20px 35px -10px rgba(255, 159, 28, 0.3);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  word-break: keep-all;
}

body {
  background: radial-gradient(circle at 10% 20%, #e0e7ff 0%, #f0fdf4 40%, #fef3c7 90%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.5);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 28px;
  background: linear-gradient(135deg, #ffd166, #ff006e);
  padding: 5px 7px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(255, 0, 110, 0.25);
  animation: bounceLogo 2.5s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes bounceLogo {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(5deg); }
}

.logo-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ff006e, #8338ec, #3a86ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-badge {
  font-size: 11px;
  font-weight: 900;
  background: #ffbe0b;
  color: #78350f;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 5px rgba(255, 190, 11, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.version-badge {
  font-size: 11px;
  font-weight: 900;
  background: #e0e7ff;
  color: #3730a3;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1.5px solid #c7d2fe;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 2px solid #e2e8f0;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.user-profile-badge:hover {
  border-color: var(--accent-blue);
  transform: scale(1.04);
  box-shadow: 0 6px 15px rgba(58, 134, 255, 0.15);
}

.user-avatar {
  font-size: 20px;
  flex-shrink: 0;
}

.user-nickname {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.btn-auth-switch {
  background: #f1f5f9;
  border: none;
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  cursor: pointer;
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Chunky, Toy-like 3D Arcade Buttons
   ========================================================================== */
.btn-arcade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 900;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
}

.btn-arcade:active {
  transform: translateY(4px);
}

.btn-arcade-gold {
  background: linear-gradient(180deg, #ffb703 0%, #fb8500 100%);
  color: #fff;
  box-shadow: 0 5px 0 #c25e00, 0 10px 20px rgba(251, 133, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-arcade-gold:active {
  box-shadow: 0 1px 0 #c25e00;
}

.btn-arcade-primary {
  background: linear-gradient(180deg, #4895ef 0%, #3f37c9 100%);
  color: white;
  box-shadow: 0 5px 0 #2b2496, 0 10px 20px rgba(67, 97, 238, 0.3);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.btn-arcade-primary:active {
  box-shadow: 0 1px 0 #2b2496;
}

.btn-arcade-emerald {
  background: linear-gradient(180deg, #2ec4b6 0%, #009688 100%);
  color: white;
  box-shadow: 0 5px 0 #00695c, 0 10px 20px rgba(0, 150, 136, 0.3);
}
.btn-arcade-emerald:active {
  box-shadow: 0 1px 0 #00695c;
}

.btn-arcade-rose {
  background: linear-gradient(180deg, #ff4d6d 0%, #c9184a 100%);
  color: white;
  box-shadow: 0 5px 0 #800f2f, 0 10px 20px rgba(201, 24, 74, 0.3);
}
.btn-arcade-rose:active {
  box-shadow: 0 1px 0 #800f2f;
}

.btn-arcade-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 0 #cbd5e1;
}
.btn-arcade-secondary:active {
  box-shadow: 0 1px 0 #cbd5e1;
}

/* Cards & Panels */
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border: 3px solid #ffbe0b;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Form inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 700;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.15);
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .container {
    padding: 0 10px;
  }
  
  .navbar {
    padding: 8px 0;
  }

  .nav-content {
    gap: 6px;
  }

  .logo-brand {
    gap: 6px;
  }

  .logo-icon {
    font-size: 20px;
    padding: 3px 5px;
    border-radius: 10px;
  }

  .logo-title {
    font-size: 16px;
  }

  .logo-badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  .version-badge {
    font-size: 9px;
    padding: 2px 5px;
  }

  .user-profile-badge {
    padding: 4px 8px;
    gap: 4px;
    max-width: 120px;
  }

  .user-avatar {
    font-size: 16px;
  }

  .user-nickname {
    font-size: 11px;
    max-width: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .btn-auth-switch {
    display: none !important;
  }

  .btn-arcade {
    padding: 8px 12px;
    font-size: 12px;
  }

  .card-glass {
    padding: 14px;
  }

  .rank-btn-label {
    display: none;
  }

  /* Modal Mobile Optimization */
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-card {
    padding: 20px 16px;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    margin: auto;
  }

  .modal-header {
    margin-bottom: 14px;
  }

  .modal-title {
    font-size: 17px;
  }

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

  .form-input, .form-select {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .logo-title {
    font-size: 14px;
  }

  .btn-arcade {
    padding: 7px 10px;
    font-size: 11px;
  }
}
