:root {
    --primary-color: #f5a623;
    --secondary-color: #4a4a4a;
    --background-color: #fffaf0;
    --white-color: #ffffff;
    --accent-color: #e67e22;
}

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

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: var(--background-color);
    color: var(--secondary-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 500px;
    background-color: var(--white-color);
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
}

section { 
    padding: 40px 30px; 
    animation: fadeIn 0.5s ease-in-out; 
}

.hidden { 
    display: none; 
}

h1, h2, h3 { 
    color: var(--primary-color); 
    margin-bottom: 20px; 
}

p { 
    margin-bottom: 20px; 
}

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

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    max-width: 320px;
}

.btn:hover { 
    background-color: var(--accent-color); 
    transform: translateY(-2px); 
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Top Screen - 写真アップロードエリア */
.photo-upload-area {
    display: block;
    margin: 20px auto;
    padding: 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.photo-upload-area:hover {
    background-color: #fcf8f2;
}

#photo-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 20px;
    background-color: #eee;
}

#dog-photo-input {
    display: none;
}

.photo-upload-caption {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
}

.photo-upload-sub-caption {
    font-size: 12px;
    color: #888;
    margin-top: -10px;
}

/* Quiz Screen */
#quiz-screen h2 { font-size: 24px; }
#question-text { font-size: 18px; min-height: 80px; }
.progress-bar-container { width: 100%; background-color: #eee; border-radius: 10px; margin: 20px 0; }
#progress-bar { height: 10px; width: 0; background-color: var(--primary-color); border-radius: 10px; transition: width 0.5s ease-in-out; }
#progress-text { margin-top: 5px; font-size: 14px; }
.choices { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }
.choice-btn { background-color: var(--white-color); color: var(--primary-color); border: 2px solid var(--primary-color); }

/* Loading Screen */
.loader { width: 60px; height: 60px; border: 8px solid #f3f3f3; border-top: 8px solid var(--primary-color); border-radius: 50%; animation: spin 1.5s linear infinite; margin: 30px auto; }
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Result Screen */
.result-card { border: 3px dashed var(--primary-color); padding: 20px; border-radius: 12px; margin-bottom: 30px; }
#result-title { font-size: 26px; font-weight: bold; }
#result-image {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    margin: 20px auto;
}
#result-description { text-align: left; margin-bottom: 30px; }
.recommendation { background-color: #fff8e1; padding: 20px; border-radius: 8px; margin-bottom: 30px; display: flex; align-items: center; gap: 20px; }
.recommendation img { width: 100px; flex-shrink: 0; }
.recommendation-text { text-align: left; }
.recommendation-text h3 { font-size: 18px; margin-bottom: 10px; }
.share-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 30px; }
.share-btn { padding: 10px 20px; font-size: 16px; width: auto; flex: 1; max-width: 150px; }
#x-share-btn { background-color: #1DA1F2; }
#line-share-btn { background-color: #06C755; }
#restart-btn { margin-top: 20px; background-color: var(--secondary-color); }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@media (max-width: 480px) {
    body { padding: 10px; }
    section { padding: 30px 20px; }
    .recommendation { flex-direction: column; }
}