/* Twitchan - 2chan Style CSS */
/* 日本向け・中央揃えデザイン */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'MS PGothic', 'MS Pゴシック', 'Hiragino Kaku Gothic ProN', sans-serif;
    background-color: #ffe4e1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23d4a5a5' d='M10 2c1 0 2 1 2 2s-1 2-2 2-2-1-2-2 1-2 2-2zm0 14c1 0 2 1 2 2s-1 2-2 2-2-1-2-2 1-2 2-2z' opacity='0.3'/%3E%3C/svg%3E");
    color: #000;
    line-height: 1.4;
    min-height: 100vh;
    padding: 10px;
}

/* Links */
a {
    color: #0000ff;
    text-decoration: underline;
}

a:visited {
    color: #6a5acd;
}

a:hover {
    color: #ff0000;
}

/* Main Container - 中央揃え */
.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: transparent;
}

/* Header - 中央揃え */
.header {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #ff0000;
    margin-bottom: 5px;
}

.site-title a {
    color: #ff0000;
    text-decoration: none;
}

.site-subtitle {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

/* Navigation - 中央揃えテーブル */
.nav-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background-color: #fff;
}

.nav-table td {
    border: 1px solid #888;
    padding: 5px 10px;
    font-size: 12px;
    text-align: center;
}

.nav-table a {
    color: #0000ff;
}

/* Main - 中央揃え */
.main {
    margin-bottom: 10px;
    text-align: center;
}

/* Board Header - 中央揃え */
.board-header {
    background-color: #e8e8e8;
    border: 2px solid #888;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
}

.board-title {
    font-size: 16px;
    font-weight: bold;
    color: #000080;
    margin-bottom: 5px;
}

.board-desc {
    font-size: 12px;
    color: #666;
}

/* Category Table - 2chan style 中央揃え */
.category-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background-color: #fff;
}

.category-table th {
    background-color: #e8e8e8;
    border: 1px solid #888;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    color: #000;
}

.category-table td {
    border: 1px solid #888;
    padding: 5px;
    font-size: 12px;
    text-align: center;
    vertical-align: top;
}

.category-table a {
    color: #0000ff;
    display: inline-block;
    margin: 2px 5px;
}

/* Thread List Table - 中央揃え */
.thread-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    margin-bottom: 10px;
}

