
/* =============================
   Mobile-only Balance Game UI
   - Ensure it never shows on desktop
   ============================= */
@media (min-width: 768px) {
  #mobileGameFab,
  #mobileGameHandle,
  #mobileGameModal {
    display: none !important;
  }
}

:root {
    --primary: #66bb8a;
    --primary-dark: #57a97b;
    --primary-light: #d5eee0;
    --accent: #4ade80;
}

* { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    background: linear-gradient(135deg, #f0fdf4 0%, #d5eee0 50%, #bbf7d0 100%);
    min-height: 100vh;
}

/* 로고 호버 효과 (뮤블라 스타일) */
.logo-hover {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.logo-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 187, 138, 0.3), transparent);
    transition: left 0.5s ease;
}

.logo-hover:hover::before {
    left: 100%;
}

.logo-hover:hover {
    background: rgba(102, 187, 138, 0.1);
    transform: scale(1.05) rotate(-2deg);
}

.logo-hover span {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.logo-hover:hover span {
    letter-spacing: 0.05em;
}

/* 네비게이션 탭 */
.nav-tab {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-tab:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-tab:hover::before {
    opacity: 1;
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 12px rgba(102, 187, 138, 0.3);
}

/* 언어 드롭다운 */
.lang-dropdown {
    display: none;
}
.lang-dropdown.active {
    display: block;
    max-height: 400px;  /* ← 추가 */
    overflow-y: auto;    /* ← 추가 */
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 187, 138, 0.3);
}

.guide-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.guide-card:hover {
    box-shadow: 0 4px 12px rgba(102, 187, 138, 0.15);
    transform: translateY(-2px);
}

.screenshot-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    min-height: 300px;
    max-height: 600px;
    position: relative;
    overflow: hidden;
}

.screenshot-placeholder img {
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center; /* 기본값: 중앙 */
    display: block;
    margin: 0 auto;
}

/* 이미지 위치 조정 클래스들 */
.img-position-top { object-position: top center; }
.img-position-bottom { object-position: bottom center; }
.img-position-left { object-position: center left; }
.img-position-right { object-position: center right; }
.img-position-top-left { object-position: top left; }
.img-position-top-right { object-position: top right; }
.img-position-bottom-left { object-position: bottom left; }
.img-position-bottom-right { object-position: bottom right; }

/* 이미지 크기 조정 클래스들 */
.img-cover { object-fit: cover; }
.img-contain { object-fit: contain; }
.img-fill { object-fit: fill; }

/* 주의사항 아코디언 */
.warning-accordion {
    background: white;
    border: 2px solid #fbbf24;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.warning-accordion:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.warning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    user-select: none;
}

.warning-icon {
    transition: transform 0.3s ease;
    color: #f59e0b;
}

.warning-accordion.active .warning-icon {
    transform: rotate(180deg);
}

.warning-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 1.5rem;
    background: #fffbeb;
}

.warning-accordion.active .warning-content {
    max-height: 400px;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.tip-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.highlight {
    background: linear-gradient(135deg, rgba(102, 187, 138, 0.1), rgba(102, 187, 138, 0.05));
    border: 1px solid var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* 밸런스 게임 스타일 */
.balance-option-btn {
    position: relative;
    z-index: 1;
    cursor: pointer;
    user-select: none;
}
.balance-option-btn:not(.disabled):hover {
    border-color: #10b981;
    transform: scale(1.02);
}
.balance-gauge-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    z-index: -1;
}
.voted .balance-option-btn {
    border-color: #f3f4f6 !important;
    cursor: default;
}
.voted .balance-gauge-a {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.3));
}
.voted .balance-gauge-b {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.3));
}
.balance-option-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* 플로팅 밸런스 게임 버튼 */
.floating-game-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.floating-game-btn.collapsed {
    width: 180px;
    cursor: pointer;
    border: 3px solid #fbbf24;
}

.floating-game-btn.expanded {
    width: 360px;
    max-height: 80vh;
    overflow-y: auto;
}

.floating-game-btn:hover {
    box-shadow: 0 12px 48px rgba(102, 187, 138, 0.3);
    transform: translateY(-4px);
}

.floating-game-content {
    display: none;
}

.floating-game-btn.expanded .floating-game-content {
    display: block;
}

.floating-game-btn.collapsed .floating-game-header-collapsed {
    display: block;
}

.floating-game-btn.expanded .floating-game-header-collapsed {
    display: none;
}

@media (max-width: 768px) {
    .floating-game-btn {
        bottom: 80px;
        right: 16px;
    }
    .floating-game-btn.expanded {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 16px;
        max-height: 70vh;
    }
    .floating-game-btn.collapsed {
        width: auto;
        padding: 12px 16px;
    }
}


