* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #ffffff;
  color: #2a2a2a;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 6px;
}

.subtitle {
  font-size: 14px;
  color: #888;
  font-weight: 400;
  text-align: center;
}

/* Input */
.input-section {
  width: 100%;
}

textarea {
  width: 100%;
  height: 100px;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* 16px 未満だと iOS Safari がフォーカス時に自動ズームする */
  border: 2px solid #e8e8ea;
  border-radius: 8px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: #2a2a2a;
}

.counter {
  text-align: right;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #888;
}

.counter.exact {
  color: #1c1c1e;
}

.counter.over {
  color: #ef4444;
}

/* Grid — black ink tiles (brand default, same as the videos) */
.grid-wrapper {
  background: #ffffff;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(10, 44px);
  grid-template-rows: repeat(10, 44px);
  gap: 3px;
}

.cell {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  text-transform: uppercase;
  color: #ffffff;
}

.cell-letter,
.cell-punct {
  background: #1c1c1e;
}

.cell-space,
.cell-empty {
  background: #ececec;
}

/* Download button */
.download-btn {
  padding: 12px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: #2a2a2a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.download-btn:hover {
  opacity: 0.85;
}

.download-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Participation line + footer */
.cta-line {
  font-size: 13px;
  color: #888;
  text-align: center;
}

.cta-line strong {
  color: #2a2a2a;
}

.site-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer-logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #2a2a2a;
}

.footer-sub {
  font-size: 11px;
  letter-spacing: 1px;
  color: #aaa;
}

.footer-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.footer-links a {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-decoration: none;
}

.footer-links a:hover {
  color: #2a2a2a;
}

/* Responsive */
@media (max-width: 500px) {
  .grid-wrapper {
    padding: 12px;
    width: 100%;
    overflow-x: auto;
  }

  .grid {
    --cell-size: calc((100vw - 32px - 24px - 27px) / 10);
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows: repeat(10, var(--cell-size));
  }

  .grid .cell {
    width: var(--cell-size);
    height: var(--cell-size);
    font-size: calc(var(--cell-size) * 0.38);
  }
}
