body {
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'BIZ UDPGothic', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

/* アニメーション定義 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

@keyframes rainbow {
    0% { border-color: #ff0000; }
    17% { border-color: #ff8800; }
    33% { border-color: #ffff00; }
    50% { border-color: #00ff00; }
    67% { border-color: #0088ff; }
    83% { border-color: #8800ff; }
    100% { border-color: #ff0000; }
}

header {
    background-color: #fff;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.logo {
    max-width: 300px;
    height: auto;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.5em;
    margin: 0.5em 0;
}

h2 {
    font-size: 1.2em;
    color: #555;
    margin: 0;
    font-weight: normal;
}

main {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

main p {
    text-align: center;
    margin-bottom: 40px;
}

.pdf-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px; /* 掲示板との間隔を拡大 */
}

.pdf-link {
    display: block;
    width: 280px;
    padding: 20px;
    background-color: #fff;
    border: 3px solid #005a9c;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 90, 156, 0.15);
}

.pdf-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 90, 156, 0.25);
    border-color: #003d6b;
    background-color: #f8fbff;
}

.pdf-link .year {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #005a9c; /* A deep blue color */
    margin-bottom: 10px;
}

.pdf-link .file-name {
    font-size: 1.1em;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9em;
    color: #777;
}

/* Responsive Design for smaller screens */
@media (max-width: 600px) {
    h1 {
        font-size: 1.2em;
    }
    h2 {
        font-size: 1em;
    }
    .pdf-link {
        width: 100%;
    }
}

/* Math Game Styles */
.math-game-section {
    margin-top: 60px;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.math-game-section h3 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 10px;
    color: #005a9c;
}

.game-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.game-container {
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

.game-container.streak-5 {
    border: 3px solid #ff0000;
    border-radius: 12px;
    padding: 10px;
    animation: rainbow 2s linear infinite;
}

/* 紙吹雪コンテナ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff0000;
    animation: confetti 3s ease-out forwards;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #333;
    flex-wrap: wrap;
    gap: 10px;
}

.score-board span {
    background-color: #f0f0f0;
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.score-board span.updating {
    transform: scale(1.1);
    background-color: #e3f2fd;
}

/* ライフ表示 */
.lives-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    gap: 10px;
}

.lives-label {
    font-size: 1.1em;
    color: #333;
}

.lives {
    display: flex;
    gap: 5px;
}

.life-icon {
    font-size: 1.5em;
    transition: all 0.3s ease;
}

.life-icon.lost {
    opacity: 0.3;
    transform: scale(0.8);
    filter: grayscale(100%);
}

.life-icon.losing {
    animation: shake 0.5s ease-out;
}

/* ハイスコア表示 */
.high-score {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
}

/* プログレスバー */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.number-display {
    font-size: 4em;
    font-weight: bold;
    text-align: center;
    color: #005a9c;
    margin: 20px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
    transition: all 0.3s ease;
}

.number-display.changing {
    animation: fadeIn 0.5s ease-out;
}

.button-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.game-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.game-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.game-btn:active::after {
    width: 300px;
    height: 300px;
}

.prime-btn {
    background-color: #4CAF50;
    color: white;
}

.prime-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.not-prime-btn {
    background-color: #f44336;
    color: white;
}

.not-prime-btn:hover {
    background-color: #da190b;
    transform: translateY(-2px);
}

.start-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background-color: #005a9c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background-color: #004080;
    transform: translateY(-2px);
}

