/* ===== Base ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  font-family: "MS PGothic", "MS Gothic", Osaka, monospace;
  font-size: 14px;
}

/* ===== Layout ===== */

.page-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 10px;
}

.site-header,
.notice,
.container,
.site-footer {
  width: 100%;
}

/* ===== Header ===== */

.site-header {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #000;
  background: #f0f0f0;
}

.site-header h1 {
  margin: 0;
  font-size: 20px;
}

.subtitle,
.header-note {
  margin-top: 6px;
  font-size: 12px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== Notice / Links ===== */

.notice {
  margin-top: 10px;
  padding: 6px;
  border: 1px solid #000;
  background: #ffffcc;
  font-size: 12px;
}

.mature-link,
.nsfw-link {
  margin-top: 10px;
  padding: 6px;
  border: 1px solid #000;
  background: #eee;
  text-align: center;
}

.mature-link a,
.nsfw-link a,
.sns-links a {
  color: #0000ee;
  text-decoration: none;
}

.mature-link a:hover,
.nsfw-link a:hover,
.sns-links a:hover {
  background: #ffffcc;
}

/* ===== Footer ===== */

.site-footer {
  margin: 20px 0;
  font-size: 12px;
  text-align: center;
}

/* ===== Accordion ===== */

.group {
  border: 1px solid #000;
  margin-bottom: 10px;
}

.group-header {
  width: 100%;
  padding: 8px;
  border: none;
  background: #dcdcdc;
  font-weight: bold;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.group-header:hover {
  background: #c0c0c0;
}

.panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  border-top: 1px solid #000;
  background: #fff;
}

.panel-inner {
  padding: 10px;
}

/* ===== Gallery Grid ===== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.card {
  display: block;
  padding: 4px;
  border: 1px solid #000;
  background: #fff;
  text-decoration: none;
  color: #0000ee;
}

.card:hover {
  background: #ffffcc;
}

.thumb {
  width: 100%;
  display: block;
  border: 1px solid #000;
}

.caption {
  margin-top: 4px;
  font-size: 12px;
}

.caption .title {
  font-weight: bold;
}

.caption .desc {
  font-size: 11px;
}

/* ===== Modal ===== */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: auto;
  border: 2px solid #000;
  background: #fff;
}

.modal-bar {
  padding: 5px;
  background: #dcdcdc;
  border-bottom: 1px solid #000;
}

.modal-close {
  margin-top: 5px;
  font-size: 12px;
  border: 1px solid #000;
  background: #fff;
  cursor: pointer;
}

.modal-img {
  width: 100%;
  display: block;
}

/* ===== Profile / SNS ===== */

.profile-box,
.sns-links {
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #000;
  background: #f5f5f5;
  font-size: 12px;
}

.profile-box h2 {
  margin: 0 0 8px;
  font-size: 14px;
}

/* ===== NSFW Gate ===== */

.warning-box {
  margin-top: 50px;
  padding: 20px;
  border: 2px solid #000;
  background: #fff0f0;
  text-align: center;
}

.warning-buttons {
  margin-top: 20px;
}

.enter-btn,
.back-btn {
  display: inline-block;
  padding: 6px 12px;
  margin: 5px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  text-decoration: none;
}

.enter-btn:hover {
  background: #ffcccc;
}

.back-btn:hover {
  background: #ccccff;
}

.password-input {
  margin-top: 10px;
  padding: 6px;
  width: 120px;
  font-size: 14px;
  text-align: center;
  border: 1px solid #000;
}

.error-message {
  margin-top: 8px;
  min-height: 40px;
  font-size: 12px;
  color: red;
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
  html, body {
    font-size: 13px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .group-header {
    font-size: 13px;
    padding: 6px;
  }

  .notice {
    font-size: 11px;
  }

  .modal-content {
    width: 100%;
  }
}