/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* カラースキーム（ライトモード） */

/* モバイル最適化 */
button {
    touch-action: manipulation; /* タップ時の300msディレイを削減 */
    -webkit-tap-highlight-color: rgba(255, 213, 79, 0.3); /* タップ時のハイライト色 */
}

body {
    font-family: 'M PLUS Rounded 1c', 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    color: #3e2723;
    min-height: 100vh;
    padding: 20px;
    /* スクロール時のパフォーマンス向上 */
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fffef7;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #fff9c4 0%, #ffd54f 100%);
    padding: 20px;
    border-bottom: 3px solid #ff6f00;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
}

.header-logo {
    width: 200px;
    height: auto;
}

header h1 {
    color: #3e2723;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
}

.header-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 0 0 0;
}

.nav-link {
    background: linear-gradient(135deg, #ffb300 0%, #ff8f00 100%);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid white;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 143, 0, 0.3);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 213, 79, 0.3);
}


.icon-btn {
    background: white;
    transition: background 0.3s ease;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

/* メインレイアウト */
.main-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
}

main {
    flex: 1;
}

/* 今日の操作パネル */
.today-panel {
    background: white;
    transition: background 0.3s ease;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.today-panel h2 {
    color: #3e2723;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* 参加スタンプ */
.stamps-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stamp-btn {
    position: relative;
    background: white;
    transition: background 0.3s ease;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.stamp-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.stamp-label {
    font-size: 0.9em;
    color: #666;
    font-weight: bold;
}

/* 花丸エフェクト（手書き風） */
.hanamaru {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    opacity: 0;
    pointer-events: none;
    background-image: url('assets/hanamaru.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stamp-btn.active .hanamaru {
    opacity: 0.8;
}

/* 押した瞬間のアニメーション（1回だけ） */
.hanamaru.animate {
    animation: hanamaru-draw 0.6s ease-out;
}

@keyframes hanamaru-draw {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15) rotate(5deg);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

/* タスクセクション */
.task-section {
    text-align: center;
}

.task-button-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.task-btn {
    background: linear-gradient(135deg, #fff9c4 0%, #ffd54f 50%, #ffb300 100%);
    color: #3e2723;
    border: 3px solid #fff;
    border-radius: 30px;
    padding: 18px 45px;
    font-size: 1.3em;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        0 0 0 2px #ffb300,
        0 8px 0 #ff8f00,
        0 12px 25px rgba(255, 143, 0, 0.5);
    transition: all 0.1s ease;
    position: relative;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
}

.task-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 2px #ffb300,
        0 10px 0 #ff8f00,
        0 15px 30px rgba(255, 143, 0, 0.6);
}

.task-btn:active {
    transform: translateY(6px);
    box-shadow:
        0 0 0 2px #ffb300,
        0 2px 0 #ff8f00,
        0 5px 12px rgba(255, 143, 0, 0.4);
}

.streak-badge {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    animation: streak-pulse 2s ease-in-out infinite;
}

@keyframes streak-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
    }
}

.task-count {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1em;
}

.task-count strong {
    color: #ff6f00;
    font-size: 1.3em;
}

/* 週ログ */
.week-log {
    background: white;
    transition: background 0.3s ease;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.week-nav button {
    background: #ffd54f;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.week-nav button:hover {
    background: #ffb300;
    transform: scale(1.05);
}

.week-nav button:disabled {
    background: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.5;
}

#weekTitle {
    color: #3e2723;
    font-size: 1.2em;
}

.week-table {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.week-header {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    background: #fff8e1;
    font-weight: bold;
    padding: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.week-body {
    max-height: 400px;
    overflow-y: auto;
}

.week-row {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.week-row:last-child {
    border-bottom: none;
}

.week-row.today {
    background: #fff9c4;
}

.week-stamps {
    display: flex;
    gap: 8px;
}

.mini-stamp {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.3;
    position: relative;
}

.mini-stamp.active {
    opacity: 1;
}

.mini-stamp.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    border: 2px solid #ff5252;
    border-radius: 50%;
}

/* リモにゃん成長パネル */
.remonyan-panel {
    width: 200px;
    background: white;
    transition: background 0.3s ease;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.remonyan-panel h3 {
    color: #3e2723;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.remonyan-container {
    margin: 20px 0;
}

.remonyan-growth {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: remonyan-bounce 3s ease-in-out infinite;
}

@keyframes remonyan-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.remonyan-count {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff6f00;
    margin: 15px 0 0 0;
}

/* ものさしバー */
.monasashi-bar {
    height: 300px;
    width: 60px;
    margin: 20px auto 0;
    border: 2px solid #bdbdbd;
    border-radius: 10px;
    overflow: visible;
    position: relative;
    background: #f5f5f5;
    display: flex;
    flex-direction: column-reverse;
}

.monasashi-bar .monasashi-block {
    overflow: hidden;
}

.monasashi-block {
    height: 1%;
    transition: all 0.3s;
}

.monasashi-current {
    position: absolute;
    left: 0; /* バーの左端に揃える */
    width: 100%; /* バーの幅に合わせる */
    height: 3px;
    background: #ff3333; /* 赤いライン */
    box-shadow: 0 1px 3px rgba(255, 51, 51, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* 数字は非表示 */
.monasashi-number {
    display: none;
}

/* 今週の目標 */
.weekly-goal {
    background: #fff9c4;
    border: 2px solid #ffd54f;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.goal-header label {
    font-weight: bold;
    color: #3e2723;
    margin: 0;
}

.add-goal-btn {
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    color: #3e2723;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

.add-goal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.4);
}

.add-goal-btn:active {
    transform: translateY(0);
}

.add-goal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.goals-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-item > div:first-child {
    display: flex;
    gap: 8px;
    align-items: center;
}

.goal-item input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
    border-radius: 10px;
    font-size: 1em;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    transition: border-color 0.2s;
}

.goal-item input:focus {
    outline: none;
    border-color: #ffb300;
}

.remove-goal-btn {
    background: #ff5252;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.remove-goal-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

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

/* 目標達成率 */
.goal-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.goal-progress-bar {
    width: 100%;
    height: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ffe082;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.goal-progress-fill.completed {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
}

.goal-progress-text {
    font-size: 0.85em;
    color: #8d6e63;
    text-align: right;
}

/* 注意書き */
.notice {
    background: #fff3e0;
    border: 2px solid #ff9800;
    border-radius: 10px;
    padding: 15px;
    font-size: 0.9em;
    color: #e65100;
    text-align: center;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    transition: background 0.3s ease;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #333;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-primary {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #1976d2;
    transform: translateY(-2px);
}

.btn-danger {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* お祝い画面 */
.celebration {
    background: rgba(0,0,0,0.8);
}

.celebration-content {
    max-width: 600px;
    text-align: center;
}

.celebration-circle {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

#celebrationCanvas {
    position: absolute;
    top: 0;
    left: 0;
}

.celebration-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: celebration-spin 2s ease-in-out;
}

@keyframes celebration-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.2); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); opacity: 1; }
}

.celebration-title {
    font-size: 2.5em;
    color: #ff6f00;
    margin: 20px 0;
    animation: celebration-bounce 1s ease-in-out;
}

@keyframes celebration-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.celebration-message {
    font-size: 1.3em;
    color: #3e2723;
    margin: 20px 0;
    line-height: 1.6;
}

.celebration-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 30px;
}

.celebration-buttons .btn-primary {
    grid-column: 1 / -1;
}

.btn-social {
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-social.threads {
    background: #000000;
}

.btn-social.x {
    background: #1da1f2;
}

.btn-social.line {
    background: #00b900;
}

.btn-social:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* 紙吹雪 */
.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd54f;
    top: -10px;
    animation: confetti-fall 3s linear;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* タスク完了メッセージ */
.task-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    color: #3e2723;
    padding: 20px 40px;
    border-radius: 30px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.task-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* フッター */
footer {
    background: #fffef7;
    color: #3e2723;
    padding: 40px 20px;
    text-align: center;
    margin-top: 50px;
    border-radius: 20px 20px 0 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #5d4037;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: #ffd54f;
}

.footer-credit {
    font-size: 0.9em;
    color: #8d6e63;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.footer-logo {
    height: 40px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* 週間サマリー確認ポップアップ */
.prompt-content {
    max-width: 450px;
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%);
    border: 3px solid #ffd54f;
    text-align: center;
    padding: 30px;
}

.prompt-content h3 {
    color: #3e2723;
    font-size: 1.4em;
    margin-bottom: 15px;
}

.prompt-content p {
    color: #3e2723;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #e0e0e0;
    color: #3e2723;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 週間サマリー画面 */
.summary-content {
    max-width: 600px;
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%);
    border: 3px solid #ffd54f;
    max-height: none; /* スクショしやすいように高さ制限なし */
    overflow-y: visible;
}

.summary-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd54f;
}

.summary-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.summary-header h2 {
    color: #ff6f00;
    font-size: 1.8em;
    margin-bottom: 5px;
}

.summary-date {
    color: #3e2723;
    font-size: 1em;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.stat-item {
    background: white;
    transition: background 0.3s ease;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
}

.stat-item.highlight {
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    border-color: #ff6f00;
}

.stat-label {
    font-size: 0.9em;
    color: #3e2723;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #ff6f00;
}

.summary-graph {
    background: white;
    transition: background 0.3s ease;
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 10px;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
}

.summary-graph h3 {
    color: #3e2723;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.summary-stamps {
    background: white;
    transition: background 0.3s ease;
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 10px;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
}

.summary-stamps h3 {
    color: #3e2723;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.stamp-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stamp-count {
    color: #3e2723;
    font-size: 1em;
}

.stamp-count strong {
    color: #ff6f00;
    font-size: 1.2em;
}

.summary-goals {
    background: white;
    transition: background 0.3s ease;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    border: 2px solid #ffe082;
    transition: border-color 0.3s ease;
}

.summary-goals h3 {
    color: #3e2723;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.summary-goals ul {
    list-style: none;
    padding: 0;
}

.summary-goals li {
    color: #3e2723;
    padding: 8px 0;
    border-bottom: 1px solid #ffe082;
}

.summary-goals li:last-child {
    border-bottom: none;
}

.summary-goals li::before {
    content: "✓ ";
    color: #4caf50;
    font-weight: bold;
    margin-right: 8px;
}

.summary-share {
    text-align: center;
    padding-top: 15px;
    border-top: 2px solid #ffd54f;
}

.share-message {
    color: #ff6f00;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
}

.hashtag-text {
    color: #ff6f00;
    font-size: 1.2em;
    font-weight: bold;
    margin: 10px 0;
}

.summary-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 積み上げを見るボタン */
.stats-btn {
    background: linear-gradient(135deg, #ffb300 0%, #ff8f00 100%);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border: 2px solid white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 143, 0, 0.3);
}

.stats-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 213, 79, 0.3);
}

/* 積み上げ統計画面 */
.stats-content {
    max-width: 700px;
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%);
    border: 3px solid #ffd54f;
    max-height: none;
    overflow-y: visible;
}

.stats-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffd54f;
}

.stats-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 8px;
}

