* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
  color: #111111;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  min-height: 100vh;
  background: #ffffff;
}

.app.stage-black {
  background: #000000;
  color: #ffffff;
}

header {
  padding: 16px 18px 10px;
  border-bottom: 1px solid #dddddd;
  background: inherit;
}

.title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

.meta {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 400;
}

.tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid #dddddd;
  background: inherit;
  white-space: nowrap;
}

.tab-button {
  appearance: none;
  border: 1px solid #cccccc;
  background: #f7f7f7;
  color: #111111;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
}

.tab-button.active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.stage-black .tab-button {
  background: #222222;
  color: #ffffff;
  border-color: #555555;
}

.stage-black .tab-button.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 22px 16px 56px;
}

.stage-title {
  font-size: 22px;
  margin: 0 0 14px;
}

.stage-description {
  display: none;
  margin: 0 0 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-word;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  pointer-events: none;
  cursor: default;
}

.image-wrap {
  width: 100%;
  text-align: center;
  margin-bottom: 22px;
}

.nazo-image {
  max-width: 100%;
  height: auto;
  border: none;
  outline: none;
  background: transparent;
  display: inline-block;
}

.answer-area {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.answer-input {
  width: min(420px, 100%);
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #bbbbbb;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
}

.submit-button,
.next-button,
.reset-button,
.post-button,
.close-button,
.confirm-button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;
  background: #111111;
  color: #ffffff;
}

.next-area {
  display: none;
  text-align: center;
  margin-top: 12px;
}

.reset-button {
  display: block;
  margin: 18px auto 0;
  background: #666666;
}

.message {
  min-height: 28px;
  margin-top: 18px;
  text-align: center;
  font-size: 18px;
  color: #ffffff;
  font-weight: 600;
  word-break: break-word;
}

.no-copy {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  pointer-events: none;
  cursor: default;
}

.clear-overlay,
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.clear-box,
.confirm-box {
  position: relative;
  width: min(520px, 100%);
  background: #ffffff;
  color: #111111;
  border: 3px solid #111111;
  border-radius: 14px;
  padding: 34px 24px 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.clear-box h2 {
  margin: 0 0 16px;
  font-size: 42px;
  letter-spacing: 0.06em;
}

.clear-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 22px;
}

.post-button {
  display: inline-block;
  text-decoration: none;
  margin-top: 4px;
  background: #111111;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 34px;
  background: #eeeeee;
  color: #111111;
}

.confirm-text {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 700;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.yes-button {
  background: #111111;
}

.no-button {
  background: #666666;
}

@media (max-width: 640px) {
  .title {
    font-size: 24px;
  }

  .meta {
    font-size: 12px;
  }

  .tab-bar {
    padding: 8px;
    gap: 5px;
  }

  .tab-button {
    padding: 7px 13px;
    font-size: 14px;
  }

  main {
    padding: 18px 12px 48px;
  }

  .stage-title {
    font-size: 20px;
  }

  .stage-description {
    font-size: 16px;
  }

  .answer-input {
    font-size: 16px;
  }

  .submit-button,
  .next-button,
  .reset-button {
    width: 100%;
  }

  .confirm-button {
    width: 120px;
  }

  .clear-box h2 {
    font-size: 36px;
  }
}