/* ============================================================
   Kana Writing Practice — NihongoDo (Poin 5.3)
   ============================================================ */

.writing-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* ── Layout ──────────────────────────────────────────── */
.writing-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (max-width: 640px) {
  .writing-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Sidebar ─────────────────────────────────────────── */
.writing-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ws-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.ws-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-xs);
}

.ws-char {
  font-family: var(--font-jp);
  font-size: 4rem;
  line-height: 1;
  color: var(--text-primary);
  text-align: center;
  padding: var(--space-sm) 0;
}

.ws-romaji {
  text-align: center;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.ws-progress {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: var(--space-xs);
}

.ws-stroke-info {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin: var(--space-xs) 0;
}

.ws-stroke-hint {
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

.ws-session-stats {
  display: flex;
  justify-content: space-around;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Area utama ──────────────────────────────────────── */
.writing-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ── Canvas ──────────────────────────────────────────── */
.canvas-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface-1);
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
}

#writing-canvas {
  display: block;
  width: 300px;
  height: 300px;
  border-radius: inherit;
  position: relative;
  z-index: 2;
  background: transparent;
}

.canvas-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-jp);
  font-size: 200px;
  line-height: 1;
  color: var(--text-primary);
  opacity: 0.07;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s;
  user-select: none;
}

/* ── Toolbar ─────────────────────────────────────────── */
.writing-toolbar {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Feedback ────────────────────────────────────────── */
.writing-feedback {
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  transition: opacity 0.2s;
}

.wf-success {
  background: rgba(47, 139, 99, 0.12);
  color: var(--success, #2f8b63);
}

.wf-error {
  background: rgba(200, 69, 46, 0.1);
  color: var(--error, #c8452e);
}

.wf-warn {
  background: rgba(203, 161, 53, 0.12);
  color: var(--warning, #cba135);
}

/* ── Hint row ────────────────────────────────────────── */
.writing-hint-row {
  text-align: center;
}

/* ── Akhir sesi ──────────────────────────────────────── */
.writing-end {
  text-align: center;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.we-icon {
  font-size: 3rem;
}

.we-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Filter bar ──────────────────────────────────────── */
.writing-filter-bar {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
