﻿:root {
  --bg: #faf7f2;
  --ink: #1a1209;
  --red: #c0392b;
  --gold: #b8860b;
  --line: #d6c9b0;
  --section-bg: #f0ebe0;
--section-border: #8b7355;
  --num-bg: #1a1209;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Serif JP', serif;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* washi paper texture effect */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
  repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(180,160,120,0.15) 39px, rgba(180,160,120,0.15) 40px);
  pointer-events: none;
  z-index: 0;
}

header {
  position: relative;
  z-index: 1;
  background: var(--ink);
  padding: 40px 32px 32px;
  text-align: center;
border-bottom: 4px solid var(--gold);
}
header .label {
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--gold);
  margin-bottom: 12px;
}
header h1 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  line-height: 1.4;
  margin-bottom: 10px;
}
header .sub {
  font-size: 12px;
  color: #aaa;
  letter-spacing: 2px;
}

/* Controls */
.controls {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 20px 10px;
  flex-wrap: wrap;
}
.ctrl-btn {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s;
}
.ctrl-btn:hover { background: #333; transform: translateY(-1px); }
.ctrl-btn:active { transform: translateY(0); }
.ctrl-btn.red { background: var(--red); }
.ctrl-btn.red:hover { background: #a93226; }
.ctrl-btn.green { background: #27ae60; }
.ctrl-btn.green:hover { background: #1e8449; }
.repeat-btn { background: #555; }
.repeat-btn:hover { background: #333; }
.repeat-btn.active { background: #e67e22; }
.repeat-btn.active:hover { background: #ca6f1e; }

.speed-label {
  font-size: 12px;
  color: #666;
  letter-spacing: 1px;
}
select {
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

/* Current playing highlight */
.playing-bar {
  position: relative;
  z-index: 1;
  text-align: center;
  min-height: 36px;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--red);
  letter-spacing: 2px;
}

/* Section */
.section {
  position: relative;
  z-index: 1;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 36px 0 14px;
}
.section-label .num {
  background: var(--num-bg);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-label h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--section-border);
}
.section-label .rule {
  flex: 1; height: 1px;
  background: var(--line);
}

/* Term items */
.term-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.term-item {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.term-item:last-child { border-bottom: none; }
.term-item:hover { background: #fdf5e6; }
.term-item.active {
  background: #fff8e7;
  border-left: 4px solid var(--red);
}
.term-item.active .idx { margin-left: -4px; }

.term-item.selected {
  background: #f0f0f0;
}
.term-item.selected .term-item-checkbox {
  accent-color: var(--red);
}

.idx {
  width: 44px;
  text-align: center;
  font-size: 11px;
  color: #bbb;
  border-right: 1px solid var(--line);
  padding: 16px 0;
  flex-shrink: 0;
  font-family: monospace;
}

.word-block {
  flex: 1;
  padding: 16px 20px;
}
.jp-main {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  line-height: 1.3;
  color: var(--ink);
}
.jp-ruby {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2px;
  margin-top: 3px;
}
.ko-meaning {
  font-size: 13px;
  color: #666;
  letter-spacing: 0px;
  margin-top: 6px;
  line-height: 1.4;
  font-family: 'Noto Sans KR', sans-serif;
}

.play-btn {
  width: 42px; height: 42px;
  margin-right: 14px;
  background: none;
  border: 2px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.play-btn:hover {
  border-color: var(--red);
  background: #fef0ee;
  color: var(--red);
}
.term-item.active .play-btn {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

/* Floating Pause Button */
.floating-pause-btn {
  display: none;
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
}
.floating-pause-btn button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.floating-pause-btn button:hover {
  background: var(--red);
  transform: scale(1.1);
}

/* Section play-from button variant */
.section-play-from-btn {
  background: #5d6d7e !important;
}
.section-play-from-btn:hover {
  background: #4a5568 !important;
}

footer {
position: relative; z-index: 1;
  text-align: center;
  margin-top: 60px;
  font-size: 11px;
  color: #aaa;
  letter-spacing: 1px;
}

/* Selection Feature */
.term-item-checkbox {
  width: 18px;
  height: 18px;
  margin-left: 10px;
  margin-right: 4px;
  cursor: pointer;
  accent-color: var(--red);
  flex-shrink: 0;
}

.section-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.section-play-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-family: 'Noto Serif JP', serif;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s;
}

.section-play-btn:hover {
  background: #9a7208;
  transform: translateY(-1px);
}

.section-play-btn:active {
  transform: translateY(0);
}

