/* ===================================
   リセット & 基本スタイル
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'M PLUS Rounded 1c', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    font-weight: 400;
    color: #fff;
    background-color: #141414;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===================================
   背景タイル
   =================================== */
#tile-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0.15;
    filter: blur(2px);
    mask-image: linear-gradient(
        to right,
        transparent 0%, black 8%,
        black 92%, transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%, black 8%,
        black 92%, transparent 100%
    );
}

.tile-row {
    display: flex;
    width: max-content; /* コンテンツ幅基準にすることで-50%が常に1セット分になる */
    margin-bottom: 8px;
    white-space: nowrap;
    will-change: transform;
}

.tile-row img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    margin-right: 8px; /* gap: 8px の代わり。末尾にも適用されて1スロット=158pxになる */
}

@keyframes scrollLeft {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes scrollRight {
    0%   { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* 行ごとに異なる速度・スタート位置（素数的比率で実質永久に非同期） */
.tile-row:nth-child(1)  { --duration: 100s; --offset:   0s; }
.tile-row:nth-child(2)  { --duration: 132s; --offset:  -8s; }
.tile-row:nth-child(3)  { --duration: 164s; --offset: -15s; }
.tile-row:nth-child(4)  { --duration: 200s; --offset: -22s; }
.tile-row:nth-child(5)  { --duration: 148s; --offset: -12s; }
.tile-row:nth-child(6)  { --duration: 116s; --offset:  -5s; }
.tile-row:nth-child(7)  { --duration: 176s; --offset: -18s; }
.tile-row:nth-child(8)  { --duration: 124s; --offset:  -9s; }
.tile-row:nth-child(9)  { --duration: 188s; --offset: -25s; }
.tile-row:nth-child(10) { --duration: 108s; --offset:  -3s; }
.tile-row:nth-child(11) { --duration: 212s; --offset: -20s; }
.tile-row:nth-child(12) { --duration:  92s; --offset:  -7s; }

.tile-row-left {
    animation: scrollLeft var(--duration, 35s) linear var(--offset, 0s) infinite;
}

.tile-row-right {
    animation: scrollRight var(--duration, 35s) linear var(--offset, 0s) infinite;
}

/* ===================================
   ローディング画面
   =================================== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    animation: blink 1.5s steps(2, start) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.2; }
}

/* ===================================
   メインコンテンツ
   =================================== */
#content {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

#content.show {
    animation: fadeIn 0.7s ease;
}

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

/* ===================================
   ヘッダー
   =================================== */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #fff;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    opacity: 0.6;
}

/* ===================================
   セクション共通
   =================================== */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title i {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* ===================================
   今日のおはつい
   =================================== */
.today-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.today-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.today-card-inner {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: flex-start;
}

.today-image {
    width: 280px;
    height: 210px;
    object-fit: cover;
    border-radius: 0.75rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.today-image:hover {
    transform: scale(1.02);
}

.today-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.today-text {
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 700;
}

.today-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.6;
    flex-wrap: wrap;
}

.today-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.today-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    width: fit-content;
}

.badge-ohachoco { background: rgba(220, 53, 69, 0.25); color: #e05c6e; }
.badge-konchoco { background: rgba(255, 152, 0, 0.25); color: #ff9800; }
.badge-konbanchoco { background: rgba(255, 87, 34, 0.25); color: #ff5722; }

/* テキストのみのカード */
.today-text-card {
    padding: 2rem 1.5rem;
}

.today-text-card-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 560px;
    margin: 0 auto;
}

.today-text-large {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.03em;
}

.tweet-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    width: fit-content;
}

.tweet-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.today-empty {
    padding: 3rem 2rem;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.5;
}

.today-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

/* ===================================
   去年の今日
   =================================== */
.onthisday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.onthisday-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.onthisday-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.onthisday-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.onthisday-card-body {
    padding: 1rem;
}

.onthisday-year {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-bottom: 0.4rem;
}

.onthisday-text {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
}

.onthisday-empty {
    padding: 2rem;
    text-align: center;
    opacity: 0.4;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.75rem;
}

/* ===================================
   統計情報
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.5;
}

.stat-detail-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.stat-detail-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.stat-detail-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* 種類別バー */
.type-bars {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.type-bar-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.type-bar-label {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.type-bar-track {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

.type-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    padding-left: 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.type-bar-fill.ohachoco { background: rgba(220, 53, 69, 0.7); }
.type-bar-fill.konchoco { background: rgba(255, 152, 0, 0.7); }
.type-bar-fill.konbanchoco { background: rgba(255, 87, 34, 0.7); }

/* プログレスバー */
.progress-container {
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.6), rgba(220, 53, 69, 0.9));
    border-radius: 16px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 700;
}

.progress-detail {
    font-size: 0.85rem;
    opacity: 0.5;
    text-align: center;
}

/* 曜日別バー */
.weekday-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    gap: 0.5rem;
}

.weekday-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.weekday-bar-fill {
    width: 100%;
    max-width: 40px;
    background: rgba(220, 53, 69, 0.5);
    border-radius: 4px 4px 0 0;
    transition: height 1s ease;
    position: relative;
}

.weekday-bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.7;
    white-space: nowrap;
}

.weekday-bar-label {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* カレンダーヒートマップ */
.heatmap-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.heatmap-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.heatmap-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.heatmap-month-label {
    font-size: 1rem;
    font-weight: 700;
    min-width: 120px;
    text-align: center;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 0.8rem;
}

.heatmap-header {
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.4;
    padding: 0.2rem;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
    container-type: size;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 2;
}

.heatmap-cell.active {
    background: rgba(220, 53, 69, 0.2);
}

.heatmap-stats {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05em;
    font-size: 20cqw;
    color: rgba(255, 255, 255, 0.95);
    pointer-events: none;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.heatmap-stats > span {
    display: flex;
    align-items: center;
    gap: 0.2em;
}

.heatmap-stat-like {
    color: rgba(255, 255, 255, 0.95);
}

.heatmap-stat-rt {
    color: rgba(255, 255, 255, 0.9);
}

.heatmap-cell.top {
    outline: 2px solid #fff;
    outline-offset: -2px;
    z-index: 1;
}

.heatmap-cell.empty {
    background: transparent;
}

.heatmap-cell .heatmap-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.heatmap-cell:hover .heatmap-tooltip {
    display: block;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    opacity: 0.5;
}

.legend-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-label {
    margin: 0 0.3rem;
}

/* ===================================
   おたのしみ
   =================================== */
.fun-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fun-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.fun-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.fun-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fun-tweet-display {
    flex: 1;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.fun-tweet-display:hover {
    opacity: 0.75;
}

.fun-tweet-display img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.6rem;
}

.fun-tweet-display .fun-tweet-text {
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 700;
}

.fun-tweet-display .fun-tweet-date {
    font-size: 0.8rem;
    opacity: 0.4;
    margin-top: 0.3rem;
}

.fun-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.7rem 1rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fun-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.fortune-message {
    font-size: 0.85rem;
    opacity: 0.6;
    text-align: center;
    font-style: italic;
}

/* ===================================
   検索・一覧
   =================================== */
.search-controls {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
}

.search-filters {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-date,
.search-select {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
}

.search-date {
    color-scheme: dark;
    -webkit-text-fill-color: #fff;
    font-size: 1rem;
}

.search-date::-webkit-date-and-time-value {
    color: #fff;
    -webkit-text-fill-color: #fff;
    min-height: 1.5em;
}

.search-date::-webkit-datetime-edit,
.search-date::-webkit-datetime-edit-fields-wrapper,
.search-date::-webkit-datetime-edit-year-field,
.search-date::-webkit-datetime-edit-month-field,
.search-date::-webkit-datetime-edit-day-field,
.search-date::-webkit-datetime-edit-text {
    color: #fff;
    -webkit-text-fill-color: #fff;
    opacity: 1;
}

.search-date::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(3) hue-rotate(310deg);
    opacity: 0.6;
    cursor: pointer;
}

.search-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.search-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    cursor: pointer;
}

.search-select option {
    background: #1e1e1e;
    color: #fff;
}

.search-date:focus,
.search-select:focus {
    outline: none;
    border-color: rgba(220, 53, 69, 0.6);
}

/* モバイル日付テキスト表示 */
.search-date-text {
    display: none;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.search-date-sep {
    opacity: 0.4;
}

.search-result-info {
    font-size: 0.85rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* ギャラリーグリッド */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
}

.gallery-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.gallery-item-info {
    padding: 0.6rem 0.8rem;
}

.gallery-item-text {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.gallery-item-date {
    font-size: 0.7rem;
    opacity: 0.4;
}

.gallery-item .milestone-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 215, 0, 0.9);
    color: #333;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
}

.gallery-item {
    position: relative;
}

.load-more-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ===================================
   モーダル
   =================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 53, 69, 0.5) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(220, 53, 69, 0.5);
    border-radius: 2px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 53, 69, 0.8);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-image {
    width: 100%;
    border-radius: 1rem 1rem 0 0;
}

