@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&display=swap');

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 24px;
}

.container {
  width: 100%;
  max-width: 600px;
}

/* ── Title ── */
.title {
  font-size: 32px;
  font-weight: 900;
  color: #000;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

/* ── Score ── */
.score-area {
  text-align: center;
  margin-bottom: 44px;
}

.score-label {
  font-size: 20px;
  font-weight: 700;
  color: #000;
}

.score-value {
  font-size: 28px;
  font-weight: 900;
  color: #e00;
  font-style: italic;
  margin-left: 8px;
}

/* ── Fields ── */
.field {
  margin-bottom: 32px;
}

.field-row {
  display: flex;
  align-items: flex-end;
}

.field-label {
  font-size: 24px;
  font-weight: 900;
  color: #000;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  padding-bottom: 6px;
}

.field-line {
  flex: 1;
  border: none;
  border-bottom: 3.5px solid #000;
  margin-left: 8px;
  min-height: 32px;
  display: flex;
  align-items: flex-end;
}

.field-line-text {
  font-size: 20px;
  font-weight: 400;
  color: #000;
  padding-bottom: 4px;
  line-height: 1;
}

/* ── Input ── */
.input-row {
  display: flex;
  align-items: flex-end;
}

.input-field {
  flex: 1;
  border: none;
  border-bottom: 1.5px solid #bbb;
  outline: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 17px;
  color: #000;
  padding: 0 6px 6px;
  margin-left: 8px;
  background: transparent;
  line-height: 1;
  transition: border-color 0.2s;
}

.input-field::placeholder {
  color: #aaa;
  font-size: 16px;
}

.input-field:focus {
  border-bottom-color: #e00;
}

/* ── Feedback ── */
.feedback-text {
  font-size: 18px;
  color: #333;
  padding-bottom: 4px;
  line-height: 1;
}

/* ── Button ── */
.btn-area {
  text-align: center;
  margin-top: 48px;
}

.btn-grade {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #000;
  background: #fff;
  border: 2px solid #aaa;
  border-radius: 50px;
  padding: 14px 56px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-grade:hover {
  border-color: #666;
  background: #fafafa;
}

.btn-grade:active {
  transform: scale(0.97);
}

.btn-grade:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loading-dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: '';
  }

  25% {
    content: '.';
  }

  50% {
    content: '..';
  }

  75% {
    content: '...';
  }

  100% {
    content: '';
  }
}

/* ── Admin Panel ── */
.admin-container {
  width: 100%;
  max-width: 700px;
}

.admin-title {
  font-size: 24px;
  font-weight: 900;
  color: #000;
  margin-bottom: 8px;
}

.admin-subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 32px;
}

.back-link {
  font-size: 14px;
  color: #999;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #000;
}

/* Login */
.login-box {
  margin-top: 60px;
  text-align: center;
}

.login-box input {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 16px;
  width: 280px;
  outline: none;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: border-color 0.2s;
}

.login-box input:focus {
  border-color: #000;
}

.login-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #000;
  border: none;
  border-radius: 8px;
  padding: 10px 32px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.login-btn:hover {
  opacity: 0.8;
}

.login-error {
  color: #e00;
  font-size: 14px;
  margin-top: 12px;
}

/* Add form */
.add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.add-form input {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  flex: 1;
  min-width: 160px;
  outline: none;
  transition: border-color 0.2s;
}

.add-form input:focus {
  border-color: #000;
}

.add-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #000;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.add-btn:hover {
  opacity: 0.8;
}

/* Stats */
.stats {
  font-size: 14px;
  color: #888;
  margin-bottom: 16px;
}

/* Phrase table */
.phrase-table {
  width: 100%;
  border-collapse: collapse;
}

.phrase-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 2px solid #eee;
}

.phrase-table td {
  font-size: 16px;
  color: #000;
  padding: 12px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.phrase-table tr:hover td {
  background: #fafafa;
}

.phrase-table .actions {
  white-space: nowrap;
  text-align: right;
}

.action-btn {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  margin-left: 6px;
  transition: opacity 0.15s;
}

.action-btn:hover {
  opacity: 0.7;
}

.edit-btn {
  color: #000;
  background: #eee;
}

.delete-btn {
  color: #fff;
  background: #e00;
}

.save-btn {
  color: #fff;
  background: #2a2;
}

.cancel-btn {
  color: #000;
  background: #eee;
}

.edit-input {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 4px 8px;
  width: 100%;
  outline: none;
}

.empty-state {
  text-align: center;
  color: #aaa;
  padding: 40px 0;
  font-size: 16px;
}

/* Search */
.search-bar {
  margin-bottom: 20px;
}

.search-bar input {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 8px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  border-color: #999;
}