:root {
  --thd-page-bg: #050607;
  --thd-card-bg: #0c0d10;
  --thd-card-bg-2: #101114;
  --thd-line: rgba(255, 255, 255, 0.09);
  --thd-line-soft: rgba(255, 255, 255, 0.06);
  --thd-text: #f2f4f7;
  --thd-muted: rgba(226, 230, 236, 0.72);
  --thd-muted-2: rgba(206, 212, 220, 0.56);
  --thd-accent: #10b981;
}

.thd-home {
  max-width: min(1280px, calc(100vw - 24px));
  margin: 0 auto 29px;
  padding: 0;
  color: var(--thd-text);
  font-family: "Prompt", "Kanit", "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
}

.thd-home * {
  box-sizing: border-box;
}

.thd-home .thd-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--thd-line-soft);
  background: #08090b;
  aspect-ratio: var(--thd-hero-ratio, 16 / 9);
  order: var(--thd-order-hero, 1);
}

.thd-home .thd-strip {
  order: var(--thd-order-strip, 2);
}

.thd-home .thd-catalog {
  order: var(--thd-order-catalog, 3);
}

.thd-home .thd-hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.thd-home .thd-hero-track {
  width: 100%;
  height: 100%;
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: transform 560ms cubic-bezier(.22, .61, .36, 1);
}

.thd-home .thd-hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: block;
}

.thd-home .thd-hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thd-home .thd-hero-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  pointer-events: none;
}

.thd-home .thd-hero-caption h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(20px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: .15px;
}

.thd-home .thd-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.thd-home .thd-hero-nav.is-prev {
  left: 10px;
}

.thd-home .thd-hero-nav.is-next {
  right: 10px;
}

.thd-home .thd-hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.thd-home .thd-hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.thd-home .thd-hero-dot.is-active {
  width: 26px;
  background: #ffffff;
}

.thd-home .thd-admin-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 8px;
}

.thd-home .thd-admin-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-size: 15px;
  cursor: pointer;
}

.thd-home .thd-strip,
.thd-home .thd-catalog {
  margin-top: 19px;
}

.thd-home .thd-strip-head,
.thd-home .thd-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.thd-home .thd-strip-head h3 {
  margin: 0;
  font-size: clamp(20px, 1.85vw, 30px);
  font-weight: 900;
  line-height: 1.2;
}

.thd-home .thd-daily {
  margin-top: 15px;
}

.thd-home .thd-day-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 26px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 2px;
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  scrollbar-width: none;
}

.thd-home .thd-day-tabs::-webkit-scrollbar {
  display: none;
}

.thd-home .thd-day-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(232, 237, 245, 0.62);
  border-radius: 0;
  min-height: 42px;
  padding: 0 1px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease;
}

.thd-home .thd-day-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(255, 255, 255, 0.96);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 170ms ease;
}

.thd-home .thd-day-tab:hover {
  color: rgba(247, 250, 255, 0.84);
}

.thd-home .thd-day-tab.is-active {
  color: #ffffff;
}

.thd-home .thd-day-tab.is-active::after {
  transform: scaleX(1);
}

.thd-home .thd-day-panel {
  display: none;
}

.thd-home .thd-day-panel.is-active {
  display: block;
  animation: thdFadeIn .22s ease;
}

.thd-home .thd-daily-empty {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  min-height: 108px;
  display: grid;
  place-items: center;
  color: rgba(221, 228, 238, 0.66);
  font-size: 13px;
  padding: 10px;
}

.thd-home .thd-strip-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(152px, 178px);
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 2px 8px;
}

.thd-home .thd-strip-track::-webkit-scrollbar {
  height: 7px;
}

.thd-home .thd-strip-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.thd-home .thd-strip-card {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 8px;
  scroll-snap-align: start;
}

.thd-home .thd-strip-card.is-cover-only {
  gap: 0;
}

.thd-home .thd-strip-cover {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #060708;
  aspect-ratio: 2 / 3;
}

.thd-home .thd-strip-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thd-home .thd-strip-card.is-ranked .thd-strip-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.thd-home .thd-strip-rank {
  position: absolute;
  left: 10px;
  bottom: 6px;
  z-index: 2;
  color: #ffffff;
  font-size: clamp(38px, 4vw, 62px);
  line-height: .92;
  font-weight: 900;
  letter-spacing: -1px;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.62);
  user-select: none;
}

.thd-home .thd-strip-meta {
  display: grid;
  gap: 3px;
}

.thd-home .thd-strip-meta strong {
  color: #f9fbff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thd-home .thd-strip-meta small {
  color: var(--thd-muted);
  font-size: 11px;
}

body.toonna-front .thd-home .thd-catalog .thd-tabs,
body.toonna-front .thd-home .thd-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 26px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 2px !important;
  margin: 0 0 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: transparent !important;
  backdrop-filter: none !important;
  scrollbar-width: none !important;
}

body.toonna-front .thd-home .thd-tabs::-webkit-scrollbar {
  display: none !important;
}