.modal-body-inner {
    padding: 1.5rem;
}

.modal-text {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.5;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.modal-milestone {
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 215, 0, 0.15);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
}

.modal-body-inner .tweet-link {
    margin-top: 1rem;
}

/* ===================================
   ライトボックス（画像拡大表示）
   =================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s ease;
    z-index: 1;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-img {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.5rem;
    z-index: 1;
}

/* ===================================
   フッター
   =================================== */
.page-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    font-size: 0.85rem;
    opacity: 0.4;
}

/* ===================================
   レスポンシブ
   =================================== */
@media (max-width: 768px) {
    #content {
        padding: 1.5rem 1rem 2rem;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .fun-grid {
        grid-template-columns: 1fr;
    }

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

    .today-card-inner {
        flex-direction: column;
    }

    .today-image {
        width: 100%;
        height: 200px;
    }

    .tile-row img {
        width: 120px;
        height: 120px;
        margin-right: 8px;
    }
}

@media (max-width: 600px) {
    .page-title {
        font-size: 1.7rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-date-sep {
        display: none;
    }

    .search-date,
    .search-select {
        width: 100%;
    }

    .onthisday-grid {
        grid-template-columns: 1fr;
    }

    /* モバイル日付入力オーバーレイ */
    .date-wrapper {
        position: relative;
        width: 100%;
    }

    .date-wrapper .search-date {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        z-index: 1;
        cursor: pointer;
    }

    .search-date-text {
        display: block;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .stat-card {
        padding: 0.8rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
