/* Reset & toàn cục */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #0d0d0d;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: #1a1a1a;
  border-radius: 24px;
  padding: 30px 25px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  border: 1px solid #2c2c2c;
}

h1 {
  text-align: center;
  font-weight: 300;
  letter-spacing: 2px;
  color: #f0f0f0;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 1px solid #2c2c2c;
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #888;
  font-size: 1.1rem;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 500;
}

.tab-btn:hover {
  color: #ccc;
}

.tab-btn.active {
  background: #2a2a2a;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

/* Các chế độ */
.mode {
  display: none;
  animation: fadeIn 0.3s ease;
}

.mode.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Màn hình hiển thị */
.display {
  background: #0a0a0a;
  padding: 20px 15px;
  border-radius: 16px;
  text-align: center;
  font-size: 3.2rem;
  font-weight: 300;
  letter-spacing: 4px;
  color: #00e676;
  font-family: 'Courier New', monospace;
  margin-bottom: 20px;
  border: 1px solid #2a2a2a;
  box-shadow: inset 0 0 15px rgba(0, 230, 118, 0.05);
}

/* Nút điều khiển chung */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.ctrl-btn {
  background: #252525;
  border: none;
  color: #ddd;
  padding: 10px 20px;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.25s;
  flex: 1 0 auto;
  min-width: 90px;
  border: 1px solid #333;
}

.ctrl-btn:hover:not(:disabled) {
  background: #333;
  color: #fff;
  border-color: #555;
}

.ctrl-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ctrl-btn.start {
  background: #1e3a2a;
  color: #69f0ae;
  border-color: #2e7d5a;
}
.ctrl-btn.start:hover:not(:disabled) {
  background: #2a4f3a;
}

.ctrl-btn.pause {
  background: #3a2a1e;
  color: #ffab91;
  border-color: #7d5a2e;
}
.ctrl-btn.pause:hover:not(:disabled) {
  background: #4f3a2a;
}

.ctrl-btn.reset {
  background: #2a1e1e;
  color: #ff8a80;
  border-color: #7d2e2e;
}
.ctrl-btn.reset:hover:not(:disabled) {
  background: #3a2a2a;
}

.ctrl-btn.split {
  background: #1e2a3a;
  color: #82b1ff;
  border-color: #2e4a7d;
}
.ctrl-btn.split:hover:not(:disabled) {
  background: #2a3a4f;
}

.ctrl-btn.set {
  background: #1e2a3a;
  color: #82b1ff;
  border-color: #2e4a7d;
}
.ctrl-btn.set:hover:not(:disabled) {
  background: #2a3a4f;
}

/* Input cho đếm ngược */
.input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin: 15px 0 10px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #aaa;
}

.input-group input {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  width: 70px;
  font-size: 1.1rem;
  text-align: center;
  transition: 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: #66bb6a;
  box-shadow: 0 0 10px rgba(102, 187, 106, 0.2);
}

/* Split list */
.split-list {
  margin-top: 25px;
  border-top: 1px solid #2a2a2a;
  padding-top: 15px;
}

.split-list h3 {
  font-weight: 400;
  font-size: 1rem;
  color: #888;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.split-list ul {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 5px;
}

.split-list ul::-webkit-scrollbar {
  width: 4px;
}
.split-list ul::-webkit-scrollbar-track {
  background: #1a1a1a;
}
.split-list ul::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 8px;
}

.split-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  margin-bottom: 4px;
  background: #121212;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: #bbb;
  border-left: 3px solid #2a4a7d;
}

.split-list li .split-index {
  color: #666;
}

.split-list li .split-time {
  color: #69f0ae;
}

/* Responsive */
@media (max-width: 500px) {
  .container { padding: 20px 15px; }
  .display { font-size: 2.4rem; padding: 15px 10px; }
  .ctrl-btn { padding: 8px 12px; font-size: 0.9rem; min-width: 70px; }
  .input-group input { width: 60px; }
  .tab-btn { font-size: 0.95rem; padding: 6px 12px; }
}