:root {
  --green: #2f9b69;
  --dark-green: #1b7149;
  --light-green: #e6f6ed;
  --yellow: #ffd859;
  --orange: #f59e0b;
  --red: #d95252;
  --blue: #378edb;
  --text: #263238;
  --sub-text: #60716b;
  --border: #d8e3dc;
  --bg: #f4fbf6;
  --white: #ffffff;
  --shadow: 0 8px 22px rgba(36, 86, 59, 0.13);
}


* {
  box-sizing: border-box;
}


html {
  min-height: 100%;
  background: var(--bg);
}


body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}


button,
input,
textarea {
  font: inherit;
}


button {
  cursor: pointer;
}


button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


.hidden {
  display: none !important;
}


#app {
  min-height: 100vh;
}


section {
  min-height: 100vh;
  padding: 88px 16px 42px;
}


/* ---------- スタート画面 ---------- */


#home-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(227, 250, 234, 0.72), rgba(255, 255, 255, 0.86)),
    #e9f9ee;
  place-items: center;
}


.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}


#hero-canvas {
  width: 100%;
  height: 100%;
}


.home-content {
  position: relative;
  z-index: 1;
  width: min(92%, 520px);
  padding: 36px 24px;
  text-align: center;
}


.home-content h1 {
  margin: 0;
  color: var(--dark-green);
  font-size: clamp(3.2rem, 13vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-shadow: 0 4px 0 #fff;
}


.home-subtitle {
  margin: 22px 0 8px;
  color: var(--dark-green);
  font-size: 1.35rem;
  font-weight: 800;
}


.home-description {
  margin: 0 auto 34px;
  color: var(--sub-text);
  font-size: 1rem;
  line-height: 1.8;
}


#start-btn {
  min-width: 210px;
  padding: 16px 28px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 7px 0 var(--dark-green), 0 12px 18px rgba(24, 105, 66, 0.2);
  font-size: 1.2rem;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}


#start-btn:hover {
  transform: translateY(-2px);
}


#start-btn:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 var(--dark-green);
}


/* ---------- 共通カード ---------- */


.page-card {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 26px 20px;
  border: 1px solid rgba(216, 227, 220, 0.9);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}


.page-card h2 {
  margin: 0 0 10px;
  color: var(--dark-green);
  font-size: 1.65rem;
  text-align: center;
}


.page-card h3 {
  margin: 28px 0 12px;
  color: var(--dark-green);
  font-size: 1.15rem;
}


.page-description {
  margin: 0 0 22px;
  color: var(--sub-text);
  line-height: 1.7;
  text-align: center;
}


.form-group {
  margin: 0 0 17px;
}


label {
  display: block;
  margin: 0 0 7px;
  color: var(--text);
  font-weight: 700;
}


input,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}


textarea {
  resize: vertical;
}


input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 155, 105, 0.16);
}


input[type="file"] {
  padding: 10px;
  background: #f8fcf9;
}


button.main-button,
button.sub-button,
button.register-button,
button.pdf-button {
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  transition: opacity 0.15s ease, transform 0.15s ease;
}


button.main-button:hover,
button.sub-button:hover,
button.register-button:hover,
button.pdf-button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}


.main-button {
  color: #fff;
  background: var(--green);
}


.sub-button {
  color: var(--dark-green);
  background: var(--light-green);
}


.register-button {
  color: #fff;
  background: var(--blue);
}


.pdf-button {
  color: #785600;
  background: #fff1b8;
}


.small-button {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}


.text-link-button {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 8px;
  border: 0;
  color: var(--dark-green);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
}


.error-message {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.5;
}


.input-help,
.privacy-warning {
  margin: 7px 0 0;
  color: var(--sub-text);
  font-size: 0.82rem;
  line-height: 1.5;
}


.privacy-warning {
  color: #a55a3c;
}


/* ---------- ログイン ---------- */


.login-card {
  width: min(100%, 460px);
}


/* ---------- 役割選択 ---------- */


.role-choice-box {
  display: grid;
  gap: 8px;
}


.role-help {
  margin: 0 0 16px;
  padding: 0 5px;
  color: var(--sub-text);
  font-size: 0.88rem;
  line-height: 1.65;
}


#create-team-form {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}


/* ---------- ダッシュボード ---------- */


.dashboard-notice {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 14px;
  background: var(--light-green);
}


.dashboard-notice h3 {
  margin: 0 0 6px;
}


.dashboard-notice p {
  margin: 0;
  color: var(--sub-text);
  line-height: 1.6;
}

