/* main.css - Index page styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables - Dark Mode (Default) */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #0f3460;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --text-primary: #fff;
  --text-secondary: #aaa;
}

/* CSS Variables - Light Mode */
body.theme-light {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: #e8ecf0;
  --accent: #e94560;
  --accent-hover: #d63050;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
}

/* CSS Variables - Art Deco Theme */
body.theme-artdeco {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-card: #1c2541;
  --accent: #d4af37;
  --accent-hover: #f4d35e;
  --text-primary: #f5f0e1;
  --text-secondary: #e8dcc8;
}

/* CSS Variables - Nordic Theme */
body.theme-nordic {
  --bg-primary: #fafbfc;
  --bg-secondary: #e8eef4;
  --bg-card: #ffffff;
  --accent: #166534;
  --accent-hover: #22c55e;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  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, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

body.theme-light .bg-animation {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(79, 172, 254, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(233, 69, 96, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

body.theme-artdeco .bg-animation {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

body.theme-nordic .bg-animation {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
}

/* Nordic theme - UI adjustments for light background */
body.theme-nordic .game-card {
  background: #ffffff;
  border: 1px solid #d1dce6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.theme-nordic .game-card:hover {
  border-color: #166534;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.theme-nordic .game-card h2 {
  color: #1e293b;
}

body.theme-nordic .game-card .tagline,
body.theme-nordic .game-card .description,
body.theme-nordic .game-card p {
  color: #64748b;
}

body.theme-nordic .hamburger-btn {
  background: rgba(30, 41, 59, 0.1);
  border-color: rgba(30, 41, 59, 0.2);
  color: #1e293b;
}

body.theme-nordic .hamburger-btn:hover {
  background: rgba(30, 41, 59, 0.2);
}

body.theme-nordic .login-btn,
body.theme-nordic .top-bar button {
  color: #1e293b;
}

body.theme-nordic .guest-btn {
  background: rgba(30, 41, 59, 0.1);
  border-color: rgba(30, 41, 59, 0.2);
  color: #1e293b;
}

body.theme-nordic .register-btn {
  background: #166534;
  color: #ffffff;
}

body.theme-nordic .online-count {
  background: rgba(22, 101, 52, 0.1);
  border-color: rgba(22, 101, 52, 0.3);
  color: #166534;
}

body.theme-nordic .settings-btn {
  color: #64748b;
}

body.theme-nordic .settings-btn:hover {
  color: #1e293b;
}

body.theme-nordic .lang-select {
  background: rgba(30, 41, 59, 0.1);
  border-color: rgba(30, 41, 59, 0.2);
  color: #1e293b;
}

body.theme-nordic .lang-select:hover {
  background: rgba(30, 41, 59, 0.15);
}

body.theme-nordic .lang-select option {
  background: #ffffff;
  color: #1e293b;
}

.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;
  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:not([type="checkbox"]) {
  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;
}

/* Settings Modal */
.settings-modal {
  max-width: 340px;
  padding: 24px;
}

.settings-header {
  text-align: center;
  margin-bottom: 24px;
}

.settings-header .settings-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.setting-icon {
  font-size: 1.1rem;
}

.setting-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.setting-select:hover {
  border-color: rgba(79, 172, 254, 0.5);
}

.setting-select:focus {
  border-color: #4facfe;
  box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.2);
}

.setting-select option {
  background: #1a1a2e;
  color: #eee;
}

/* Nordic theme settings modal */
body.theme-nordic .settings-modal {
  background: #ffffff;
  border-color: #d1dce6;
}

body.theme-nordic .settings-header h2 {
  background: linear-gradient(135deg, #166534 0%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-nordic .setting-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.theme-nordic .setting-select {
  background: #ffffff;
  border-color: #d1dce6;
  color: #1e293b;
}

body.theme-nordic .setting-select option {
  background: #ffffff;
  color: #1e293b;
}

body.theme-nordic .modal-close {
  color: #64748b;
}

body.theme-nordic .modal-close:hover {
  color: #1e293b;
}

/* Light theme settings modal */
body.theme-light .settings-modal {
  background: #ffffff;
  border-color: #e8ecf0;
}

body.theme-light .setting-item {
  background: #f5f7fa;
  border-color: #e8ecf0;
}

body.theme-light .setting-select {
  background: #ffffff;
  border-color: #d1d5db;
  color: #1a1a2e;
}

body.theme-light .setting-select option {
  background: #ffffff;
  color: #1a1a2e;
}

body.theme-light .modal-close {
  color: #666;
}

body.theme-light .modal-close:hover {
  color: #1a1a2e;
}

.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;
  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: 20px 20px;
  margin-bottom: 20px;
  line-height: 1.8;
}

.intro-section p {
  color: #a8b2d1;
  font-size: 1.1rem;
}

/* Mobile-only: intro + maker row wrapper */
.intro-maker-row {
  display: block; /* PC: intro-section만 표시 (블록으로 쌓임) */
  margin-bottom: 0;
}

/* Mobile-only boxes: PC에서 숨기기 */
.mobile-maker-box,
.mobile-notice-box {
  display: none;
}

/* Page wrapper with sidebar outside container */
.page-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrapper .container {
  flex: 1;
  max-width: 1000px;
}

.ad-sidebar-left {
  width: 160px;
  min-width: 160px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  margin-top: 200px;
}

.ad-sidebar-main {
  width: 160px;
  min-width: 160px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  margin-top: 200px;
}

.notice-sidebar-left {
  width: 160px;
  min-width: 160px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
  margin-top: 200px;
}

.notice-sidebar-link {
  display: block;
  text-decoration: none;
}

.notice-sidebar-placeholder {
  width: 160px;
  height: 600px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.2s ease;
}

.notice-sidebar-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.notice-sidebar-link:hover .notice-sidebar-placeholder {
  border-color: rgba(79, 172, 254, 0.5);
  box-shadow: 0 6px 20px rgba(79, 172, 254, 0.18);
  color: var(--text-primary);
}

.notice-sidebar-title {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.notice-sidebar-title:hover {
  color: #4facfe;
}

.notice-sidebar-list {
  display: grid;
  gap: 7px;
  text-align: center;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.notice-sidebar-list::-webkit-scrollbar {
  width: 5px;
}

.notice-sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.notice-sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.notice-sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 172, 254, 0.4);
}

.notice-sidebar-maker {
  margin-top: 15px;
  padding: 15px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.notice-sidebar-maker-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.notice-sidebar-maker-link {
  display: inline-block;
  text-decoration: none;
  border: 1px solid rgba(79, 172, 254, 0.45);
  background: rgba(79, 172, 254, 0.12);
  color: #9ed3ff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  width: 100%;
  transition: all 0.2s ease;
}

.notice-sidebar-maker-link:hover {
  color: #d7ecff;
  border-color: rgba(79, 172, 254, 0.7);
  background: rgba(79, 172, 254, 0.2);
}

.notice-sidebar-item {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.4;
  padding: 7px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.notice-sidebar-item:hover {
  color: var(--text-primary);
  border-color: rgba(79, 172, 254, 0.35);
  background: rgba(79, 172, 254, 0.08);
}

.notice-sidebar-item-date {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  opacity: 0.75;
}

.notice-sidebar-empty {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.ad-affiliate {
  font-size: 9px;
  color: var(--text-secondary);
  opacity: 0.5;
  text-align: center;
  padding: 6px 2px;
  line-height: 1.3;
  word-break: keep-all;
  max-width: 160px;
}

/* 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: 145px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.game-icon-img {
  width: 215px;
  height: 141px;
  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;
  flex-direction: column;
  gap: 8px;
  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;
}

.card-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.card-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

/* Silver button (Guide) */
.btn-silver {
  background: linear-gradient(180deg, #e8e8e8 0%, #b8b8b8 50%, #a0a0a0 100%);
  color: #333;
  border: 1px solid #888;
  box-shadow: 0 3px 0 #707070, 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-silver:hover {
  background: linear-gradient(180deg, #f0f0f0 0%, #c8c8c8 50%, #b0b0b0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #707070, 0 5px 8px rgba(0, 0, 0, 0.3);
}

.btn-silver:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #707070, 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Gold button (Board) */
.btn-gold {
  background: linear-gradient(180deg, #ffd700 0%, #daa520 50%, #b8860b 100%);
  color: #4a3000;
  border: 1px solid #8b6914;
  box-shadow: 0 3px 0 #8b6914, 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(180deg, #ffe44d 0%, #e6b800 50%, #cc9900 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #8b6914, 0 5px 8px rgba(0, 0, 0, 0.3);
}

.btn-gold:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8b6914, 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* 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: 215px;
  height: 141px;
  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);
}

/* 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%;
}

/* 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);
  }
}

/* Territory (Dots and Boxes) icon */
.territory-icon {
  position: relative;
  width: 130px;
  height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.territory-grid {
  display: grid;
  grid-template-columns: 12px 35px 12px;
  grid-template-rows: 12px 35px 12px;
  gap: 0;
}

.territory-dot {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.territory-line {
  background: rgba(108, 92, 231, 0.8);
  border-radius: 3px;
}

.territory-line.h {
  width: 35px;
  height: 6px;
  align-self: center;
}

.territory-line.v {
  width: 6px;
  height: 35px;
  justify-self: center;
}

.territory-box {
  width: 35px;
  height: 35px;
  border-radius: 4px;
}

.territory-box.filled {
  background: rgba(231, 76, 60, 0.4);
  border: 2px solid rgba(231, 76, 60, 0.6);
  animation: territoryPulse 2s ease-in-out infinite;
}

@keyframes territoryPulse {

  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

.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: 14px 50px;
  background: linear-gradient(180deg, #5fbfff 0%, #4facfe 50%, #2d8fe0 100%);
  color: #0a0a1a;
  border-radius: 29px;
  font-weight: 600;
  font-size: 1.22rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid #1a7ac7;
  box-shadow: 0 4px 0 #1a6bb0, 0 5px 8px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.play-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: playBtnShine 2.5s ease-in-out infinite;
}

@keyframes playBtnShine {
  0% {
    left: -100%;
  }

  50%,
  100% {
    left: 150%;
  }
}

.play-btn:hover {
  background: linear-gradient(180deg, #7dcfff 0%, #5fbfff 50%, #4facfe 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1a6bb0, 0 8px 12px rgba(0, 0, 0, 0.3);
}

.play-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1a6bb0, 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 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;
  }
}

/* Settings button for lobby */
.settings-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;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 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) {
  .page-wrapper {
    flex-direction: column;
    padding: 0;
  }

  .ad-sidebar-main,
  .ad-sidebar-left,
  .notice-sidebar-left {
    display: none;
  }

  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: 105px;
    transform: scale(1.0);
  }

  .game-icon-img,
  .chess-card-img {
    width: 171px;
    height: 113px;
  }

  .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: 12px 23px;
    font-size: 1.15rem;
  }

  .guide-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .intro-section {
    padding: 20px;
  }

  .intro-section p {
    font-size: 1.04rem;
  }

  /* 모바일/태블릿: 인트로 카드 높이 축소 (본문 2줄 + Maker 1줄) */
  .intro-maker-row .intro-section {
    padding: 14px 16px;
    min-height: 90px;
    position: relative;
    display: block;
  }

  .intro-maker-row .intro-section p:first-of-type {
    margin: 0;
    line-height: 1.5;
    font-size: 0.98rem;
    display: block;
    overflow: visible;
    padding-right: 0;
  }

  .intro-maker-row .intro-section .intro-signature {
    display: none;
  }

  /* 모바일: intro + maker 가로 배치 */
  .intro-maker-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
  }

  .intro-maker-row .intro-section {
    flex: 1;
    margin-bottom: 0;
  }

  /* 모바일 전용 Maker와의 대화 박스 */
  .mobile-maker-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    width: 110px;
    background: rgba(79, 172, 254, 0.06);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 10px;
    padding: 7px 6px;
    text-align: center;
    height: 90px;
    min-height: 90px;
    overflow: hidden;
  }

  .mobile-maker-box .notice-sidebar-maker-title {
    font-size: 14px;
    line-height: 1.3;
    margin: 0;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .mobile-maker-box .notice-sidebar-maker-link {
    font-size: 13px;
    line-height: 1.2;
    padding: 6px 8px;
  }

  /* 모바일 전용 공지사항 박스: 제목 왼쪽 세로 + 카드 가로 스크롤 */
  .mobile-notice-box {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
    margin-bottom: 16px;
  }

  .mobile-notice-box .notice-sidebar-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    flex-shrink: 0;
    align-self: center;
    font-size: 13px;
  }

  .mobile-notice-box .notice-sidebar-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 8px;
    width: 0;
    flex-grow: 1;
    text-align: left;
  }

  .mobile-notice-box .notice-sidebar-list::-webkit-scrollbar {
    display: none;
  }

  .mobile-notice-box .notice-sidebar-item {
    flex: 0 0 calc(50% - 4px);
    scroll-snap-align: start;
    border-radius: 8px;
    text-align: left;
    overflow: hidden;
    min-height: 88px;
    position: relative;
    display: block;
    padding: 7px 8px 8px;
  }

  .mobile-notice-box .notice-sidebar-item-title {
    display: block;
    line-height: 1.35;
    padding-right: 0;
  }

  .mobile-notice-box .notice-sidebar-item-date {
    display: none;
  }

  .mobile-fitted-lines .fit-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.35;
    min-height: 1.35em;
  }

  .mobile-fitted-lines .fit-line.fit-line-tail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-fitted-lines .fit-line.fit-line-tail .fit-left {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
  }

  .mobile-fitted-lines .fit-line.fit-line-tail .fit-tail {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .intro-maker-row .intro-section .mobile-fitted-lines .fit-line.fit-line-tail.intro-tail .fit-tail {
    font-size: 1em;
    opacity: 1;
  }

  .mobile-notice-box .notice-sidebar-item-title.mobile-fitted-lines .fit-line.fit-line-tail.notice-tail .fit-tail {
    font-size: 12px;
    opacity: 0.78;
  }

  .auth-buttons {
    gap: 6px;
  }

  .auth-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .auth-btn.guest {
    display: none;
  }

  /* Mobile header: show only avatar for logged-in user */
  .user-info {
    gap: 0;
  }

  .user-name,
  .guest-badge {
    display: none !important;
  }

  /* 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: 90px;
    transform: scale(1.0);
  }

  .game-icon-img,
  .chess-card-img {
    width: 150px;
    height: 99px;
  }

  .game-card h2 {
    font-size: 1rem;
  }

  .game-card .tagline {
    font-size: 0.7rem;
  }

  .game-card .description {
    font-size: 0.8rem;
  }

  .play-btn {
    padding: 9px 17px;
    font-size: 1.08rem;
    min-width: 140px;
  }

  .guide-link {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .card-btns {
    gap: 6px;
  }

  .card-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .intro-section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .intro-section p {
    font-size: 0.98rem;
  }

  .intro-maker-row .intro-section {
    min-height: 90px;
    padding: 12px 14px;
  }

  .intro-maker-row .intro-section p:first-of-type {
    padding-right: 0;
  }

  .intro-maker-row .intro-section .intro-signature {
    display: none;
  }

  .mobile-maker-box {
    width: 102px;
    height: 90px;
    min-height: 90px;
    padding: 6px 6px;
    gap: 3px;
  }

  .mobile-maker-box .notice-sidebar-maker-title {
    font-size: 13px;
    line-height: 1.25;
  }

  .mobile-maker-box .notice-sidebar-maker-link {
    font-size: 12px;
    line-height: 1.2;
    padding: 5px 7px;
  }

  .mobile-notice-box .notice-sidebar-item {
    min-height: 82px;
  }

  .mobile-notice-box .notice-sidebar-item-title {
    padding-right: 0;
  }

  .mobile-notice-box .notice-sidebar-item-date {
    display: none;
  }
}


/* Responsive Ads */
.ad-between-games {
  grid-column: 1 / -1;
  min-height: 90px;
}

@media (max-width: 768px) {
  .ad-pc-only {
    display: none !important;
  }

  .ad-between-games {
    display: none !important;
  }
}

/* PC: Ad after 3rd game (chess) */
@media (min-width: 769px) {
  .ad-mobile-only {
    display: none !important;
  }

  .games-grid .game-card:nth-of-type(1) {
    order: 1;
  }

  .games-grid .game-card:nth-of-type(2) {
    order: 2;
  }

  .games-grid .game-card:nth-of-type(3) {
    order: 3;
  }

  .games-grid .ad-between-games {
    order: 4;
  }

  .games-grid .game-card:nth-of-type(n+4) {
    order: 5;
  }
}
