/* ===== 全体 ===== */
body {
  margin: 0;
  background: #000;
  color: #00FF00;
  font: 14px/1.4 "MS UI Gothic", monospace;
}

.title {
  text-align: center;
  margin: 20px 0;
}

hr {
  border: 1px solid #00FF00;
}

/* ===== 共通レイアウト ===== */
.layout {
  display: flex;
  justify-content: center;
  gap: 30px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* ===== サイドバー ===== */
.side_menu {
  width: 200px;
  flex-shrink: 0;
  border-right: 2px solid #00FF00;
  padding-right: 15px;
}

.side_menu a {
  display: block;
  border: 2px solid #00FF00;
  padding: 5px 10px;
  margin-bottom: 5px;
  text-decoration: none;
  color: #00FF00;
  background: #0c0c0c;
}

.side_menu a:hover {
  background: #003300;
}

.menu_title {
  margin-top: 20px;
}

/* カウンター */
.counter {
  font-family: "Courier New", monospace;
  font-size: 20px;
  border: 2px solid #00FF00;
  padding: 5px 10px;
  display: inline-block;
}

/* ===== メインコンテンツ共通 ===== */
.main_content {
  flex: 1;
  max-width: 1300px;
  min-width: 0;
}

/* ===== BBS投稿 ===== */
.post {
  border: 2px solid #00FF00;
  padding: 8px;
  margin-bottom: 15px;
  background: #000;
}

.post_header {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 13px;
}

.post_body {
  margin: 0;
  white-space: pre-wrap;
}

/* ===== 投稿フォーム ===== */
.post_form {
  border: 2px solid #00FF00;
  padding: 10px;
  margin-top: 30px;
}

.post_form h2 {
  margin-top: 0;
  font-size: 16px;
}

input, textarea {
  background: #000;
  color: #00FF00;
  border: 1px solid #00FF00;
  font-family: "MS UI Gothic", monospace;
}

input[type="submit"],
input[type="reset"] {
  background: #0c0c0c;
  border: 2px solid #00FF00;
  padding: 3px 10px;
  cursor: pointer;
}

input[type="submit"]:hover,
input[type="reset"]:hover {
  background: #003300;
}

/* ===== ターミナル風ボタン ===== */
button {
  background: #000;
  color: #00FF00;
  border: 2px solid #00FF00;
  font-family: "MS UI Gothic", monospace;
  font-size: 13px;
  padding: 2px 8px;
  margin-right: 6px;
  cursor: pointer;
}

/* ホバーで反転 */
button:hover {
  background: #003300;
}

/* 押したとき */
button:active {
  background: #00FF00;
  color: #000;
}

.delete-btn:hover {
  background-color: #d32f2f;
}

/* ===== プロフィール ===== */
.profile_image {
  width: 120px;
  height: 120px;
  border: 2px solid #00FF00;
  margin-right: 15px;
}

.profile_box {
  border: 2px solid #00FF00;
  border-collapse: collapse;
  width: 100%;
}

.profile_box th, .profile_box td {
  border: 1px solid #00FF00;
  padding: 8px;
  text-align: left;
}

.center_text {
  text-align: center;
}

.center_text table {
  margin-left: auto;
  margin-right: auto;
  text-align: left; /* Keep cell content left-aligned unless otherwise specified */
}

/* Web拍手モーダル */
#clap-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #000;
  border: 2px solid #00FF00;
  padding: 20px;
  z-index: 1000;
  width: 280px;
  box-shadow: 0 0 20px #00FF00;
}
#clap-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 999;
}
.clap-btn {
  display: block;
  border: 2px solid #00FF00;
  padding: 5px 10px;
  margin-top: 10px;
  text-decoration: none;
  color: #00FF00;
  background: #0c0c0c;
  font-weight: bold;
  text-align: center;
  font-size: 13px;
}
.clap-btn:hover {
  background: #003300;
}
.clap-count-display {
  display: block;
  text-align: center;
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #00FF00;
  margin-bottom: 5px;
  background: #111;
  border: 1px solid #00FF00;
  padding: 2px;
}

