/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
  :root, :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
      "Courier New", monospace;
    --color-gray-200: oklch(92.8% 0.006 264.531);
    --color-gray-300: oklch(87.2% 0.01 258.338);
    --color-black: #000;
    --color-white: #fff;
    --spacing: 0.25rem;
    --text-xs: 0.75rem;
    --text-xs--line-height: calc(1 / 0.75);
    --text-sm: 0.875rem;
    --text-sm--line-height: calc(1.25 / 0.875);
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --font-weight-semibold: 600;
    --leading-relaxed: 1.625;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --default-transition-duration: 150ms;
    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}
@layer base {
  *, ::after, ::before, ::backdrop, ::file-selector-button {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html, :host {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }
  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }
  small {
    font-size: 80%;
  }
  sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }
  sub {
    bottom: -0.25em;
  }
  sup {
    top: -0.5em;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  :-moz-focusring {
    outline: auto;
  }
  progress {
    vertical-align: baseline;
  }
  summary {
    display: list-item;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea, ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
  }
  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }
  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }
  ::file-selector-button {
    margin-inline-end: 4px;
  }
  ::placeholder {
    opacity: 1;
  }
  @supports (not (-webkit-appearance: -apple-pay-button))  or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentcolor;
      @supports (color: color-mix(in lab, red, red)) {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }
  textarea {
    resize: vertical;
  }
  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }
  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }
  ::-webkit-datetime-edit {
    display: inline-flex;
  }
  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }
  ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }
  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }
  :-moz-ui-invalid {
    box-shadow: none;
  }
  button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
    appearance: button;
  }
  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
    height: auto;
  }
  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }
}
@layer utilities {
  .visible {
    visibility: visible;
  }
  .fixed {
    position: fixed;
  }
  .relative {
    position: relative;
  }
  .static {
    position: static;
  }
  .container {
    width: 100%;
    @media (width >= 40rem) {
      max-width: 40rem;
    }
    @media (width >= 48rem) {
      max-width: 48rem;
    }
    @media (width >= 64rem) {
      max-width: 64rem;
    }
    @media (width >= 80rem) {
      max-width: 80rem;
    }
    @media (width >= 96rem) {
      max-width: 96rem;
    }
  }
  .mx-auto {
    margin-inline: auto;
  }
  .mt-10 {
    margin-top: calc(var(--spacing) * 10);
  }
  .mt-auto {
    margin-top: auto;
  }
  .mb-4 {
    margin-bottom: calc(var(--spacing) * 4);
  }
  .block {
    display: block;
  }
  .block\! {
    display: block !important;
  }
  .flex {
    display: flex;
  }
  .grid {
    display: grid;
  }
  .hidden {
    display: none;
  }
  .inline {
    display: inline;
  }
  .inline-block {
    display: inline-block;
  }
  .w-full {
    width: 100%;
  }
  .max-w-\[900px\] {
    max-width: 900px;
  }
  .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .flex-col {
    flex-direction: column;
  }
  .items-center {
    align-items: center;
  }
  .gap-8 {
    gap: calc(var(--spacing) * 8);
  }
  .space-y-3 {
    :where(& > :not(:last-child)) {
      --tw-space-y-reverse: 0;
      margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
      margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
    }
  }
  .rounded-md {
    border-radius: var(--radius-md);
  }
  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }
  .border-t {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
  }
  .border-gray-300 {
    border-color: var(--color-gray-300);
  }
  .bg-gray-200 {
    background-color: var(--color-gray-200);
  }
  .px-5 {
    padding-inline: calc(var(--spacing) * 5);
  }
  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }
  .py-2 {
    padding-block: calc(var(--spacing) * 2);
  }
  .pt-4 {
    padding-top: calc(var(--spacing) * 4);
  }
  .pt-6 {
    padding-top: calc(var(--spacing) * 6);
  }
  .pt-10 {
    padding-top: calc(var(--spacing) * 10);
  }
  .pb-6 {
    padding-bottom: calc(var(--spacing) * 6);
  }
  .text-center {
    text-align: center;
  }
  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }
  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }
  .text-xs {
    font-size: var(--text-xs);
    line-height: var(--tw-leading, var(--text-xs--line-height));
  }
  .leading-relaxed {
    --tw-leading: var(--leading-relaxed);
    line-height: var(--leading-relaxed);
  }
  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }
  .text-black {
    color: var(--color-black);
  }
  .opacity-80 {
    opacity: 80%;
  }
  .shadow-sm {
    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }
  .transition-colors {
    transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }
  .transition-opacity {
    transition-property: opacity;
    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }
  .duration-300 {
    --tw-duration: 300ms;
    transition-duration: 300ms;
  }
  .hover\:bg-gray-300 {
    &:hover {
      @media (hover: hover) {
        background-color: var(--color-gray-300);
      }
    }
  }
  .hover\:opacity-70 {
    &:hover {
      @media (hover: hover) {
        opacity: 70%;
      }
    }
  }
  .md\:grid-cols-4 {
    @media (width >= 48rem) {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
  .md\:items-start {
    @media (width >= 48rem) {
      align-items: flex-start;
    }
  }
  .md\:text-left {
    @media (width >= 48rem) {
      text-align: left;
    }
  }
}
@layer components {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  :root {
    --color-bg: #fafafa;
    --color-white: #ffffff;
    --color-text: #1a1a2e;
    --color-text-light: #6b7280;
    --color-primary: #3b82f6;
    --color-primary-light: #dbeafe;
    --color-primary-hover: #2563eb;
    --color-error: #ef4444;
    --color-error-light: #fee2e2;
    --color-success: #10b981;
    --color-border: #e5e7eb;
    --color-border-block: #1a1a2e;
    --color-highlight: #eef2ff;
    --color-same-number: #c7d2fe;
    --color-selected: #bbdefb;
    --color-given: #1a1a2e;
    --color-user: #3b82f6;
    --color-pencil: #9ca3af;
    --color-cage: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 150ms ease;
  }
  [data-theme="dark"] {
    --color-bg: #0f1117;
    --color-white: #1a1d27;
    --color-text: #e4e6eb;
    --color-text-light: #9ca3b0;
    --color-primary: #5b9cf6;
    --color-primary-light: #1e2a45;
    --color-primary-hover: #4a8af0;
    --color-error: #f87171;
    --color-error-light: #3b1c1c;
    --color-success: #34d399;
    --color-border: #2a2d38;
    --color-border-block: #6b7280;
    --color-highlight: #1e2235;
    --color-same-number: #2a3452;
    --color-selected: #1e3a5f;
    --color-given: #e4e6eb;
    --color-user: #5b9cf6;
    --color-pencil: #6b7280;
    --color-cage: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  }
  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
  }
  .theme-toggle:hover {
    background: var(--color-bg);
    color: var(--color-text);
  }
  .trophy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all var(--transition);
  }
  .trophy-link:hover {
    background: var(--color-bg);
    color: #d97706;
  }
  .daily-challenge-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
  }
  .daily-challenge-link:hover {
    background: var(--color-bg);
    color: var(--color-primary);
  }
  .daily-challenge-link.completed {
    opacity: 0.5;
  }
  .daily-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    font-size: 0;
    line-height: 1;
    pointer-events: none;
  }
  .daily-badge.active {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success);
    animation: badgePulse 2s ease-in-out infinite;
  }
  .daily-badge.done {
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--color-success);
    top: 1px;
    right: 0;
    animation: none;
  }
  @keyframes badgePulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.4;
    }
  }
  .theme-toggle .icon-sun {
    display: none;
  }
  .theme-toggle .icon-moon {
    display: block;
  }
  [data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
  }
  [data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
  }
  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
  }
  body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .header {
    width: 100%;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
  }
  .header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
  }
  .header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  .header-right {
    justify-content: flex-end;
  }
  .header-center {
    flex: 0 0 auto;
    text-align: center;
  }
  .logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    white-space: nowrap;
  }
  .mode-tabs {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 3px;
    gap: 2px;
  }
  .mode-tab {
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
  }
  .mode-tab:hover {
    color: var(--color-text);
  }
  .mode-tab.active {
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
  }
  .lang-select {
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
  }
  .lang-select:focus {
    border-color: var(--color-primary);
  }
  .menu-wrapper {
    position: relative;
  }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
  }
  .menu-toggle:hover {
    background: var(--color-bg);
    color: var(--color-text);
  }
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition);
    z-index: 200;
  }
  .dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition);
  }
  .dropdown-item:hover {
    background: var(--color-bg);
  }
  .dropdown-item:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .dropdown-item:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .main {
    width: 100%;
    max-width: 480px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .difficulty-bar {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .difficulty-btn {
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-white);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
  }
  .difficulty-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
  .difficulty-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
  }
  .game-info-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    width: 100%;
    padding: 8px 0;
  }
  .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .info-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-light);
  }
  .info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }
  .info-value.error-limit {
    color: var(--color-error);
  }
  .timer-clickable {
    cursor: pointer;
    user-select: none;
  }
  .timer-clickable:hover {
    color: var(--color-primary);
  }
  .best-time {
    color: #d97706;
  }
  .grid-container {
    width: 100%;
    aspect-ratio: 1;
    max-width: 420px;
  }
  .sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    height: 100%;
    background: var(--color-white);
    border: 2.5px solid var(--color-border-block);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
  }
  .sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 0.5px solid var(--color-border);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
    position: relative;
    aspect-ratio: 1;
  }
  .sudoku-cell:hover {
    background: var(--color-highlight);
  }
  .sudoku-cell.block-left {
    border-left: 2px solid var(--color-border-block);
  }
  .sudoku-cell.block-top {
    border-top: 2px solid var(--color-border-block);
  }
  .sudoku-cell.given {
    color: var(--color-given);
    font-weight: 700;
  }
  .sudoku-cell.user-input {
    color: var(--color-user);
  }
  .sudoku-cell.error {
    color: var(--color-error);
    background: var(--color-error-light);
    animation: shake 0.3s ease;
  }
  .sudoku-cell.selected {
    background: var(--color-selected) !important;
  }
  .sudoku-cell.highlighted {
    background: var(--color-highlight);
  }
  .sudoku-cell.same-number {
    background: var(--color-same-number);
  }
  .sudoku-cell.has-pencil {
    padding: 0;
  }
  .pencil-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .pencil-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 400;
    color: var(--color-pencil);
    line-height: 1;
  }
  .sudoku-cell.cage-cell {
    position: relative;
  }
  .sudoku-cell.cage-top {
    border-top: 1.5px dashed var(--color-cage) !important;
  }
  .sudoku-cell.cage-bottom {
    border-bottom: 1.5px dashed var(--color-cage) !important;
  }
  .sudoku-cell.cage-left {
    border-left: 1.5px dashed var(--color-cage) !important;
  }
  .sudoku-cell.cage-right {
    border-right: 1.5px dashed var(--color-cage) !important;
  }
  .cage-sum {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--color-cage);
    line-height: 1;
    pointer-events: none;
  }
  .sudoku-grid.won .sudoku-cell {
    animation: winPulse 0.6s ease forwards;
  }
  @keyframes shake {
    0%, 100% {
      transform: translateX(0);
    }
    20% {
      transform: translateX(-3px);
    }
    40% {
      transform: translateX(3px);
    }
    60% {
      transform: translateX(-2px);
    }
    80% {
      transform: translateX(2px);
    }
  }
  @keyframes winPulse {
    0% {
      transform: scale(1);
      background: var(--color-white);
    }
    50% {
      transform: scale(1.05);
      background: #d1fae5;
    }
    100% {
      transform: scale(1);
      background: #ecfdf5;
    }
  }
  .controls {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .control-actions {
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }
  .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    flex: 1;
  }
  .action-btn svg {
    width: 22px;
    height: 22px;
  }
  .action-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
  }
  .action-btn.active {
    color: var(--color-primary);
    background: var(--color-primary-light);
  }
  .hint-badge {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-left: 2px;
  }
  .numpad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
  }
  .numpad-btn {
    font-family: var(--font);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 0;
    cursor: pointer;
    transition: all var(--transition);
  }
  .numpad-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
  .numpad-btn:active {
    transform: scale(0.95);
  }
  .new-game-btn {
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius);
    padding: 10px 24px;
    cursor: pointer;
    transition: all var(--transition);
    align-self: center;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .new-game-btn:hover {
    background: var(--color-primary);
    color: white;
  }
  .numpad-btn.completed {
    opacity: 0.25;
    pointer-events: none;
    transform: scale(0.95);
    border-color: transparent;
  }
  .progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 420px;
  }
  .progress-bar {
    flex: 1;
    height: 5px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .progress-text {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
  }
  .confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
  }
  .confetti-particle {
    position: absolute;
    top: -10px;
    opacity: 1;
    animation: confettiFall linear forwards;
  }
  @keyframes confettiFall {
    0% {
      transform: translateY(0) translateX(0) rotate(0deg);
      opacity: 1;
    }
    75% {
      opacity: 1;
    }
    100% {
      transform: translateY(100vh) translateX(var(--drift)) rotate(var(--rotation));
      opacity: 0;
    }
  }
  .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 200ms ease;
  }
  .popup-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .popup-modal {
    max-width: 360px;
    width: 90%;
  }
  .popup-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: popupIn 200ms ease;
  }
  @keyframes popupIn {
    from {
      transform: scale(0.95);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
  }
  .popup-title {
    font-size: 1.125rem;
    font-weight: 700;
  }
  .popup-close {
    font-size: 1.5rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition);
  }
  .popup-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
  }
  .popup-body {
    padding: 16px 20px;
  }
  .popup-message {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 16px;
  }
  .popup-ad-placeholder {
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .popup-ad-icon {
    color: var(--color-text-light);
    opacity: 0.5;
  }
  .popup-ad-text {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 500;
  }
  .popup-footer {
    padding: 0 20px 20px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }
  .popup-btn {
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
  }
  .popup-btn-primary {
    background: var(--color-primary);
    color: white;
  }
  .popup-btn-primary:hover {
    background: var(--color-primary-hover);
  }
  .popup-btn-secondary {
    background: transparent;
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
  }
  .popup-btn-secondary:hover {
    background: var(--color-bg);
  }
  .win-stats {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    margin-bottom: 8px;
  }
  .win-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  .win-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    font-weight: 500;
  }
  .win-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
  }
  .win-record {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-success);
    padding: 8px 0;
  }
  @media (hover: none) and (pointer: coarse) {
    .sudoku-cell, .numpad-btn, .action-btn, .difficulty-btn, .mode-tab, .daily-play-btn, .daily-back-btn, .new-game-btn {
      -webkit-tap-highlight-color: transparent;
    }
    .sudoku-cell:hover {
      background: inherit;
    }
    .sudoku-cell.highlighted:hover {
      background: var(--color-highlight);
    }
    .sudoku-cell.selected:hover {
      background: var(--color-selected);
    }
    .numpad-btn {
      padding: 14px 0;
      min-height: 48px;
    }
    .action-btn {
      min-height: 48px;
    }
    .difficulty-btn {
      min-height: 36px;
    }
  }
  @media (max-width: 768px) {
    .main {
      max-width: 440px;
    }
    .grid-container {
      max-width: 380px;
    }
    .controls {
      max-width: 380px;
    }
  }
  @media (max-width: 420px) {
    .main {
      padding: 12px 8px;
      gap: 12px;
    }
    .grid-container {
      max-width: 100%;
    }
    .controls {
      max-width: 100%;
    }
    .sudoku-cell {
      font-size: 1rem;
    }
    .pencil-mark {
      font-size: 0.45rem;
    }
    .numpad-btn {
      font-size: 1rem;
      padding: 8px 0;
      border-radius: 6px;
    }
    .numpad {
      gap: 3px;
    }
    .difficulty-btn {
      font-size: 0.6875rem;
      padding: 5px 8px;
    }
    .header-inner {
      padding: 10px 8px;
      gap: 8px;
    }
    .logo {
      font-size: 1rem;
    }
    .mode-tab {
      font-size: 0.75rem;
      padding: 5px 10px;
    }
    .lang-select {
      font-size: 0.6875rem;
      padding: 4px 6px;
    }
    .game-info-bar {
      gap: 16px;
    }
    .info-label {
      font-size: 0.75rem;
    }
    .info-value {
      font-size: 0.8125rem;
    }
    .action-btn {
      padding: 8px 6px;
    }
    .action-btn svg {
      width: 20px;
      height: 20px;
    }
    .action-btn span {
      font-size: 0.625rem;
    }
    .daily-challenge-banner {
      padding: 0 8px;
    }
    .daily-challenge-inner {
      padding: 12px 14px;
    }
    .daily-title {
      font-size: 0.875rem;
    }
    .daily-date {
      font-size: 0.6875rem;
    }
    .daily-play-btn {
      font-size: 0.75rem;
      padding: 6px 14px;
    }
    .daily-calendar {
      padding: 8px 12px 10px;
      gap: 2px;
    }
    .daily-day {
      width: 20px;
      height: 20px;
      font-size: 0.5rem;
    }
    .daily-back-bar {
      padding: 8px 8px;
      gap: 12px;
    }
    .daily-back-btn {
      font-size: 0.75rem;
      padding: 5px 10px;
    }
    .daily-mode-label {
      font-size: 0.6875rem;
    }
    .popup-modal {
      width: 92%;
    }
    .popup-header {
      padding: 16px 16px 0;
    }
    .popup-body {
      padding: 12px 16px;
    }
    .popup-footer {
      padding: 0 16px 16px;
    }
    .new-game-btn {
      font-size: 0.8125rem;
      padding: 8px 18px;
    }
  }
  @media (max-width: 360px) {
    .difficulty-bar {
      gap: 3px;
    }
    .difficulty-btn {
      font-size: 0.625rem;
      padding: 4px 6px;
    }
    .action-btn {
      padding: 6px 4px;
    }
    .action-btn svg {
      width: 18px;
      height: 18px;
    }
    .action-btn span {
      font-size: 0.5625rem;
    }
    .numpad-btn {
      font-size: 0.9375rem;
      border-radius: 5px;
    }
    .numpad {
      gap: 2px;
    }
    .game-info-bar {
      gap: 12px;
    }
    .cage-sum {
      font-size: 0.4rem;
    }
    .sudoku-cell {
      font-size: 0.875rem;
    }
    .pencil-mark {
      font-size: 0.375rem;
    }
    .daily-day {
      width: 17px;
      height: 17px;
      font-size: 0.4375rem;
      border-width: 1px;
    }
    .header-inner {
      padding: 8px 6px;
      gap: 6px;
    }
    .mode-tab {
      font-size: 0.6875rem;
      padding: 4px 8px;
    }
    .logo {
      font-size: 0.875rem;
    }
  }
  .daily-challenge-banner {
    max-width: 520px;
    margin: 12px auto 0;
    padding: 0 16px;
  }
  .daily-challenge-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
  }
  .daily-challenge-inner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
  }
  .daily-info {
    flex: 1;
  }
  .daily-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }
  .daily-icon {
    opacity: 0.9;
    flex-shrink: 0;
  }
  .daily-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .daily-date {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
  }
  .daily-play-btn {
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 20px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    white-space: nowrap;
  }
  .daily-play-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
  }
  .daily-play-btn.completed {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    cursor: default;
    pointer-events: none;
  }
  .daily-play-btn.completed::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
    background: radial-gradient(circle, #fff 40%, transparent 40%);
  }
  .daily-calendar {
    display: flex;
    gap: 3px;
    padding: 10px 20px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: center;
    flex-wrap: wrap;
  }
  .daily-calendar::-webkit-scrollbar {
    display: none;
  }
  .daily-day {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-highlight);
    border: 1.5px solid transparent;
    transition: all var(--transition);
    flex-shrink: 0;
  }
  .daily-day.today {
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 700;
  }
  .daily-day.completed {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
  }
  .daily-day.future {
    opacity: 0.35;
  }
  .daily-back-bar {
    max-width: 520px;
    margin: 8px auto 0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }
  .daily-back-bar.hidden {
    display: none;
  }
  .daily-back-btn {
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
  }
  .daily-back-btn:hover {
    background: var(--color-highlight);
  }
  .daily-mode-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .daily-completed-message {
    max-width: 520px;
    margin: 12px auto;
    padding: 0 16px;
  }
  .daily-completed-message.hidden {
    display: none;
  }
  .daily-completed-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: var(--radius-lg);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
  }
  .daily-completed-inner svg {
    flex-shrink: 0;
    opacity: 0.9;
  }
}
@layer components {
  .trophy-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
  }
  .trophy-stat-card {
    flex: 1;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
  }
  .trophy-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
  }
  .trophy-stat-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
  }
  .trophy-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .trophy-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 200ms ease, transform 200ms ease;
    cursor: pointer;
  }
  .trophy-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
  }
  .trophy-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
  }
  .trophy-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .trophy-icon-wrap.earned {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  }
  .trophy-icon-wrap.locked {
    background: var(--color-highlight);
    border: 2px dashed var(--color-border);
  }
  .trophy-icon-wrap.in-progress {
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-highlight));
    border: 2px solid var(--color-primary);
  }
  .trophy-icon {
    width: 24px;
    height: 24px;
  }
  .trophy-icon-wrap.earned .trophy-icon {
    color: #fff;
  }
  .trophy-icon-wrap.locked .trophy-icon {
    color: var(--color-text-light);
    opacity: 0.4;
  }
  .trophy-icon-wrap.in-progress .trophy-icon {
    color: var(--color-primary);
  }
  .trophy-details {
    flex: 1;
    min-width: 0;
  }
  .trophy-month-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
  }
  .trophy-progress-text {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-bottom: 6px;
  }
  .trophy-progress-bar {
    height: 6px;
    background: var(--color-highlight);
    border-radius: 3px;
    overflow: hidden;
  }
  .trophy-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 500ms ease;
  }
  .trophy-progress-fill.earned {
    background: linear-gradient(90deg, #f59e0b, #d97706);
  }
  .trophy-progress-fill.in-progress {
    background: var(--color-primary);
  }
  .trophy-progress-fill.locked {
    background: linear-gradient(90deg, var(--color-text-light), var(--color-border));
  }
  .trophy-badge {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
  }
  .trophy-badge.earned {
    background: #fef3c7;
    color: #d97706;
  }
  .trophy-badge.in-progress {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }
  [data-theme="dark"] .trophy-badge.earned {
    background: #78350f;
    color: #fcd34d;
  }
  .trophy-expanded {
    display: none;
    padding: 0 20px 20px;
  }
  .trophy-card.expanded .trophy-expanded {
    display: block;
  }
  .trophy-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .trophy-cal-header {
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-light);
    text-align: center;
    padding: 4px 0;
  }
  .trophy-cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-highlight);
    gap: 1px;
    position: relative;
  }
  .trophy-cal-day.empty {
    background: transparent;
  }
  .trophy-cal-day.completed {
    background: var(--color-primary);
    color: #fff;
  }
  .trophy-cal-day.today {
    border: 2px solid var(--color-primary);
  }
  .trophy-cal-time {
    font-size: 0.4375rem;
    opacity: 0.7;
  }
  .trophy-cal-day.missed {
    border: 1.5px dashed var(--color-border);
    background: transparent;
  }
  .trophy-cal-day.clickable {
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
  }
  .trophy-cal-day.clickable:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
    transform: scale(1.1);
  }
  .trophy-cal-day.future {
    opacity: 0.25;
    cursor: default;
  }
  .daily-date-label {
    max-width: 520px;
    margin: 0 auto;
    padding: 6px 16px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
  }
  .trophy-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-light);
  }
  .trophy-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
    color: var(--color-text-light);
  }
  .trophy-empty h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
  }
  .trophy-empty p {
    font-size: 0.8125rem;
    line-height: 1.5;
  }
  @media (max-width: 420px) {
    .trophy-stats {
      gap: 8px;
    }
    .trophy-stat-card {
      padding: 12px 8px;
    }
    .trophy-stat-value {
      font-size: 1.375rem;
    }
    .trophy-stat-label {
      font-size: 0.5625rem;
    }
    .trophy-card-header {
      padding: 14px 14px;
      gap: 10px;
    }
    .trophy-icon-wrap {
      width: 40px;
      height: 40px;
    }
    .trophy-icon {
      width: 20px;
      height: 20px;
    }
    .trophy-month-name {
      font-size: 0.875rem;
    }
    .trophy-progress-text {
      font-size: 0.6875rem;
    }
    .trophy-badge {
      font-size: 0.5625rem;
      padding: 2px 6px;
    }
    .trophy-expanded {
      padding: 0 14px 14px;
    }
    .trophy-calendar {
      gap: 3px;
    }
    .trophy-cal-day {
      font-size: 0.5625rem;
      border-radius: 6px;
    }
    .trophy-cal-time {
      font-size: 0.375rem;
    }
  }
  @media (max-width: 360px) {
    .trophy-stats {
      flex-direction: column;
      gap: 6px;
    }
    .trophy-stat-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: left;
      padding: 10px 14px;
    }
    .trophy-stat-value {
      font-size: 1.25rem;
      order: 2;
    }
    .trophy-stat-label {
      order: 1;
      margin-top: 0;
    }
    .trophy-cal-header {
      font-size: 0.5rem;
    }
    .trophy-cal-day {
      font-size: 0.5rem;
    }
  }
}
@layer components {
  .print-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }
  .option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .option-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
  }
  .option-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pill {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-white);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 150ms ease;
  }
  .pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
  .pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
  }
  .option-row {
    display: flex;
    gap: 16px;
    align-items: center;
  }
  .option-row label {
    font-size: 0.8125rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }
  .option-row input[type="number"] {
    font-family: 'Inter', sans-serif;
    width: 60px;
    padding: 6px 10px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
    background: var(--color-white);
    color: var(--color-text);
  }
  .generate-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    cursor: pointer;
    transition: background 150ms ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
  }
  .generate-btn:hover {
    background: var(--color-primary-hover);
  }
  .preview-area {
    margin-top: 24px;
    display: none;
  }
  .preview-area.visible {
    display: block;
  }
  .preview-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
  }
  .print-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
  }
  .print-puzzle {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
  }
  .print-puzzle-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--color-text-light);
  }
  .print-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    border: 2px solid var(--color-border-block);
    aspect-ratio: 1;
  }
  .print-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    border: 0.5px solid var(--color-border);
    aspect-ratio: 1;
  }
  .print-cell.bl {
    border-left: 1.5px solid var(--color-border-block);
  }
  .print-cell.bt {
    border-top: 1.5px solid var(--color-border-block);
  }
  .print-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
  }
  .print-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .print-btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: none;
  }
  .print-btn-primary:hover {
    background: var(--color-primary-hover);
  }
  .print-btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
  }
  .print-btn-secondary:hover {
    background: var(--color-primary-light);
  }
  @media (max-width: 420px) {
    .pill {
      font-size: 0.6875rem;
      padding: 5px 10px;
    }
    .option-label {
      font-size: 0.75rem;
    }
    .option-row label {
      font-size: 0.75rem;
    }
    .generate-btn {
      font-size: 0.8125rem;
      padding: 10px 24px;
      width: 100%;
      justify-content: center;
    }
    .print-grid-wrapper {
      grid-template-columns: 1fr;
      gap: 16px;
    }
    .print-cell {
      font-size: 0.625rem;
    }
    .print-actions {
      flex-direction: column;
      gap: 8px;
    }
    .print-btn {
      font-size: 0.75rem;
      padding: 10px 16px;
      justify-content: center;
    }
  }
  @media (max-width: 360px) {
    .pill {
      font-size: 0.625rem;
      padding: 4px 8px;
    }
    .option-row {
      gap: 10px;
      flex-wrap: wrap;
    }
  }
  @media print {
    .header, .print-options, .generate-btn, .print-actions, .page-subtitle, .preview-title {
      display: none !important;
    }
    .page-main {
      padding: 0;
      max-width: 100%;
    }
    .page-title {
      font-size: 1rem;
      margin-bottom: 4px;
    }
    .print-grid-wrapper {
      gap: 16px;
    }
    .print-puzzle {
      border: none;
      padding: 8px;
      break-inside: avoid;
    }
  }
}
@layer components {
  .solver-grid-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    aspect-ratio: 1;
  }
  .solver-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    height: 100%;
    background: var(--color-white);
    border: 2.5px solid var(--color-border-block);
    border-radius: 8px;
    overflow: hidden;
  }
  .solver-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid var(--color-border);
    position: relative;
  }
  .solver-cell.bl {
    border-left: 2px solid var(--color-border-block);
  }
  .solver-cell.bt {
    border-top: 2px solid var(--color-border-block);
  }
  .solver-cell input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-given);
    background: transparent;
    caret-color: var(--color-primary);
  }
  .solver-cell input:focus {
    background: var(--color-primary-light);
  }
  .solver-cell input.solved-val {
    color: var(--color-user);
    font-weight: 700;
  }
  .solver-cell input.error-val {
    color: var(--color-error);
    background: var(--color-error-light);
  }
  .solver-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
  }
  .solver-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .solver-btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: none;
  }
  .solver-btn-primary:hover {
    background: var(--color-primary-hover);
  }
  .solver-btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1.5px solid var(--color-border);
  }
  .solver-btn-secondary:hover {
    background: var(--color-highlight);
  }
  .solver-btn-danger {
    background: transparent;
    color: var(--color-error);
    border: 1.5px solid var(--color-error);
  }
  .solver-btn-danger:hover {
    background: var(--color-error-light);
  }
  .solver-status {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 24px;
  }
  .solver-status.success {
    color: var(--color-success);
  }
  .solver-status.error {
    color: var(--color-error);
  }
  .solver-status.info {
    color: var(--color-text-light);
  }
  .solver-tips {
    margin-top: 24px;
    padding: 16px;
    background: var(--color-highlight);
    border-radius: 8px;
    border: 1px solid var(--color-border);
  }
  .solver-tips h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
  }
  .solver-tips ul {
    padding-left: 18px;
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.7;
  }
  @media (max-width: 420px) {
    .solver-grid-container {
      max-width: 100%;
    }
    .solver-cell input {
      font-size: 0.9375rem;
    }
    .solver-actions {
      gap: 8px;
    }
    .solver-btn {
      font-size: 0.8125rem;
      padding: 8px 16px;
      flex: 1;
      justify-content: center;
    }
    .solver-tips {
      padding: 12px;
    }
    .solver-tips ul {
      font-size: 0.75rem;
    }
  }
  @media (max-width: 360px) {
    .solver-cell input {
      font-size: 0.8125rem;
    }
    .solver-btn {
      font-size: 0.75rem;
      padding: 8px 12px;
    }
  }
}
@layer components {
  .category-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
  }
  .cat-tab {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-white);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 150ms ease;
  }
  .cat-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
  .cat-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
  }
  .articles-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .article-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 200ms ease, transform 200ms ease;
    cursor: pointer;
  }
  .article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
  }
  .article-card-inner {
    padding: 20px;
  }
  .article-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
  }
  .badge-beginner {
    background: #d1fae5;
    color: #059669;
  }
  .badge-intermediate {
    background: #dbeafe;
    color: #2563eb;
  }
  .badge-advanced {
    background: #fef3c7;
    color: #d97706;
  }
  .badge-expert {
    background: #fce7f3;
    color: #db2777;
  }
  [data-theme="dark"] .badge-beginner {
    background: #064e3b;
    color: #6ee7b7;
  }
  [data-theme="dark"] .badge-intermediate {
    background: #1e3a5f;
    color: #93c5fd;
  }
  [data-theme="dark"] .badge-advanced {
    background: #78350f;
    color: #fcd34d;
  }
  [data-theme="dark"] .badge-expert {
    background: #831843;
    color: #f9a8d4;
  }
  .article-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .article-excerpt {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 10px;
  }
  .article-meta {
    font-size: 0.6875rem;
    color: var(--color-pencil);
  }
  .article-expanded {
    display: none;
  }
  .article-card.expanded .article-expanded {
    display: block;
    padding: 0 20px 20px;
  }
  .article-card.expanded .article-excerpt {
    display: none;
  }
  .article-body {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.8;
  }
  .article-body h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--color-text);
  }
  .article-body p {
    margin-bottom: 12px;
  }
  .article-body ul, .article-body ol {
    padding-left: 20px;
    margin-bottom: 12px;
  }
  .article-body li {
    margin-bottom: 4px;
  }
  .article-body strong {
    color: var(--color-text);
  }
  .article-body .tip-box {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
    font-size: 0.8125rem;
  }
  .article-body .example-grid {
    display: inline-grid;
    grid-template-columns: repeat(3, 28px);
    grid-template-rows: repeat(3, 28px);
    border: 2px solid var(--color-border-block);
    margin: 8px 4px;
    vertical-align: middle;
  }
  .article-body .eg-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 0.5px solid var(--color-border);
  }
  .article-body .eg-cell.highlight {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }
  @media (max-width: 420px) {
    .category-tabs {
      gap: 4px;
      margin-bottom: 20px;
    }
    .cat-tab {
      font-size: 0.6875rem;
      padding: 5px 10px;
    }
    .article-card-inner {
      padding: 14px;
    }
    .article-title {
      font-size: 0.9375rem;
    }
    .article-excerpt {
      font-size: 0.75rem;
    }
    .article-body {
      font-size: 0.8125rem;
    }
    .article-body .tip-box {
      padding: 10px 12px;
      font-size: 0.75rem;
    }
    .article-body .example-grid {
      grid-template-columns: repeat(3, 24px);
      grid-template-rows: repeat(3, 24px);
    }
    .article-card.expanded .article-expanded {
      padding: 0 14px 14px;
    }
  }
  @media (max-width: 360px) {
    .cat-tab {
      font-size: 0.625rem;
      padding: 4px 8px;
    }
    .article-title {
      font-size: 0.875rem;
    }
    .article-badge {
      font-size: 0.5625rem;
    }
  }
}
@layer components {
  .page-main {
    max-width: 620px;
    margin: 0 auto;
    padding: 24px 16px 64px;
  }
  .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
  }
  .page-subtitle {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    margin-bottom: 24px;
    line-height: 1.5;
  }
  @media (max-width: 420px) {
    .page-main {
      padding: 16px 12px 48px;
    }
    .page-title {
      font-size: 1.25rem;
    }
    .page-subtitle {
      font-size: 0.8125rem;
      margin-bottom: 16px;
    }
  }
}
@property --tw-space-y-reverse {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}
@property --tw-font-weight {
  syntax: "*";
  inherits: false;
}
@property --tw-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-inset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-inset-shadow-color {
  syntax: "*";
  inherits: false;
}
@property --tw-inset-shadow-alpha {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 100%;
}
@property --tw-ring-color {
  syntax: "*";
  inherits: false;
}
@property --tw-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-inset-ring-color {
  syntax: "*";
  inherits: false;
}
@property --tw-inset-ring-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-ring-inset {
  syntax: "*";
  inherits: false;
}
@property --tw-ring-offset-width {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --tw-ring-offset-color {
  syntax: "*";
  inherits: false;
  initial-value: #fff;
}
@property --tw-ring-offset-shadow {
  syntax: "*";
  inherits: false;
  initial-value: 0 0 #0000;
}
@property --tw-duration {
  syntax: "*";
  inherits: false;
}
@layer properties {
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
    *, ::before, ::after, ::backdrop {
      --tw-space-y-reverse: 0;
      --tw-border-style: solid;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
      --tw-duration: initial;
    }
  }
}
