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

body {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: #1a1a2e;
  color: #eee;
  font-family: sans-serif;
}

/* ── Sidebar toggle ── */
#sidebar-toggle {
  position: fixed;
  top: 50%;
  left: 220px;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 20px;
  height: 48px;
  background: #0f3460;
  color: #a0aec0;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
  transition: left 0.2s, background 0.15s;
}

#sidebar-toggle:hover {
  background: #e94560;
  color: #fff;
}

body.sidebar-collapsed #sidebar-toggle {
  left: 10px;
}

/* ── Sidebar ── */
#sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #16213e;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0.75rem;
  border-right: 1px solid #0f3460;
  transition: width 0.2s, padding 0.2s;
  overflow: hidden;
}

body.sidebar-collapsed #sidebar {
  width: 0;
  padding: 0;
  border-right: none;
}

#sidebar h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a0aec0;
  margin-bottom: 0.25rem;
}

#file-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.file-item:hover {
  background: #0f3460;
}

.file-item input[type="checkbox"] {
  accent-color: #e94560;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.file-item label {
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#custom-input {
  background: #0f3460;
  color: #eee;
  border: 1px solid #1a3a6e;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font-size: 1rem;
  resize: vertical;
  width: 100%;
  font-family: sans-serif;
  line-height: 1.4;
  display: none;
}

#custom-input.active {
  display: block;
}

#custom-input::placeholder {
  color: #a0aec0;
  opacity: 0.6;
}

#custom-input:focus {
  outline: none;
  border-color: #e94560;
}

#start-btn {
  margin-top: auto;
  padding: 0.65rem 1rem;
  background: #e94560;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

#start-btn:hover:not(:disabled) {
  background: #c73652;
}

#start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Main area ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

#character {
  font-size: 40vmin;
  line-height: 1;
  font-family: "KaiTi", "STKaiti", "AR PL UKai CN", serif;
  transition: opacity 0.15s ease;
}

@media (pointer: coarse) {
  #character {
    font-size: 50vmin;
  }
}

#character.fade {
  opacity: 0;
}

#progress {
  position: absolute;
  bottom: 1.5rem;
  font-size: 1rem;
  opacity: 0.4;
}

#message {
  font-size: 2rem;
  opacity: 0.6;
  text-align: center;
  padding: 1rem;
}

#hint {
  position: absolute;
  top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.3;
}