/* ===== 管理者用拍手メッセージ管理 ===== */
.admin-stats {
  font-size: 20px;
  margin: 20px 0;
  padding: 10px;
  border: 1px double #00FF00;
  background: #111;
  display: inline-block;
}
.clap-msg-item {
  border: 1px solid #00FF00;
  padding: 10px;
  margin-bottom: 10px;
  background: #000;
}
.clap-date {
  color: #888;
  font-size: 12px;
  margin-bottom: 5px;
}
.clap-content {
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== 絵チャ専用レイアウト ===== */
.draw_chat_wrapper {
  display: flex;
  flex-wrap: nowrap; /* PCでは横並びを維持 */
  gap: 20px;
  align-items: flex-start;
}

@media (max-width: 1000px) {
  .draw_chat_wrapper {
    flex-wrap: wrap; /* 画面が狭い時だけ折り返し */
  }
}

.draw_area {
  flex: 0 0 auto;
}

.controls {
  background: #1a1a1a;
  border: 2px solid #00FF00;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid #333;
  padding-right: 15px;
}

.control-group:last-child {
  border-right: none;
}

.label {
  font-size: 12px;
  color: #00FF00;
  font-weight: bold;
}

.chat_area {
  flex: 1;
  min-width: 250px;
  border-left: 1px solid #333;
  padding-left: 15px;
  display: flex;
  flex-direction: column;
  height: 560px;
}

.operation_guide {
  background: #0c0c0c;
  border: 2px inset #00FF00;
  padding: 8px;
  margin-bottom: 15px;
  font-size: 12px;
}

.guide_title {
  font-weight: bold;
  text-align: center;
  margin: 0 0 5px 0;
  border-bottom: 1px dashed #00FF00;
  color: #00FF00;
}

.guide_list {
  list-style: none;
  padding: 0;
  margin: 0;
  color: #00FF00;
  line-height: 1.6;
}

.guide_list li::before {
  content: "・";
}

#chat_messages {
  flex: 1;
  border: 2px inset #666;
  background: black;
  color: #00ff00;
  font-family: 'Courier New', Courier, monospace;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 10px;
}

canvas {
  border: 2px solid #00FF00;
  background: #ffffff;
  cursor: none; /* デフォルトのカーソルを消す */
}

#canvas-container {
  line-height: 0;
}

#brush-cursor {
  position: absolute;
  pointer-events: none; /* マウスイベントを貫通させる */
  display: none; /* 初期は非表示 */
  box-sizing: border-box;
  background-image: url('../images/cursor.gif');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 999; /* 最前面に表示 */
  /* デフォルトサイズを確保 */
  min-width: 10px;
  min-height: 10px;
}

.tool-btn.active {
  background-color: #00FF00;
  color: black;
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5);
}

.action-btn.danger:hover {
  background-color: #900;
  border-color: #f00;
  color: #fff;
}

#brushSize {
  width: 80px;
}

/* ===== ブログ投稿フォーム用 ===== */
.file-upload-label {
  display: inline-block;
  background-color: #333;
  color: #00FF00;
  border: 2px outset #666;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 13px;
}

/* ===== トップページ管理者用拍手表示 ===== */
.admin-clap-section {
  margin-top: 30px;
  border: 1px solid #00FF00;
  padding: 10px;
}
.admin-clap-section h3 {
  margin-top: 0;
  color: #00FF00;
  border-bottom: 1px solid #00FF00;
}
.admin-clap-list {
  max-height: 300px;
  overflow-y: auto;
  font-size: 12px;
}

/* ===== ユーティリティ・コンポーネント ===== */
.admin-input {
  width: 80px;
  margin-bottom: 5px;
}
.admin-msg-small {
  font-size: 12px;
  color: #FF0000;
  margin-top: 5px;
}
.admin-login-status {
  color: #00FF00;
  font-size: 12px;
}
.admin-manage-link {
  display: block;
  color: #00FF00;
  margin-bottom: 10px;
}
.clap-btn-container {
  margin-top: 30px;
  border-top: 1px dashed #00FF00;
}
.news-section {
  margin-top: 20px;
  border: 1px double #00FF00;
  padding: 15px;
  background-color: #111;
}
.news-section h3 {
  color: #00FF00;
  margin-top: 0;
  border-bottom: 1px solid #00FF00;
}
.news-post-area {
  display: none;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #444;
}
.news-post-label {
  color: #00FF00;
  font-size: 0.9em;
  margin-top: 0;
}
.news-textarea {
  width: 100%;
  height: 60px;
  background-color: #222;
  color: #00FF00;
  border: 1px solid #00FF00;
  font-family: monospace;
}
.news-loading {
  color: #888;
}
.clap-modal-desc {
  font-size: 12px;
}
.clap-textarea {
  width: 100%;
  height: 80px;
  background: #111;
  color: #00FF00;
  border: 1px solid #00FF00;
  margin-bottom: 10px;
}
.flex-between {
  display: flex;
  justify-content: space-between;
}
.flex-1 {
  flex: 1;
}
.mr-5 {
  margin-right: 5px;
}
.mt-10 {
  margin-top: 10px;
}
.mt-20 {
  margin-top: 20px;
}
.mb-10 {
  margin-bottom: 10px;
}

.hidden {
  display: none;
}

/* インライン編集・削除確認 */
.inline-form {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed #00FF00;
  background: #0c0c0c;
}

.inline-confirm {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #FF0000;
  background: #1a0000;
  color: #FF0000;
}

.inline-confirm .confirm-msg {
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

.inline-confirm button {
  border-color: #FF0000;
  color: #FF0000;
}

.inline-confirm button:hover {
  background: #440000;
}

.fs-11 {
  font-size: 11px;
}
.ml-5 {
  margin-left: 5px;
}
.text-gray {
  color: #888;
}

.admin-clap-item {
  margin-bottom: 8px;
  border-bottom: 1px solid #222;
}
.admin-clap-item .date {
  color: #888;
}
.admin-clap-item .msg {
  color: #00FF00;
}

