@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Jua&display=swap'); /* 게임용 귀여운 폰트 */

:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --background-color: #f8f9fa;
    --text-color: #2d3436;
    --card-bg: #ffffff;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* 헤더 스타일 (본진과 통일감) */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.2);
    position: relative;
}

header h1 {
    font-family: 'Jua', sans-serif;
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
}

.lang-switch a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.lang-switch a:hover {
    background: rgba(255, 255, 255, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.9;
    border-bottom: 1px dashed white;
}

.back-link:hover {
    opacity: 1;
    border-bottom: 1px solid white;
}

/* 메인 컨테이너 */
.game-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* 게임 카드 디자인 */
.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.15);
}

.game-icon {
    font-size: 3.5rem;
    background: #f1f2f6;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    transition: transform 0.3s;
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(10deg);
}

.game-card h2 {
    font-family: 'Jua', sans-serif;
    color: var(--text-color);
    margin: 10px 0;
    font-size: 1.5rem;
}

.game-card p {
    color: #636e72;
    font-size: 0.95rem;
    margin-bottom: 25px;
    height: 48px; /* 줄맞춤 */
    overflow: hidden;
}

.play-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.play-btn:hover {
    background: #5649c0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.4);
}

.play-btn.disabled {
    background: #dfe6e9;
    color: #b2bec3;
    cursor: not-allowed;
    box-shadow: none;
}

.coming-soon {
    opacity: 0.8;
}

/* 광고 배너 */
.ad-banner {
    width: 100%;
    max-width: 728px;
    margin: 30px auto;
    text-align: center;
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

/* 게임 UI 및 캔버스 */
canvas {
    display: block;
    cursor: crosshair;
}

#game-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
}

#game-ui h1 {
    font-family: 'Jua', sans-serif;
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 20px;
}

#leaderboard {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px;
    border-radius: 15px;
    min-width: 150px;
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
    pointer-events: none;
}

#leaderboard h3 {
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
    font-size: 1rem;
}

#rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#rank-list li {
    margin-bottom: 5px;
}

#kill-log {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 50, 50, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* 푸터 */
footer {
    background: #f1f2f6;
    color: #636e72;
    padding: 40px 20px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #dfe6e9;
}

.footer-links a {
    color: #636e72;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
    font-weight: bold;
}

/* Header Buttons */
.header-top {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lang-btn, .main-lab-btn {
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.main-lab-btn {
    background: #ffeaa7;
    color: #2d3436;
    box-shadow: 0 4px 0 #fdcb6e;
}

.main-lab-btn:hover {
    transform: translateY(-2px);
}

.main-lab-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .header-top {
        top: 10px; right: 10px;
        flex-direction: column;
        align-items: flex-end;
    }
}


/* ===========================
   공유하기 버튼 스타일 (수정됨: 플로팅 바)
   =========================== */
.share-container {
    position: fixed;       /* 화면에 고정 */
    bottom: 30px;          /* 바닥에서 30px 위 */
    left: 50%;             /* 가로 중앙 */
    transform: translateX(-50%); /* 정확한 중앙 정렬 */
    z-index: 9999;         /* 게임 화면보다 무조건 위에 표시 */
    
    background: rgba(0, 0, 0, 0.6); /* 반투명 검은 배경 */
    backdrop-filter: blur(5px);     /* 배경 흐림 효과 */
    padding: 10px 20px;
    border-radius: 50px;            /* 둥근 알약 모양 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    
    display: flex;
    align-items: center;
    gap: 15px;
    transition: bottom 0.3s;
}

/* 게임 중 마우스 방해되면 살짝 투명해지게 */
.share-container:hover {
    background: rgba(0, 0, 0, 0.8);
}

.share-title {
    font-size: 0.9rem;
    color: #fff;
    margin: 0;
    margin-right: 10px;
    font-weight: bold;
    white-space: nowrap; /* 줄바꿈 방지 */
}

/* 모바일에서는 텍스트 숨기고 버튼만 보여주기 (공간 확보) */
@media (max-width: 600px) {
    .share-title { display: none; }
}

.share-btn-group {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover { transform: scale(1.1); }

/* 색상별 스타일 */
.btn-twitter { background-color: #1DA1F2; } 
.btn-facebook { background-color: #1877F2; } 
.btn-link { background-color: #6c5ce7; }    

/* 토스트 메시지 스타일 */
#toast-msg {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px; /* 공유바보다 위로 */
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

#toast-msg.show {
    visibility: visible;
    opacity: 1;
    bottom: 90px; /* 공유바 위에 뜸 */
}

