:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --primary: #0f766e;
  --primary-hover: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: linear-gradient(160deg, #eef6ff 0%, var(--bg) 55%, #e8fff6 100%);
  color: var(--text);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.06);
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  padding: 9px 10px;
  border: 1px solid #bfc7d2;
  border-radius: 8px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  background: var(--primary);
  cursor: pointer;
  width: fit-content;
}

button:hover {
  background: var(--primary-hover);
}

button.secondary {
  background: #475569;
}

button.secondary:hover {
  background: #334155;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  color: #0f766e;
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  text-decoration: underline;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.required {
  color: #b91c1c;
  font-size: 0.82rem;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.consent-check input {
  width: 16px;
  height: 16px;
}

.consent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.doc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.doc-viewer {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.doc-viewer h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.doc-viewer pre {
  margin: 0;
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.45;
}

.withdraw-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0 12px;
  background: #fffaf3;
}

.withdraw-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.withdraw-box p {
  margin: 0 0 8px;
}

.sugoroku-controls {
  margin-bottom: 10px;
}

.sugoroku-controls label {
  max-width: 240px;
}

.sugoroku-board {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0 12px;
}

.sugoroku-step {
  min-width: 52px;
  min-height: 64px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 2px dashed #cbd5e1;
}

.step-number {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.step-mark {
  min-height: 1.6rem;
  margin-top: 4px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rabbit-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.sugoroku-step.reached .step-mark {
  color: #1d4ed8;
  font-weight: 700;
}

.sugoroku-step.current .step-number {
  color: #0f766e;
  font-size: 1.15rem;
}

.sugoroku-step.current .step-mark {
  color: #0f766e;
  font-weight: 700;
}

.sugoroku-step.current .rabbit-icon {
  animation: bunny-hop 0.9s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes bunny-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-6px) scale(1.04); }
  50% { transform: translateY(-10px) scale(1.06); }
  70% { transform: translateY(-4px) scale(1.02); }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: -4px;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .container {
    padding: 16px 12px 28px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .rabbit-icon {
    width: 22px;
    height: 22px;
  }
}

.youtube-recommend-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
