/* ===== reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  background: #f3f5f8;
  color: #1f2933;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}
a { color: #2d8659; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: #1f2933; margin-top: 0; }
h1 { font-size: 1.6rem; margin-bottom: .75rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; padding-bottom: .35rem; border-bottom: 2px solid #e1e6ec; }
h3 { font-size: 1rem; margin: .75rem 0 .35rem; }

/* ===== header / nav ===== */
.header {
  background: linear-gradient(135deg, #1d5a3a 0%, #2d8659 100%);
  color: #fff;
  padding: .75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.brand {
  font-size: 1.2rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: .5rem;
}
.brand::before { content: "⛏"; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.92);
  padding: .35rem .8rem; border-radius: 6px;
  font-size: .9rem;
}
.nav a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.nav a.active { background: rgba(0,0,0,.25); }

/* ===== layout ===== */
.container { max-width: 1280px; margin: 1.25rem auto; padding: 0 1.25rem; flex: 1; width: 100%; }
.footer {
  text-align: center; padding: .9rem; color: #6b7785; font-size: .82rem;
  border-top: 1px solid #e1e6ec; background: #fff;
}
.footer-version { margin-left: .8rem; color: #a0aab4; font-size: .78rem; }

/* ===== card ===== */
.card {
  background: #fff;
  border: 1px solid #e1e6ec;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ===== split layout (form + data side-by-side on desktop) ===== */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .split { grid-template-columns: minmax(320px, 380px) 1fr; align-items: start; }
  .split .card { margin-bottom: 0; }
}

/* ===== dashboard tiles ===== */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .85rem;
}
.tile {
  background: #fff;
  border: 1px solid #e1e6ec;
  border-left: 4px solid #2d8659;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.tile .label { font-size: .82rem; color: #6b7785; margin-bottom: .25rem; }
.tile .value { font-size: 1.7rem; font-weight: 700; color: #1f2933; line-height: 1.1; }
.tile.warn { border-left-color: #d97706; }
.tile.danger { border-left-color: #dc2626; }

/* ===== flash ===== */
.flash {
  padding: .6rem .9rem;
  border-radius: 6px;
  margin-bottom: .65rem;
  border: 1px solid;
  font-size: .9rem;
}
.flash.success { background: #ecfdf5; border-color: #34d399; color: #065f46; }
.flash.error   { background: #fef2f2; border-color: #f87171; color: #991b1b; }

/* ===== forms ===== */
form .field { margin-bottom: .75rem; }
form .field label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .87rem; color: #374151; }
form .field input[type="text"],
form .field input[type="password"],
form .field input[type="file"],
form .field textarea,
form .field select {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #cbd2da;
  border-radius: 6px;
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
form .field input:focus,
form .field textarea:focus {
  outline: none;
  border-color: #2d8659;
  box-shadow: 0 0 0 3px rgba(45, 134, 89, .15);
}
form .field textarea { min-height: 90px; resize: vertical; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: .9rem; margin: .5rem 0 .75rem; }
.checkbox-row label {
  display: inline-flex; align-items: center; gap: .35rem;
  font-weight: normal; font-size: .88rem; color: #374151;
  cursor: pointer;
}
.form-row { display: flex; gap: .85rem; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; }

/* ===== buttons ===== */
.btn {
  display: inline-block;
  padding: .45rem .95rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #2d8659;
  color: #fff;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .05s;
}
.btn:hover { background: #1d5a3a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.btn.btn-secondary { background: #6b7785; }
.btn.btn-secondary:hover { background: #4b5563; }
.btn.btn-danger { background: #dc2626; }
.btn.btn-danger:hover { background: #991b1b; }
.btn.btn-warn { background: #d97706; }
.btn.btn-warn:hover { background: #92400e; }
.btn.btn-outline {
  background: transparent; color: #2d8659; border-color: #2d8659;
}
.btn.btn-outline:hover { background: #2d8659; color: #fff; }
form.inline { display: inline; }

/* ===== table ===== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .9rem;
}
table.data th, table.data td {
  padding: .5rem .7rem;
  text-align: left;
  border-bottom: 1px solid #e1e6ec;
  vertical-align: middle;
}
table.data th {
  background: #f6f8fa;
  font-weight: 600;
  font-size: .82rem;
  color: #4b5563;
  border-bottom: 2px solid #cbd2da;
}
table.data tr:hover td { background: #fafbfc; }
table.data .actions { white-space: nowrap; }
table.data .actions form { display: inline-block; margin-right: .25rem; }

/* ===== status badges ===== */
.status {
  display: inline-block;
  padding: .12rem .55rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}
.status.pending  { background: #fef3c7; color: #92400e; }
.status.approved { background: #d1fae5; color: #065f46; }
.status.rejected { background: #fee2e2; color: #991b1b; }
.status.removed  { background: #e5e7eb; color: #374151; }
.status.active   { background: #fee2e2; color: #991b1b; }
.status.inactive { background: #e5e7eb; color: #374151; }
.status.published { background: #d1fae5; color: #065f46; }
.status.draft     { background: #e5e7eb; color: #374151; }
.status.latest    { background: #fef3c7; color: #92400e; }

/* ===== news ===== */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .news-grid { grid-template-columns: repeat(3, 1fr); }
}
.news-item {
  background: #fff;
  border: 1px solid #e1e6ec;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.news-item h3 { margin: 0 0 .25rem; }
.news-item .meta { font-size: .78rem; color: #6b7785; margin-bottom: .5rem; }
.news-item .body {
  white-space: pre-wrap; color: #374151; font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6;
  -webkit-box-orient: vertical; overflow: hidden;
}
/* admin news list — show full body, no clamp */
.news-list .news-item .body { display: block; -webkit-line-clamp: none; }

/* ===== launcher hero ===== */
.launcher-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #d1fae5;
  border-radius: 10px;
  margin-bottom: 1.25rem;
}
.launcher-hero .version {
  font-size: 1.8rem; font-weight: 700; color: #065f46; margin: .25rem 0;
}
.launcher-hero .meta { color: #6b7785; font-size: .88rem; margin-bottom: 1rem; }
.launcher-hero .btn { padding: .6rem 1.5rem; font-size: 1rem; }

/* ===== home hero (welcome card) ===== */
.hero { padding: 1.5rem; }
.hero h1 { font-size: 1.8rem; }

/* ===== misc ===== */
.muted { color: #6b7785; font-size: .88rem; }
.empty { color: #6b7785; padding: 1.25rem; text-align: center; font-style: italic; font-size: .92rem; }
hr.sep { border: none; border-top: 1px solid #e1e6ec; margin: 1.25rem 0; }
.permission-list { font-size: .8rem; color: #4b5563; }
.permission-list .perm { display: inline-block; margin-right: .35rem; }
.perm.on { color: #065f46; font-weight: 600; }
.perm.off { color: #9ca3af; text-decoration: line-through; }

/* ===== Discord OAuth ===== */
.btn-discord {
  background: #5865f2;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  font-size: .98rem;
}
.btn-discord:hover { background: #4752c4; color: #fff; text-decoration: none; }
.discord-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: rgba(255,255,255,.2);
  border-radius: 4px;
  font-weight: 700; font-size: .85rem;
}
.discord-card {
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 1rem;
  background: #f0f3ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.discord-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  flex-shrink: 0; background: #5865f2; color: #fff;
}
.discord-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.3rem;
}
.discord-info { flex: 1; min-width: 0; }
.discord-name { font-weight: 600; font-size: 1rem; }
.discord-handle { font-size: .82rem; }

/* ===== auth-choice (Discord ログイン or 手動 の2択) ===== */
.auth-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}
.auth-choice-card {
  border: 1px solid #e1e6ec;
  border-radius: 8px;
  padding: 1.1rem;
  background: #fafbfc;
}
.auth-choice-card h3 { margin: 0 0 .35rem; }
.auth-choice-or {
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #6b7785; font-size: .85rem;
  position: relative;
}
.auth-choice-or::before,
.auth-choice-or::after {
  content: ""; flex: 1; height: 1px; background: #cbd2da;
}
.auth-choice-or { gap: .75rem; padding: .25rem 0; }

@media (min-width: 768px) {
  .auth-choice {
    grid-template-columns: 1fr auto 1fr;
  }
  .auth-choice-or {
    flex-direction: column;
    padding: 0 .25rem;
  }
  .auth-choice-or::before,
  .auth-choice-or::after {
    width: 1px; height: auto; flex: 1;
  }
}

/* ===== home: 2-column hero/news on desktop ===== */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 960px) {
  .home-grid { grid-template-columns: 360px 1fr; align-items: start; }
  .home-grid > .card { margin-bottom: 0; }
}

/* ===== responsive: mobile ===== */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .header { padding: .65rem .9rem; }
  .container { margin: .75rem auto; padding: 0 .75rem; }
  .card { padding: 1rem; border-radius: 8px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
  .tile .value { font-size: 1.4rem; }
  table.data { font-size: .82rem; }
  table.data th, table.data td { padding: .4rem .5rem; }
}

/* ===== player grid ===== */
.player-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.player-tag {
  background: #e8f0fe;
  color: #1a56db;
  border-radius: 4px;
  padding: .2rem .55rem;
  font-size: .85rem;
  font-family: monospace;
}

/* ===== WL status indicators ===== */
.wl-dot { font-size: .65rem; vertical-align: middle; font-style: normal; }
.wl-dot.ok   { color: #059669; }
.wl-dot.warn { color: #d97706; }
.wl-dot.bad  { color: #dc2626; }
.wl-dot.gray { color: #9ca3af; }
.wl-dot.be   { color: #0ea5e9; }  /* 統合版(Bedrock)識別。コピーリンクの濃青と区別するため水色。 */

/* ===== responsive: large desktop ===== */
@media (min-width: 1440px) {
  .container { max-width: 1360px; }
}