.stats-header h2 {
    color: #ff6f00;
    font-size: 1.5em;
    margin-bottom: 5px;
}

/* 累計統計カード */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: white;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid #ffe082;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.6em;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.85em;
    color: #8d6e63;
    margin-bottom: 3px;
}

.stat-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff6f00;
}

/* 月間カレンダー */
.calendar-section {
    background: white;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 2px solid #ffe082;
    transition: all 0.3s ease;
}

.calendar-section h3 {
    color: #3e2723;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.monthly-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    transition: all 0.2s;
}

.calendar-day:hover {
    transform: scale(1.1);
}

.calendar-day-label {
    font-size: 0.7em;
    color: #8d6e63;
    font-weight: normal;
}

.calendar-day-number {
    font-size: 1.1em;
}

/* タスク数による色分け */
.calendar-day.level-0 {
    background: #f5f5f5;
    color: #9e9e9e;
}

.calendar-day.level-1 {
    background: #fff9c4;
    color: #3e2723;
}

.calendar-day.level-2 {
    background: #ffe082;
    color: #3e2723;
}

.calendar-day.level-3 {
    background: #ffd54f;
    color: #3e2723;
}

.calendar-day.level-4 {
    background: #ffb300;
    color: #3e2723;
}

.calendar-day.level-5 {
    background: #ff6f00;
    color: white;
}