/* =========================
   Mobile Balance Game UI
   ========================= */
.fw-mgame-fab{
  width:64px;height:64px;border-radius:9999px;
  background: linear-gradient(135deg, #66bb8a, #4ade80);
  color:#fff;font-size:28px;line-height:1;
  border:none;box-shadow:0 10px 25px rgba(0,0,0,.18);
  display:flex;align-items:center;justify-content:center;
}
.fw-mgame-hide{
  position:absolute;top:-6px;right:-6px;
  width:22px;height:22px;border-radius:9999px;
  border:none;background:#111827;color:#fff;
  font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 14px rgba(0,0,0,.18);
}
.fw-mgame-handle{
  position:fixed;right:0;top:55%;
  transform:translateY(-50%);
  width:34px;height:58px;border-radius:9999px 0 0 9999px;
  border:none;
  background: linear-gradient(135deg, #66bb8a, #4ade80);
  color:#fff;font-size:18px;
  box-shadow:0 10px 25px rgba(0,0,0,.18);
  display:none;
  z-index:9999;
}
.fw-mgame-modal{
  position:fixed;inset:0;
  background:rgba(0,0,0,.35);
  display:none;
  align-items:center;justify-content:center;
  padding:16px;
  z-index:9998;
}
.fw-mgame-modal.active{display:flex;}
.fw-mgame-modal-card{
  width:100%;max-width:420px;
  background:#fff;border-radius:24px;
  box-shadow:0 20px 60px rgba(0,0,0,.22);
  padding:18px 16px 16px 16px;
}
.fw-mgame-modal-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;
}
.fw-mgame-modal-title{
  font-weight:900;color:#111827;font-size:18px;
}
.fw-mgame-close{
  border:none;background:transparent;color:#9ca3af;
  font-size:28px;line-height:1;padding:4px 8px;
}
.fw-mgame-badge{
  display:flex;justify-content:center;margin:6px 0 2px;
}
.fw-mgame-badge span{
  display:inline-block;padding:6px 10px;border-radius:9999px;
  background:#dcfce7;color:#047857;font-weight:800;font-size:11px;
}
.fw-mgame-sub{ text-align:center; color:#6b7280; font-size:12px; margin-bottom:10px; }
.fw-mgame-question{
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border:2px solid #f59e0b33;
  border-radius:18px;
  padding:14px 12px;
  text-align:center;
  font-weight:900;
  color:#111827;
  font-size:14px;
  min-height:64px;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:10px;
}
.fw-mgame-option{
  position:relative;
  width:100%;
  border-radius:18px;
  border:2px solid #e5e7eb;
  background:#fff;
  padding:14px 12px;
  overflow:hidden;
  margin:10px 0;
}
.fw-mgame-option:disabled{opacity:.85;}
.fw-mgame-gauge{
  position:absolute;left:0;top:0;height:100%;
  width:0%;
  background: rgba(102,187,138,.18);
  transition: width .6s ease;
}
#mobileGameGaugeB{ background: rgba(239,68,68,.16); }
.fw-mgame-option-inner{
  position:relative;z-index:1;
  display:flex;flex-direction:column;gap:6px;
  align-items:center;justify-content:center;
}
.fw-mgame-option-text{
  font-weight:900;color:#374151;font-size:16px;text-align:center;
}
.fw-mgame-option-pct{
  font-weight:900;font-size:22px;color:#047857;display:none;
}
#mobileGamePctB{ color:#ef4444; }
.fw-mgame-vs{
  text-align:center;color:#d1d5db;font-weight:900;font-style:italic;letter-spacing:.25em;
  margin:6px 0;
}
.fw-mgame-next{
  margin-top:10px;
  text-align:center;
  font-size:10px;
  color:#d1d5db;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  display:none;
}
/* Tips chevron animation */
.fw-tips-toggle svg{ transition: transform .2s ease; }


/* === Index-compatible mobile game handle (defensive) === */
#fw-mobile-game-handle{display:none;position:fixed;right:0;bottom:120px;z-index:10001;width:42px;height:42px;border-radius:999px 0 0 999px;background:#fff;border:1px solid rgba(0,0,0,.12);box-shadow:0 8px 24px rgba(0,0,0,.18);align-items:center;justify-content:center;font-size:20px;cursor:pointer;user-select:none;}
@media (max-width:767px){body.fw-mobile-game-hidden #fw-mobile-game-handle{display:flex;}}
body.fw-mobile-game-open #fw-mobile-game-backdrop{display:block!important;}
