:root {
    --primary: #4a90e2;
    --bg: #f5f7f9;
    --text: #333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

#app {
    width: 90%;
    max-width: 700px;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}

h1 { margin-bottom: 0.5rem; color: var(--primary); }
.subtitle { font-size: 0.9rem; color: #666; margin-bottom: 2rem; }

#target-container {
    background: #f0f4f8;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#target-text {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.5;
}

#typing-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s;
}

#typing-input:focus {
    border-color: var(--primary);
}

#status-bar {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:disabled { background: #ccc; cursor: not-allowed; }

#info { font-size: 0.9rem; color: #888; display: flex; gap: 1rem; }

/* 結果エリアの装飾 */
#result-area {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.result-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#ai-response {
    text-align: left;
    line-height: 1.8;
    margin: 1.5rem 0;
    white-space: pre-wrap;
}

.retry-btn { margin-top: 1rem; width: 100%; }