:root {
  color-scheme: light dark;
  --page: #fcf9f6;
  --surface: #ffffff;
  --well: #fff6ee;
  --line: #f0e8e3;
  --outline: #928a86;
  --ink: #2e2e2e;
  --ink-soft: #746e6c;
  --accent: #b64d4d;
  --accent-fill: #ff6b6b;
  --accent-ink: #2e2e2e;
  --success: #397557;
  --success-well: #e8f6e9;
  --error: #a3214a;
  --error-well: #fdebf0;
  --radius: 14px;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Hiragino Sans",
    "Noto Sans JP",
    sans-serif;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #1c1819;
    --surface: #241f20;
    --well: #302829;
    --line: #493b3d;
    --outline: #7d7374;
    --ink: #f5ebea;
    --ink-soft: #b7a7a5;
    --accent: #ffa8a8;
    --accent-fill: #ff8080;
    --accent-ink: #241f20;
    --success: #86d0a5;
    --success-well: #325342;
    --error: #ff8fb1;
    --error-well: #4a2433;
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header,
.site-footer,
.content {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 16px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
}

.account > span:not(.visually-hidden) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .account > span:not(.visually-hidden),
  .site-header:has(.account) .brand-title {
    display: none;
  }
}

.avatar {
  border-radius: 50%;
  flex: none;
}

.content {
  flex: 1;
  padding-block: 16px 48px;
}

h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.25;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.hero {
  padding-block: 32px;
}

.lead {
  font-size: 1.1rem;
  max-width: 36em;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 24px 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
}

.button-quiet {
  min-height: 36px;
  padding: 4px 14px;
  font-size: 0.85rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-block: 16px;
}

.invite + .invite {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.invite-code {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 16px;
}

.invite-code .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.invite-code code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  background: var(--well);
  border-radius: 10px;
  overflow-wrap: anywhere;
  user-select: all;
}

.notice {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--well);
  margin-block: 12px;
}

.notice-success {
  background: var(--success-well);
  color: var(--ink);
  border-left: 4px solid var(--success);
}

.notice-error {
  background: var(--error-well);
  color: var(--ink);
  border-left: 4px solid var(--error);
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.form > * {
  min-width: 0;
}

.form .button {
  justify-self: start;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.field input[type="text"],
.field input[type="url"] {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
}

.field input[type="file"] {
  width: 100%;
  font: inherit;
  color: var(--ink-soft);
}

.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  gap: 16px;
}

.site-footer a[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
