body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% 20%, #0c0d14, #090a12 55%, #07070d 100%);
  color: #e5e7eb;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.9) 65%);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../img/logo-big.1fadc716.png") 50% 45% / min(70vw, 70vh) no-repeat;
  opacity: 0.35;
  filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.45)) brightness(1.35) saturate(1.1);
  mix-blend-mode: normal;
  z-index: 0;
  pointer-events: none;
}

.cursor-marquee {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cursor-marquee.is-visible[data-cursor-marquee-status="active"] {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cursor-marquee__card {
  background: linear-gradient(135deg, rgba(90, 46, 255, 0.92), rgba(164, 65, 255, 0.95));
  color: #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  box-shadow: 0 12px 30px rgba(112, 70, 255, 0.35), 0 0 18px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.cursor-marquee__text-span {
  display: inline-block;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: cursorMarquee 6s linear infinite;
  animation-play-state: paused;
}

.cursor-marquee__text-span.is--duplicate {
  position: absolute;
  left: 100%;
  top: 0;
}

[data-cursor-marquee-status="active"] .cursor-marquee__text-span {
  animation-play-state: running;
}

@keyframes cursorMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Theme toggle button */
.theme-toggle {
  position: static;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(125, 47, 234, 0.95), rgba(78, 52, 214, 0.95));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  width: auto;
  max-width: fit-content;
  flex: 0 0 auto;
  align-self: flex-start;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(112, 70, 255, 0.32);
  transition: transform 0.1s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(90, 52, 210, 0.32);
  filter: brightness(1.02);
}

/* Light theme overrides */
body.theme-light {
  background: radial-gradient(circle at 10% 10%, #f6f7fb, #e9ebf5 55%, #e4e7f2 100%);
  color: #0d1117;
}

body.theme-light::before {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(235, 238, 247, 0.95) 65%);
}

body.theme-light::after {
  opacity: 0.28;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.55)) brightness(1.25);
  mix-blend-mode: normal;
}

body.theme-light header {
  background: #f9fafc;
  color: #0d1117;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body.theme-light .header-brand {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.07), 0 10px 20px rgba(15, 23, 42, 0.08);
}

body.theme-light .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.9));
  color: #0d1117;
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
  border-color: rgba(15, 23, 42, 0.06);
}

