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

:root {
  --sidebar-width: 250px;
  --ink: #212121;
  --heading: #323232;
  --muted: #5f6368;
  --line: #dadce0;
  --button: #323232;
  --button-hover: #4a4a4a;
  --footer: #323232;
  font-family: Roboto, "Open Sans", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* サイドバー */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--sidebar-width);
  padding: 40px 20px;
  overflow-y: auto;
  background: #000;
  color: #fff;
}

.site-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.site-title img {
  width: 48px;
  height: 48px;
}

.site-nav ul {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 8px 20px;
  border-radius: 4px;
  text-decoration: none;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
}

/* ヘッダー */

.page {
  margin-left: var(--sidebar-width);
}

.hero {
  position: relative;
  display: grid;
  min-height: 310px;
  padding: 48px 24px;
  place-items: center;
  background: #000 url("/images/header.png") center / cover no-repeat;
  color: #fff;
  text-align: center;
}

.hero::before {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  content: "";
}

.hero > * {
  position: relative;
}

.hero-home {
  min-height: 480px;
}

.hero-logo {
  width: min(600px, 100%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-credit {
  position: absolute;
  right: 24px;
  bottom: 16px;
  margin: 0;
  font-size: 0.75rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* 本文 */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 40px 64px;
}

main h2 {
  margin: 0 0 24px;
  color: var(--heading);
  font-size: 2rem;
  line-height: 1.4;
}

main h3 {
  margin: 0 0 24px;
  color: var(--heading);
  font-size: 1.5rem;
  line-height: 1.4;
}

main h4 {
  margin: 24px 0 8px;
  font-size: 0.875rem;
  font-weight: 400;
}

main p,
main li {
  font-size: 1rem;
  line-height: 1.7;
}

.section + .section {
  margin-top: 64px;
}

.section-divider {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 32px;
  align-items: start;
}

.small {
  font-size: 0.875rem !important;
}

.note {
  color: var(--muted);
  font-size: 0.875rem !important;
}

.button {
  display: block;
  padding: 6px 16px;
  border-radius: 4px;
  background: var(--button);
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--button-hover);
}

.vote-button {
  width: min(400px, 100%);
  margin: 48px auto 0;
  padding: 12px 24px;
  font-size: 1.125rem;
}

/* 投票フォーム */

.button:disabled,
.button[aria-disabled="true"] {
  background: #9aa0a6;
  cursor: not-allowed;
}

.vote .section + .section {
  margin-top: 48px;
}

main .vote-subheading {
  margin: 24px 0 8px;
  font-size: 1.125rem;
}

.vote-rules {
  margin: 0;
  padding-left: 1.5em;
}

.vote-alert {
  padding: 12px 16px;
  border-radius: 4px;
  background: #fce8e6;
  color: #a50e0e;
}

.search-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.search-row input:focus {
  border-color: var(--button);
  outline: 2px solid var(--button);
  outline-offset: -1px;
}

.search-row input:disabled {
  background: #f1f3f4;
}

.search-button {
  flex: none;
  min-width: 96px;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.search-message,
.list-message {
  min-height: 1.7em;
  margin: 8px 0 0;
  color: var(--muted);
}

[data-tone="error"] {
  color: #c5221f;
}

[data-tone="success"] {
  color: #137333;
}

.world-card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 4px;
}

.world-card.is-eligible {
  border-left-color: #137333;
}

.world-card.is-ineligible {
  border-left-color: #c5221f;
}

.world-card.is-unverified {
  border-left-color: #f9ab00;
}

.world-thumb,
.vote-item-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: #f1f3f4;
  object-fit: cover;
}

.world-thumb.is-broken,
.vote-item-thumb.is-broken {
  visibility: hidden;
}

.world-body > * {
  margin: 0;
}

.world-body > * + * {
  margin-top: 4px;
}

main .world-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.world-meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.world-id code,
.vote-item-id code {
  color: var(--muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.world-status {
  font-weight: 700;
}

.world-status.is-ok {
  color: #137333;
}

.world-status.is-ng {
  color: #c5221f;
}

.world-status.is-warn {
  color: #b06000;
}

.world-body .world-status {
  margin-top: 12px;
}

.world-reasons {
  margin: 4px 0 0;
  padding-left: 1.25em;
}

.world-reasons li {
  font-size: 0.875rem;
}

.add-button {
  width: min(240px, 100%);
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.world-body .add-button {
  margin-top: 12px;
}

.vote-count {
  margin-left: 8px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.vote-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: vote;
}

.vote-item {
  display: grid;
  grid-template-columns: 2em 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: vote;
}

.vote-item::before {
  color: var(--muted);
  text-align: right;
  content: counter(vote);
}

.vote-item.has-problem {
  background: #fce8e6;
}

.vote-item-body > * {
  margin: 0;
}

.vote-item-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.vote-item .world-status {
  margin-top: 4px;
  font-size: 0.875rem;
}

.remove-button {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.remove-button:hover {
  background: #f1f3f4;
}

.vote-notice {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-left: 4px solid #f9ab00;
  border-radius: 4px;
  background: #fef7e0;
}

.vote-notice p {
  margin: 0;
}

.vote-notice p + p {
  margin-top: 4px;
}

.vote-submit-button {
  width: min(400px, 100%);
  margin: 24px auto 0;
  padding: 12px 24px;
  font-size: 1.125rem;
}

.submit-hint,
.direct-link {
  margin-top: 8px;
  text-align: center;
}

.direct-link {
  margin-top: 32px;
}

/* 10選結果 */

.results {
  display: grid;
  gap: 48px;
  max-width: 908px;
  margin: 0 auto;
}

.results-latest {
  justify-self: center;
  width: min(442px, 100%);
}

.results-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  align-items: start;
}

.results-row > div {
  display: grid;
  gap: 24px;
}

/* フッター */

.site-footer {
  padding: 32px 24px 40px;
  background: var(--footer);
  color: #fff;
  text-align: center;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 1rem;
}

.social {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: #1d9bf0;
}

.social svg {
  width: 28px;
  height: 28px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  max-width: 960px;
  margin: 40px auto 0;
}

.footer-columns p {
  margin: 0;
  font-size: 0.875rem;
}

/* スマートフォン */

@media (max-width: 960px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 12px 16px;
  }

  .site-title {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding-bottom: 12px;
    font-size: 1.125rem;
  }

  .site-title img {
    width: 32px;
    height: 32px;
  }

  .site-nav ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
  }

  .page {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .hero-home {
    min-height: 320px;
  }

  .hero-credit {
    right: 16px;
    left: 16px;
    text-align: right;
  }

  main {
    padding: 32px 16px 48px;
  }

  main h2 {
    font-size: 1.5rem;
  }

  main h3 {
    font-size: 1.25rem;
  }

  .two-column,
  .results-row,
  .footer-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .results {
    gap: 32px;
  }

  .world-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .world-thumb {
    max-width: 256px;
  }

  .vote-item {
    grid-template-columns: 1.5em 64px minmax(0, 1fr) auto;
    gap: 8px;
    padding-right: 0;
  }
}
