@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@300;600&family=Inter:wght@400;500;600;700&family=Source+Serif+4:wght@600;700;800&display=swap");
@import url("/kimi-template.css?v=20260326-kimi-template1");

:root {
  --background: 220 20% 98.6%;
  --foreground: 240 10% 12%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 12%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 12%;
  --primary: 250 85% 60%;
  --primary-foreground: 0 0% 100%;
  --secondary: 220 18% 95.8%;  
  --secondary-foreground: 240 10% 12%;
  --muted: 240 5% 96%;
  --muted-foreground: 240 4% 46%;
  --accent: 250 85% 60%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 240 6% 88%;
  --input: 240 6% 88%;
  --ring: 250 85% 60%;
  --radius: 0.75rem;
  --level-1: 142 76% 45%;
  --level-2: 162 85% 45%;
  --level-3: 199 89% 55%;
  --level-4: 250 85% 60%;
  --level-5: 280 85% 55%;
  --shell-bar-bg: hsla(243, 26%, 87%, 0.96);}

html[data-theme="dark"],
html.dark {
  --background: 240 10% 6%;
  --foreground: 0 0% 95%;
  --card: 240 10% 8%;
  --card-foreground: 0 0% 95%;
  --popover: 240 10% 8%;
  --popover-foreground: 0 0% 95%;
  --primary: 250 85% 65%;
  --primary-foreground: 0 0% 100%;
  --secondary: 240 6% 14%;
  --secondary-foreground: 0 0% 95%;
  --muted: 240 6% 14%;
  --muted-foreground: 240 5% 58%;
  --accent: 250 85% 65%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 62% 55%;
  --destructive-foreground: 0 0% 100%;
  --border: 240 6% 18%;
  --input: 240 6% 18%;
  --ring: 250 85% 65%;
  --shell-bar-bg: hsl(var(--secondary) / 1.1);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap,
main.wrap,
main.home-main {
  width: min(42rem, calc(100% - 2rem));
  margin-inline: auto;
}

main.wrap,
main.home-main {
  padding-top: 5.35rem;
  padding-bottom: 2.1rem;
}

/* Header */
.site-header,
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  border-bottom: 1px solid hsl(250 18% 78% / 0.95);
  background: var(--shell-bar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 8px 24px hsl(250 30% 20% / 0.08),
    0 1px 0 hsl(0 0% 100% / 0.55) inset;
  margin: 0;
  width: 100%;
  border-radius: 0;
}

.brand-row,
.header-top {
  max-width: 42rem;
  margin: 0 auto;
  min-height: 3.8rem;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.72rem;
}


.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: 0.55rem;
}

svg.brand-icon,
svg#brandIcon {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  display: block;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  background: none !important;
}

.brand-icon:not(svg),
#brandIcon:not(svg) {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  display: block;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  background: none !important;
}

svg.brand-icon .mark-body,
svg#brandIcon .mark-body {
  fill: hsl(var(--foreground));
}

svg.brand-icon .mark-diamond,
svg#brandIcon .mark-diamond {
  fill: var(--shell-bar-bg);
}


/* When brand-icon is inline SVG (home page) */
svg.brand-icon {
  background: none !important;
}

svg.brand-icon .mark-body {
  fill: hsl(var(--foreground));
}

svg.brand-icon .mark-diamond {
  fill: var(--shell-bar-bg);
}

.brand-title,
#brandTitle {
  font-family: "Crimson Pro", serif !important;
  font-size: 1.752rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: lowercase !important;
  color: hsl(var(--foreground));
}

.brand-title .wm-a,
#brandTitle .wm-a {
  font-weight: 600;
}

.brand-title .wm-d,
#brandTitle .wm-d {
  font-weight: 300;
  opacity: 0.42;
}

html[data-theme="dark"] .brand-title .wm-d,
html.dark .brand-title .wm-d,
html[data-theme="dark"] #brandTitle .wm-d,
html.dark #brandTitle .wm-d {
  opacity: 0.55;
}


.brand-subtitle {
  display: none;
}

.header-meta,
.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 0rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0rem;
  min-height: 2.2rem;
  padding: 0 0.18rem;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: hsl(var(--muted-foreground));
  user-select: none;
  cursor: pointer;
}

.lang-switch .lang-globe-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-switch .lang-current {
  font-size: 0.92rem;
  line-height: 1;
  font-weight: 520;
  letter-spacing: -0.01em;
}

