:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff3d9;
  background: #101a2d;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 8% 5%, #31484370, transparent 52%),
    radial-gradient(ellipse at 94% 90%, #52402c55, transparent 50%),
    #101a2d;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button,
.button {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
.invite-code:focus-visible {
  outline: 3px solid #40c4b8;
  outline-offset: 4px;
}

.page-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

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

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.wordmark strong {
  display: block;
  color: #ffd38c;
  font-size: 17px;
  letter-spacing: 0.16em;
}

.brand-rings {
  position: relative;
  display: block;
  width: 44px;
  height: 37px;
}

.brand-rings i {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 4px solid #ffcc52;
  border-radius: 50%;
  bottom: 0;
  left: 0;
}

.brand-rings i:nth-child(2) {
  border-color: #4fd7cd;
  left: 15px;
}

.brand-rings i:nth-child(3) {
  border-color: #ee84bf;
  bottom: 10px;
  left: 8px;
}

.language-toggle {
  min-width: 58px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #e9ce963d;
  border-radius: 999px;
  background: #ffffff09;
  color: #fff3d9;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.invite-card {
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  overflow: hidden;
  border: 1px solid #e6c88a66;
  border-radius: 30px;
  background: #fff7e7;
  box-shadow: 0 24px 80px #020a1a66;
}

.game-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 42px 36px;
  background: radial-gradient(ellipse at 50% 20%, #224776, #11213c 65%, #142a35);
  text-align: center;
}

.game-art {
  display: block;
  width: min(100%, 318px);
  height: auto;
  border: 1px solid #ffe4b342;
  border-radius: 26px;
  box-shadow: 0 16px 40px #000b2370, 0 0 48px #e9b56d12;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7ed8c9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-wrap: balance;
}

.game-genre {
  max-width: 280px;
  margin: 14px auto 0;
  color: #d2d7d5;
  font-size: 14px;
  line-height: 1.6;
  text-wrap: balance;
}

.invite-content {
  padding: 38px 34px 28px;
  color: #263d39;
  color-scheme: light;
}

h2 {
  margin: 0;
  color: #214d43;
  font-size: clamp(22px, 2.5vw, 27px);
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
}

.introduction {
  margin: 13px 0 16px;
  color: #56645c;
  font-size: 15px;
  line-height: 1.65;
}

.game-features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-features li {
  padding: 6px 9px;
  border: 1px solid #d6decd;
  border-radius: 999px;
  color: #496256;
  font-size: 11px;
  line-height: 1.25;
}

.code-panel {
  margin: 24px 0 20px;
  padding: 17px 18px 14px;
  border: 1px solid #dbbc7d;
  border-radius: 16px;
  background: #fffdf5;
}

.code-panel h3 {
  margin: 0 0 12px;
  color: #73603d;
  font-size: 12px;
  font-weight: 650;
}

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

.invite-code {
  color: #1b5045;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(16px, 2.1vw, 21px);
  font-weight: 750;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: text;
  user-select: all;
  -webkit-user-select: all;
}

.copy-button {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b2cebc;
  border-radius: 10px;
  background: #e5f1e7;
  color: #205448;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.copy-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.invite-hint,
.copy-status {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.invite-hint {
  color: #687063;
}

.copy-status {
  min-height: 19px;
  margin-top: 4px;
  color: #276b52;
}

.copy-status[data-state="manual"] {
  color: #88602e;
}

.actions {
  display: grid;
  gap: 10px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
}

.button svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.button-primary {
  border-color: #c8943f;
  background: linear-gradient(#ffdb8f, #efbc61);
  color: #403018;
  box-shadow: 0 3px 0 #bb85392b;
}

.button-primary:disabled {
  border-color: #dfd0aa;
  background: #ede4ce;
  color: #776b50;
  box-shadow: none;
  cursor: default;
}

.button-secondary {
  border-color: #bbd3bd;
  background: #edf3e8;
  color: #245747;
}

.download-status,
.noscript-note {
  margin: 14px 0 0;
  color: #717567;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (hover: hover) {
  .language-toggle:hover {
    background: #ffffff16;
  }

  .copy-button:hover:enabled,
  .button-secondary:hover {
    background: #deecdc;
  }

  .button-primary[href]:hover {
    background: #ffdc8d;
  }
}

@media (max-width: 760px) {
  .page-shell {
    max-width: 540px;
    padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .page-header {
    margin-bottom: 16px;
  }

  .invite-card {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .game-overview {
    flex-direction: row;
    justify-content: flex-start;
    gap: 18px;
    padding: 24px;
    text-align: left;
  }

  .game-art {
    flex-shrink: 0;
    width: 104px;
    border-radius: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .game-genre {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.45;
  }

  .invite-content {
    padding: 25px 24px 22px;
  }

  .introduction {
    font-size: 14px;
  }

  .invite-code {
    font-size: clamp(16px, 4.1vw, 21px);
  }
}

@media (max-width: 360px) {
  .page-shell {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .game-overview {
    gap: 14px;
    padding: 20px;
  }

  .game-art {
    width: 86px;
    border-radius: 16px;
  }

  h1 {
    font-size: 25px;
  }

  .invite-content {
    padding: 22px 18px 20px;
  }

  .code-panel {
    padding-right: 13px;
    padding-left: 13px;
  }
}
