:root {
  color-scheme: light;
  --ink: #162f49;
  --muted: #506980;
  --blue: #185a9d;
  --line: #dce7ef;
  --surface: #ffffff;
  --canvas: #f2f7fb;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #2378b8;
  outline-offset: 3px;
}
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

.site-header { border-bottom: 1px solid var(--line); background: #fcfeff; }
.header-inner {
  max-width: 1352px;
  margin: auto;
  min-height: 76px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand { display: inline-flex; justify-self: start; align-items: center; gap: 11px; font-size: 20px; line-height: 1.15; font-weight: 800; }
.brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #eff8ff; background: var(--blue); }
.brand-icon svg { width: 25px; height: 25px; }
.brand small { display: block; margin-top: 5px; font-size: 10px; font-weight: 600; letter-spacing: .09em; color: var(--muted); }
.tabs { align-self: stretch; display: flex; gap: 26px; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-top: 3px solid transparent; border-bottom: 3px solid transparent; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs a[aria-current] { border-bottom-color: var(--blue); color: var(--blue); }
.tabs a:hover, .rules-link:hover { color: var(--blue); }
.rules-link { justify-self: end; display: flex; align-items: center; gap: 7px; padding: 9px 0 9px 9px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 700; }

.layout { max-width: 1352px; margin: auto; padding: 32px; display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 26px; }
.sidebar { padding-top: 9px; }
.section-label { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; margin-bottom: 13px; font-weight: 700; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.room-total { padding: 2px 6px; color: var(--blue); background: #e5eff8; border-radius: 5px; font: 700 11px ui-monospace, monospace; }
.room-list { display: grid; gap: 8px; }
.room-link, .board-link { display: grid; grid-template-columns: 40px minmax(0, 1fr) 15px; gap: 10px; align-items: center; padding: 10px; border: 1px solid transparent; border-radius: 12px; }
.room-link:hover, .board-link:hover { background: #edf5fb; }
.room-link[aria-current], .board-link[aria-current] { background: #e7f1fb; border-color: #cadff0; }
.room-link[aria-current] strong, .board-link[aria-current] strong { color: var(--blue); }
.room-link strong, .board-link strong { display: block; font-size: 13px; }
.room-link small, .board-link small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.room-link > svg, .board-link > svg { width: 15px; height: 15px; color: #5e7990; }
.room-icon, .side-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 21px; }
.mint { background: #d7eee6; }
.pink { background: #f8e4eb; }
.blue { background: #dfeaf9; }
.side-icon { background: #e6eef6; color: var(--blue); }
.board-link { margin-top: 17px; border-color: var(--line); background: #fbfdff; }

.view { min-width: 0; }
.board-hero { padding: 16px; border: 1px solid #cfdfeb; border-radius: 17px; background: url('/water.svg') no-repeat right bottom / auto 125%, linear-gradient(105deg, #edf7fc, #ddecf7); }
.board-hero h1 { margin: 0; font-size: clamp(24px, 3.6vw, 39px); line-height: 1.25; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 4px 12px #233f5e06; }
.panel-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.panel-heading h2 svg { color: #3c759f; width: 18px; height: 18px; }

.board-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; text-align: center; margin: 0; }
.board-empty strong { color: var(--ink); font-size: 15px; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 5px; color: #397aa9; background: #edf5fb; border-radius: 16px; }
.empty-icon svg { width: 24px; height: 24px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; font-weight: 750; background: var(--avatar, #e7f1fb); }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.message-meta strong { overflow-wrap: anywhere; }
.message-meta time, .thread-meta time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.board-post p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }

.post-form label { display: grid; gap: 5px; color: var(--ink); font-size: 12px; font-weight: 700; }
.post-form input, .post-form textarea { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d9e7; border-radius: 8px; background: white; color: var(--ink); font-size: 16px; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #61798f; font-size: 13px; }
textarea { resize: vertical; }
.name-ocean { color: #185a9d; --avatar: #e7f1fb; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; font-size: 13px; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.primary { color: white; background: var(--blue); }
.primary:hover:not(:disabled) { background: #144d85; }
.secondary { color: var(--blue); background: #f5f9fd; border-color: #d2e2f0; }
.secondary:hover:not(:disabled) { background: #e7f1fb; }
.error { margin: 10px 0 0; color: #a02e48; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; }

.board-panel { margin-top: 18px; }
.board-content { padding: 15px 18px; }
.board-content > .error + .button { margin-top: 8px; }
.board-empty { min-height: 245px; }
.thread-row { display: flex; align-items: center; gap: 11px; min-height: 66px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: #f6fafe; }
.thread-title { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.thread-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.reply-count { flex: none; color: var(--blue); font-size: 11px; font-weight: 750; }
.pagination { display: flex; justify-content: center; }
.pagination:has(button:not([hidden])) { padding-bottom: 15px; }
.board-error { margin: 0 18px 15px; }
.back-link { display: inline-block; margin: 16px 0 9px; color: var(--blue); font-size: 13px; font-weight: 750; }
.back-link:hover { text-decoration: underline; }
.thread-panel h3 { font-size: 14px; margin: 12px 0; }
.board-post { padding: 12px 0; }
.board-post p { margin-top: 9px; }
.original-post, .reply-list { border-bottom: 1px solid var(--line); }
.reply-list .board-post + .board-post { border-top: 1px solid var(--line); }
.more-replies { margin-top: 10px; }
.reply-form { padding-top: 10px; }
.post-form { display: grid; gap: 11px; }
.post-form button { justify-self: end; }
.post-form .error { margin: 0; }

.dialog { width: min(100% - 32px, 480px); max-height: calc(100% - 32px); padding: 21px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); }
.dialog::backdrop { background: #102f4b60; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.dialog h2 { margin: 0; font-size: 19px; }
.dialog p { line-height: 1.7; }
.close-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: #edf5fb; font-size: 25px; line-height: 1; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 183px minmax(0, 1fr); gap: 15px; padding: 24px; }
}
@media (max-width: 650px) {
  .header-inner { min-height: 62px; padding: 0 12px; gap: 8px; }
  .brand { gap: 6px; font-size: 16px; }
  .brand-icon { width: 31px; height: 31px; border-radius: 9px; }
  .brand-icon svg { width: 20px; height: 20px; }
  .brand small { font-size: 8px; }
  .tabs { gap: 3px; }
  .tabs a { gap: 4px; padding: 0 5px; font-size: 12px; }
  .tabs svg, .rules-link svg { width: 16px; height: 16px; }
  .rules-link { gap: 4px; padding-left: 2px; font-size: 11px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 13px; }
  .sidebar { padding-top: 2px; }
  .section-label { margin-bottom: 5px; font-size: 11px; }
  .room-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .room-link { grid-template-columns: 23px minmax(0, 1fr); padding: 6px 4px; gap: 4px; border-radius: 8px; }
  .room-link strong { font-size: 11px; }
  .room-link small { font-size: 9px; margin-top: 3px; }
  .room-icon { width: 23px; height: 27px; font-size: 15px; border-radius: 6px; }
  .room-link > svg, .board-link { display: none; }
  .board-panel { margin-top: 12px; }
  .panel-heading { min-height: 47px; padding: 8px 12px; }
}
@media (max-width: 360px) {
  .tabs svg { display: none; }
}