.theme-toggle,
.kimi-menu-toggle {
  width: 2.16rem;
  height: 2.16rem;
  border: 0 !important;
  border-radius: 0.72rem;
  background: transparent !important;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: none !important;
}

.theme-toggle:hover,
.kimi-menu-toggle:hover,
.lang-switch:hover {
  color: hsl(var(--foreground));
}

.theme-toggle svg,
.kimi-menu-toggle svg {
  width: 1.06rem;
  height: 1.06rem;
}

.site-header.kimi-nav-open .kimi-menu-toggle {
  background: hsl(var(--secondary) / 0.9) !important;
  color: hsl(var(--foreground));
}

.main-nav {
  position: fixed;
  top: 4.05rem;
  left: auto;
  right: max(0.6rem, calc((100vw - 42rem) / 2 - 0.1rem));
  transform: none;
  z-index: 80;
  display: none;
  width: min(33rem, calc(100vw - 1.2rem));
  border: 1px solid hsl(var(--border) / 0.82);
  border-radius: 1.26rem;
  background: hsl(var(--background) / 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 36px hsl(240 30% 10% / 0.12);
  padding: 0.66rem;
}

.site-header.kimi-nav-open .main-nav {
  display: block;
}

.main-nav a,
.main-nav button {
  width: 100%;
  margin: 0;
  min-height: 2.96rem;
  border: 0 !important;
  background: transparent !important;
  color: hsl(var(--muted-foreground) / 0.96);
  font-size: 0.97rem;
  line-height: 1.2;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none !important;
  padding: 0 0.96rem;
  border-radius: calc(var(--radius) + 4px);
}

.main-nav a + a,
.main-nav a + button,
.main-nav button + a,
.main-nav button + button {
  margin-top: 0.12rem;
}

.main-nav a:hover,
.main-nav button:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--secondary));
}

.main-nav a.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1) !important;
  border: 1px solid hsl(var(--primary) / 0.24);
}

.main-nav .menu-item-sparkle {
  display: inline-flex;
  margin-left: auto;
  color: hsl(var(--primary));
}

.main-nav .menu-lang-block {
  width: 100%;
  margin: 0.52rem 0 0.04rem;
  padding-top: 0.78rem;
  border-top: 1px solid hsl(var(--border) / 0.72);
  display: grid;
  gap: 0.5rem;
}

.main-nav .menu-lang-label {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.main-nav .menu-lang-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
}

.main-nav .menu-lang-btn {
  min-height: 2.9rem;
  border-radius: 1.02rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.72);
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 620;
}

.main-nav .menu-lang-btn.active {
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary) / 0.35);
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(250 85% 55%) 100%);
  box-shadow: 0 4px 14px hsl(var(--primary) / 0.24);
}

/* Home */
.hero-intro {
  margin: 0 auto 1.68rem;
  text-align: center;
}

.hero-copy,
#headerCountdownWrapDesktop,
#nextPuzzleCountdownHero {
  display: none !important;
}

.hero-countdown {
  margin: 0 0 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  color: hsl(var(--muted-foreground) / 0.95);
  font-size: 0.76rem;
  line-height: 1.2;
  font-weight: 430;
}

.hero-countdown strong,
.hero-countdown .mono,
#nextPuzzleCountdown {
  font-size: 0.76rem;
  font-weight: 470 !important;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground) / 0.76) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.hero-countdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.more-disclosure summary {
  list-style: none;
}

.more-disclosure summary::-webkit-details-marker {
  display: none;
}

.more-disclosure[open] .more-disclosure-meta svg {
  transform: rotate(180deg);
  opacity: 0.92;
}

.date-line {
  margin: 0;
  color: hsl(var(--muted-foreground) / 0.9);
  font-size: 0.8rem;
  line-height: 1.35;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#dailyPuzzleCard {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.7rem 1.6rem 1.58rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.55);
  border-radius: calc(var(--radius) + 7px);
  box-shadow:
    0 10px 30px hsl(240 20% 12% / 0.045),
    0 1px 0 hsl(0 0% 100% / 0.7) inset;
}

.meta-row.pills {
  display: flex;
  align-items: center;
  gap: 0.46rem;
  margin-bottom: 1.12rem;
  flex-wrap: wrap;
}

