
/* 基本設定 */

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

body{

    background:#ffffff;

    font-family:'DotGothic16',sans-serif;

    color:#6663d4;

    padding:20px;

}

.container{

    max-width:1100px;

    margin:auto;

    background:#c1c3ff;

    border:4px solid #6663d4;

    padding:25px;

    box-shadow:8px 8px #6663d4;

}

/* タイトル */

header{

    text-align:center;

    margin-bottom:30px;

}

header h1{

    font-size:36px;

    letter-spacing:3px;

}

header p{

    margin-top:10px;

}



  /* カレンダー */


.calendar{

    display:grid;

grid-template-columns: repeat(7, minmax(0, 1fr));

    gap:12px;

}

.day{

    background:#ffffff;

    border:3px solid #6663d4;

    min-height:110px;

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

    cursor:pointer;

    transition:.15s;

}

.day:hover{

    transform:translate(-3px,-3px);

    box-shadow:5px 5px #6663d4;

}

.day.selected{

    background:#ffbbe4;

}

.day.today{

    border:3px dashed #6663d4;

}

.day-number{

    margin-bottom:8px;

}

.day img{

    width:58px;

    image-rendering:pixelated;

}


/* --------------------
   感情選択
-------------------- */

.emotion-window{

    margin-top:40px;

    background:#ffffff;

    border:4px solid #6663d4;

    padding:20px;

    box-shadow:8px 8px #6663d4;

}

.emotion-window h2{

    text-align:center;

    margin-bottom:20px;

}

.emotion-list{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

}

.emotion-list img{

    width:70px;

    margin:auto;

    cursor:pointer;

    image-rendering:pixelated;

    transition:.15s;

}

.emotion-list img:hover{

    transform:scale(1.15);

}
/* メモ */
.memo-window{

    margin-top:35px;

    background:#ffffff;

    border:4px solid #6663d4;

    padding:20px;

    box-shadow:8px 8px #6663d4;

}

.memo-window h2{

    text-align:center;

    margin-bottom:15px;

}

textarea{

    width:100%;

    height:120px;

    resize:none;

    padding:15px;

    font-family:'DotGothic16',sans-serif;

    border:3px solid #6663d4;

    font-size:14px;

}

.memo-footer{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-top:15px;

}

#saveButton{

    font-size:20px;

    width:150px;

    height:45px;

    background:white;

    border:3px solid #6663d4;

    cursor:pointer;

    font-family:'DotGothic16',sans-serif;

    transition:.15s;

}

#saveButton:hover{

    transform:translate(-2px,-2px);

    box-shadow:4px 4px black;

}

#saveButton:active{

    transform:translate(2px,2px);

    box-shadow:none;

}


/* --------------------
   SAVE COMPLETE
-------------------- */

#savePopup{

    position:fixed;

    top:20px;

    right:20px;

    background:#6663d4;

    color:white;

    padding:15px 25px;

    border:3px solid white;

    display:none;

    z-index:1000;

}
/* HISTORY */
.history-window{

    margin-top:45px;

    background:#fbfbfb;

    border:4px solid #6663d4;

    padding:20px;

    box-shadow:8px 8px #6663d4;

}

.history-window h2{

    text-align:center;

    margin-bottom:20px;

}


/* 外側 */

.history-wrapper{

    overflow:hidden;

}


/* 流れる部分 */

#historyTrack{

    display:flex;

    gap:20px;

    width:max-content;

    animation:historyScroll 35s linear infinite;

}

/* PCではホバーで停止 */

#historyTrack:hover{

    animation-play-state:paused;

}


/* カード */

.history-card{

    width:170px;

    min-height:190px;

    background:white;

    border:3px solid #6663d4;

    box-shadow:5px 5px #6663d4;

    padding:15px;

    flex-shrink:0;

    text-align:center;

}

.history-card img{

    width:70px;

    image-rendering:pixelated;

    margin-bottom:10px;

}

.history-date{

    margin-bottom:10px;

}

.history-comment{

    font-size:13px;

    word-break:break-word;

}


