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

:root {
  --ink:    #1a1a2e;
  --paper:  #f5f0e8;
  --sage:   #7a9e7e;
  --sage-d: #6a8e6e;
  --rust:   #c4622d;
  --mist:   #e8e0d0;
  --gray:   #888;
}

body {
  font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px;
}
header.app-header h1 { font-size: 17px; font-weight: 700; }
header.app-header .logout-link { font-size: 13px; color: var(--gray); text-decoration: none; }

.card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 4px 24px rgba(26,26,46,.08);
  margin-bottom: 20px;
}

.error {
  background: #fef0eb;
  color: var(--rust);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}

label { display: block; font-size: 12px; color: var(--gray); margin-bottom: 6px; }

input[type=text], input[type=password] {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--mist);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  margin-bottom: 16px;
}
input[type=text]:focus, input[type=password]:focus { border-color: var(--sage); }

button, .btn {
  display: inline-block;
  width: 100%;
  padding: 14px;
  background: var(--sage);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--sage-d); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { background: var(--mist); color: var(--gray); cursor: not-allowed; }

.btn-outline {
  background: #fff;
  color: var(--sage-d);
  border: 1.5px solid var(--sage);
}
.btn-outline:hover { background: var(--paper); }

.btn-secondary {
  background: var(--mist);
  color: var(--ink);
}
.btn-secondary:hover { background: #ddd2b8; }

.streak-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(26,26,46,.08);
}
.streak-badge .flame { font-size: 28px; }
.streak-badge .num { font-size: 24px; font-weight: 700; color: var(--rust); }
.streak-badge .label { font-size: 12px; color: var(--gray); }

.scene-name { font-size: 13px; color: var(--gray); margin-bottom: 4px; }
.scene-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; }

.step-label {
  display: inline-block;
  font-size: 11px;
  color: var(--sage-d);
  background: #eef4ee;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.speaker { font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.line-en { font-size: 19px; font-weight: 700; margin-bottom: 4px; line-height: 1.4; }
.line-ja { font-size: 14px; color: var(--gray); margin-bottom: 16px; }
.line-block { margin-bottom: 20px; }
.line-block:last-child { margin-bottom: 0; }

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 400;
  background: var(--mist);
  color: var(--ink);
  border-radius: 100px;
  margin-bottom: 4px;
}
.play-btn:hover { background: #ddd2b8; }

.progress-bar {
  height: 6px;
  background: var(--mist);
  border-radius: 100px;
  margin-bottom: 24px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 100px;
  transition: width .3s ease;
}
.progress-text { font-size: 12px; color: var(--gray); text-align: right; margin-top: -18px; margin-bottom: 24px; }

.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-row button { flex: 1; }

.said-btn { background: var(--sage); }
.not-said-btn { background: #fff; color: var(--rust); border: 1.5px solid var(--rust); }
.not-said-btn:hover { background: #fef0eb; }

.complete-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.complete-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.complete-sub { font-size: 13px; color: var(--gray); text-align: center; margin-bottom: 24px; }

table.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.history-table th, table.history-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--mist);
}
table.history-table th { color: var(--gray); font-weight: 400; font-size: 12px; }
.result-said { color: var(--sage-d); font-weight: 700; }
.result-not-said { color: var(--rust); font-weight: 700; }

.day-group { margin-bottom: 22px; }
.day-group h3 { font-size: 13px; color: var(--gray); margin-bottom: 8px; font-weight: 400; }

.empty-note { text-align: center; color: var(--gray); font-size: 13px; padding: 40px 0; }