.pill,
.pill-level,
.pill-topic,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.76rem;
  height: auto;
  padding: 0.34rem 0.78rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border) / 0.82);
  background: hsl(var(--secondary) / 0.72);
  color: hsl(var(--muted-foreground) / 0.96);
  font-size: 0.74rem;
  font-weight: 610;
  letter-spacing: 0.008em;
  line-height: 1.1;
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 100%;
  text-align: center;
}

@media (max-width: 640px) {
  .meta-row.pills {
    gap: 0.4rem;
    align-items: flex-start;
  }

  .pill,
  .pill-level,
  .pill-topic,
  .chip {
    font-size: 0.72rem;
    padding: 0.34rem 0.62rem;
    min-height: 1.7rem;
    line-height: 1.18;
  }

  #sectionPill {
    max-width: min(14rem, 100%);
  }
}

.pill-level {
  background: hsl(258 78% 94%);
  border-color: hsl(258 52% 84%);
  color: hsl(258 48% 46%);
}

.pill-topic {
  background: hsl(var(--secondary) / 0.46);
  border-color: hsl(var(--border) / 0.56);
  color: hsl(var(--foreground) / 0.68);
}

.difficulty-pill-scale,
.difficulty-dot {
  display: none !important;
}

#puzzleTitle {
  margin: 0 0 1.34rem;
  color: hsl(var(--foreground));
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 675;
  letter-spacing: -0.026em;
  line-height: 1.1;
  font-size: clamp(1.4rem, 2.3vw, 1.82rem);
}

#puzzleStatement,
.markdown-block {
  font-size: 0.99rem;
  line-height: 1.72;
  color: hsl(var(--foreground) / 0.88);
}

#puzzleStatement p {
  margin: 0 0 1.14rem;
}

#puzzleStatement p:last-child {
  margin-bottom: 0;
}

.answer-stack {
  margin-top: 1.18rem;
  display: grid;
  gap: 0.72rem;
}

input,
textarea,
select,
#answerInput,
.field,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 3.62rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1.5px solid hsl(var(--input) / 0.78);
  background: hsl(0 0% 100%);
  color: hsl(var(--foreground));
  font-size: 1rem;
  padding: 0 1.18rem;
  box-shadow:
    0 1px 0 hsl(0 0% 100% / 0.82) inset,
    0 3px 10px hsl(240 20% 12% / 0.035);
}

#answerInput {
  margin-top: 0.65rem;
}

#answerInput:focus,
input:focus,
textarea:focus,
select:focus,
.field:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: hsl(var(--primary) / 0.42);
  box-shadow:
    0 0 0 4px hsl(var(--primary) / 0.08),
    0 1px 0 hsl(0 0% 100% / 0.72) inset;
}

textarea,
.field-textarea {
  min-height: 8.4rem;
  padding: 0.78rem 1rem;
  line-height: 1.56;
}

#answerInput::placeholder,
input::placeholder,
textarea::placeholder {
  color: hsl(var(--muted-foreground) / 0.72);
}

html[data-theme="dark"] input,
html.dark input,
html[data-theme="dark"] textarea,
html.dark textarea,
html[data-theme="dark"] select,
html.dark select,
html[data-theme="dark"] #answerInput,
html.dark #answerInput,
html[data-theme="dark"] .field,
html.dark .field,
html[data-theme="dark"] .field-input,
html.dark .field-input,
html[data-theme="dark"] .field-select,
html.dark .field-select,
html[data-theme="dark"] .field-textarea,
html.dark .field-textarea {
  background: hsl(240 8% 11%);
  color: hsl(var(--foreground));
  border-color: hsl(var(--border) / 0.95);
  box-shadow:
    0 1px 0 hsl(0 0% 100% / 0.03) inset,
    0 3px 10px hsl(0 0% 0% / 0.16);
}

html[data-theme="dark"] input::placeholder,
html.dark input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html.dark textarea::placeholder,
html[data-theme="dark"] #answerInput::placeholder,
html.dark #answerInput::placeholder {
  color: hsl(var(--foreground) / 0.56);
}


#checkBtn,
.btn-primary,
#showSolutionBtn,
#communitySubmitBtn,
#donateCustomSubmit {
  min-height: 3.18rem;
  border-radius: calc(var(--radius) + 1px);
  border: 0;
  color: hsl(var(--primary-foreground));
  background: linear-gradient(
    135deg,
    hsl(252 82% 61% / 0.92) 0%,
    hsl(261 76% 75% / 0.9) 100%
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-size: 0.98rem;
  font-weight: 590;
  box-shadow:
    0 10px 24px hsl(var(--primary) / 0.16),
    inset 0 1px 0 hsl(0 0% 100% / 0.4);
}

