/* NAKAMA QR hub — mobile-first, accessible, lightweight. */
@import url('https://fonts.googleapis.com/css2?family=Yuji+Boku&display=swap');

:root {
  --bg: #fdf6ee;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #6b6359;
  --accent: #bf9456;
  --accent-dark: #8c6a3a;
  --line: #e8ddcd;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 40, 15, 0.06);
  --tap: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

a { color: var(--accent-dark); }
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

main {
  max-width: 460px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  min-height: calc(100vh - 80px);
}

header.app-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 18px;
}
header.app-header .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text);
}
header.app-header .brand .kanji {
  font-family: 'Yuji Boku', 'Ma Shan Zheng', cursive;
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--accent);
  opacity: 0.9;
  line-height: 1;
}
header.app-header .brand .wordmark {
  height: 22px;
  width: auto;
  display: block;
}
header.app-header .lang {
  position: absolute;
  top: 14px;
  right: 0;
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
header.app-header .lang button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  text-transform: uppercase;
}
header.app-header .lang button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.back-link {
  display: inline-block;
  padding: 8px 4px;
  margin: -8px -4px 8px;
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 4px 0 6px;
}
h2 { font-size: 18px; margin: 22px 0 10px; }
p  { line-height: 1.5; margin: 8px 0 14px; color: var(--text); }
.lead { color: var(--muted); margin-bottom: 22px; }

/* Hub buttons */
.action-list { display: grid; gap: 12px; margin-top: 18px; }
.action {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  min-height: var(--tap);
  transition: transform 0.06s ease;
}
.action:active { transform: scale(0.99); }
.action .title { font-weight: 600; font-size: 17px; }
.action .sub   { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Forms */
label.field {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}
label.field > span.label { display: block; margin-bottom: 6px; }
label.field input, label.field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px;
  min-height: var(--tap);
}
label.field textarea { min-height: 110px; resize: vertical; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
}
.consent input { margin-top: 3px; min-width: 18px; min-height: 18px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  min-height: var(--tap);
  cursor: pointer;
  text-decoration: none;
  margin-top: 6px;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

.bonus-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 8px 0 20px;
  box-shadow: var(--shadow);
}
.bonus-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bonus-card p { margin: 0; font-size: 14px; }

/* Master grid */
.master-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 10px 0 18px;
}
.master-card {
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  min-height: var(--tap);
  transition: border-color 0.1s ease;
}
.master-card:hover { border-color: var(--line); }
.master-card[aria-pressed="true"] { border-color: var(--accent); }
.master-card img,
.master-card .avatar-placeholder {
  width: 100%;
  aspect-ratio: 350 / 410;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
}
.master-card .avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 600;
  color: var(--accent);
  background: linear-gradient(135deg, #f3e6cf, #e8ddcd);
  letter-spacing: 0.04em;
}
.master-card .name { font-weight: 600; margin-top: 8px; font-size: 14px; }
.master-card .role { color: var(--muted); font-size: 12px; }

/* Rating */
.rating {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 18px;
}
.rating button {
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  font-size: 36px;
  line-height: 1;
  color: #d8c9b3;
  min-width: var(--tap);
  min-height: var(--tap);
}
.rating button.active,
.rating button:hover { color: var(--accent); }

/* Tip QR display */
.qr-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.qr-wrap img { margin: 0 auto 12px; max-width: 260px; }
.qr-wrap .caption { font-weight: 600; }
.qr-wrap .hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.qr-wrap a.tip-link {
  display: inline-block;
  margin-top: 10px;
  word-break: break-all;
}

/* Footer */
footer.app-footer {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 16px 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
footer.app-footer a { color: var(--muted); text-decoration: underline; }
footer.app-footer .social { margin: 6px 0; }
footer.app-footer .social a { margin: 0 6px; }

.hidden { display: none !important; }

.notice {
  background: #fff5e8;
  border: 1px solid #f0d9b6;
  color: #6b4d1f;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin: 10px 0 16px;
}
.error { color: #a8442c; font-size: 13px; margin-top: 6px; }
