:root {
    /* Color Palette - Japanese Modern Premium */
    --bg-color: #FCFAF5;
    /* Gofun-iro (Refined Chalk White) */
    --bg-gradient: linear-gradient(135deg, #FCFAF5 0%, #F2F0EC 100%);

    --text-primary: #482E21;
    /* Koge-cha (Deep Espresso Brown) */
    --text-secondary: #737D61;
    /* Rikyu-cha (Sage/Tea Green) */
    --text-muted: #736b63;
    /* Grayish Brown */

    --accent: #D9B340;
    /* Shibui Gold */
    --accent-soft: #D9ADAD;
    /* Hai-ume (Dusty Plum) */
    --accent-ui: #F5E9E4;
    /* Toki-iro (Pale Ibis Pink) */

    --surface: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --border: rgba(72, 46, 33, 0.1);
    --shadow: 0 8px 32px 0 rgba(72, 46, 33, 0.05);

    /* Typography */
    --font-main: 'M PLUS Rounded 1c', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.glass-header {
    background: rgba(252, 250, 245, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--text-primary);
    /* Removed gradient text for cleaner look */
}

nav ul {
    display: flex;
    gap: 20px;
}

nav a {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.9rem;
}

nav a:hover {
    color: var(--text-primary);
}

.lang-switch {
    border: 1px solid var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: 0.2s;
}

.lang-switch:hover {
    background: var(--text-secondary);
    color: #fff !important;
}

/* Sections */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1rem;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 70px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    z-index: 2;
}

.hero-text {
    max-width: 500px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-ui);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.hero h2 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-primary {
    background: var(--text-primary);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 46, 33, 0.2);
    background: #3a251b;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    margin-left: 10px;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-secondary);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.app-screenshot {
    max-width: 300px;
    height: auto;
    border-radius: 40px;
    border: 8px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(72, 46, 33, 0.2);
    transition: 0.5s;
}

.app-screenshot:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 30px 60px rgba(72, 46, 33, 0.3);
}

/* Background Glow */
.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--accent-ui);
    opacity: 0.6;
    filter: blur(120px);
    border-radius: 50%;
    top: 50%;
    left: 70%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Cards (Rules & Gallery) */
.rules-grid,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.resource-note {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    display: inline-block;
    width: 100%;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    background: var(--surface-hover);
}

.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    transition: 0.3s;
}

/* Score Colors from FrogmouthTheme */
/* 1. Fuji-nezu (Purple) */
.rule-card:nth-child(1) .icon-box {
    background: rgba(163, 148, 173, 0.15);
    color: rgb(163, 148, 173);
}

.rule-card:nth-child(1):hover .icon-box {
    background: rgb(163, 148, 173);
    color: #fff;
    box-shadow: 0 5px 15px rgba(163, 148, 173, 0.3);
}

/* 2. Miru-iro (Green) */
.rule-card:nth-child(2) .icon-box {
    background: rgba(112, 117, 92, 0.15);
    color: rgb(112, 117, 92);
}

.rule-card:nth-child(2):hover .icon-box {
    background: rgb(112, 117, 92);
    color: #fff;
    box-shadow: 0 5px 15px rgba(112, 117, 92, 0.3);
}

/* 3. Benikaba (Red) */
.rule-card:nth-child(3) .icon-box {
    background: rgba(186, 89, 82, 0.15);
    color: rgb(186, 89, 82);
}

.rule-card:nth-child(3):hover .icon-box {
    background: rgb(186, 89, 82);
    color: #fff;
    box-shadow: 0 5px 15px rgba(186, 89, 82, 0.3);
}

/* 4. Kitsune-iro (Orange) */
.rule-card:nth-child(4) .icon-box {
    background: rgba(209, 148, 97, 0.15);
    color: rgb(209, 148, 97);
}

.rule-card:nth-child(4):hover .icon-box {
    background: rgb(209, 148, 97);
    color: #fff;
    box-shadow: 0 5px 15px rgba(209, 148, 97, 0.3);
}

.card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.gallery-item {
    aspect-ratio: 9/16;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(255, 255, 255, 0.5);
}

/* Leaderboard */
.leaderboard-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    padding: 15px;
    border-bottom: 1px solid rgba(72, 46, 33, 0.05);
    align-items: center;
    transition: 0.2s;
    color: var(--text-primary);
    font-weight: 500;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.4);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.rank-1 {
    color: #D9B340;
    font-weight: 800;
}

/* Gold */
.rank-2 {
    color: #A0A0A0;
    font-weight: 800;
}

/* Silver */
.rank-3 {
    color: #CD7F32;
    font-weight: 800;
}

/* Bronze */

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Contact */
.contact-box {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

input:focus,
textarea:focus {
    border-color: var(--text-secondary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(115, 125, 97, 0.1);
}

textarea {
    height: 120px;
    resize: none;
}

.btn-block {
    width: 100%;
}

/* Footer */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.4);
}

.social-links {
    margin-top: 20px;
}

.social-links a {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0 10px;
}

/* Mobile */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: none;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    nav {
        display: none;
        /* Simple hide for now, could add burger */
    }
}