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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #fff;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0 20px;
}

h1 {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(90deg, #f9d423, #ff4e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    margin-top: 8px;
    color: #aaa;
    font-size: 0.9rem;
}

/* Input Section */
.input-section {
    margin-top: 24px;
}

.input-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #ccc;
}

.situation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.situation-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    color: #fff;
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.situation-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.situation-btn.active {
    border-color: #f9d423;
    background: rgba(249, 212, 35, 0.15);
}

/* Level */
.level-section {
    margin-top: 24px;
}

.level-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #ccc;
}

.level-buttons {
    display: flex;
    gap: 8px;
}

.level-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    color: #fff;
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.level-btn.active {
    border-color: #f9d423;
    background: rgba(249, 212, 35, 0.15);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px;
    background: linear-gradient(90deg, #f9d423, #ff4e50);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.generate-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 212, 35, 0.4);
}

.generate-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Result */
.result-section {
    margin-top: 32px;
    animation: fadeInUp 0.5s ease;
}

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

.result-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.result-situation {
    background: rgba(249, 212, 35, 0.2);
    color: #f9d423;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.result-level {
    background: rgba(255, 78, 80, 0.2);
    color: #ff4e50;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.excuse-text {
    font-size: 1.15rem;
    line-height: 1.8;
    margin: 20px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 4px solid #f9d423;
}

/* Stats */
.stats {
    margin-top: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.stat-label {
    width: 80px;
    font-size: 0.8rem;
    color: #aaa;
}

.stat-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #f9d423, #ff4e50);
    border-radius: 4px;
    transition: width 1s ease;
    width: 0;
}

.stat-fill.creativity {
    background: linear-gradient(90deg, #a18cd1, #fbc2eb);
}

.stat-fill.stealth {
    background: linear-gradient(90deg, #43e97b, #38f9d7);
}

.stat-value {
    width: 36px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Risk Badge */
.risk-badge {
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.risk-badge.safe {
    background: rgba(67, 233, 123, 0.15);
    color: #43e97b;
}

.risk-badge.medium {
    background: rgba(249, 212, 35, 0.15);
    color: #f9d423;
}

.risk-badge.danger {
    background: rgba(255, 78, 80, 0.15);
    color: #ff4e50;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-x { background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.3); }
.btn-line { background: rgba(6,199,85,0.15); border-color: rgba(6,199,85,0.4); color: #06c755; }
.btn-line:hover { background: rgba(6,199,85,0.25); }
.btn-copy { background: rgba(102,126,234,0.15); border-color: rgba(102,126,234,0.3); }
.btn-retry { width: 100%; }
.share-buttons { margin-bottom: 8px; }

.btn-retry:hover {
    border-color: #f9d423;
}

/* History */
.history-section {
    margin-top: 40px;
}

.history-section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #ccc;
}

#historyList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #bbb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item .history-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.history-item .history-tag {
    font-size: 0.7rem;
    background: rgba(249, 212, 35, 0.2);
    color: #f9d423;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: #43e97b;
    color: #000;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: bottom 0.3s ease;
    z-index: 100;
}

.toast.show {
    bottom: 30px;
}

/* Footer */
footer {
    margin-top: 48px;
    text-align: center;
    color: #666;
    font-size: 0.75rem;
    padding-bottom: 24px;
}

footer .copyright {
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 400px) {
    h1 {
        font-size: 1.5rem;
    }

    .situation-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .level-buttons {
        flex-wrap: wrap;
    }

    .level-btn {
        flex: 1 1 45%;
    }
}
