:root {
    font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 400;
    color-scheme: light dark;
    background-color: #f5f5f5;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    color: #333;
  }

  .game-container {
    max-width: 485px;
    background: white;
    justify-content: center;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  .header {
    text-align: center;
  }
  
  .controls {
    min-width: 350px;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .activeMenuControl {
    background-color: #d21976;
    color: white;
  }
  
  .activeMenuControl:hover {
    background-color: #7c15c0;
  }
  
  .board {
    max-width: 485px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #344861;
    padding: 2px;
    border: 3px solid #344861;
  }
  
  /* Styles for very small screens */
  @media (max-width: 350px) {
    .board {
      margin: 3 auto;
      align-items: center;
      width: calc(100vw - 6px);
      height: auto;
    }
  }

  @media (max-height: 350px) {
    .board {
      margin: 3 auto;
      align-items: center;
      width: auto;
      height: calc(100vh - 6px);
    }
  }

  .cell {
    max-width: 50px;
    max-height: 50px;
    min-height: 50px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    user-select: none;
    color: #2196f3;
    border: 1px solid #e0e0e0;
  }
  
  .cell.initial.played.wrong-move {
      animation: wrongMoveInfinite 1s ease infinite alternate;
      animation-iteration-count: infinite;
  }
  
  @keyframes wrongMoveInfinite {
      0% {
          background-color: #ff9999;
          color: #d50000;
          transform: scale(1);
      }
      100% {
          background-color: #ff3737;
          color: #b30000;
          transform: scale(1.1);
      }
  }

  .cell.initial {
    font-weight: bold;
    background: #f8f9fa;
    color: #333;
    cursor: not-allowed;
  }

  .cell.initial.played {
    color: rgb(0, 217, 255);
  }

  .cell.selected {
    background: #e3f2fd;
  }
  
  .cell.highlighted {
    background: #f5f5f5d7;
  }
  
  .cell.same-number {
    background: #e3f2fdd5;
  }

  .cell.marked1 {
    background-color: rgb(211, 211, 211);
  }

  .cell.marked2 {
    background-color: rgb(150, 150, 150);
  }

  .cell.marked3 {
    background-color: rgb(238, 255, 0);
  }

  .hint.same-number {
    background-color: #47e261d5;
  }

  .hint.same-number.strike {
    background-color: #c0e0c6d5;
  }

  .hints {
    position: absolute;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: auto;
  }
  
  .cell:hover .hints,
  .cell.show-hints .hints {
    display: grid;
  }

  .cell:hover {
    transform: scale(1.2);
    z-index: 1;
  }

  .cell:has(.hint) .cell-content {
    background-color: #ADD8E6;
  }
  
  .hint {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1976d2;
    font-weight: 500;
    font-size: 0.9rem;
    width: 100%;
    height: 100%;
    cursor: pointer;
    line-height: 1;
  }
  
  .hint:hover {
    background: #e3f2fd;
    color: #1565c0;
  }
  
  h1 button.hidden-text {
    font-family: inherit;
    background: none;
    color: #333;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    text-align: center;
    vertical-align: inherit;
  }

  h1 button.hidden-text:hover {
    background: none;
  }

  button, select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background: #1976d2;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    vertical-align: middle;
  }

  button:active, select:active {
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    transform: translateY(2px);
  }

  #pause-button {
    background: #1976d2;
    padding-left: 5px;
    padding-right: 2px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  
  button:hover {
    background: #1565c0;
  }

  button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
  }

  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
  }

  .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
  }

  input:checked+.slider {
    background-color: #2196F3;
  }

  input:checked+.slider:before {
    transform: translateX(14px);
  }
    
  select {
    background: white;
    color: #333;
    border: 1px solid #ccc;
  }
  
  .mistakes {
    font-weight: bold;
    color: #d32f2f;
  }
  
  /* 3x3 box borders */
  .cell:nth-child(3n) {
    border-right: 2px solid #344861;
  }
  
  .cell:nth-child(9n) {
    border-right: none;
  }
  
  .cell:nth-child(n+19):nth-child(-n+27),
  .cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #344861;
  }

  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: none;
  }

  .modal-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(3px);
    z-index: 10;
    border: 2px solid rgba(0, 0, 0, 0.2);
  }

  #message-modal {
    font-size: 24px;
    margin-bottom: 20px;
    animation: jump-out 2s ease-out;
    animation-fill-mode: forwards;
    opacity: 0;
    transform: scale(1);
  }

  #game-result {
    font-size: 48px;
    margin-bottom: 20px;
    animation: jump-out 1s ease-out;
    animation-fill-mode: forwards;
    opacity: 0;
    transform: scale(1);
  }

  .top-scores span p {
    font-weight: bold;
  }

  @keyframes jump-out {
    0% {
      opacity: 0;
      transform: scale(1);
    }

    20% {
      opacity: 1;
    }

    99% {
      opacity: 0;
      transform: scale(2);
    }

    100% {
      opacity: 1;
      transform: scale(1);
    }
  }