@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;800&display=swap');

/* --- Reset & Base Styles --- */
:root {
    --primary-color: #ff8ab4; /* ピンク */
    --secondary-color: #a2e2ff; /* 水色 */
    --accent-color: #ffda77; /* 黄色 */
    --bg-color: #fdf6ff;
    --font-color: #5d5d5d;
    --white: #ffffff;
    --border-radius: 16px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background-color: #eef5ff;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--font-color);
}

/* --- Game Container --- */
#game-container {
    width: 100%;
    max-width: 400px;
    height: 100%;
    max-height: 800px;
    background-color: var(--bg-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- Screens --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    display: flex;
    flex-direction: column;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* --- Header --- */
.header {
    padding: 15px 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid #eee;
}

.header h1 {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 800;
}

/* --- Home Screen --- */
#home-screen .main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

#goomin-display {
    text-align: center;
    position: relative;
}

#goomin-art {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 80px;
    position: relative;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
    padding: 15px; /* 画像用の余白を追加 */
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#goomin-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    background-color: var(--white);
    padding: 5px 20px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: var(--shadow);
}

#goomin-info {
    margin-top: 15px;
    width: 80%;
}

#goomin-info p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

#exp-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

#exp-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 0.5s ease-out;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: var(--primary-color);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    user-select: none;
}
.nav-arrow:hover { opacity: 1; }
#prev-goomin { left: 15px; }
#next-goomin { right: 15px; }
.nav-arrow.hidden { display: none; }

/* --- Bottom Menu --- */
.bottom-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-top: 1px solid #eee;
}

.bottom-menu .main-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.menu-button {
    padding: 15px 10px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}
.menu-button:active {
    transform: scale(0.95);
}

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

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--font-color);
}

.btn-tertiary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

/* --- Zukan (Collection) Screen --- */
#zukan-screen .content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

#zukan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.zukan-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    opacity: 0.5;
}

.zukan-item.owned {
    opacity: 1;
}

.zukan-art {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    padding: 5px; /* 画像用の余白を追加 */
}

.zukan-item.owned .zukan-art {
     animation: float 3s ease-in-out infinite;
}

.zukan-name {
    font-size: 0.8rem;
    font-weight: 700;
}

.zukan-name.locked {
    color: #aaa;
}

/* --- Modal --- */
#modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
}

#modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

#modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 350px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s;
}

#modal-overlay.active #modal-content {
    transform: scale(1);
}

#modal-content h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

#modal-content p {
    margin-bottom: 25px;
}

/* --- Modal specific styles --- */
#scan-animation {
    height: 80px;
    width: 100%;
    background: linear-gradient(to right, #ccc, #eee, #ccc);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
#scan-line {
    position: absolute;
    top: 0;
    left: -10px;
    width: 5px;
    height: 100%;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scanning 1.5s linear infinite;
}

@keyframes scanning {
    0% { transform: translateX(0); }
    100% { transform: translateX(350px); }
}

#scan-result-art {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    padding: 10px; /* 画像用の余白を追加 */
}

/* --- Effects --- */
.effect-text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 2px 2px 0 var(--white), -2px -2px 0 var(--white), 2px -2px 0 var(--white), -2px 2px 0 var(--white);
    opacity: 0;
    animation: fade-up-out 1.5s ease-out forwards;
    pointer-events: none;
}
@keyframes fade-up-out {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1.2); opacity: 0; }
}