.thread-table th {
    background-color: #e8e8e8;
    border: 1px solid #888;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}

.thread-table td {
    border: 1px solid #888;
    padding: 5px;
    font-size: 12px;
    text-align: center;
}

.thread-table .thread-num {
    width: 40px;
    color: #008000;
}

.thread-table .thread-title {
    text-align: left;
    padding-left: 10px;
}

.thread-table .thread-title a {
    color: #0000ff;
}

.thread-table .thread-count {
    width: 50px;
    color: #ff0000;
}

.thread-table .thread-date {
    width: 120px;
    color: #666;
}

/* Forms - 2chan style 中央揃え */
.post-form {
    background-color: #f0f0f0;
    border: 2px solid #888;
    padding: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.post-form table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    margin: 0 auto;
}

.post-form td {
    padding: 5px;
    font-size: 12px;
}

.post-form .label {
    width: 80px;
    background-color: #e8e8e8;
    border: 1px solid #888;
    padding: 5px;
    font-weight: bold;
    text-align: center;
}

.post-form .input-cell {
    border: 1px solid #888;
    padding: 3px;
    background-color: #fff;
    text-align: left;
}

.post-form input[type="text"],
.post-form input[type="url"],
.post-form input[type="email"],
.post-form textarea {
    width: 100%;
    border: 1px solid #888;
    padding: 5px;
    font-family: inherit;
    font-size: 12px;
    background-color: #fff;
}

.post-form textarea {
    min-height: 80px;
    resize: vertical;
}

.post-form input:focus,
.post-form textarea:focus {
    background-color: #fffef0;
    outline: none;
}

.submit-btn {
    background-color: #d0d0d0;
    border: 2px outset #fff;
    padding: 5px 20px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
}

.submit-btn:active {
    border-style: inset;
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    color: #888;
}

/* Optional field label */
.optional {
    font-size: 10px;
    color: #888;
    font-weight: normal;
}

/* Messages - 2chan style */
.message-area {
    background-color: #fff;
    border: 1px solid #888;
    margin-bottom: 5px;
    text-align: left;
}

.message-header {
    background-color: #e8e8e8;
    border-bottom: 1px solid #888;
    padding: 5px 10px;
    font-size: 12px;
}

.message-num {
    color: #008000;
    font-weight: bold;
}

.message-name {
    color: #008b8b;
    font-weight: bold;
}

.message-email {
    color: #0000ff;
}

.message-date {
    color: #666;
}

.message-id {
    color: #999;
    font-size: 10px;
}

.message-body {
    padding: 10px;
    font-size: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-body a {
    color: #0000ff;
}

/* Reply in message */
.reply-link {
    color: #0000ff;
    text-decoration: underline;
}

/* YouTube Section */
.youtube-section {
    background-color: #fff;
    border: 1px solid #888;
    margin-bottom: 10px;
}

.youtube-header {
    background-color: #e8e8e8;
    border-bottom: 1px solid #888;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.youtube-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-controls {
    padding: 10px;
    background-color: #f0f0f0;
    border-top: 1px solid #888;
    text-align: center;
}

.sync-btn, .room-btn {
    background-color: #d0d0d0;
    border: 2px outset #fff;
    padding: 5px 15px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin: 0 5px;
}

/* Thread View - 中央揃え */
.thread-header {
    background-color: #e8e8e8;
    border: 1px solid #888;
    padding: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.thread-title {
    font-size: 18px;
    font-weight: bold;
    color: #ff0000;
}

.thread-meta {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Pagination - 中央揃え */
.pagination {
    text-align: center;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #888;
    margin-bottom: 10px;
}

.pagination a, .pagination span {
    margin: 0 5px;
    color: #0000ff;
}

.pagination .current {
    color: #ff0000;
    font-weight: bold;
}

/* Captcha - 中央揃え */
.captcha-container {
    background-color: #f8f8f8;
    border: 1px solid #888;
    padding: 15px;
    margin: 10px auto;
    text-align: center;
    max-width: 400px;
}

.captcha-challenge {
    margin-bottom: 10px;
}

.captcha-math {
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0;
    color: #000;
}

.captcha-input {
    width: 100px;
    padding: 5px;
    border: 2px solid #888;
    text-align: center;
    font-size: 16px;
}

.captcha-slider {
    width: 200px;
    margin: 10px;
}

.captcha-click-area {
    width: 200px;
    height: 80px;
    background-color: #ddd;
    margin: 10px auto;
    border: 1px solid #888;
    position: relative;
    cursor: crosshair;
}

.captcha-click-target {
    width: 25px;
    height: 25px;
    background-color: #ff0000;
    border-radius: 50%;
    position: absolute;
}

.captcha-success {
    color: #008000;
    font-weight: bold;
}

.captcha-error {
    color: #ff0000;
}

.captcha-refresh {
    color: #0000ff;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
    margin-top: 10px;
    display: inline-block;
}

/* Chat Panel - 中央揃え */
.chat-panel {
    border: 1px solid #888;
    background-color: #fff;
    margin-bottom: 10px;
}

.chat-header {
    background-color: #e8e8e8;
    border-bottom: 1px solid #888;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.chat-messages {
    height: 250px;
    overflow-y: auto;
    padding: 10px;
    background-color: #fff;
    text-align: left;
}

.chat-message {
    border-bottom: 1px dashed #ccc;
    padding: 5px 0;
    font-size: 12px;
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message-time {
    color: #666;
    font-size: 10px;
}

.chat-message-name {
    color: #008b8b;
    font-weight: bold;
}

.chat-input {
    padding: 10px;
    background-color: #f0f0f0;
    border-top: 1px solid #888;
    text-align: center;
}

.chat-input input {
    width: calc(100% - 80px);
    max-width: 300px;
    padding: 5px;
    border: 1px solid #888;
    font-family: inherit;
    font-size: 12px;
}

.chat-input button {
    width: 60px;
    padding: 5px;
    background-color: #d0d0d0;
    border: 2px outset #fff;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
}

/* Room Controls - 中央揃え */
.room-controls {
    text-align: center;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #888;
    margin-bottom: 10px;
}

.cinema-btn, .exit-btn {
    padding: 5px 15px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin: 0 5px;
    background-color: #d0d0d0;
    border: 2px outset #fff;
}

.sync-status {
    display: inline-block;
    margin-left: 15px;
}

.sync-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #00ff00;
    margin-right: 5px;
}

.sync-indicator.syncing {
    background-color: #ffff00;
}

.sync-indicator.error {
    background-color: #ff0000;
}

/* Video Controls - 中央揃え */
.video-controls {
    padding: 10px;
    background-color: #f0f0f0;
    text-align: center;
}

.control-btn {
    padding: 5px 15px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    background-color: #d0d0d0;
    border: 2px outset #fff;
    margin: 0 5px;
}

.time-display {
    font-family: monospace;
    font-size: 12px;
    margin-left: 15px;
}

.room-info {
    font-size: 11px;
    color: #666;
    padding: 5px;
    background-color: #e8e8e8;
    border-top: 1px solid #888;
    text-align: center;
}

/* Footer - 中央揃え */
.footer {
    text-align: center;
    padding: 15px;
    background-color: #e8e8e8;
    border: 1px solid #888;
    font-size: 11px;
}

.footer a {
    color: #0000ff;
    margin: 0 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #f0f0f0;
    border: 2px solid #888;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #000;
    font-size: 14px;
}

/* Static Pages - 中央揃え */
.static-page {
    background-color: #fff;
    border: 1px solid #888;
    padding: 20px;
    text-align: left;
}

.static-page h2 {
    border-bottom: 2px solid #888;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #000;
    font-size: 16px;
    text-align: center;
}

.static-page section {
    margin-bottom: 20px;
}

.static-page h3 {
    background-color: #e8e8e8;
    padding: 8px;
    margin: 20px 0 10px 0;
    border-left: 4px solid #0000ff;
    font-size: 13px;
}

.static-page p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.static-page ul, .static-page ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.static-page li {
    margin-bottom: 5px;
}

.static-page pre {
    background-color: #f0f0f0;
    padding: 10px;
    border: 1px solid #888;
    overflow-x: auto;
    font-size: 12px;
}

/* Contact Form */
.contact-success, .contact-error {
    text-align: center;
    padding: 30px;
}

/* FAQ */
.faq-item {
    border: 1px solid #888;
    margin-bottom: 5px;
}

.faq-item summary {
    background-color: #e8e8e8;
    padding: 8px;
    cursor: pointer;
    font-size: 12px;
}

.faq-item p {
    padding: 10px;
    font-size: 12px;
}

/* Utility */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error-message {
    color: #ff0000;
    font-size: 11px;
}

.success-message {
    color: #008000;
    font-size: 11px;
}

/* Spam Warning */
.spam-warning {
    background-color: #fff0f0;
    border: 1px solid #ff0000;
    padding: 10px;
    margin: 10px 0;
    color: #ff0000;
    font-size: 11px;
    text-align: center;
}

.rate-limit-info {
    font-size: 11px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

/* Cinema Mode */
body.cinema-mode {
    background: #000 !important;
    background-image: none !important;
}

body.cinema-mode .container {
    max-width: 100%;
}

body.cinema-mode .header,
body.cinema-mode .footer,
body.cinema-mode .nav-table {
    display: none;
}

body.cinema-mode .main {
    padding: 0;
}

body.cinema-mode .video-panel {
    background: #000;
}

body.cinema-mode .chat-panel {
    background: #111;
    border: 1px solid #333;
}

body.cinema-mode .chat-header {
    background: #222;
    border-color: #333;
    color: #fff;
}

body.cinema-mode .chat-messages {
    background: #000;
}

body.cinema-mode .chat-message {
    color: #fff;
    border-color: #222;
}

body.cinema-mode .chat-message-time {
    color: #888;
}

body.cinema-mode .chat-message-name {
    color: #4da6ff;
}

body.cinema-mode .chat-input {
    background: #111;
    border-color: #333;
}

body.cinema-mode .chat-input input {
    background: #222;
    color: #fff;
    border-color: #444;
}

body.cinema-mode .room-controls,
body.cinema-mode .video-controls {
    background: #111;
    border-color: #333;
}

body.cinema-mode .control-btn,
body.cinema-mode .cinema-btn,
body.cinema-mode .exit-btn {
    background: #333;
    color: #fff;
    border-color: #555;
}

body.cinema-mode .room-info {
    background: #111;
    color: #aaa;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .nav-table td {
        padding: 3px 5px;
        font-size: 11px;
    }
    
    .post-form table {
        max-width: 100%;
    }
    
    .thread-table .thread-date {
        width: auto;
    }
}

/* Print */
@media print {
    body {
        background: #fff;
        background-image: none;
    }
    
    .header, .footer, .youtube-section, .post-form, .chat-panel {
        display: none;
    }
}