body.toonna-front .thd-home .thd-catalog .thd-tab,
body.toonna-front .thd-home .thd-tab {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
  border: 0 !important;
  background: transparent !important;
  color: rgba(232, 237, 245, 0.62) !important;
  border-radius: 0 !important;
  min-height: 42px !important;
  padding: 0 1px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: color 160ms ease !important;
  box-shadow: none !important;
}

body.toonna-front .thd-home .thd-catalog .thd-tab::after,
body.toonna-front .thd-home .thd-tab::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: -1px !important;
  height: 2px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  transform: scaleX(0) !important;
  transform-origin: center !important;
  transition: transform 170ms ease !important;
}

body.toonna-front .thd-home .thd-catalog .thd-tab:hover,
body.toonna-front .thd-home .thd-tab:hover {
  color: rgba(247, 250, 255, 0.84) !important;
}

body.toonna-front .thd-home .thd-catalog .thd-tab.is-active,
body.toonna-front .thd-home .thd-tab.is-active {
  color: #ffffff !important;
}

body.toonna-front .thd-home .thd-catalog .thd-tab.is-active::after,
body.toonna-front .thd-home .thd-tab.is-active::after {
  transform: scaleX(1) !important;
}

.thd-home .thd-grid-panel {
  display: none;
}

.thd-home .thd-grid-panel.is-active {
  display: block;
  animation: thdFadeIn .24s ease;
}

.thd-home .thd-grid-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.thd-home .thd-grid-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(160deg, #0a0b0c, #121316);
  transition: transform .2s ease, border-color .2s ease;
}

.thd-home .thd-grid-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.45);
}

.thd-home .thd-grid-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #08090a;
}

.thd-home .thd-grid-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thd-home .thd-grid-meta {
  display: grid;
  gap: 5px;
  padding: 10px 10px 12px;
}

.thd-home .thd-grid-meta strong {
  font-size: 14px;
  line-height: 1.38;
  font-weight: 800;
  color: #f9fbff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thd-home .thd-grid-meta small {
  font-size: 12px;
  color: var(--thd-muted);
}

.thd-home .thd-grid-meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--thd-muted-2);
}

.thd-home .thd-grid-card.is-collapsed {
  display: none;
}

.thd-home .thd-loadmore-wrap {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}

.thd-home .thd-loadmore-btn {
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  background: transparent;
  border-radius: 999px;
  min-height: 44px;
  min-width: 172px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.thd-home .thd-loadmore-btn[hidden] {
  display: none !important;
}

.thd-home .thd-admin-modal[hidden] {
  display: none !important;
}

.thd-home .thd-admin-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  z-index: 2147483600;
}

.thd-home .thd-admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 50% 5%, rgba(255, 255, 255, 0.06) 0%, rgba(7, 8, 10, 0.92) 70%);
  backdrop-filter: blur(7px) saturate(118%);
}

.thd-home #thdBannerModal .thd-admin-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 20px));
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 58%),
    linear-gradient(180deg, rgba(12, 13, 16, 0.99) 0%, rgba(10, 11, 13, 0.99) 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  padding: 18px 18px 16px;
}

.thd-home #thdBannerModal .thd-admin-dialog::-webkit-scrollbar {
  width: 8px;
}

.thd-home #thdBannerModal .thd-admin-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.23);
  border-radius: 999px;
}

.thd-home #thdBannerModal .thd-admin-dialog h4 {
  margin: 0 0 14px;
  font-size: clamp(21px, 2.6vw, 30px);
  line-height: 1.2;
  letter-spacing: 0.2px;
  color: #fff;
}

.thd-home #thdBannerModal .thd-admin-slide-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.thd-home #thdBannerModal .thd-admin-slide-nav strong {
  text-align: center;
  color: rgba(245, 249, 255, 0.94);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.thd-home #thdBannerModal .thd-admin-slide-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.thd-home #thdBannerModal .thd-editor-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 180ms ease;
}

.thd-home #thdBannerModal .thd-editor-dot:hover {
  background: rgba(255, 255, 255, 0.55);
}

.thd-home #thdBannerModal .thd-editor-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: #fff;
}

.thd-home #thdBannerModal .thd-admin-dialog label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.thd-home #thdBannerModal .thd-admin-dialog label span {
  font-size: 14px;
  color: #f3f7ff;
  font-weight: 700;
}

.thd-home #thdBannerModal .thd-admin-dialog input[type="text"] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 13px;
  font-size: 14px;
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.thd-home #thdBannerModal .thd-admin-dialog input[type="text"]:focus,
.thd-home #thdBannerModal .thd-admin-dialog input[type="file"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.thd-home #thdBannerModal .thd-admin-dialog input[type="file"] {
  width: 100%;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.02);
  color: #f4f8ff;
  border-radius: 12px;
  min-height: 48px;
  padding: 9px 11px;
}

.thd-home #thdBannerModal .thd-admin-dialog input[type="file"]::file-selector-button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fbff;
  border-radius: 9px;
  min-height: 31px;
  padding: 0 11px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 700;
}

