@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  /* Background — warm washi paper tones */
  --bg-primary: #f0e8da;
  --bg-secondary: #faf6ee;
  --bg-surface: #e8dfcf;
  --bg-hover: #e0d5c3;

  /* Text — dark brown for readability */
  --text-primary: #2a2018;
  --text-secondary: #5c5040;
  --text-muted: #8a7e6e;

  /* Accent — matcha green */
  --accent: #4a8a3a;
  --accent-hover: #3d7530;
  --accent-dim: rgba(74, 138, 58, 0.12);

  /* Status */
  --status-waiting: #c07a20;
  --status-playing: #4a8a3a;
  --status-finished: #8a7e6e;

  /* Danger */
  --danger: #c04030;
  --danger-hover: #a03525;

  /* Border & Shadow */
  --border: #d0c4b0;
  --shadow: rgba(80, 60, 30, 0.12);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Font */
  --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: url('/img/tatami-bg.jpg') repeat;
  color: var(--text-primary);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  font-family: var(--font-family);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
  border-color: var(--accent);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-waiting {
  background: rgba(192, 122, 32, 0.12);
  color: var(--status-waiting);
}

.status-playing {
  background: rgba(74, 138, 58, 0.12);
  color: var(--status-playing);
}

.status-finished {
  background: rgba(138, 126, 110, 0.12);
  color: var(--status-finished);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Site Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}

.header-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
}

.header-title:hover {
  color: var(--accent-hover);
}

.header-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.header-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Hamburger Button ---------- */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: background 0.2s;
}

.hamburger-btn:hover span {
  background: var(--accent);
}

/* ---------- Hamburger Menu ---------- */
.hamburger-menu {
  position: fixed;
  top: 48px;
  right: 12px;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 1100;
  overflow: hidden;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item:hover {
  background: var(--bg-hover);
}

.menu-item-danger {
  color: var(--danger);
}

.menu-item-danger:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* ---------- Ad / Affiliate ---------- */
.ad-banner {
  margin: 24px 0;
  text-align: center;
}

.affiliate-link {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.2s;
}

.affiliate-link:hover {
  background: var(--accent-dim);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ---------- Legal Modal ---------- */
.legal-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.legal-modal-overlay.active {
  display: flex;
}

.legal-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.legal-modal-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.legal-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  padding: 0 4px;
  line-height: 1;
}

.legal-modal-close:hover {
  color: var(--text-primary);
}

.legal-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.legal-modal-body h4 {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-top: 16px;
  margin-bottom: 6px;
}

.legal-modal-body h4:first-child {
  margin-top: 0;
}

.legal-modal-body ul {
  margin-left: 20px;
  margin-bottom: 8px;
}

.legal-modal-body li {
  margin-bottom: 4px;
}