.back-to-level-btn {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.back-to-level-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.result-message {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    min-height: 50px;
    font-weight: bold;
    line-height: 1.5;
}

.result-message.correct {
    color: #4CAF50;
    animation: pulse 0.5s ease-out;
}

.result-message.incorrect {
    color: #f44336;
    animation: shake 0.5s ease-out;
}

.game-content {
    display: none;
}

.game-content.active {
    display: block;
}

/* ゲームオーバー画面 */
.game-over {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease-out;
}

.game-over h3 {
    font-size: 2em;
    color: #f44336;
    margin-bottom: 20px;
}

.final-score {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
}

.game-over-message {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Level Selection Styles */
.level-selection {
    text-align: center;
    margin: 20px 0;
}

.level-selection h4 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

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

.level-btn {
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
    background-color: #fff;
    border: 2px solid #005a9c;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.level-btn:hover {
    background-color: #005a9c;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.level-btn:hover .ranking-note {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    transform: scale(1.05);
}

.level-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.level-range {
    font-size: 1.1em;
    opacity: 0.8;
}

/* ゲームクレジット */
.game-credit {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 10px;
}

.game-credit small {
    font-size: 0.75em;
    color: #999;
    font-style: italic;
    opacity: 0.7;
}

/* Responsive adjustments for game */
@media (max-width: 600px) {
    /* ヘッダー */
    .logo {
        max-width: 240px;
    }
    
    h1 {
        font-size: 1em;
    }
    
    h2 {
        font-size: 0.9em;
    }
    
    /* メインコンテンツ */
    main {
        padding: 15px;
    }
    
    main p {
        font-size: 0.9em;
        margin-bottom: 30px;
    }
    
    /* ゲームセクション */
    .math-game-section {
        margin-top: 40px;
        padding: 30px 15px;
    }
    
    .math-game-section h3 {
        font-size: 1.5em;
    }
    
    .game-description {
        font-size: 0.9em;
        margin-bottom: 25px;
    }
    
    /* スコアボード */
    .score-board {
        justify-content: center;
        gap: 10px;
        margin-bottom: 20px;
        font-size: 0.9em;
    }
    
    .score-board span {
        padding: 8px 15px;
        flex: 0 0 auto;
    }
    
    /* ライフ表示 */
    .lives-container {
        margin: 10px 0;
        gap: 8px;
    }
    
    .lives-label {
        font-size: 1em;
    }
    
    .life-icon {
        font-size: 1.3em;
    }
    
    /* ハイスコア */
    .high-score {
        font-size: 0.8em;
        margin-top: 8px;
    }
    
    /* 数字表示 */
    .number-display {
        font-size: 2.5em;
        margin: 15px 0;
        min-height: 50px;
    }
    
    /* 結果メッセージ */
    .result-message {
        font-size: 1em;
        margin: 15px 0;
        min-height: 40px;
    }
    
    /* ゲームボタン */
    .game-btn {
        font-size: 0.9em;
        padding: 12px 15px;
    }
    
    .button-container {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    /* レベル選択 */
    .level-selection h4 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .level-btn {
        min-width: 80px;
        padding: 12px 15px;
    }
    
    .level-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
         .level-name {
         font-size: 1.3em;
     }
     
     .level-range {
         font-size: 1em;
     }
    
    /* スタートボタン */
    .start-btn {
        padding: 12px;
        font-size: 1em;
    }
    
    /* ゲームオーバー画面 */
    .game-over {
        padding: 30px 15px;
    }
    
    .game-over h3 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }
    
    .final-score {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .game-over-message {
        font-size: 1em;
        margin-bottom: 25px;
    }
    
    .restart-btn {
        padding: 12px 30px;
        font-size: 1em;
    }
    
    /* プログレスバー */
    .progress-container {
        height: 6px;
        margin: 15px 0;
    }
    
    /* ゲームクレジット */
    .game-credit {
        margin-top: 20px;
        margin-bottom: 5px;
    }
    
    .game-credit small {
        font-size: 0.7em;
    }
}

/* ランキングボタンコンテナ */
.ranking-button-container {
    text-align: center;
    margin: 20px 0;
}

/* ランキングダッシュボードボタン */
.ranking-dashboard-btn {
    background: linear-gradient(45deg, #ffd700, #ffb347);
    color: #333;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    display: inline-block;
}

.ranking-dashboard-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.ranking-dashboard-btn:active {
    transform: translateY(-1px);
}

/* ユーザー情報入力フォーム */
.user-info-form {
    background: #f8f9fa;
    border: 2px solid #e74c3c;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.user-info-form h4 {
    color: #e74c3c;
    margin-top: 0;
    margin-bottom: 10px;
}

.form-description {
    color: #666;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.char-counter {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
    transition: color 0.3s ease;
}

.char-counter.warning {
    color: #ff9800;
}

.char-counter.danger {
    color: #e74c3c;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #e74c3c;
}

.privacy-note {
    color: #666;
    font-size: 0.8em;
    margin-top: 15px;
    margin-bottom: 0;
}

.ranking-note {
    display: block;
    color: #e74c3c;
    font-weight: bold;
    font-size: 1em;
    margin-top: 8px;
    padding: 2px 8px;
    background-color: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
}

/* ランキングモーダル */
.ranking-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.ranking-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ranking-header {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.ranking-header-content {
    flex: 1;
}

.ranking-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.ranking-header .ranking-note {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.8em;
    font-weight: normal;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.ranking-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.ranking-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ranking-update-time,
.ranking-participants {
    color: #666;
    font-size: 0.9em;
}

.ranking-participants {
    font-weight: bold;
    color: #28a745;
}

.ranking-table-container {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.ranking-table th,
.ranking-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.ranking-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0;
}

.ranking-table tr:hover {
    background-color: #f8f9fa;
}

.ranking-table .rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    font-weight: bold;
}

.ranking-table .rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    font-weight: bold;
}

.ranking-table .rank-3 {
    background: linear-gradient(135deg, #cd7f32, #deb887);
    font-weight: bold;
}

.score-cell {
    font-weight: bold;
    color: #e74c3c;
}

.nickname-cell {
    font-weight: bold;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.affiliation-cell {
    color: #666;
    font-size: 0.9em;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.time-cell {
    color: #999;
    font-size: 0.8em;
}

.ranking-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ranking-empty p {
    margin: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .ranking-button-container {
        margin: 15px 0;
    }
    
    .ranking-dashboard-btn {
        padding: 10px 18px;
        font-size: 0.9em;
    }
    
    .ranking-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .ranking-header {
        padding: 15px;
    }
    
    .ranking-header h3 {
        font-size: 1.2em;
    }
    
    .ranking-header .ranking-note {
        font-size: 0.7em;
    }
    
    /* レベル選択ボタンの※ランキング対象（モバイル版） */
    .level-btn .ranking-note {
        font-size: 0.9em;
        padding: 2px 6px;
    }
    
    .ranking-stats {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .ranking-update-time,
    .ranking-participants {
        font-size: 0.8em;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 8px 4px;
        font-size: 0.9em;
    }
    
    .nickname-cell {
        max-width: 70px;
    }
    
    .affiliation-cell {
        max-width: 85px;
    }
    
    .user-info-form {
        padding: 15px;
    }
    
    .input-group input {
        padding: 8px;
    }
}

/* ローディング表示 */
.ranking-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ranking-loading p {
    color: #666;
    margin: 0;
    font-size: 1em;
}

/* エラー表示 */
.ranking-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
}

.error-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.ranking-error p {
    margin: 0 0 20px 0;
    font-size: 1em;
}

.retry-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.9em;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

/* レスポンシブ対応 - ローディング・エラー */
@media (max-width: 768px) {
    .ranking-loading,
    .ranking-error {
        padding: 30px 15px;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    .error-icon {
        font-size: 1.5em;
    }
    
    .retry-btn {
        padding: 8px 16px;
        font-size: 0.8em;
    }
}

/* ========================================
   感想・質問掲示板スタイル
   ======================================== */

.board-section {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 50%, #e1f5fe 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 0 20px rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.1);
}

.board-section h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 8px;
    text-align: center;
}

.board-description {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1em;
    line-height: 1.5;
}

/* 投稿フォーム */
.post-form {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.form-header {
    background: linear-gradient(135deg, #005a9c, #0074d9);
    color: white;
    padding: 10px 15px;
    margin: 0;
}

.form-header h4 {
    margin: 0;
    font-size: 1em;
    font-weight: bold;
}

.form-body {
    padding: 15px;
}

.post-form .input-group {
    margin-bottom: 15px;
}

.post-form .input-group:last-child {
    margin-bottom: 0;
}

.post-form label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9em;
}

.post-form input[type="text"], 
.post-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.post-form input[type="text"]:focus, 
.post-form textarea:focus {
    outline: none;
    border-color: #005a9c;
    box-shadow: 0 0 0 2px rgba(0, 90, 156, 0.1);
}

.post-form textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.4;
}

.form-actions {
    margin-top: 15px;
    text-align: center;
}

.submit-post-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.submit-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.submit-post-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 投稿一覧 */
.posts-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    overflow: visible; /* モバイルでの表示問題を解決するため変更 */
}

.posts-header {
    background: linear-gradient(135deg, #6f42c1, #8e44ad);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.posts-header h4 {
    margin: 0;
    font-size: 1em;
}

.posts-count {
    font-size: 0.8em;
    background-color: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: bold;
}

/* ローディング・エラー・空状態 */
.posts-loading, .posts-error, .posts-empty {
    padding: 25px 15px;
    text-align: center;
    color: #666;
}

.posts-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #005a9c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.error-icon, .empty-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.posts-error p, .posts-empty p {
    margin: 4px 0;
    font-size: 0.95em;
}

.empty-subtitle {
    color: #999 !important;
    font-size: 0.85em !important;
}

/* 投稿リスト */
.posts-list {
    /* 段階的表示機能により、全ての投稿を順次表示 */
    width: 100%;
    display: block;
    overflow: visible;
    position: relative;
    min-height: auto;
}

.post-item {
    border-bottom: 1px solid #e1e8ed;
    padding: 12px 15px;
    transition: background-color 0.2s ease;
    display: block;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background-color: #f8f9fa;
}

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

.post-author {
    font-weight: bold;
    color: #005a9c;
    font-size: 0.95em;
}

.post-author.admin {
    color: #e74c3c;
}

.post-author.admin::after {
    content: " 👑";
    font-size: 0.7em;
}

.post-timestamp {
    color: #999;
    font-size: 0.8em;
}

.post-content {
    line-height: 1.5;
    color: #2c3e50;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* もっと見るボタン */
.load-more-container {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e1e8ed;
    background-color: #f8f9fa;
}

.load-more-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #5a6268, #3d4142);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.load-more-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.load-more-count {
    color: rgba(255,255,255,0.8);
    font-size: 0.85em;
    font-weight: normal;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .board-section {
        margin: 15px auto;
        padding: 12px;
    }
    
    .board-section h3 {
        font-size: 1.3em;
    }
    
    .board-description {
        font-size: 0.9em;
    }
    
    .form-header, .posts-header {
        padding: 8px 12px;
    }
    
    .form-body {
        padding: 12px;
    }
    
    .posts-header {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px !important; /* さらにコンパクト化 */
        margin-bottom: 2px !important; /* ニックネームの下の隙間を縮小 */
    }
    
    .submit-post-btn {
        padding: 7px 18px;
        font-size: 0.9em;
    }
    
    .back-to-level-btn {
        padding: 10px !important;
        font-size: 0.9em !important;
    }
    
    .posts-list {
        /* モバイルでも段階的表示機能を使用するため、max-heightを削除 */
        overflow: visible !important;
        position: relative !important;
        display: block !important;
    }
    
    .post-item {
        padding: 4px 8px; /* さらにコンパクト化 */
        display: block !important;
        position: relative !important;
        width: 100% !important;
    }
    
    .post-author {
        font-size: 0.8em; /* コンパクト化 */
        margin-bottom: 0px !important; /* さらにコンパクト化 */
    }
    
    .post-content {
        font-size: 0.8em !important; /* コンパクト化 */
        line-height: 1.3 !important; /* コンパクト化 */
        margin: 0px 0 !important; /* さらにコンパクト化 */
    }
    
    .post-timestamp {
        font-size: 0.7em !important; /* コンパクト化 */
        margin: 0px !important; /* さらにコンパクト化 */
    }
    
    .post-form .input-group {
        margin-bottom: 12px;
    }
    
    .posts-loading, .posts-error, .posts-empty {
        padding: 20px 12px;
    }
    
    .load-more-container {
        padding: 12px;
    }
    
    .load-more-btn {
        padding: 7px 16px;
        font-size: 0.85em;
        gap: 6px;
    }
} 