:root {
  --bg: #0f0f12;
  --panel: #181924;
  --line: #2a2a36;
  --text: #eef1ff;
  --sub: #b9bdd2;
  --card: #1e1f2b;
  --shadow: rgba(0, 0, 0, 0.35);
  --pill: #2c2d3a;
  --chip: #171825;
  --link: #9fd0ff;
  --tac: #2e7d32;
  --open: #b23a48;
  --mid: #3759a8;
  --end: #6b48a8;
  --prac: #2f4858;
  --morn: #2a9d8f;
  --aft: #e9c46a;
  --eve: #8a5cf6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 system-ui;
}
.page {
  max-width: 1400px;
  margin: 12px auto;
  padding: 10px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
}
h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
}
.meta {
  color: var(--sub);
}
.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.legend .pill {
  background: var(--pill);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #fff;
}
.legend .Tactics {
  background: var(--tac);
}
.legend .Opening {
  background: var(--open);
}
.legend .Middlegame {
  background: var(--mid);
}
.legend .Endgame {
  background: var(--end);
}
.legend .Practice {
  background: var(--prac);
}
/* 7 ngày */
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 65vh;
}
.col h3 {
  margin: 0;
  padding: 8px 10px;
  background: #141522;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.stack {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* CARD chung */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 8px 22px var(--shadow);
}
.title {
  margin: 0 0 8px 0;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--pill);
  color: #fff;
  border: 1px solid #3a3a44;
}
.tag {
  border: none;
}
.Tactics {
  background: var(--tac);
}
.Opening {
  background: var(--open);
}
.Middlegame {
  background: var(--mid);
}
.Endgame {
  background: var(--end);
}
.Practice {
  background: var(--prac);
}
/* time-of-day chip */
.time {
  border-radius: 999px;
  border: 1px solid #3a3a44;
  background: transparent;
}
.Morning {
  background: rgba(42, 157, 143, 0.18);
  border-color: rgba(42, 157, 143, 0.45);
}
.Afternoon {
  background: rgba(233, 196, 106, 0.18);
  border-color: rgba(233, 196, 106, 0.55);
  color: #fce3a0;
}
.Evening {
  background: rgba(138, 92, 246, 0.18);
  border-color: rgba(138, 92, 246, 0.55);
}
.section {
  margin-top: 8px;
}
.note {
  border: 1px dashed #646476;
}
a.btn {
  display: inline-block;
  margin-top: 10px;
  background: var(--chip);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--link);
}
.link-sub {
  display: block;
  color: var(--sub);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}

/* PRACTICE blocks */
.practice-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.block {
  background: #171826;
  border: 1px solid #313248;
  border-radius: 12px;
  padding: 8px;
}
.block h6 {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.value {
  font-weight: 700;
}

footer {
  margin-top: 10px;
  color: var(--sub);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

/* print */
@media print {
  @page {
  }
  body {
    background: #fff;
  }
  .page {
    margin: 0;
    max-width: none;
    padding: 0;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a.btn {
    color: var(--link) !important;
    text-decoration: underline;
  }
}
/* responsive preview */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.modal {
  display: none; /* Ẩn mặc định */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
  color: #000;
}

.close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title {
  margin-top: 14px;
}

/* ===== NAVBAR + HAMBURGER ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 4px 14px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  margin: 0;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.3px;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  transition: max-height 0.22s ease, opacity 0.18s ease;
}
.nav-item {
  color: var(--sub);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.15s ease;
}
.nav-item:hover {
  color: var(--link);
}
.nav-item.active {
  color: var(--text);
  border-bottom: 2px solid var(--link);
  padding-bottom: 4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-btn {
  background: var(--chip);
  color: var(--link);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: var(--pill);
  transform: translateY(-1px);
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--chip);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-hamburger:hover {
  background: var(--pill);
  transform: translateY(-1px);
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ===== Responsive behavior ===== */
@media (max-width: 860px) {
  .nav-links {
    position: absolute;
    left: 0;
    right: 0;
    top: 62px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 12px;
    box-shadow: 0 10px 20px var(--shadow);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
  }
  .nav-links a {
    padding: 10px 6px;
    border-radius: 8px;
  }
  .nav-links.show {
    max-height: 320px;
    opacity: 1;
  }

  .nav-right {
    display: none;
  } /* có thể hiện ở menu thả xuống nếu muốn */
  .nav-hamburger {
    display: inline-flex;
  }
}