body.theme-light select {
  background: linear-gradient(180deg, #f8f8fb, #eef1fa);
  color: #0d1117;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 16px rgba(17, 24, 39, 0.08);
}

body.theme-light select option {
  background: #f8f8fb;
  color: #0d1117;
}

body.theme-light button {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 16px 38px rgba(99, 102, 241, 0.28);
}

body.theme-light .alert.error {
  background: rgba(244, 63, 94, 0.12);
  color: #9f1239;
  border-color: rgba(244, 63, 94, 0.22);
}

body.theme-light .alert.info {
  background: rgba(59, 130, 246, 0.14);
  color: #0f172a;
  border-color: rgba(59, 130, 246, 0.25);
}

body.theme-light table {
  background: #f9fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light th {
  color: #0f172a;
  background: rgba(99, 102, 241, 0.08);
}

body.theme-light td {
  color: #0f172a;
}

header {
  background: #0b0c12;
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  z-index: 5;
  position: relative;
  justify-content: space-between;
}

header img {
  height: 3rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.header-right h1 {
  display: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 25px rgba(0, 0, 0, 0.25);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.theme-light .header-brand {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.07), 0 10px 20px rgba(15, 23, 42, 0.08);
}

body.theme-light header {
  background: #f9fafc;
  color: #0d1117;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

main {
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: linear-gradient(180deg, rgba(29, 31, 41, 0.9), rgba(18, 20, 28, 0.9));
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(6px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.picker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

select {
  padding: 0.65rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(24, 26, 34, 0.95), rgba(14, 15, 21, 0.95));
  min-width: 260px;
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: border 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

select option {
  background: #0f1118;
  color: #e5e7eb;
}

select:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 24px rgba(0, 0, 0, 0.4);
}

select:focus {
  outline: 2px solid rgba(168, 102, 255, 0.45);
  outline-offset: 2px;
  transform: translateY(-1px);
}

select:-internal-list-box {
  background: #0f1118;
  color: #e5e7eb;
}

button {
  padding: 0.7rem 1.4rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7d2fea, #4e34d6);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(90, 52, 210, 0.26),
    0 6px 14px rgba(64, 46, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(90, 52, 210, 0.3),
    0 10px 18px rgba(64, 46, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  filter: brightness(1.02);
}

.alert {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
}

.alert.error {
  background: rgba(255, 83, 112, 0.12);
  color: #fda4af;
  border: 1px solid rgba(255, 83, 112, 0.3);
}

.alert.info {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 0.1rem 0;
}

.muted {
  color: #9ca3af;
  margin: 0.3rem 0 0 0;
}

.result-header h3 {
  margin: 0.15rem 0 0 0;
}

.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
  table-layout: fixed;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0f1118;
}

th,
td {
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.65rem;
  text-align: center;
  width: 5em;
  height: 3em;
  font-size: 0.95rem;
  color: #e5e7eb;
}

th:first-child,
td:first-child {
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
  min-width: 3em;
}

th {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.logo-hansei {
  height: 2.5rem;
  margin: auto auto;
  display: block;
}

footer {
  text-align: center;
  margin-top: 2rem;
  padding: 0.8rem 0;
  background: transparent;
  font-size: 0.85rem;
  color: #e5e7eb;
}

body.theme-light footer {
  color: #0f172a;
}

.promo-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 1.6rem);
  z-index: 12000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.promo-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.promo-modal__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(17, 24, 39, 0.85), rgba(3, 7, 18, 0.9));
  backdrop-filter: blur(4px);
}

.promo-modal__dialog {
  position: relative;
  width: min(90vw, 780px);
  max-height: 90vh;
  background: linear-gradient(155deg, rgba(26, 30, 45, 0.9), rgba(12, 14, 26, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: clamp(1.1rem, 3vw, 1.5rem);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s ease;
  overflow: hidden;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.promo-modal.is-open .promo-modal__dialog {
  transform: translateY(0) scale(1);
}

.promo-modal__close {
  position: absolute;
  right: 14px;
  top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.promo-modal__headline {
  margin-top: 0.5rem;
}

.promo-modal__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: #c4c6ff;
}

.promo-modal__headline h2 {
  margin: 0.2rem 0 0.2rem 0;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  color: #fff;
}

.promo-modal__sub {
  margin: 0;
  color: #a5b4fc;
  font-weight: 600;
}

.promo-modal__media {
  margin-top: 1.1rem;
  background: radial-gradient(circle at 20% 15%, rgba(108, 70, 255, 0.12), rgba(32, 35, 50, 0.8));
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 46px rgba(0, 0, 0, 0.4);
  max-height: 58vh;
}

.promo-modal__link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.promo-modal__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #080a12;
  max-height: 58vh;
}

.promo-modal__fallback {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.3rem;
  color: #e5e7eb;
  padding: 3.5rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(108, 70, 255, 0.2), rgba(32, 35, 50, 0.9));
}

.promo-modal.is-missing-image .promo-modal__fallback {
  display: flex;
}

.promo-modal.is-missing-image img {
  display: none;
}

.promo-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.promo-modal__btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #7c3aed, #4e34d6);
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(90, 52, 210, 0.26);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.promo-modal__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(90, 52, 210, 0.3), 0 10px 18px rgba(64, 46, 255, 0.25);
  filter: brightness(1.02);
}

.promo-modal__btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  box-shadow: none;
}

body.theme-light .promo-modal__dialog {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(245, 247, 255, 0.98));
  color: #0f172a;
}

body.theme-light .promo-modal__eyebrow {
  color: #4f46e5;
}

body.theme-light .promo-modal__sub {
  color: #4338ca;
}

body.theme-light .promo-modal__media {
  background: #eef2ff;
}

@media (min-aspect-ratio: 4/3) {
  .promo-modal__dialog {
    width: min(70vw, 760px);
    max-height: 86vh;
  }

  .promo-modal__media,
  .promo-modal__media img {
    max-height: 60vh;
  }
}

@media (max-aspect-ratio: 3/4) {
  .promo-modal__dialog {
    width: 92vw;
    max-height: 92vh;
  }

  .promo-modal__media,
  .promo-modal__media img {
    max-height: 65vh;
  }
}

@media (max-width: 768px) {
  main {
    padding: 1.2rem clamp(0.9rem, 3vw, 1.2rem);
    max-width: 100%;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  header img {
    height: 2.4rem;
  }

  .header-right {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
  }

  .theme-toggle {
    position: static;
    width: auto;
    white-space: nowrap;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
  }

  h1 {
    font-size: 1.15rem;
  }

  .page {
    gap: 0.9rem;
  }

  .card {
    padding: 1.2rem;
  }

  .picker {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  select,
  button:not(.theme-toggle) {
    width: 100%;
    min-width: 0;
  }

  button {
    text-align: center;
    padding: 0.8rem 1rem;
  }

  .table-scroll {
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
  }

  th,
  td {
    padding: 0.55rem 0.4rem;
    font-size: 0.85rem;
    word-break: break-word;
  }

  .alert {
    font-size: 0.9rem;
  }

  footer {
    font-size: 0.8rem;
  }

  .promo-modal__dialog {
    width: 100%;
    max-height: 90vh;
    padding: 1rem;
    border-radius: 18px;
  }

  .promo-modal__actions {
    justify-content: center;
  }
}
