* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    background-color: #f5f5f5;
    color: #222;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px 16px;
}

h1 {
    font-size: 1.6em;
    margin-bottom: 16px;
    border-bottom: 3px solid #4a90d9;
    padding-bottom: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: #4a90d9;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* スレッド作成・投稿フォーム共通 */
.new-thread-form, .new-post-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.new-thread-form {
    flex-direction: row;
}

input[type="text"], textarea {
    font-size: 1em;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    width: 100%;
}

.new-thread-form input[type="text"] {
    flex: 1;
}

textarea {
    resize: vertical;
}

button {
    background-color: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    white-space: nowrap;
}

button:hover {
    background-color: #3a7bc4;
}

/* スレッド一覧 */
.thread-list {
    list-style: none;
    padding: 0;
}

.thread-list li {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thread-list a {
    color: #222;
    text-decoration: none;
    font-weight: 500;
}

.thread-list a:hover {
    color: #4a90d9;
}

.thread-date {
    font-size: 0.8em;
    color: #999;
}

/* 投稿一覧 */
.post-list {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
}

.post-list li {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85em;
}

.post-author {
    font-weight: 600;
    color: #4a90d9;
}

.post-date {
    color: #999;
}

.post-body {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
}

.post-image {
    margin-top: 10px;
}

.post-image img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

input[type="file"] {
    font-size: 0.9em;
}

/* 電光掲示板 */
.news-ticker {
    display: flex;
    align-items: center;
    background-color: #111;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    text-decoration: none;
    height: 36px;
}

.news-ticker-text-wrapper {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.news-ticker-text {
    display: inline-block;
    color: #4ade80;
    font-family: "Courier New", monospace;
    font-size: 0.95em;
    padding-left: 100%;
    animation: ticker-scroll 15s linear infinite;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 更新履歴(電光掲示板より控えめな、軽微な変更の記録) */
.changelog-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px;
    background-color: #eee;
    border-radius: 6px;
    margin-bottom: 20px;
    text-decoration: none;
    font-size: 0.85em;
}

.changelog-label {
    flex-shrink: 0;
    color: #888;
    font-weight: bold;
}

.changelog-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #555;
}

.changelog-strip:hover .changelog-text {
    text-decoration: underline;
}

/* お知らせページ */
.news-list {
    list-style: none;
    padding: 0;
}

.news-entry {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 14px;
}

.news-heading {
    font-size: 1.1em;
    margin: 0 0 8px 0;
    color: #222;
}

.news-body {
    color: #444;
    line-height: 1.6;
}

.news-body p {
    margin: 0 0 8px 0;
}

.ui-switch {
    text-align: right;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 12px;
}

.ui-switch select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.9em;
}
.site-links-bar {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}
.site-links-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85em;
    font-family: inherit;
    color: #444;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}
.site-links-toggle:hover {
    border-color: #4a90d9;
    color: #4a90d9;
}
.site-links-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10;
    min-width: 220px;
    max-width: min(900px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.site-links-panel.open {
    display: block;
}
@media (max-width: 480px) {
    /* right:0だけだと、中身が狭い時にパネル自体が画面の右寄りに小さく浮き、
       内側をflex-startで揃えても画面の左端には届かない。スマホでは
       left:0も指定してページ本文と同じ左端まで広げる */
    .site-links-panel {
        left: 0;
        max-width: none;
    }
}
.site-links-panel > div {
    text-align: left;
    margin-bottom: 8px;
}
.site-links-panel > div:last-child {
    margin-bottom: 0;
}
.site-links-columns {
    display: flex;
    flex-wrap: wrap;
    /* flex-endだと折り返した行(主にスマホ幅で3列が1行に収まらない時)が
       それぞれ右詰めになり、ゲーム/知識/エンタメの各列の開始位置がバラける。
       常に左端から詰める */
    justify-content: flex-start;
    gap: 4px 16px;
}
.site-links-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.site-links-column > div {
    white-space: nowrap;
}
.site-links-genre {
    text-align: left;
    font-size: 0.85em;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    margin-bottom: 8px;
}
.royale-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.royale-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.royale-link a:hover {
    text-decoration: underline;
}
.trader-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.trader-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.trader-link a:hover {
    text-decoration: underline;
}
.scenery-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.scenery-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.scenery-link a:hover {
    text-decoration: underline;
}
.benchmark-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.benchmark-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.benchmark-link a:hover {
    text-decoration: underline;
}
.deeplearning-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.deeplearning-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.deeplearning-link a:hover {
    text-decoration: underline;
}
.arena-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.arena-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.arena-link a:hover {
    text-decoration: underline;
}
.fps-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.fps-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.fps-link a:hover {
    text-decoration: underline;
}
.solitaire-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.solitaire-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.solitaire-link a:hover {
    text-decoration: underline;
}

.minesweeper-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.minesweeper-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.minesweeper-link a:hover {
    text-decoration: underline;
}

.cipher-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.cipher-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.cipher-link a:hover {
    text-decoration: underline;
}
.network-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.network-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.network-link a:hover {
    text-decoration: underline;
}

.database-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.database-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.database-link a:hover {
    text-decoration: underline;
}
.hardware-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.hardware-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.hardware-link a:hover {
    text-decoration: underline;
}
.physics-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.physics-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.physics-link a:hover {
    text-decoration: underline;
}
.shogi-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.shogi-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.shogi-link a:hover {
    text-decoration: underline;
}
.invaders-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.invaders-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.invaders-link a:hover {
    text-decoration: underline;
}
.keiba-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.keiba-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.keiba-link a:hover {
    text-decoration: underline;
}
.podcast-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.podcast-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.podcast-link a:hover {
    text-decoration: underline;
}

.gallery-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.gallery-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.gallery-link a:hover {
    text-decoration: underline;
}
.flight-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.flight-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.flight-link a:hover {
    text-decoration: underline;
}
.motors-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.motors-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.motors-link a:hover {
    text-decoration: underline;
}

/* おすすめボード(モダン) */
.promo-board {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 20px;
}

.promo-arrow {
    flex: 0 0 30px;
    padding: 0;
    background: #111;
    color: #4ade80;
    border: 0.5px solid #2b2b2b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

@media (max-width: 480px) {
    /* スマホでは矢印を細くして、タイルの横幅を確保する。
       これにより等倍(2:1)のタイルでも画像の左右が切れにくくなる */
    .promo-arrow {
        flex-basis: 18px;
        font-size: 12px;
    }
}

.promo-arrow:hover {
    border-color: #4ade80;
}

.promo-arrow--prev .promo-arrow-glyph::before {
    content: "‹";
}

.promo-arrow--next .promo-arrow-glyph::before {
    content: "›";
}

.promo-track {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.promo-track::-webkit-scrollbar {
    display: none;
}

.promo-page {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    scroll-snap-align: start;
}

.promo-tile {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
    border: 0.5px solid #2b2b2b;
    text-decoration: none;
    display: block;
}

.promo-tile--wide {
    grid-column: 1 / -1;
    aspect-ratio: 6 / 1;
}

@media (max-width: 480px) {
    /* 画像タイル(promo画像は400×200=2:1で作られている)は等倍のまま表示し、
       object-fit:coverによる左右の切れを起こさない。矢印は上で細くして
       横幅を確保しているので、この比率でも画面に収まる */
    .promo-tile {
        aspect-ratio: 2 / 1;
    }

    .promo-tile--wide {
        aspect-ratio: 6 / 1;
    }
}

/* <picture> は箱を作らせない(中の img が絶対配置なので、行ボックスの隙間を防ぐ)。
   WebP優先 + PNGフォールバックの導入にあわせて追加。2026-08-29 */
.promo-tile picture {
    display: contents;
}

.promo-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.promo-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.promo-scrim--none {
    background: none;
}

.promo-scrim--bottom.promo-scrim--light {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0) 55%);
}

.promo-scrim--bottom.promo-scrim--dark {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 55%);
}

.promo-scrim--full.promo-scrim--light {
    background: rgba(0, 0, 0, 0.45);
}

.promo-scrim--full.promo-scrim--dark {
    background: rgba(255, 255, 255, 0.55);
}

.promo-tile-text {
    display: flex;
    flex-direction: column;
    padding: 9px 10px;
    overflow: hidden;
}

.promo-tile:not(.promo-tile--image) .promo-tile-text {
    height: 100%;
    justify-content: center;
}

.promo-tile--image .promo-tile-text {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.promo-scrim--bottom + .promo-tile-text {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
}

.promo-scrim--full + .promo-tile-text {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.promo-scrim--none + .promo-tile-text {
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.promo-tile-badgerow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.promo-tile-icon {
    font-size: 14px;
    line-height: 1;
}

.promo-tile-title {
    display: block;
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #4ade80;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.promo-tile-copy {
    display: block;
    font-family: "Courier New", monospace;
    font-size: 11px;
    line-height: 1.3;
    color: #2f9c58;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 3px;
}

.promo-scrim--light + .promo-tile-text .promo-tile-title {
    color: #fff;
}

.promo-scrim--light + .promo-tile-text .promo-tile-copy {
    color: #e5e5e5;
}

.promo-scrim--dark + .promo-tile-text .promo-tile-title {
    color: #111;
}

.promo-scrim--dark + .promo-tile-text .promo-tile-copy {
    color: #3a3a3a;
}

.promo-badge {
    display: inline-block;
    background: #4ade80;
    color: #0b2b18;
    font-family: "Courier New", monospace;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.4;
    padding: 1px 5px;
    border-radius: 3px;
}

.promo-badge--floating {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
}

.promo-status {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.promo-dots {
    display: flex;
    gap: 6px;
}

.promo-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
}

.promo-dot--active {
    background: #4ade80;
}

.promo-status-text {
    display: none;
    font-size: 0.8em;
    color: #666;
}

@media (prefers-reduced-motion: reduce) {
    .promo-track {
        scroll-behavior: auto;
    }
}

/* サイト共通フッタ(運営情報・お問い合わせ)。2026-08-28追加 */
.site-footer {
    margin: 40px 0 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e5e9;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.9;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    align-items: baseline;
    justify-content: space-between;
}
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
.site-footer a { color: #4b5563; }
.site-footer a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.news-subscribe { font-size: 0.84rem; margin: -4px 0 22px; }

.music-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.music-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.music-link a:hover {
    text-decoration: underline;
}

.movie-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.movie-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.movie-link a:hover {
    text-decoration: underline;
}
.rpg-link {
    text-align: left;
    font-size: 0.85em;
    margin-bottom: 8px;
}
.rpg-link a {
    color: #0000ee;
    text-decoration: none;
    font-weight: bold;
}
.rpg-link a:hover {
    text-decoration: underline;
}