.thd-home #thdBannerModal .thd-admin-help {
  color: rgba(220, 228, 244, 0.75);
  font-size: 12px;
}

.thd-home #thdBannerModal .thd-admin-dialog button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #eaf1ff;
  border-radius: 11px;
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease, background 160ms ease;
}

.thd-home #thdBannerModal .thd-admin-dialog button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.thd-home #thdBannerModal .thd-admin-dialog button:active {
  transform: translateY(0);
}

.thd-home #thdBannerModal [data-slide-prev],
.thd-home #thdBannerModal [data-slide-next] {
  min-width: 90px;
  color: rgba(240, 246, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
}

.thd-home #thdBannerModal [data-slide-remove] {
  color: #ffd8de;
  background: rgba(255, 78, 109, 0.14);
  border-color: rgba(255, 112, 140, 0.28);
}

.thd-home #thdBannerModal [data-banner-cancel] {
  color: #e9efff;
  background: rgba(255, 255, 255, 0.08);
}

.thd-home #thdBannerModal .thd-admin-dialog button.is-primary,
.thd-home #thdBannerModal [data-banner-save] {
  color: #081020;
  border-color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(160deg, #ffffff 0%, #ecf3ff 100%);
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.thd-home #thdBannerModal .thd-admin-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.thd-home #thdBannerModal .thd-admin-actions.is-spread {
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 10px;
}

.thd-home #thdBannerModal .thd-admin-status {
  margin: 9px 0 2px;
  min-height: 1.2em;
  color: rgba(220, 232, 255, 0.78);
  font-size: 13px;
}

@keyframes thdFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1140px) {
  .thd-home .thd-grid-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .thd-home {
    max-width: calc(100vw - 16px);
  }

  .thd-home .thd-grid-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .thd-home .thd-hero {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .thd-home .thd-hero-caption {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .thd-home .thd-hero-caption h2 {
    font-size: clamp(16px, 4.7vw, 22px);
  }

  .thd-home .thd-hero-nav {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  .thd-home .thd-strip-track {
    grid-auto-columns: minmax(130px, 150px);
    gap: 10px;
  }

  .thd-home .thd-strip-rank {
    font-size: clamp(30px, 7vw, 48px);
    left: 8px;
    bottom: 5px;
  }

  .thd-home .thd-grid-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .thd-home .thd-grid-meta strong {
    font-size: 13px;
  }

  .thd-home .thd-grid-meta small,
  .thd-home .thd-grid-meta em {
    font-size: 10px;
  }

  .thd-home #thdBannerModal .thd-admin-dialog {
    width: calc(100vw - 12px);
    max-height: min(92vh, 820px);
    border-radius: 16px;
    padding: 14px 12px;
  }

  .thd-home #thdBannerModal .thd-admin-dialog h4 {
    margin-bottom: 12px;
    font-size: clamp(19px, 5vw, 25px);
  }

  .thd-home #thdBannerModal .thd-admin-slide-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .thd-home #thdBannerModal .thd-admin-slide-nav strong {
    grid-column: 1 / -1;
    order: -1;
    min-height: 38px;
  }

  .thd-home #thdBannerModal .thd-admin-slide-nav button {
    width: 100%;
  }

  .thd-home #thdBannerModal .thd-admin-actions.is-spread {
    flex-wrap: wrap;
  }

  .thd-home #thdBannerModal .thd-admin-actions.is-spread button,
  .thd-home #thdBannerModal .thd-admin-actions button {
    flex: 1 1 calc(50% - 5px);
  }

  .thd-home #thdBannerModal .thd-admin-actions button[data-banner-cancel],
  .thd-home #thdBannerModal .thd-admin-actions button[data-banner-save] {
    flex-basis: 100%;
  }
}

@media (max-width: 460px) {
  .thd-home .thd-day-tabs {
    gap: 18px;
    padding-bottom: 0;
  }

  .thd-home .thd-day-tab {
    min-height: 38px;
    padding: 0 1px;
    font-size: 14px;
  }

  body.toonna-front .thd-home .thd-catalog .thd-tabs,
  body.toonna-front .thd-home .thd-tabs {
    gap: 16px !important;
    padding: 0 2px !important;
    margin-bottom: 8px !important;
  }

  body.toonna-front .thd-home .thd-catalog .thd-tab,
  body.toonna-front .thd-home .thd-tab {
    min-height: 38px !important;
    padding: 0 1px !important;
    font-size: 13px !important;
  }

  .thd-home #thdBannerModal .thd-admin-dialog {
    padding: 13px 10px;
  }

  .thd-home #thdBannerModal .thd-admin-slide-nav strong {
    font-size: 14px;
  }

  .thd-home #thdBannerModal .thd-admin-actions button {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thd-home .thd-grid-card,
  .thd-home .thd-tab,
  .thd-home .thd-hero-track {
    transition: none !important;
    animation: none !important;
  }
}
