@font-face {
  font-family: "FateTell Nunito";
  src: url("/fonts/nunito-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "FateTell Nunito";
  src: url("/fonts/nunito-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #fafafa;
  --ink: #0a0a0a;
  --muted: #525252;
  --line: #e0e0e0;
  --button: #222;
  --soft: #efeeeb;
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: "FateTell Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.header, .footer {
  width: min(100%, 1160px);
  margin-right: auto;
  margin-left: auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 18px clamp(24px, 5vw, 64px);
}

.brand { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.brand-icon { display: block; width: 40px; height: 40px; object-fit: contain; }
.brand-wordmark { display: block; width: 77px; height: 41px; object-fit: contain; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.language-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 72px;
  height: 44px;
  border-radius: 10px;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.language-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  color: var(--ink);
  pointer-events: none;
}

.language-trigger img { display: block; width: 32px; height: 32px; }
.language-chevron { flex: 0 0 auto; }

.language-control select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
}
.language-control:has(select:focus-visible) { outline: 3px solid var(--button); outline-offset: 3px; }
.language-control:active { transform: scale(0.96); }

.hero {
  display: flex;
  flex: 1;
  align-items: center;
  width: min(100% - 48px, 540px);
  margin: 0 auto;
  padding: 56px 0 72px;
}

.content { width: 100%; max-width: 480px; min-width: 0; }

h1 {
  max-width: 10em;
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.description {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.55;
}

.code-panel {
  margin-top: 32px;
  padding: 20px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.code-panel[hidden] { display: none; }

.code-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.invite-code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  letter-spacing: 0.08em;
  user-select: all;
}

.copy-button {
  min-width: 76px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: 600 13px/1 "FateTell Nunito", -apple-system, sans-serif;
  touch-action: manipulation;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}

.copy-button:active, .open-button:active, .store-button:active { transform: scale(0.96); }
.copy-button:focus-visible, .open-button:focus-visible, .store-button:focus-visible, .footer a:focus-visible {
  outline: 3px solid var(--button);
  outline-offset: 3px;
}

.copy-status { display: block; min-height: 0; color: var(--muted); font-size: 12px; }
.copy-status:not(:empty) { margin-top: 8px; }

.actions { display: grid; gap: 10px; margin-top: 24px; }

.open-button, .store-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}

.store-button { background: var(--button); color: #fafafa; }
.open-button { background: var(--soft); color: var(--ink); }

.help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.help { margin: 5px 0 0; text-wrap: pretty; }

.footer {
  display: flex;
  gap: 16px;
  padding: 0 clamp(24px, 5vw, 64px) max(20px, env(safe-area-inset-bottom));
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  text-underline-offset: 3px;
}

@media (max-width: 767px) {
  .header { min-height: 72px; padding: 12px 24px; }
  .brand { gap: 10px; }
  .brand-icon { width: 32px; height: 32px; }
  .brand-wordmark { width: 62px; height: auto; }

  .hero {
    width: min(100% - 48px, 480px);
    padding: 48px 0 56px;
  }

  h1 { max-width: none; font-size: clamp(28px, 8vw, 36px); line-height: 1.25; letter-spacing: -0.04em; }
  .description { margin-top: 12px; font-size: 16px; }
  .code-panel { margin-top: 24px; padding: 16px 0; }
  .actions { margin-top: 20px; }
  .help { font-size: 13px; }
  .footer { width: min(100%, 480px); margin-top: auto; padding: 0 24px max(12px, env(safe-area-inset-bottom)); }
}

@media (hover: hover) {
  .language-control:hover { background: #f4f4f4; }
  .copy-button:hover { background: #f4f4f4; }
  .store-button:hover { background: #0a0a0a; }
  .open-button:hover { background: #e5e3df; }
}

@media (prefers-reduced-motion: reduce) {
  .language-control { transition: none; }
  .language-control:active { transform: none; }
  .copy-button, .open-button, .store-button { transition: none; }
  .copy-button:active, .open-button:active, .store-button:active { transform: none; }
}