/* --------------------
   アニメーション
-------------------- */

@keyframes historyScroll{

    from{

        transform:translateX(0);

    }

    to{

        transform:translateX(calc(-190px * 8));

    }

}

@keyframes pop{

    0%{

        transform:scale(.6);

    }

    50%{

        transform:scale(1.2);

    }

    100%{

        transform:scale(1);

    }

}

.pop{

    animation:pop .25s;

}


/* --------------------
   フッター
-------------------- */

footer{

    margin-top:50px;

    text-align:center;

}


/* --------------------
   スマホ
-------------------- */

@media(max-width:768px){

.calendar{

gap: 4px;

}

.day{

min-height:90px;

}

.day img{

width:45px;

}

.emotion-list{

grid-template-columns:repeat(4,1fr);

gap:12px;

}

.emotion-list img{

width:55px;

}

.memo-footer{

flex-direction:column;

gap:15px;

}

#saveButton{

width:100%;

}

.history-wrapper{

overflow-x:auto;

overflow-y:hidden;

padding-bottom:10px;

}

/* スマホでは自動スクロールを止めて
   指で横スクロールできるようにする */

#historyTrack{

animation:none;

padding-right:20px;

}

.history-card{

width:150px;

min-height:170px;

}

}

#historyTrack{

    display:flex;

    gap:20px;

    width:max-content;

    animation:historyScroll 60s linear infinite;

}
.delete-btn{

    margin-top:10px;

    width:28px;

    height:28px;

    border:2px solid #6663d4;

    background:white;

    cursor:pointer;

    font-family:'DotGothic16',sans-serif;

}

.delete-btn:hover{

    background:#ffb5b5;

}

.day {
    min-width: 0;
}

.day img {
    max-width: 100%;
    height: auto;
}

.history-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 6px 12px;
}

#historyTrack {
    flex-wrap: nowrap;
    animation: none;
}

.history-card {
    height: 190px;
    min-height: 0;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 8px;
        box-shadow: 4px 4px #6663d4;
    }

    .day {
        min-height: 64px;
        border-width: 2px;
    }

    .day.today {
        border-width: 2px;
    }

    .day img {
        width: min(32px, 100%);
    }

    .emotion-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .emotion-list img {
        max-width: 100%;
        height: auto;
    }
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
    text-align: center;
    font-size: 14px;
    padding-block: 6px;
}

#calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
    text-align: center;
    padding-block: 6px;
}

.day-icon:not([src]) {
    display: none;
}

@media (max-width: 768px) {
    #calendar {
        gap: 4px;
    }
}
.status-bar, .month-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 16px;
    margin-block: 16px;
}

.status-bar {
    background: white;
    border: 3px solid #6663d4;
    padding: 8px;
}

.calendar-section {
    text-align: center;
}

.month-controls button, #currentMonth {
    background: white;
    border: 2px solid #6663d4;
    color: inherit;
    font: inherit;
    padding: 6px 12px;
    cursor: pointer;
}

#currentMonth {
    margin-bottom: 10px;
}

.day {
    color: inherit;
    font: inherit;
    padding: 2px;
}

.calendar-weekday:first-child { color: #9c2457; }
.calendar-weekday:nth-child(7) { color: #304da7; }

.history-space { flex: 0 0 20px; }

#loadingScreen[hidden] {
    display: none;
}

#loadingScreen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #c1c3ff;
}

.loading-card {
    width: min(100%, 260px);
    padding: 24px;
    border: 4px solid #6663d4;
    box-shadow: 6px 6px #6663d4;
    background: #fff;
    text-align: center;
    letter-spacing: 2px;
}

.loading-heart {
    display: block;
    margin-bottom: 6px;
    color: #6663d4;
    font-size: 44px;
    line-height: 1;
    animation: loadingBounce 600ms steps(3) infinite alternate;
}

.loading-bar {
    height: 16px;
    margin-top: 14px;
    border: 2px solid #6663d4;
    background: #ffeff8;
    overflow: hidden;
}