/* 実績コレクション */
.achievements-section {
    background: white;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 2px solid #ffe082;
}

.achievements-section h3 {
    color: #3e2723;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #fff9c4 0%, #fffde7 100%);
    border-radius: 8px;
    border: 2px solid #ffd54f;
    transition: all 0.2s;
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 213, 79, 0.3);
}

.achievement-item.locked {
    background: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.5;
}

.achievement-icon {
    font-size: 2.5em;
    margin-bottom: 8px;
}

.achievement-name {
    font-size: 0.9em;
    font-weight: bold;
    color: #3e2723;
    text-align: center;
}

.stats-share {
    text-align: center;
    padding-top: 15px;
    border-top: 2px solid #ffd54f;
}

/* レスポンシブ */
@media (max-width: 768px) {
    /* ボディのパディング縮小 */
    body {
        padding: 10px;
    }

    /* ヘッダータイトルのフォントサイズ縮小 */
    header h1 {
        font-size: 1.3em;
    }

    header {
        padding: 15px;
    }

    /* メインレイアウト */
    .main-layout {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    /* パネルのパディング縮小 */
    .today-panel,
    .week-log {
        padding: 15px;
    }

    /* リモにゃんパネル */
    .remonyan-panel {
        width: 100%;
    }

    .monasashi-panel {
        width: 100%;
    }

    .monasashi-bar {
        width: 100%;
        height: 60px;
        flex-direction: row;
    }

    /* スタンプを2列に */
    .stamps-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* スタンプアイコンとラベルを縮小 */
    .stamp-icon {
        width: 50px;
        height: 50px;
    }

    .stamp-label {
        font-size: 0.85em;
    }

    .stamp-btn {
        padding: 12px;
    }

    /* タスクボタンのサイズ調整 */
    .task-btn {
        padding: 15px 35px;
        font-size: 1.1em;
    }

    /* 週ナビゲーションの調整 */
    .week-nav button {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    /* 週タイトルの改行防止とサイズ調整 */
    #weekTitle {
        font-size: 1em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 週テーブルの調整 */
    .week-header,
    .week-row {
        grid-template-columns: 85px 1fr 65px;
        font-size: 0.85em;
        padding: 8px;
    }

    /* 今週の目標セクション */
    .weekly-goal {
        padding: 12px;
    }

    .goal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .add-goal-btn {
        width: 100%;
        padding: 12px;
        font-size: 1em;
    }

    .goal-item input {
        padding: 12px;
        font-size: 1em;
    }

    /* モーダルのパディング縮小 */
    .modal-content {
        padding: 20px;
        width: 95%;
    }

    /* お祝い画面の調整 */
    .celebration-content {
        padding: 20px;
    }

    .celebration-circle {
        width: 250px;
        height: 250px;
    }

    #celebrationCanvas {
        width: 250px;
        height: 250px;
    }

    .celebration-logo {
        width: 120px;
        height: 120px;
    }

    .celebration-title {
        font-size: 2em;
    }

    .celebration-message {
        font-size: 1.1em;
    }

    .celebration-buttons {
        grid-template-columns: 1fr;
    }

    /* 週間サマリー画面 */
    .summary-content {
        padding: 8px;
    }

    .summary-header {
        margin-bottom: 4px;
        padding-bottom: 4px;
    }

    .summary-logo {
        width: 40px;
        height: 40px;
        margin-bottom: 3px;
    }

    .summary-header h2 {
        font-size: 1.1em;
        margin-bottom: 2px;
    }

    .summary-date {
        font-size: 0.75em;
    }

    .summary-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        margin-bottom: 6px;
    }

    .stat-item {
        padding: 6px 4px;
    }

    .stat-label {
        font-size: 0.65em;
        margin-bottom: 2px;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .summary-graph,
    .summary-stamps,
    .summary-goals {
        padding: 6px;
        margin-bottom: 4px;
    }

    .summary-graph h3,
    .summary-stamps h3,
    .summary-goals h3 {
        font-size: 0.8em;
        margin-bottom: 4px;
    }

    #weeklyChart {
        max-height: 100px;
    }

    .summary-share {
        padding-top: 4px;
        border-top: 1px solid #ffd54f;
    }

    .share-message {
        font-size: 0.8em;
        margin-bottom: 4px;
    }

    .hashtag-text {
        font-size: 1em;
        margin: 4px 0;
    }

    .summary-buttons {
        gap: 6px;
    }

    .summary-buttons .btn-social {
        padding: 6px 12px;
        font-size: 0.75em;
    }

    .stamp-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .stamp-count {
        font-size: 0.75em;
    }

    .stamp-count strong {
        font-size: 0.9em;
    }

    .summary-goals li {
        padding: 3px 0;
        font-size: 0.75em;
    }

    /* フッター */
    footer {
        padding: 30px 15px;
    }

    .footer-links {
        gap: 15px;
    }

    .footer-links a {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}

/* 超小型デバイス（360px以下） */
@media (max-width: 360px) {
    header h1 {
        font-size: 1.1em;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .task-btn {
        padding: 12px 25px;
        font-size: 1em;
    }

    #weekTitle {
        font-size: 0.9em;
    }

    .week-nav button {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .week-header,
    .week-row {
        grid-template-columns: 75px 1fr 60px;
        font-size: 0.8em;
    }
}
