:root {
  --bg: #111;
  --fg: #e9e6df;
  --muted: #8a857c;
  --dim: #55524c;
  --line: #2a2a2a;
  --selected: #c9b99a;
  --error: #b5574a;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-feature-settings: "palt";
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  padding: 32px 16px;
}

.gate-header {
  text-align: center;
}

.gate-org {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .3em;
}

.gate-org-en {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: .2em;
}

.gate-title {
  margin: 12px 0 24px;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .2em;
}

.gate-lead {
  margin: 24px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: #fff;
  letter-spacing: .08em;
}

.gate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: min(336px, 100%);
}

.panel {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  color: var(--dim);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .25s;
}

.panel:hover {
  color: var(--fg);
}

.mark {
  display: block;
  width: 64%;
  height: 64%;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.panel[aria-pressed="true"] {
  color: var(--selected);
}

.panel:focus-visible {
  outline: 1px solid var(--selected);
  outline-offset: -1px;
}

.gate-preview {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1;
  color: #fff;
  border: 1px solid var(--line);
}

.gate-preview .mark {
  position: absolute;
  inset: 18%;
  width: auto;
  height: auto;
}

.gate-preview.is-wrong {
  color: var(--error);
}

.gate-submit {
  margin-top: 24px;
  padding: 10px 48px;
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  letter-spacing: .3em;
  background: var(--selected);
  border: 1px solid var(--selected);
  cursor: pointer;
  transition: background-color .25s, border-color .25s, color .25s;
}

a.gate-submit {
  display: inline-block;
  text-decoration: none;
}

.gate-submit:not(:disabled):hover {
  background: var(--fg);
  border-color: var(--fg);
}

.gate-submit:disabled {
  background: none;
  border-color: var(--line);
  color: var(--dim);
  cursor: default;
}

.gate-submit:focus-visible {
  outline: 1px solid var(--selected);
  outline-offset: 3px;
}

.gate-status {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--error);
  letter-spacing: .05em;
}

.gate-notice {
  margin: 24px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .05em;
}

.gate-notice a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate-notice a:hover,
.gate-notice a:focus-visible {
  color: var(--selected);
}

.gate-footer {
  padding: 16px;
  font-size: 10px;
  color: var(--dim);
  text-align: center;
  letter-spacing: .05em;
}

.gate-footer p {
  margin: 4px 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  color: var(--muted);
  text-decoration: underline;
  outline: none;
}

.modal {
  width: min(560px, calc(100% - 32px));
  max-height: 80vh;
  max-height: 80dvh;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid var(--line);
  background: #181818;
  color: var(--fg);
}

.modal::backdrop {
  background: rgba(0, 0, 0, .7);
}

.modal-title {
  margin: 0;
  padding: 32px 28px 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1em;
}

.modal-body {
  padding: 8px 28px 32px;
  font-size: 13px;
  line-height: 2;
}

.modal-body h3 {
  margin: 20px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.modal-body p {
  margin: 0;
}

.modal-body a {
  color: var(--selected);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .gate-submit {
    transition: none;
  }
}
