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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* 縦並びに変更 */
    align-items: center;
    justify-content: flex-start; /* 上から配置 */
    padding: 40px 20px 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 60px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: fadeInUp 0.8s ease-out;
    margin-bottom: 40px; /* フッターとの間にマージンを追加 */
}

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

h1 {
    font-size: 2.5rem; /* サイズを少し小さく */
    font-weight: 700;
    margin-bottom: 15px; /* マージンを調整 */
    text-align: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: #8892b0;
    text-align: center;
    margin-bottom: 50px;
}


@keyframes glow {
    from { filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.5)); }
    to { filter: drop-shadow(0 0 30px rgba(0, 242, 254, 0.8)); }
}

.goals-section {
    background: rgba(79, 172, 254, 0.05);
    border: 1px solid rgba(79, 172, 254, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.goals-section::before {
    content: '目標設定';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 0.8rem;
    color: #4facfe;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.goals-toggle {
    position: absolute;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: #8892b0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: rgba(79, 172, 254, 0.3);
}

.toggle-slider {
    position: absolute;
    top: 2.5px;
    left: 2.5px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(25px);
}

.goals-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1列 */
    gap: 20px;
    margin-top: 40px;
}

.goal-input {
    position: relative;
}

.goal-input label {
    font-size: 0.8rem;
    color: #8892b0;
    display: block;
    margin-bottom: 5px;
}

.goal-input input {
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.goal-input input:focus {
    outline: none;
    border-color: #4facfe;
    background: rgba(255, 255, 255, 0.08);
}

.input-section {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1列 */
    gap: 30px;
    margin-bottom: 60px;
}

.input-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow; /* パフォーマンス改善のため追加 */
}

.input-group.optional {
    background: rgba(255, 210, 0, 0.02);
    border-color: rgba(255, 210, 0, 0.1);
}

.input-group.optional label::after {
    content: '（任意）';
    font-size: 0.7rem;
    color: #ffd200;
    margin-left: 5px;
}

.input-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.input-group:hover::before {
    left: 100%;
}

.input-group:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(79, 172, 254, 0.3);
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: #8892b0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper span {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #4facfe;
    font-size: 1.1rem;
    pointer-events: none;
}

input {
    width: 100%;
    padding: 15px 20px 15px 45px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: #ffffff;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #4facfe;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

input::placeholder {
    color: #4a5568;
}

.results-section {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1列 */
    gap: 30px;
}

.result-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 40px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform, box-shadow; /* パフォーマンス改善のため追加 */
}

.result-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(79, 172, 254, 0.1);
}

.result-card.good {
    background: linear-gradient(135deg, rgba(0, 242, 96, 0.05) 0%, rgba(5, 117, 230, 0.02) 100%);
    border-color: rgba(0, 242, 96, 0.3);
}

.result-card.good .metric-value {
    color: #00f260;
    text-shadow: 0 0 30px rgba(0, 242, 96, 0.5);
}

.result-card.warning {
    background: linear-gradient(135deg, rgba(247, 151, 30, 0.05) 0%, rgba(255, 210, 0, 0.02) 100%);
    border-color: rgba(247, 151, 30, 0.3);
}

.result-card.warning .metric-value {
    color: #ffd200;
    text-shadow: 0 0 30px rgba(255, 210, 0, 0.5);
}

.result-card.bad {
    background: linear-gradient(135deg, rgba(238, 9, 121, 0.05) 0%, rgba(255, 106, 0, 0.02) 100%);
    border-color: rgba(255, 106, 0, 0.3);
}

.result-card.bad .metric-value {
    color: #ff6a00;
    text-shadow: 0 0 30px rgba(255, 106, 0, 0.5);
}

.metric-name {
    font-size: 1rem;
    color: #8892b0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.metric-value {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1;
    transition: all 0.3s ease;
    position: relative;
}

.metric-value.updating {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.metric-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
}

.achievement-rate {
    display: none;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.9rem;
}

.achievement-rate.show {
    display: block;
}

.achievement-rate.excellent {
    background: rgba(0, 242, 96, 0.1);
    color: #00f260;
}

.achievement-rate.good {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.achievement-rate.poor {
    background: rgba(255, 106, 0, 0.1);
    color: #ff6a00;
}

.copy-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8892b0;
}

.copy-button:hover {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
    transform: scale(1.1);
}

.copy-button.copied {
    background: rgba(0, 242, 111, 0.2);
    color: #00f26f;
    animation: success 0.5s ease;
}

@keyframes success {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    stroke: rgba(255, 255, 255, 0.1);
    fill: transparent;
    stroke-width: 8;
}

.progress-ring__progress {
    stroke: url(#gradient);
    fill: transparent;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
}

.formula {
    font-size: 0.8rem;
    color: #4a5568;
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover .formula {
    opacity: 1;
}

.result-card.new-metric {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05) 0%, rgba(79, 172, 254, 0.02) 100%);
    border-color: rgba(147, 51, 234, 0.3);
}

.result-card.new-metric.good .metric-value {
    color: #9333ea;
    text-shadow: 0 0 30px rgba(147, 51, 234, 0.5);
}

.content-section {
    margin-top: 60px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #a0aec0;
}

.content-section h2 {
    font-size: 1.6rem;
    font-weight: 600;
    color: #4facfe;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(79, 172, 254, 0.2);
}

.content-section h3 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    margin-top: 30px;
    margin-bottom: 15px;
}

.content-section h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 10px;
}

.content-section p, .content-section li {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.content-section ul {
    list-style-type: disc;
    padding-left: 20px;
}

.content-section a {
    color: #4facfe;
    text-decoration: none;
    transition: color 0.3s ease;
}
.content-section a:hover {
    color: #00f2fe;
    text-decoration: underline;
}

footer {
    width: 100%;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #64748b; /* リンク以外のフッターテキスト色 */
    line-height: 1.8; /* 行間の調整 */
}

/* フッターのリンク用のスタイルを新たに追加・修正 */
footer a {
    color: #a0aec0; /* 明るいグレーに変更し、可読性を向上 */
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0 5px; /* リンク間の余白を調整 */
}

footer a:hover {
    color: #ffffff; /* ホバー時にさらに明るい白に */
    text-decoration: underline;
}

/* -- Responsive Breakpoints for Columns -- */

/* Tablet (768px) and above: 2 columns */
@media (min-width: 768px) {
    .input-section,
    .results-section,
    .goals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Desktop (1200px) and above: 4 columns */
@media (min-width: 1200px) {
    .input-section,
    .results-section,
    .goals-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


@media (max-width: 767px) { /* Adjust breakpoint to avoid conflict */
    body {
        padding: 20px 15px;
    }
    .container {
        padding: 30px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .metric-value {
        font-size: 2.5rem;
    }

    .input-section, .results-section, .goals-grid {
        gap: 20px;
    }

    .goals-section {
        padding: 20px;
    }
    
    .content-section {
        padding: 30px 20px;
    }
}

/* style.cssの末尾に追記 */

.content-section hr {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 40px 0;
}

.faq-section details {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-section summary {
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    position: relative;
    outline: none;
}

.faq-section summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.faq-section details[open] summary::after {
    transform: rotate(45deg);
}

.faq-section details p {
    padding: 0 20px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
    padding-top: 20px;
}