@charset "UTF-8";
html {
    overflow-y: scroll;
}
/* --- レイアウト共通設定 --- */
body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f4;
}

a { text-decoration: none; color: #007bff; }

/* コンテンツ幅の制限（中央寄せ） */
.inner-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- ヘッダー --- */
.site-header {
    background-color: #333;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.site-logo {
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.site-logo:hover { color: #ddd; }

/* --- メインコンテンツエリア --- */
.main-content {
    background-color: #fff;
    padding-top: 30px;
    padding-bottom: 30px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

/* --- ダッシュボードヘッダー（タイトルとカレンダーの配置） --- */
.dashboard-header {
    display: flex;
    justify-content: space-between; /* 左右に配置 */
    align-items: flex-start;        /* 上揃え */
    flex-wrap: wrap;                /* スマホで折り返し */
    gap: 20px;                      /* 間隔 */
    margin-bottom: 30px;            /* 下のコンテンツとの余白 */
}

.header-left {
    flex: 1; /* 左側は余ったスペースを全部使う */
    min-width: 280px; /* 極端に狭くならないように */
}

/* カレンダーコンテナ */
.calendar-container {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;

    width: 100%;       /* スマホ等は幅いっぱい */
    max-width: 320px;  /* 最大幅制限 */
    flex-shrink: 0;    /* PC表示で潰れないように固定 */
}

/* --- ステータスボックス (機能追加分) --- */
.status-box {
    background-color: #f9f9f9;
    border-left: 4px solid #007bff;
    padding: 12px 15px;
    margin-top: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.plot-count {
    font-size: 1.1em;
    margin: 0 0 8px 0;
}
.plot-count strong {
    font-size: 1.3em;
    color: #007bff;
}
.phase-msg {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95em;
}
/* 締切強調 */
.deadline-highlight {
    color: #d32f2f; /* 赤色 */
    font-weight: bold;
}

/* --- フッター --- */
.site-footer {
    background-color: #333;
    color: #ccc;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85em;
    margin-top: auto;
}
.site-footer p { margin: 5px 0; }

/* --- その他パーツ --- */
.back-link { display: inline-block; margin-bottom: 20px; font-weight: bold; }

/* テーブル */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; white-space: nowrap; }

/* テーブルヘッダー */
th { background-color: #444; color: white; padding: 10px; text-align: left; cursor: pointer; user-select: none; position: relative; }
th:hover { background-color: #666; }
th::after { content: "⇅"; position: absolute; right: 5px; opacity: 0.3; font-size: 0.8em; }

td { border-bottom: 1px solid #ddd; padding: 8px 10px; vertical-align: middle; }
tr:nth-child(even) { background-color: #f9f9f9; }

/* 文字色など */
.size-S { color: #2196F3; font-weight: bold; }
.size-M { color: #FF9800; font-weight: bold; }
.size-L { color: #f44336; font-weight: bold; font-size: 1.2em; }
.price { text-align: right; font-family: monospace; }
.entries { text-align: center; font-weight: bold; color: #d32f2f; }
.updated { font-size: 0.8em; color: #888; }

/* カードデザイン */
.world-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.world-card { border: 1px solid #ddd; padding: 15px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s; }
.world-card:hover { transform: translateY(-3px); box-shadow: 0 5px 10px rgba(0,0,0,0.1); }
.world-name { font-size: 1.2em; font-weight: bold; margin-bottom: 5px; }
.count-badge { background: #eee; padding: 3px 10px; border-radius: 12px; font-size: 0.9em; }
.count-badge.has-plots { background: #ffebee; color: #c62828; font-weight: bold; }

/* カレンダー内部パーツ */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.calendar-header h3 { margin: 0; font-size: 1.1em; color: #333; }
.calendar-legend { font-size: 0.8em; }
.legend-item { display: inline-block; padding: 2px 8px; border-radius: 4px; margin-left: 5px; font-weight: bold; }
.legend-item.entry, .calendar-day.entry { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.legend-item.result, .calendar-day.result { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { padding: 6px 0; text-align: center; border-radius: 4px; font-size: 0.9em; position: relative; }
.calendar-day.today { font-weight: bold; }
.calendar-day.today::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border: 2px solid #007bff; border-radius: 50%; z-index: 1; }

/* スマホ表示の調整 (画面幅768px以下) */
@media (max-width: 768px) {
    .inner-container { padding: 0 10px; }
    .main-content { padding-top: 15px; padding-bottom: 15px; }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    .calendar-container {
        max-width: 100%;
        order: 0;
    }

    h1 { font-size: 1.5em; }
    .world-name { font-size: 1.1em; }

    table { font-size: 12px; }
    td, th { padding: 8px 5px; }
}