@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho&display=swap');

:root {
    --primary-bg: #e0f7fa;
    --larimar-blue: #81d4fa;
    --larimar-dark: #4fc3f7;
    --larimar-light: #e1f5fe;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-color: #2c3e50;
    --accent: #00bcd4;
}

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

body {
    font-family: 'Shippori Mincho', serif;
    color: var(--text-color);
    background: linear-gradient(45deg, #a1c4fd, #e0f7fa, #c2e9fb, #b2ebf2);
    background-size: 400% 400%;
    animation: rippleBg 20s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@keyframes rippleBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* --- Cover Screen --- */
.cover-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('assets/avatar_mirai.png') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 1s ease;
}

.cover-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

.cover-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.cover-logo {
    font-size: 2.5rem;
    color: var(--larimar-dark);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(255,255,255,0.9);
}

.cover-sub {
    font-size: 1rem;
    color: #455a64;
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

.start-btn {
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--larimar-dark);
    color: var(--larimar-dark);
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
}

.start-btn:hover {
    background: var(--larimar-dark);
    color: white;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.6);
}

/* --- Main App UI --- */
.glass-panel {
    background: url('assets/avatar_mirai.png') center/cover no-repeat;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.82); /* 文字が読みやすいように明るめのオーバーレイ */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    z-index: -1;
}

header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 1px;
    color: var(--larimar-dark);
    text-shadow: 0 1px 5px rgba(255,255,255,0.5);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.8);
    border-radius: 3px;
}

.message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

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

.message-row.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--larimar-light);
    box-shadow: 0 0 15px rgba(129, 212, 250, 0.6);
    object-fit: cover;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 18px;
    line-height: 1.8;
    font-size: 0.95rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.minato .message-bubble {
    background: rgba(255, 255, 255, 0.85);
    border-top-left-radius: 2px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.user .message-bubble {
    background: var(--larimar-light);
    color: var(--text-color);
    border-top-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.highlight {
    color: var(--larimar-dark);
    font-weight: bold;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
}
.dot {
    width: 6px; height: 6px;
    background: var(--larimar-dark);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Interactive Forms & Buttons */
.interaction-area {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.3);
    position: relative;
    z-index: 1;
}

.input-group {
    margin-bottom: 10px;
    width: 100%;
    display: flex;
}

input, select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--larimar-light);
    border-radius: 10px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--larimar-dark);
    box-shadow: 0 0 10px rgba(129, 212, 250, 0.5);
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--larimar-dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.4);
}

button[type="submit"]:hover {
    background: #29b6f6;
}

/* Choice Buttons */
.choice-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--larimar-dark);
    color: var(--larimar-dark);
    border-radius: 10px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}
.choice-btn:hover {
    background: var(--larimar-dark);
    color: white;
}

.system-notice {
    font-size: 0.75rem;
    color: #546e7a;
    text-align: center;
    margin-top: 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    padding: 5px;
}

.hidden {
    display: none !important;
}

.result-card-mini {
    background: rgba(255, 255, 255, 0.7);
    border-left: 4px solid var(--larimar-dark);
    padding: 10px;
    margin-top: 5px;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
}