.loading-bar::before {
    content: "";
    display: block;
    width: 40%;
    height: 100%;
    background: #a19eff;
    animation: loadingSlide 850ms steps(6) infinite alternate;
}

@keyframes loadingBounce {
    to { transform: translateY(-8px); }
}

@keyframes loadingSlide {
    to { transform: translateX(150%); }
}

@media (prefers-reduced-motion: reduce) {
    .loading-heart,
    .loading-bar::before {
        animation: none;
    }
}/* 感情の名前と使い方 */
html { scroll-padding-top: 20px; }
.emotion-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 4px;
    border: 2px solid transparent;
    background: #f5f3ff;
    color: #514ab0;
    font: inherit;
    cursor: pointer;
}
.emotion-choice[aria-pressed="true"] { border-color: #6663d4; background: #ffe0f2; }
.emotion-name { font-size: 14px; }
.emotion-choice:focus-visible, .page-link:focus-visible { outline: 3px solid #bd3a84; outline-offset: 3px; }
.guide-header, .timeline-header { padding: 26px 12px; border-bottom: 3px dashed #8c87dd; }
.guide-panel { margin-top: 24px; padding: 22px; border: 3px solid #6663d4; background: #fff; color: #514ab0; box-shadow: 4px 4px #9690e6; }
.guide-panel h2 { margin-bottom: 14px; font-size: 22px; }
.guide-panel p { line-height: 1.9; }
.guide-steps { padding-left: 24px; }
.guide-steps li + li { margin-top: 22px; }
.page-link { display: inline-block; margin-top: 12px; padding: 8px 12px; background: #ffe0f2; border: 2px solid #6663d4; color: #514ab0; text-decoration: none; }
.page-link:hover { background: #ffc5e8; }
.guide-emotions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.guide-emotion { padding: 14px; background: #f5f3ff; border: 2px solid #dad6fb; text-align: center; }
.guide-emotion h3 { font-size: 16px; }
.guide-emotion img { width: 58px; height: 58px; object-fit: contain; image-rendering: pixelated; margin: 12px 0; }
.guide-emotion p { font-size: 13px; text-align: left; }
.review-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.timeline-page .container { background: #ecebff; }
.timeline-header { background: #fff; border: 3px solid #6663d4; margin-top: 16px; box-shadow: 5px 5px #aba5ef; }
.timeline-header p { color: #514ab0; }
.timeline-controls { background: #dad6fb; padding: 16px 8px; border: 2px solid #aaa4e8; }
.timeline-page #monthSummary { font-size: 18px; margin: 24px 0 12px; }
.timeline-page #emotionSummary li { border: 1px solid #b0a7e7; box-shadow: 2px 2px #d0caee; padding: 6px 12px; }
.timeline-page #timelineRecords { margin-top: 30px; }
.timeline-page .timeline-record { padding: 18px; margin-bottom: 20px; box-shadow: 4px 4px #cec8ee; }
.timeline-record time { display: inline-block; padding: 3px 8px; background: #efecff; }
.timeline-record p { padding-top: 10px; border-top: 1px dashed #ccc4e9; line-height: 1.8; }
@media (max-width: 600px) {
    .guide-emotions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-links { grid-template-columns: 1fr; }
    .guide-panel { padding: 14px; }
    .emotion-name { font-size: 12px; }
    .emotion-list { gap: 6px; }
    .emotion-choice { padding: 8px 2px; }
}

/* ページメニューとタイムライン */
.site-nav { display: flex; justify-content: flex-end; }
.site-nav details { position: relative; }
.site-nav summary {
    list-style: none;
    cursor: pointer;
    background: #fff;
    border: 3px solid #6663d4;
    padding: 4px 12px;
    font-size: 24px;
}
.site-nav summary::-webkit-details-marker { display: none; }
.site-links {
    position: absolute;
    right: 0;
    z-index: 20;
    width: max-content;
    background: white;
    border: 3px solid #6663d4;
    box-shadow: 4px 4px #6663d4;
}
.site-links a { display: block; padding: 8px 14px; color: #473da0; }
.site-links a[aria-current="page"] { background: #ffbbe4; }