/*
  代表者向けのチーム管理ボタンと、
  下に並ぶ4つのホームボタンの間に余白を作る。
*/
#dashboard-team-btn {
  margin-bottom: 24px;
}




.dashboard-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}


.dashboard-link {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--dark-green);
  background: #fff;
  font-weight: 800;
  line-height: 1.45;
}


.dashboard-link:hover {
  border-color: var(--green);
  background: var(--light-green);
}


/* ---------- 持ち物・ルール ---------- */


.check-item,
.rule-item,
.member-item,
.tool-item,
.post-item {
  list-style: none;
}


#checklist-items,
#rules-list {
  display: grid;
  gap: 9px;
}


.check-item,
.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fcfffd;
}


.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}


.check-item span,
.rule-item span {
  flex: 1;
  line-height: 1.55;
}


.delete-item-btn {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: #a03f3f;
  background: #ffe8e8;
  font-size: 0.8rem;
  font-weight: 700;
}


#checklist-editor,
#add-rule-form {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}


/* ---------- タブ ---------- */


.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}


.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  border-radius: 9px;
  color: var(--sub-text);
  background: #eef4f0;
  font-weight: 800;
}


.tab-btn.active {
  color: #fff;
  background: var(--green);
}


#reserve-list,
#lend-list,
#return-list,
#member-list,
#done-list {
  margin: 12px 0 0;
  padding: 0;
}


.member-item,
.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fcfffd;
}


.member-item {
  justify-content: space-between;
}


.tool-main {
  flex: 1;
  min-width: 0;
}


.tool-name {
  display: block;
  font-weight: 800;
}


.tool-user {
  display: block;
  margin-top: 4px;
  color: var(--sub-text);
  font-size: 0.83rem;
}


.tool-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}


.status-waiting {
  color: #8b5e00;
  background: #fff0b5;
}


.status-approved {
  color: #16653e;
  background: #d9f4e4;
}


.status-returned {
  color: #3d5874;
  background: #e1edf8;
}


.tool-action-btn {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
}


/* ---------- 投稿 ---------- */


.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}


.section-title-row h2 {
  margin: 0;
}


.post-item {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}


.post-body {
  padding: 15px;
}


.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}


.post-name {
  color: var(--dark-green);
  font-weight: 900;
}


.post-date {
  color: var(--sub-text);
  font-size: 0.82rem;
  white-space: nowrap;
}


.post-info {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 0.93rem;
}


.post-description {
  margin: 10px 0 0;
  color: var(--sub-text);
  line-height: 1.65;
  white-space: pre-wrap;
}


.post-image {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  background: #eef4f0;
}


.like-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
}


.like-btn {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  color: #a64b4b;
  background: #fff0f0;
  font-size: 0.84rem;
  font-weight: 800;
}


/* ---------- メニュー ---------- */


.menu-toggle-btn {
  position: fixed;
  z-index: 30;
  top: 16px;
  right: 16px;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 11px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 4px 13px rgba(28, 98, 61, 0.28);
  gap: 5px;
}


.menu-toggle-btn span {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #fff;
}


.menu-overlay {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: rgba(24, 43, 33, 0.42);
}


.side-menu {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(86vw, 330px);
  min-height: 100vh;
  padding: 20px;
  background: #fff;
  box-shadow: -7px 0 25px rgba(28, 58, 41, 0.18);
}


.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}


.side-menu-header h2 {
  margin: 0;
  color: var(--dark-green);
  font-size: 1.25rem;
}


.menu-close-btn {
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--sub-text);
  background: #eff4f1;
  font-size: 0.85rem;
  font-weight: 700;
}


.side-menu-list {
  display: grid;
  margin-top: 14px;
  gap: 5px;
}


.side-menu-list button {
  padding: 13px 10px;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  text-align: left;
}


.side-menu-list button:hover {
  color: var(--dark-green);
  background: var(--light-green);
}


.side-menu-list .logout-menu-button {
  margin-top: 14px;
  border: 1px solid #f5cccc;
  border-radius: 10px;
  color: #ad4040;
  background: #fff7f7;
  text-align: center;
}


#like-dialog {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: rgba(30, 73, 48, 0.94);
  box-shadow: var(--shadow);
  font-weight: 700;
}


@media (min-width: 720px) {
  .page-card {
    padding: 34px;
  }


  .dashboard-links {
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 420px) {
  section {
    padding-right: 12px;
    padding-left: 12px;
  }


  .page-card {
    padding: 22px 16px;
    border-radius: 16px;
  }


  .dashboard-links {
    grid-template-columns: 1fr;
  }


  .tool-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }


  .tool-action-btn {
    width: 100%;
  }
}