:root {
    --primary: #80CBC4;
    --primary-dark: #26A69A;
    --accent: #FFAB91;
    --text-main: #37474F;
    --text-light: #78909C;
    --bg-color: #F8FBFB;
    --surface-color: #FFFFFF;
    --gradient-1: linear-gradient(135deg, #E0F2F1 0%, #E0F7FA 100%);

    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    --container-max: 1100px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: --text-main;
    background-color: var(--bg-color);
    line-height: 1.6;
    color: var(--text-main);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    color: var(--text-main);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
}

/* Header */
.header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.03);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 1.0rem;
    color: var(--primary-dark);
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav a {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav a:hover,
.nav a.active {
    color: var(--primary-dark);
}

.btn-primary {
    background: var(--primary-dark);
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(38, 166, 154, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 166, 154, 0.4);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s ease;
}

.mobile-menu-btn span:nth-child(1) {
    top: 0;
}

.mobile-menu-btn span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-btn span:nth-child(3) {
    bottom: 0;
}

.mobile-menu-btn.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Hero Section */
.hero {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.hero-bg-accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 0 0 0 200px;
    z-index: -1;
    opacity: 0.6;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

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

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    background: -webkit-linear-gradient(45deg, var(--text-main), var(--primary-dark));
    background: linear-gradient(45deg, var(--text-main), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.app-buttons {
    display: flex;
    gap: 15px;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--text-main);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.store-btn svg {
    width: 24px;
    height: 24px;
}

.store-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.hero-image {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
}

.phone-mockup {
    max-width: 300px;
    border-radius: 40px;
    border: 8px solid white;
    box-shadow: var(--shadow-soft);
    z-index: 10;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-main);
    z-index: 20;
    animation: float 3s ease-in-out infinite;
}

.card-1 {
    top: 50px;
    left: 20px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Features */
.features {
    padding: 100px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20%;
    width: 60%;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--bg-color);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Gallery */
.gallery {
    padding: 100px 0;
    overflow: hidden;
}

.gallery-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.gallery-image {
    width: 240px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, opacity 0.3s;
}

.gallery-image img {
    width: 100%;
    display: block;
}

.gallery-image:not(.key-visual) {
    transform: scale(0.9);
    opacity: 0.7;
}

/* CTA */
.cta-section {
    background: var(--primary-dark);
    padding: 100px 0;
    text-align: center;
    color: white;
}

.cta-section h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.cta-section .app-buttons {
    justify-content: center;
}

.store-btn.white {
    background: white;
    color: var(--primary-dark);
}

/* Footer */
footer {
    background: var(--bg-color);
    padding: 60px 0 150px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-light);
}

.footer-logo img {
    height: 30px;
    border-radius: 6px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-light);
    font-size: 0.9rem;
}

.copyright {
    color: #B0BEC5;
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 1001;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        padding-top: 100px;
        transition: right 0.3s ease;
        display: block;
        z-index: 999;
    }

    .nav.active {
        right: 0;
    }

    .nav ul {
        flex-direction: column;
        gap: 40px;
    }

    .nav a {
        font-size: 1.2rem;
    }

    .hero {
        padding-top: 100px;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
        margin-bottom: 20px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .app-buttons {
        justify-content: center;
    }

    .hero-bg-accent {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        border-radius: 200px 0 0 0;
        transform: scaleX(1.5);
    }

    .gallery-wrapper {
        flex-direction: column;
    }

    .gallery-image:not(.key-visual) {
        display: none;
        /* Hide side images on mobile to save space */
    }

    .gallery-image {
        width: 80%;
    }
}

/* Legal Pages */
.legal-page {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 80px;
    background: #fff;
    min-height: 80vh;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.legal-content .last-updated {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 50px;
}

.legal-content h2 {
    font-size: 1.4rem;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-color);
}

.legal-content p {
    margin-bottom: 1.5em;
    color: var(--text-main);
    line-height: 1.8;
}

.legal-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.legal-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Contact Form */
.form-group {
    margin-bottom: 25px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E0E0E0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #FAFAFA;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-submit-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-top: 10px;
}

.submit-success,
.submit-error {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

.submit-success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.submit-error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Word List Page */
.wordhub-header {
    background: white;
    padding: 15px 0 0;
    /* Reduced padding */
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    /* Reduced margin */
}

.grade-selector {
    display: flex;
    gap: 8px;
    /* Reduced gap */
    margin-bottom: 12px;
    /* Reduced margin */
    overflow-x: auto;
    padding-bottom: 2px;
}

.grade-btn {
    padding: 6px 14px;
    /* Reduced padding */
    border-radius: 20px;
    background: #eee;
    color: var(--text-light);
    font-size: 0.85rem;
    /* Slightly smaller font */
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.grade-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.progress-container {
    background: #f0f0f0;
    border-radius: 10px;
    height: 8px;
    /* Thinner bar */
    width: 100%;
    margin-bottom: 0px;
    /* Reduced margin */
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s ease-out;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    margin-bottom: 0px;
    /* Added control over bottom spacing */
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    /* Reduced gap */
    margin-bottom: 0;
    /* Removed margin */
    border-bottom: 2px solid #eee;
}

.filter-tab {
    padding: 10px 15px;
    /* Reduced padding */
    cursor: pointer;
    color: var(--text-light);
    font-weight: 700;
    position: relative;
    transition: color 0.3s;
}

.filter-tab.active {
    color: var(--primary-dark);
}

.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-dark);
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.word-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.word-card.learned {
    background: #F0F9F8;
    border-color: #B2DFDB;
    opacity: 0.8;
}

.word-card.learned .word-text {
    color: var(--text-light);
}

/* Highlight Target Animation */
@keyframes highlightTarget {
    0% {
        background-color: var(--accent);
        transform: scale(1.05);
    }

    100% {
        background-color: white;
        transform: scale(1);
    }
}

.word-card.highlight-target {
    animation: highlightTarget 1s ease-out;
    border-color: var(--accent);
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.word-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Outfit', sans-serif;
}

.pos-badge {
    display: inline-block;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 0.8rem;
    font-weight: normal;
    background-color: #eee;
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
    position: relative;
    top: -3px;
}

.check-label {
    cursor: pointer;
    position: relative;
    width: 24px;
    height: 24px;
}

.check-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: #eee;
    border-radius: 6px;
    transition: all 0.2s;
}

.check-label:hover .checkmark {
    background-color: #ccc;
}

.check-input:checked~.checkmark {
    background-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.check-input:checked~.checkmark:after {
    display: block;
}

.check-label .checkmark:after {
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.word-meaning {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.word-example {
    font-size: 0.9rem;
    color: var(--text-light);
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 10px;
}

.word-example-en {
    font-style: italic;
    margin-bottom: 4px;
}

.word-example-ja {
    font-size: 0.85rem;
}

.load-more-container {
    text-align: center;
    margin-top: 40px;
}

/* In-Grid Promo Card */
.word-card.promo-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border: none;
}

.word-card.promo-card h3 {
    font-size: 1.4rem;
    color: white;
    margin-bottom: 10px;
}

.word-card.promo-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.promo-btn {
    background: white;
    color: var(--primary-dark);
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    margin: 0 auto;
    /* Added for centering */
}

.promo-btn:hover {
    transform: translateY(-2px);
}

/* Sticky CTA Bar */
.sticky-cta {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    /* Hidden initially */
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.sticky-cta.visible {
    transform: translateX(-50%) translateY(0);
}

.sticky-cta-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.sticky-cta-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: nowrap;
    /* Prevent line break */
}

.sticky-cta-buttons {
    display: flex;
    gap: 10px;
}

.sticky-cta-btn {
    background: var(--text-main);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.sticky-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sticky-cta-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 0 0 15px;
    line-height: 1;
}

@media (max-width: 600px) {
    .sticky-cta {
        bottom: 20px;
        left: 5%;
        width: 90%;
        margin: 0;
        transform: translateY(150%);
        flex-direction: column;
        padding: 20px;
        border-radius: 20px;
        gap: 15px;
    }

    .sticky-cta.visible {
        transform: translateY(0);
    }

    .sticky-cta-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .sticky-cta-text {
        white-space: normal;
    }

    .sticky-cta-close {
        position: absolute;
        top: 10px;
        right: 15px;
        padding: 0;
    }
}

.stage-divider {
    grid-column: 1 / -1;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    font-size: 1.2rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stage-divider::before {
    content: '📚';
}

/* App Screenshots in Detail Page */
.app-screenshots {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    justify-content: center;
    overflow-x: auto;
    padding: 10px 5px;
    /* Add padding for shadow/hover */
    -webkit-overflow-scrolling: touch;
}

.app-screenshot-img {
    width: 140px;
    /* Slightly larger for visibility */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    border: none;
    flex-shrink: 0;
}

.app-screenshot-img:hover {
    transform: translateY(-5px);
}

@media (max-width: 600px) {
    .app-screenshots {
        justify-content: flex-start;
        /* Left align on mobile for scrolling */
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-screenshot-img {
        width: 120px;
    }
}

/* Share Buttons */
.share-area {
    margin: 20px 0;
    text-align: center;
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 700;
}

.share-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.x-twitter {
    background: #000000;
}

.share-btn.line {
    background: #06C755;
}

.share-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Promo Image */
.promo-img {
    width: 60%;
    margin: 10px auto;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}