/* Mahjong-inspired CSS Variables */
:root {
    --primary-color: #2d5a3d;        /* Deep mahjong green */
    --secondary-color: #4a7c59;      /* Medium forest green */
    --accent-color: #6b8e6b;         /* Sage green accent */
    --success-color: #228b22;        /* Forest green */
    --warning-color: #8b7355;        /* Muted brown */
    --background-color: #f8f9f8;     /* Very light green-tinted white */
    --surface-color: #ffffff;        /* Pure white */
    --text-primary: #2f4f2f;         /* Dark forest green */
    --text-secondary: #5a6b5a;       /* Medium green-gray */
    --border-color: #c8d4c8;         /* Light green-gray */
    --shadow-light: 0 2px 10px rgba(45, 90, 61, 0.15);
    --shadow-medium: 0 4px 20px rgba(45, 90, 61, 0.2);
    --shadow-heavy: 0 8px 30px rgba(45, 90, 61, 0.25);
    --border-radius-small: 6px;
    --border-radius-medium: 10px;
    --border-radius-large: 14px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: var(--surface-color);
    box-shadow: var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Logo Styles */
.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: var(--border-radius-small);
}

.logo a:hover {
    background: rgba(45, 90, 61, 0.1);
    transform: translateY(-1px);
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(45, 90, 61, 0.3));
    animation: subtle-pulse 3s ease-in-out infinite;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

@keyframes subtle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-small);
    transition: all 0.2s ease;
}

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

nav a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    box-shadow: var(--shadow-medium);
    border-top: 1px solid var(--border-color);
}

.mobile-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
}

.mobile-nav a {
    display: block;
    padding: 1rem 2rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--surface-color);
    border-radius: var(--border-radius-large);
    margin-bottom: 3rem;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-heavy);
}

.hero h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-medium);
}

.game-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: var(--border-radius-small);
    background: #f0f0f0;
}

#game-iframe {
    border: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    user-select: none;
}

/* Content Sections */
.content-section {
    background: var(--surface-color);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-light);
}

.content-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* FAQ Section */
.faq-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--background-color);
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    background: var(--border-color);
}

.faq-answer {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.faq-toggle {
    transition: transform 0.2s ease;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

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

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

/* Breadcrumb */
.breadcrumb {
    background: var(--surface-color);
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-small);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "→";
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* Game Highlights Section */
.game-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-item {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--accent-color);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.highlight-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.highlight-item p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* Tips Grid Layout */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tip-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.tip-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tip-card p {
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

/* Strategy Cards Layout */
.strategy-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.strategy-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    padding: 2rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--accent-color);
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.strategy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.strategy-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.strategy-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.strategy-card p {
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}

/* Features Hero Section */
.features-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.feature-image {
    width: 200px;
    height: 150px;
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-medium);
    flex-shrink: 0;
}

.features-hero p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

@media (max-width: 768px) {
    .features-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-image {
        width: 150px;
        height: 112px;
    }
}

/* Rules Grid Layout */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.rule-card {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: all 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.rule-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.rule-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.rule-card p {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Benefits Grid Layout */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.benefit-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--secondary-color);
    box-shadow: var(--shadow-light);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.benefit-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-color);
}

.benefit-card:hover::after {
    transform: scaleX(1);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.benefit-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.benefit-card p {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Quick Tips Layout */
.quick-tips {
    margin-top: 2rem;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--border-radius-medium);
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.tip-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-medium);
    border-left-color: var(--primary-color);
}

.tip-number {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--surface-color);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-light);
}

.tip-content h4 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.tip-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .header-content {
        padding: 0.75rem 0;
    }
    
    nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-nav.active {
        display: block;
    }
    
    .hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .game-container {
        padding: 15px;
        margin: 10px;
    }
    
    .game-wrapper {
        padding-bottom: 75%; /* 4:3 aspect ratio for mobile */
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 1rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .game-container {
        padding: 10px;
        margin: 5px;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .hero {
        padding: 1.5rem 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Consistent color scheme - no dark mode auto-switching */

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline-offset: 4px;
}

/* Print styles */
@media print {
    .game-container,
    .mobile-menu-toggle,
    .mobile-nav {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero {
        background: none;
        color: black;
    }
} 