#checkBtn {
  width: 100%;
}

#checkBtn:hover,
.btn-primary:hover {
  filter: brightness(1.03);
}

html[data-theme="dark"] #checkBtn,
html.dark #checkBtn,
html[data-theme="dark"] .btn-primary,
html.dark .btn-primary {
  background: hsl(250 30% 42%);
  box-shadow: 0 6px 18px hsl(250 30% 30% / 0.22), inset 0 1px 0 hsl(0 0% 100% / 0.08);
}

#nextPuzzleCountdownMobile {
  display: none;
}

.small,
.muted,
.section-sub,
.helper-note {
  color: hsl(var(--muted-foreground));
}

/* Common cards for non-home pages */
.card,
.archive-card,
.home-section,
.connect-panel,
.participate-subcard,
.community-editor-subcard {
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 5px);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(240 20% 12% / 0.03);
}

.wrap > section.card,
.wrap > section.grid {
  max-width: 42rem;
  margin-inline: auto;
}

.wrap > section.card {
  margin-top: 0.82rem;
  padding: 1.24rem;
}

.result-box {
  border-radius: 18px;
  padding: 0.9rem 1rem;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}

/* Veredicto centrado, con la misma estética que la fecha superior */
.result-verdict-line {
  margin: 0 0 0.72rem;
  text-align: center;
  color: hsl(var(--muted-foreground) / 0.9);
  font-size: 0.8rem;
  line-height: 1.35;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

#resultVerdict {
  display: inline-block;
  font-weight: 600;
  color: hsl(var(--foreground));
}

#resultFeedback {
  margin: 0;
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.58;
  color: hsl(var(--foreground) / 0.9);
}

#resultBox.result-correct {
  background: #eef8f0 !important;
  border: 1px solid #cfe7d3 !important;
  box-shadow: 0 8px 24px rgba(80, 140, 90, 0.08);
}

#resultBox.result-partial {
  background: #fff7e8 !important;
  border: 1px solid #ecd8a2 !important;
  box-shadow: 0 8px 24px rgba(180, 140, 60, 0.08);
}
#resultBox.result-ambiguous {
  background: #eef4fb !important;
  border: 1px solid #c7d7ea !important;
  box-shadow: 0 8px 24px rgba(90, 120, 160, 0.08);
}
#resultBox.result-incorrect {
  background: #fff1f0 !important;
  border: 1px solid #e5b0aa !important;
  box-shadow: 0 8px 24px rgba(170, 90, 80, 0.08);
}

/* Ajuste fino del texto según estado */
#resultBox.result-correct #resultVerdict {
  color: #2f6b3d;
}

#resultBox.result-partial #resultVerdict {
  color: #9a6b00;
}

#resultBox.result-incorrect #resultVerdict {
  color: #a3443b;
}

html[data-theme="dark"] #resultBox.result-correct,
html.dark #resultBox.result-correct {
  background: rgba(50, 92, 60, 0.35) !important;
  border-color: rgba(126, 193, 141, 0.38) !important;
}

html[data-theme="dark"] #resultBox.result-partial,
html.dark #resultBox.result-partial {
  background: rgba(120, 92, 28, 0.3) !important;
  border-color: rgba(232, 195, 108, 0.34) !important;
}

html[data-theme="dark"] #resultBox.result-incorrect,
html.dark #resultBox.result-incorrect {
  background: rgba(110, 52, 48, 0.3) !important;
  border-color: rgba(229, 176, 170, 0.3) !important;
}

html[data-theme="dark"] #resultFeedback,
html.dark #resultFeedback {
  color: hsl(var(--foreground) / 0.92);
}

main.wrap:not(.home-main) > section.card:first-of-type {
  padding: 1.42rem 1.48rem 1.3rem;
}

main.wrap:not(.home-main) > section.card:first-of-type .h1 {
  margin: 0 0 0.72rem;
  font-size: clamp(1.62rem, 2.9vw, 2.08rem);
  line-height: 1.15;
  letter-spacing: -0.018em;
  font-weight: 680;
  color: hsl(var(--foreground));
}

main.wrap:not(.home-main) > section.card:first-of-type .muted {
  font-size: 0.94rem;
  line-height: 1.64;
}

main.wrap:not(.home-main) > section.card + section.card {
  margin-top: 0.66rem;
}

