:root {
  --navy: #014a73;
  --navy-deep: #013957;
  --orange: #ff6600;
  --orange-deep: #e05a00;
  --gold: #998641;
  --gold-text: #7a6b33;
  --gold-pale: #d9cf9f;
  --bg: #011d2d;
  --surface: #02283d;
  --field: #011d2d;
  --line: rgb(255 255 255 / .12);
  --ink: #eef3f6;
  --mute: #9fb2c0;
  --radius: 12px;
}

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

body {
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.site-header .inner,
.intro,
.tool,
.category,
.cta {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

.site-header {
  background: #fff;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-header .logo img {
  height: 26px;
}

.site-nav {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav:hover,
.site-nav[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.eyebrow {
  font: 800 12px/1 "Archivo", sans-serif;
  letter-spacing: .2em;
  color: var(--gold-pale);
}

.intro {
  padding-block: 48px 28px;
}

.intro h1 {
  margin-top: 12px;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  line-height: 1.4;
}

.intro p {
  margin-top: 12px;
  max-width: 44em;
  color: var(--mute);
  font-size: 14px;
}

.tool {
  display: grid;
  grid-template-columns: var(--columns, minmax(0, 1.15fr) minmax(320px, .85fr));
  gap: 32px;
  align-items: start;
  padding-bottom: 72px;
}

.stage {
  position: sticky;
  top: 20px;
}

.stage canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgb(0 0 0 / .45);
  cursor: grab;
}

.stage .draggable {
  touch-action: none;
  outline: 2px dashed var(--orange);
  outline-offset: 4px;
}

.stage canvas:active {
  cursor: grabbing;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.hint,
.note {
  font-size: 12px;
  color: var(--mute);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid rgb(255 255 255 / .32);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 700 14px/1 "Noto Sans JP", sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}

.btn:hover {
  border-color: var(--ink);
}

.btn[aria-pressed="true"] {
  border-color: var(--orange);
  color: var(--orange);
}

.btn svg {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}

.btn.primary {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.btn.primary:hover {
  border-color: var(--orange-deep);
  background: var(--orange-deep);
}

.btn.light {
  border-color: #fff;
  background: #fff;
  color: var(--bg);
}

.btn.light:hover {
  border-color: #dfe7ec;
  background: #dfe7ec;
}

.btn:disabled {
  opacity: .35;
  cursor: default;
}

.panel {
  display: grid;
  gap: 32px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
}

legend,
.category h2 {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--gold-pale);
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--mute);
}

input:is([type="text"], [type="number"], [type="date"], [type="time"]),
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  color-scheme: dark;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
.upload .btn:focus-within {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  cursor: pointer;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips label {
  display: block;
}

.chips input {
  position: absolute;
  opacity: 0;
}

.chips span {
  display: block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.chips small {
  margin-left: 6px;
  font-size: 11px;
  opacity: .7;
}

.chips input:checked + span {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.chips input:focus-visible + span {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.chips .shape {
  padding: 6px;
  border-radius: 8px;
  background: rgb(255 255 255 / .88);
}

.chips .shape img {
  width: 30px;
  height: 30px;
}

.chips input:checked + .shape {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 2px var(--orange);
}

.panel:has([value="volleyball"]:checked, [value="basketball"]:checked, [value="rugby"]:checked) .shootout,
.panel:has([value="soccer"]:checked, [value="handball"]:checked, [value="rugby"]:checked) .periods .col:nth-child(n+5) {
  display: none;
}

input[readonly] {
  opacity: .55;
}

.periods {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.periods .col {
  display: grid;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.periods .col:first-child {
  flex: none;
}

.periods span {
  display: flex;
  align-items: center;
  min-height: 20px;
  font-size: 11px;
}

.periods .col + .col span {
  justify-content: center;
}

.periods .col:first-child span {
  min-height: 42px;
}

.periods .col:first-child span:first-child {
  min-height: 20px;
}

.periods input {
  padding-inline: 4px;
  text-align: center;
  appearance: textfield;
}

.periods input::-webkit-inner-spin-button {
  appearance: none;
}

.upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload .btn {
  min-height: 48px;
  padding-inline: 24px;
  font-size: 15px;
}

.upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photos,
.palettes {
  display: grid;
  gap: 8px;
}

.photos {
  grid-template-columns: repeat(4, 1fr);
}

.palettes {
  grid-template-columns: repeat(4, 1fr);
}

.photos button,
.palettes button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.photos button {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: var(--field);
  color: var(--mute);
  font: 700 12px/1 "Noto Sans JP", sans-serif;
  box-shadow: inset 0 0 0 1px var(--line);
}

.photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.palettes button {
  display: grid;
  gap: 2px;
  padding: 14px 12px 12px;
  text-align: left;
  box-shadow: inset 0 0 0 1px var(--line);
}

.photos button[aria-pressed="true"],
.palettes button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--orange);
}

.palettes strong {
  font: 400 24px/1 "Bebas Neue", sans-serif;
  white-space: nowrap;
  letter-spacing: -.02em;
}

.palettes span {
  font: 400 18px/1 "Bebas Neue", sans-serif;
}

.palettes small {
  margin-top: 8px;
  font-size: 11px;
  opacity: .75;
}

details summary {
  font-size: 12px;
  color: var(--mute);
  cursor: pointer;
}

details .row {
  margin-top: 12px;
}

.crop {
  --columns: minmax(300px, .8fr) minmax(0, 1.2fr);
}

.crop .panel {
  position: sticky;
  top: 20px;
}

.focus {
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--mute);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend li::before {
  content: "";
  width: 14px;
  height: 10px;
  border: 2px solid var(--color);
  border-radius: 2px;
}

.faces [data-key="hide"],
.faces [data-key="maybe"] {
  --color: #ffffff;
}

.faces [data-key="show"] {
  --color: #ff6600;
}

.faces [data-key="maybe"]::before {
  border-style: dashed;
}

.bokaauto {
  --columns: minmax(0, 1.6fr) minmax(300px, .8fr);
}

.bokaauto .stage canvas {
  cursor: pointer;
}

.view {
  position: relative;
}

.busy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: var(--radius);
  background: rgb(1 29 45 / .45);
  pointer-events: none;
}

.busy span {
  padding: 14px 28px;
  border-radius: 999px;
  background: rgb(1 29 45 / .8);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  animation: blink 1.2s ease-in-out infinite alternate;
}

@keyframes blink {
  from {
    opacity: 1;
  }

  to {
    opacity: .35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .busy span {
    animation: none;
  }
}

.bokaauto .stage .note {
  margin-top: 12px;
}

.legend [data-key="feed"],
.legend [data-key="post"] {
  --color: #ffffff;
}

.legend [data-key="story"] {
  --color: #f5d76e;
}

.legend [data-key="x"],
.legend [data-key="wide"] {
  --color: #5ec8f2;
}

.legend [data-key="link"] {
  --color: #ff8fb0;
}

.slider {
  display: grid;
  gap: 6px;
}

.dock {
  display: none;
}

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 24px;
  align-items: start;
}

.spot canvas {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--field);
}

.spot figcaption {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.spot strong {
  font-size: 14px;
  font-weight: 900;
}

.spot span {
  font-size: 12px;
  color: var(--mute);
}

.spot .btn {
  margin-top: 12px;
  padding: 9px 16px;
  font-size: 13px;
}

.sukkirin .spot canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 380px;
}

.field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.count {
  font-variant-numeric: tabular-nums;
}

.count.over {
  color: var(--orange);
}

.category {
  padding-bottom: 88px;
}

.category h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 32px;
  margin-top: 28px;
  padding: 0;
  list-style: none;
}

.cards a {
  display: block;
  text-decoration: none;
}

.cards img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.cards h3 {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.5;
}

.cards a:hover h3 {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cards p {
  margin-top: 6px;
  color: var(--mute);
  font-size: 13px;
}

.cta {
  max-width: none;
  padding-block: 64px;
  background: #fff;
  color: var(--navy);
  text-align: center;
}

.cta .eyebrow {
  color: var(--gold-text);
}

.cta h2 {
  margin-top: 14px;
  font-size: clamp(19px, 2.6vw, 26px);
  font-weight: 900;
  line-height: 1.6;
}

.cta :is(h2, p) span {
  display: inline-block;
}

.cta p {
  margin: 12px auto 24px;
  max-width: 46em;
  color: #4d6475;
  font-size: 14px;
}

.site-footer {
  display: grid;
  gap: 6px;
  padding: 28px 20px;
  background: var(--navy-deep);
  color: rgb(255 255 255 / .7);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 480px) {
  .palettes {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 880px) {
  .bokaauto .actions .btn {
    flex: 1 1 100%;
  }

  .tool {
    grid-template-columns: 1fr;
  }

  .stage,
  .crop .panel {
    position: static;
  }

  .dock {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -8px 24px rgb(0 0 0 / .35);
    transform: translateY(100%);
    transition: transform .25s;
  }

  .dock.shown {
    transform: none;
  }

  .dock canvas {
    width: auto;
    border-radius: 3px;
  }
}
