:root {
    --bg-color: #fffbeb;
    --text-color: #451a03;
    --accent-color: #fbbf24;
    --board-bg: #fde68a;
    --box-border: #f59e0b;
    --danger-line: #ef4444;
}

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

body {
    font-family: 'Jua', 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

.page-container {
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Header */
.seo-header {
    text-align: center;
    background: #fff;
    padding: 20px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15);
    width: 100%;
    border: 2px solid #fef3c7;
}

.seo-header h1 {
    font-size: 2.2rem;
    font-weight: 400;
    /* Jua is already bold */
    color: #f59e0b;
    margin-bottom: 8px;
}

.seo-header p {
    font-size: 1.1rem;
    color: #78350f;
    line-height: 1.4;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.seo-header strong {
    color: #ea580c;
}

/* Game Interface */
.game-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-container,
.next-fruit-container {
    background: #fff;
    padding: 10px 20px;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #fef3c7;
    min-width: 120px;
}

.score-container span:first-child,
.next-fruit-container span:first-child {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    color: #d97706;
}

#score {
    font-size: 2rem;
    color: #b45309;
}

#next-fruit-display {
    font-size: 2rem;
    line-height: 1;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Physics Canvas Container */
#game-canvas-container {
    width: 100%;
    aspect-ratio: 3/4;
    /* Classic suika proportion */
    background: #fff;
    border-radius: 12px 12px 0 0;
    border: 8px solid var(--box-border);
    border-top: none;
    /* Open top box */
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

#game-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Let Matter.js render to this size */
}

#danger-line {
    position: absolute;
    top: 15%;
    /* If fruits pile above this, it's game over */
    left: 0;
    width: 100%;
    border-top: 3px dashed var(--danger-line);
    opacity: 0.5;
    z-index: 5;
    pointer-events: none;
}

.evolution-guide {
    text-align: center;
    background: #fff;
    padding: 10px;
    border-radius: 12px;
    font-size: 1.2rem;
    letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid #fef3c7;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--accent-color);
    width: 80%;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.hidden .overlay-content {
    transform: scale(0.9);
}

.overlay-content h2 {
    font-size: 1.8rem;
    color: #ea580c;
    margin-bottom: 10px;
}

.overlay-content p {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #78350f;
    margin-bottom: 25px;
}

.btn-action {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1.3rem;
    font-family: 'Jua', sans-serif;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
    transition: background 0.2s, transform 0.1s;
    width: 100%;
}

.btn-action:active {
    transform: scale(0.95);
    background: #f59e0b;
}

/* Article */
.seo-article {
    background: #fff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.1);
    width: 100%;
    border: 2px solid #fef3c7;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
}

.seo-article h2 {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #d97706;
}

.seo-article ul {
    list-style-position: inside;
    color: #78350f;
    line-height: 1.6;
}

.seo-article li {
    margin-bottom: 10px;
}

.back-link {
    margin-bottom: 30px;
}

.back-link a {
    color: #d97706;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.1rem;
    font-family: 'Nunito', sans-serif;
}

.back-link a:hover {
    text-decoration: underline;
}