main.wrap:not(.home-main) .meta {
  margin: 0.7rem 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
}

main.wrap:not(.home-main) .meta .pill {
  height: 1.72rem;
  padding: 0 0.76rem;
}

main.wrap:not(.home-main) .meta .pill > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  main.wrap:not(.home-main) .meta {
    gap: 0.42rem;
    align-items: center;
  }

  main.wrap:not(.home-main) .meta .pill,
  main.wrap:not(.home-main) .meta .pill-level,
  main.wrap:not(.home-main) .meta .pill-topic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.68rem;
    min-height: 1.68rem;
    padding: 0 0.68rem;
    border-radius: 9999px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
  }

  main.wrap:not(.home-main) .meta .pill > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    line-height: 1;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
  }
}

main.wrap:not(.home-main) .meta .pill:last-child {
  color: hsl(var(--muted-foreground) / 0.92);
  font-size: 0.76rem;
}

main.wrap:not(.home-main) h2 {
  margin: 0 0 0.58rem;
  font-size: 1.04rem;
  line-height: 1.24;
  font-weight: 620;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

main.wrap:not(.home-main) .intro p,
main.wrap:not(.home-main) .content p,
main.wrap:not(.home-main) .content li {
  margin: 0 0 0.78rem;
  font-size: 0.98rem;
  line-height: 1.66;
  color: hsl(var(--foreground) / 0.92);
}

main.wrap:not(.home-main) .content ul,
main.wrap:not(.home-main) .content ol {
  margin: 0.58rem 0 0.9rem;
  padding-left: 1.1rem;
}

main.wrap:not(.home-main) .intro {
  margin: 0 0 1.05rem;
  padding: 0.92rem 1rem;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(180deg, hsl(215 100% 97% / 0.78), hsl(220 85% 96% / 0.42));
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / 0.55),
    0 1px 2px hsl(220 30% 20% / 0.03);
}

main.wrap:not(.home-main) .intro p {
  margin: 0 0 0.7rem;
  color: hsl(var(--foreground) / 0.78);
  font-size: 0.97rem;
  line-height: 1.68;
}

main.wrap:not(.home-main) .intro p:last-child {
  margin-bottom: 0;
}

html[data-theme="dark"] main.wrap:not(.home-main) .intro,
html.dark main.wrap:not(.home-main) .intro {
  border: 0;
  background: linear-gradient(180deg, hsl(220 28% 16% / 0.62), hsl(220 24% 12% / 0.42));
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / 0.03),
    0 1px 2px hsl(0 0% 0% / 0.12);
}

html[data-theme="dark"] main.wrap:not(.home-main) .intro p,
html.dark main.wrap:not(.home-main) .intro p {
  color: hsl(var(--foreground) / 0.82);
}

main.wrap:not(.home-main) .action-row {
  margin-top: 1rem;
}

main.wrap:not(.home-main) .action-row .btn-primary {
  width: 100%;
  max-width: 23rem;
}

main.wrap:not(.home-main) .spoiler-panel {
  border: 1px solid hsl(var(--border) / 0.92);
  border-radius: calc(var(--radius) + 3px);
  background: hsl(var(--secondary) / 0.5);
  overflow: hidden;
}

main.wrap:not(.home-main) .spoiler-panel summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 560;
  color: hsl(var(--foreground));
  padding: 0.74rem 0.84rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

main.wrap:not(.home-main) .spoiler-panel summary::-webkit-details-marker {
  display: none;
}

main.wrap:not(.home-main) .spoiler-panel[open] summary {
  border-bottom: 1px solid hsl(var(--border));
}

main.wrap:not(.home-main) .spoiler-panel > .content {
  padding: 0.78rem 0.84rem;
}

main.wrap:not(.home-main) #seo-hints-details[open] {
  border-color: rgb(245 158 11 / 0.34);
  background: linear-gradient(180deg, rgb(245 158 11 / 0.09), rgb(245 158 11 / 0.14));
}

main.wrap:not(.home-main) #seo-hints-details[open] summary {
  color: rgb(180 83 9);
}

main.wrap:not(.home-main) #seo-solution-details[open] {
  border-color: hsl(var(--primary) / 0.3);
  background: linear-gradient(
    180deg,
    hsl(var(--primary) / 0.08),
    hsl(260 78% 75% / 0.12)
  );
}

main.wrap:not(.home-main) #seo-solution-details[open] summary {
  color: hsl(var(--primary));
}

