:root {
    --primary-color: #ff8fb1;
    --primary-dark: #ff5c8d;
    --secondary-color: #b5eaea;
    --accent-color: #fce38a;
    --bg-color: #fff9f9;
    --text-color: #444;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(255, 143, 177, 0.2);
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', 'Nanum Gothic', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* Background Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.1); }
}

/* Navigation */
header {
    padding: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.hero-title span {
    color: var(--primary-dark);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #666;
    line-height: 1.6;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.game-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(255, 143, 177, 0.3);
    border-color: var(--primary-color);
}

.game-thumb {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.game-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
}

.category-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    z-index: 10;
    text-transform: uppercase;
}

.tag-puppy { background-color: #ff9a9e; }
.tag-cat { background-color: #a18cd1; }
.tag-rabbit { background-color: #fad0c4; color: #444; }
.tag-horse { background-color: #84fab0; color: #444; }
.tag-others { background-color: #7695ff; }

.game-info {
    padding: 1.5rem;
    text-align: center;
}

.game-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.play-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s;
}

.game-card:hover .play-btn {
    background: var(--primary-dark);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    width: 90%;
    max-width: 1000px;
    height: 90vh;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.5s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    color: var(--primary-dark);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}

.modal-body {
    flex: 1;
    background: white;
}

#gameIframe {
    width: 100%;
    height: 100%;
}

/* Footer */
footer {
    padding: 2rem;
    max-width: 1200px;
    margin: 2rem auto 0;
}

.footer-content {
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    color: var(--primary-dark);
}

/* Auth & Admin Styles */
.hidden { display: none !important; }

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.nav-btn.accent {
    background: var(--accent-color);
    color: #444;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #888;
    font-size: 0.8rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

.divider:not(:empty)::before { margin-right: .5em; }
.divider:not(:empty)::after { margin-left: .5em; }

.google-btn {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.google-btn:hover { background: #f9f9f9; }
.google-btn img { width: 20px; height: 20px; }

.nav-btn.small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.user-box { display: flex; align-items: center; gap: 0.8rem; }
#userName { font-weight: 600; font-size: 0.9rem; }

.auth-container { max-width: 400px; height: auto; padding-bottom: 2rem; }
.input-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-size: 0.9rem; font-weight: 600; color: #666; }
.input-group input, .input-group select {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
}

.play-btn.wide { width: 100%; margin-top: 1rem; }
.auth-switch { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; }
.auth-switch a { color: var(--primary-dark); font-weight: 600; }
.danger-text { color: #ff5252; }

/* Admin Section */
.admin-section { padding: 4rem 2rem; max-width: 1200px; margin: 0 auto; background: rgba(255,255,255,0.5); border-radius: 30px; margin-top: 2rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-game-list { display: flex; flex-direction: column; gap: 1rem; }
.admin-game-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.admin-item-info h4 { margin-bottom: 0.2rem; }
.admin-item-info p { font-size: 0.8rem; color: #888; }
.admin-actions { display: flex; gap: 0.5rem; }

.edit-btn, .delete-btn {
    padding: 0.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn { background: #e3f2fd; color: #2196f3; }
.delete-btn { background: #ffebee; color: #f44336; }

/* Payment Styles */
.payment-container { max-width: 500px; height: auto; }
.plan-card { padding: 2rem; text-align: center; }
.plan-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.plan-card .price { font-size: 2.5rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 1.5rem; }
.plan-card .price span { font-size: 1rem; color: #888; }
.plan-card ul { list-style: none; text-align: left; margin-bottom: 2rem; }
.plan-card li { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; color: #555; }
.plan-card li i { color: #4caf50; width: 18px; }
#paypal-button-container { margin-top: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-title { font-size: 2.5rem; }
    .game-grid { grid-template-columns: 1fr; }
    .admin-game-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
