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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans CJK JP', sans-serif;
    background-color: #F9E7EF;
    color: #444444;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #F9E7EF 0%, #CAEAF8 100%);
    padding: 30px;
    position: relative;
}

.header-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.character-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.character-message {
    position: relative;
    margin-top: 10px;
}

.message-bubble {
    background: white;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.message-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.header-main {
    flex: 1;
}

.header-main h1 {
    font-size: 28px;
    color: #444444;
    margin-bottom: 20px;
    font-weight: 600;
}

.achievement-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.achievement-chart {
    width: 100px;
    height: 100px;
}

.circular-chart {
    display: block;
    max-width: 100%;
}

.circle-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.circle {
    fill: none;
    stroke: #B0B0B0;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
}

.percentage {
    fill: #444444;
    font-size: 20px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
}

.achievement-text {
    flex: 1;
    font-size: 18px;
    font-weight: 500;
}

.main-content {
    padding: 30px;
}

.sns-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sns-item {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 20px;
    display: grid;
    grid-template-columns: 50px 120px 1fr;
    grid-template-rows: auto auto;
    gap: 15px;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sns-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sns-icon {
    font-size: 30px;
    grid-row: span 2;
}

.sns-name {
    font-weight: 600;
    font-size: 16px;
}

.sns-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.sns-controls label {
    font-size: 14px;
    color: #666;
}

.plan-input {
    width: 50px;
    padding: 5px;
    border: 2px solid #CAEAF8;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.plan-input:focus {
    outline: none;
    border-color: #FF9770;
}

.count-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #FF9770;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.count-btn:hover {
    background: #ff7a4d;
}

.count-btn:active {
    transform: scale(0.95);
}

.actual-count {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.progress-container {
    grid-column: 2 / -1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #B0B0B0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 10px;
}

.remaining {
    font-size: 14px;
    color: #666;
    min-width: 60px;
}

.footer {
    padding: 30px;
    background: #f9f9f9;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn {
    background: #FF9770;
    color: white;
}

.save-btn:hover {
    background: #ff7a4d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 151, 112, 0.3);
}

.copy-btn {
    background: #CAEAF8;
    color: #444444;
}

.copy-btn:hover {
    background: #b5dff5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(202, 234, 248, 0.3);
}

.reset-btn {
    background: #f0f0f0;
    color: #666;
}

.reset-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 1000;
}

.celebration-emoji {
    font-size: 100px;
    animation: celebrate 1s ease-out;
}

@keyframes celebrate {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0;
    }
}

.celebration.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .character-message {
        margin-bottom: 20px;
    }
    
    .message-bubble::before {
        left: 50%;
        top: -10px;
        transform: translateX(-50%);
        border-width: 0 10px 10px 10px;
        border-color: transparent transparent white transparent;
    }
    
    .header-main h1 {
        font-size: 24px;
    }
    
    .achievement-container {
        flex-direction: column;
    }
    
    .sns-item {
        grid-template-columns: 40px 1fr;
        grid-template-rows: auto auto auto;
        padding: 15px;
    }
    
    .sns-icon {
        grid-row: 1;
    }
    
    .sns-name {
        grid-column: 2;
        grid-row: 1;
    }
    
    .sns-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        justify-content: space-between;
        margin-top: 10px;
    }
    
    .progress-container {
        grid-column: 1 / -1;
        grid-row: 3;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .footer {
        padding: 20px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .header-main h1 {
        font-size: 20px;
    }
    
    .achievement-text {
        font-size: 16px;
    }
    
    .sns-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .plan-input {
        width: 45px;
    }
}