main.wrap:not(.home-main) .related {
  display: grid;
  gap: 0.52rem;
}

main.wrap:not(.home-main) .related a {
  border: 1px solid hsl(var(--border));
  border-radius: 0.92rem;
  padding: 0.72rem 0.84rem;
  background: hsl(var(--secondary) / 0.42);
  display: block;
}

main.wrap:not(.home-main) .related a strong {
  font-size: 0.98rem;
  color: hsl(var(--foreground));
}

main.wrap:not(.home-main) .related a .small {
  margin-top: 0.14rem;
  display: block;
}

/* Suggest form */
.suggest-form {
  display: grid;
  gap: 0.62rem;
}

.suggest-form-row {
  display: grid;
  gap: 0.24rem;
}

.suggest-form-label {
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.suggest-form-label .is-required {
  color: hsl(var(--primary));
  margin-left: 0.26rem;
}

.suggest-form .field,
.suggest-form .field-textarea,
.suggest-form .field-select {
  min-height: 2.82rem;
  border-width: 1px;
  font-size: 0.94rem;
  padding-inline: 0.78rem;
}

.suggest-form .field-textarea {
  min-height: 7.2rem;
  padding: 0.66rem 0.78rem;
}

.suggest-form .action-row {
  margin-top: 0.34rem;
}

.suggest-form .btn-primary {
  width: 100%;
  max-width: 21rem;
}

/* Archive page */
.archive-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
}

.archive-toolbar input,
.archive-toolbar select,
.archive-toolbar .field,
.archive-toolbar .field-select {
  color: hsl(var(--foreground));
  font-weight: 500;
}

html[data-theme="dark"] .archive-toolbar input,
html.dark .archive-toolbar input,
html[data-theme="dark"] .archive-toolbar select,
html.dark .archive-toolbar select,
html[data-theme="dark"] .archive-toolbar .field,
html.dark .archive-toolbar .field,
html[data-theme="dark"] .archive-toolbar .field-select,
html.dark .archive-toolbar .field-select {
  background: hsl(240 8% 11%);
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

#archiveGrid,
section.grid#archiveGrid,
main.wrap section.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.66rem;
  align-items: start;
}

.archive-card {
  margin: 0;
  padding: 1.02rem 1.08rem;
}

.archive-card h3 {
  margin: 0 0 0.42rem !important;
}

.archive-card h3 a {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  font-weight: 620;
}

.archive-card .small.muted {
  font-size: 0.78rem;
  line-height: 1.25;
}

.archive-card .archive-excerpt {
  margin-top: 0.58rem;
  font-size: 0.88rem;
  line-height: 1.52;
  color: hsl(var(--foreground) / 0.86);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.site-footer {
  margin-top: 1.05rem;
  border-top: 1px solid hsl(var(--border) / 0.78);
  padding-top: 0.9rem;
}

.site-footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.64rem 1rem;
}

.site-footer .footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.64rem 0.84rem;
}

.site-footer .footer-links a {
  font-size: 0.8rem;
  line-height: 1.2;
  color: hsl(var(--muted-foreground));
}

.site-footer .footer-links a:hover {
  color: hsl(var(--foreground));
}

.site-footer .copy {
  margin: 0.76rem 0 0;
  text-align: center;
  font-size: 0.81rem;
  line-height: 1.4;
  color: hsl(var(--muted-foreground));
}

.heart-mark {
  color: #fb7185;
  font-weight: 500;
}

