/* GGオートマ馬券 デザインシステム
   競馬モチーフ: 芝の緑・馬蹄・ゼッケンカラー(勝負服の配色) */

:root {
  --turf-dark: #0f3d2e;
  --turf: #1b5e42;
  --turf-mid: #2e7d55;
  --turf-light: #6fbf8b;
  --cream: #faf7ef;
  --paper: #ffffff;
  --gold: #c9971f;
  --gold-light: #e6b83d;
  --silk-red: #b3261e;
  --silk-blue: #1d4e89;
  --ink: #23281f;
  --ink-soft: #5a6152;
  --border: #e3ddc9;
  --shadow: 0 2px 10px rgba(15, 61, 46, 0.1), 0 1px 2px rgba(15, 61, 46, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(135deg, rgba(27, 94, 66, 0.05) 0, rgba(27, 94, 66, 0.05) 26px, transparent 26px, transparent 52px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- ヘッダー ---------- */

.site-header {
  background: linear-gradient(135deg, var(--turf-dark), var(--turf));
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cream);
}

.brand-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: block;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-text .accent {
  color: var(--gold-light);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav a,
.site-nav .link-button {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.92;
  background: none;
  border: none;
  padding: 0.3rem 0.1rem;
  cursor: pointer;
  font-family: inherit;
}

.site-nav a:hover,
.site-nav .link-button:hover {
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: var(--gold-light);
}

.logout-form {
  margin: 0;
  display: inline;
}

/* ---------- レイアウト ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page.wide {
  max-width: 960px;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

/* ---------- カード ---------- */

.card {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--turf);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.card + .card {
  margin-top: 1.25rem;
}

.card h1 {
  margin-top: 0;
  font-size: 1.4rem;
  color: var(--turf-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h1::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1.3rem;
  background: var(--gold);
  border-radius: 3px;
}

.card h2 {
  font-size: 1.05rem;
  color: var(--turf-dark);
  margin-top: 0;
}

.lede {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: -0.5rem;
}

/* ---------- フォーム ---------- */

label {
  display: block;
  margin-top: 1.1rem;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--turf-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--turf-mid);
  box-shadow: 0 0 0 3px rgba(46, 125, 85, 0.18);
  background: var(--paper);
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-weight: 400;
  font-size: 0.95rem;
}

.radio-row label {
  display: inline;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
}

/* ---------- ボタン ---------- */

button,
.btn {
  margin-top: 1.5rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--turf-mid), var(--turf));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(15, 61, 46, 0.25);
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  display: inline-block;
  text-decoration: none;
}

button:hover,
.btn:hover {
  background: linear-gradient(135deg, var(--turf), var(--turf-dark));
  box-shadow: 0 3px 8px rgba(15, 61, 46, 0.35);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button.danger {
  background: linear-gradient(135deg, #d1453b, var(--silk-red));
}

button.danger:hover {
  background: linear-gradient(135deg, var(--silk-red), #8f1c16);
}

button.ghost {
  background: none;
  color: var(--turf-dark);
  border: 1.5px solid var(--turf-mid);
  box-shadow: none;
}

button.ghost:hover {
  background: rgba(46, 125, 85, 0.08);
}

/* ---------- メッセージ ---------- */

.errors {
  background: #fdecea;
  color: #8a2c22;
  border: 1px solid #f3c6bf;
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  margin-top: 1rem;
}

.errors ul {
  margin: 0;
  padding-left: 1.2rem;
}

.flash {
  background: #eaf6ee;
  color: var(--turf-dark);
  border: 1px solid #bfe3cc;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  margin-bottom: 1.25rem;
}

.notice {
  background: #fff8e6;
  color: #7a5b00;
  border: 1px solid #f0dca0;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}

/* ---------- テーブル ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: var(--turf-dark);
  color: var(--cream);
  font-size: 0.82rem;
}

th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }

td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) {
  background: rgba(46, 125, 85, 0.05);
}

tbody tr:hover {
  background: rgba(201, 151, 31, 0.1);
}

.empty {
  color: var(--ink-soft);
  margin-top: 1rem;
}

.actions form {
  display: inline;
}

.actions button {
  margin-top: 0;
  margin-right: 0.4rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

/* ---------- バッジ ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-active { background: #e0f3e6; color: var(--turf-dark); }
.badge-pending { background: #fff3d6; color: #8a6300; }
.badge-approved { background: #e3edfa; color: var(--silk-blue); }
.badge-suspended { background: #fbe2e0; color: var(--silk-red); }
.badge-rejected { background: #ececec; color: #666; }

/* ---------- 診断結果 ---------- */

.recommendation {
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
  background: linear-gradient(180deg, #fffefb, var(--paper));
}

.recommendation .candidate-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 0.2rem;
}

.bet-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: baseline;
  margin: 0.4rem 0;
}

.bet-type {
  background: var(--turf);
  color: #fff;
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.bet-amount {
  font-weight: 700;
  color: var(--turf-dark);
}

.bet-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.usable-budget {
  background: var(--turf-dark);
  color: var(--cream);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.usable-budget strong {
  color: var(--gold-light);
  font-size: 1.15rem;
}

.stars {
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* ---------- リンク行 ---------- */

.link-row {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.link-row a {
  color: var(--turf);
  font-weight: 600;
  text-decoration: none;
}

.link-row a:hover {
  text-decoration: underline;
}

.pagination {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination strong {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--turf-dark);
}

.pagination strong {
  background: var(--turf);
  color: #fff;
}

.pagination a:hover {
  background: rgba(46, 125, 85, 0.12);
}

/* ---------- レスポンシブ ---------- */

@media (max-width: 560px) {
  .page {
    padding: 1.25rem 0.85rem 2rem;
  }

  .card {
    padding: 1.25rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