/* Links and markdown in text blocks */
.content a,
.markdown-block a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-decoration-color: hsl(var(--primary) / 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content a:hover,
.markdown-block a:hover {
  text-decoration-color: hsl(var(--primary));
}

/* Mobile tune */
@media (max-width: 900px) {
  #archiveGrid,
  section.grid#archiveGrid,
  main.wrap section.grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .wrap,
  main.wrap,
  main.home-main {
    width: min(42rem, calc(100% - 1.2rem));
  }

  main.wrap,
  main.home-main {
    padding-top: 5.22rem;
    padding-bottom: 1.72rem;
  }

  .site-header,
  header.site-header {
    border-bottom-color: hsl(var(--border) / 0.82);
  }

  .brand-row,
  .header-top {
    min-height: 4rem;
    padding: 0 0.64rem;
  }

  svg.brand-icon,
  svg#brandIcon {
    width: 3.5rem;
    height: 3.5rem;
  }

  .brand-icon:not(svg),
  #brandIcon:not(svg) {
    width: 3.5rem;
    height: 3.5rem;
  }

  svg.brand-icon .mark-body,
  svg#brandIcon .mark-body {
    fill: hsl(var(--foreground));
  }

  svg.brand-icon .mark-diamond,
  svg#brandIcon .mark-diamond {
    fill: var(--shell-bar-bg);
  }

  .brand-title,
  #brandTitle {
    font-size: 1.6rem !important;
    letter-spacing: 0.0062em;
  }

  html[lang="en"] .brand-title,
  html[lang="en"] #brandTitle {
    font-size: 1.4rem !important;
    letter-spacing: 0.002em;
  }

  .brand-link {
    gap: 0.14rem;
    padding-left: 0.28rem;
  }

  html[lang="en"] .brand-link {
    gap: 0.1rem;
  }

  .theme-toggle {
    margin-right: -0.28rem;
  }

  .lang-switch {
    min-height: 2rem;
    gap: 0rem;
    padding: 0 0.04rem 0 0.1rem;

  }

  .lang-switch .lang-current {
    font-size: 0.88rem;
    font-weight: 520;
  }

  .theme-toggle,
  .kimi-menu-toggle {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.68rem;
  }

  .theme-toggle svg,
  .kimi-menu-toggle svg {
    width: 1.02rem;
    height: 1.02rem;
  }

  .main-nav {
    top: 3.46rem;
    left: auto;
    right: 0.4rem;
    transform: none;
    width: calc(100vw - 0.8rem);
    border-radius: 1.06rem;
    padding: 0.52rem;
  }

  .main-nav a,
  .main-nav button {
    width: 100%;
    min-height: 2.92rem;
    font-size: 0.95rem;
    padding-inline: 0.8rem;
  }

  .main-nav .menu-lang-block {
    width: 100%;
    margin-bottom: 0.24rem;
  }

  .hero-intro {
    margin-bottom: 1.16rem;
  }

  .hero-countdown {
    margin-bottom: 0.56rem;
    font-size: 0.72rem;
    gap: 0.28rem;
  }

  .hero-countdown strong,
  .hero-countdown .mono,
  #nextPuzzleCountdown {
    font-size: 0.72rem;
    font-weight: 460;
    font-variant-numeric: tabular-nums;
  }

  .date-line {
    font-size: 0.79rem;
    letter-spacing: 0.062em;
  }

  #dailyPuzzleCard {
    padding: 1.26rem 1.1rem 1.18rem;
    border-radius: calc(var(--radius) + 6px);
    border-color: hsl(var(--border) / 0.5);
    box-shadow:
      0 10px 26px hsl(240 20% 12% / 0.04),
      0 1px 0 hsl(0 0% 100% / 0.68) inset;
  }

  .meta-row.pills {
    margin-bottom: 1rem;
    gap: 0.42rem;
  }

  .pill,
  .pill-level,
  .pill-topic,
  .chip {
    min-height: 1.68rem;
    padding: 0.32rem 0.7rem;
    font-size: 0.72rem;
  }

  #dailyPuzzleCard #puzzleTitle {
    margin-bottom: 1.16rem;
    font-size: clamp(1.2rem, 6.8vw, 1.64rem);
    line-height: 1.12;
    letter-spacing: -0.022em;
  }

  main.wrap:not(.home-main) > section.card:first-of-type .h1 {
    font-size: clamp(1.42rem, 7vw, 1.9rem);
    line-height: 1.15;
  }

  main.wrap:not(.home-main) h2 {
    font-size: 1.02rem;
  }

  #dailyPuzzleCard #puzzleStatement,
  #dailyPuzzleCard .markdown-block {
    font-size: 0.98rem;
    line-height: 1.66;
  }

  input,
  textarea,
  select,
  #answerInput,
  .field,
  .field-input,
  .field-select,
  .field-textarea {
    min-height: 3.28rem;
    font-size: 0.98rem;
    padding-inline: 0.98rem;
  }

  #checkBtn,
  .btn-primary {
    min-height: 3rem;
    font-size: 0.95rem;
  }

  .archive-toolbar {
    grid-template-columns: 1fr;
  }

  .site-footer .footer-top {
    row-gap: 0.56rem;
  }

  .site-footer .footer-links {
    gap: 0.62rem;
  }

  .site-footer .copy,
  .site-footer .footer-links a {
    font-size: 0.77rem;
  }
}