:root {
    --color1: #d22a52;
    --color2: #1ea2aa;
    --socket-color: #dedede;
  }
  
  #takuzu {
    position: relative;
  }
  
  #takuzu .board {
    --board-size: 0;
    display: grid;
    grid-template-columns: repeat(var(--board-size), 1fr);
    gap: 3px;
    padding: 0.5em;
    max-width: 600px;
    margin-inline: auto;
    -webkit-tap-highlight-color: transparent;
  }
  
  #takuzu #errors {
    display: flex;
    gap: 8px;
    flex-direction: column;
    font-family: sans-serif;
    background-color: #ED350D;
    color: white;
    font-weight: 500;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 100%);
    padding: 1em 2em;
    border-radius: .5em;
    box-shadow: 4px 6px 13px -1px #4e4e4e;
    opacity: 0;
    transition: opacity 0.3s ease-out, top .3s ease-out;
    width: min(100%,500px);
    z-index: -1;
  }
  #takuzu #errors li{
    line-height: 1.4;
  }
  #takuzu #errors.show {
    z-index: 8;
    opacity: 1;
    bottom: -20px;
  }
  #takuzu #board[solved="true"] {
    position: relative;
    pointer-events: none;
  }
  
  #takuzu #board:after {
    content: "Nyertél!";
    display: flex;
    font-size: clamp(2em,5vw,3em);
    font-family: sans-serif;
    width: min(480px,100%);
    height: 20%;
    opacity: 0;
    transition: opacity .5s, top .5s ;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 10;
    background: rgb(255, 255, 255);
    justify-content: center;
    align-items: center;
    box-shadow: 2px 2px 13px -1px #5a5a5a;
    border-radius: 100vw;
  }
  
  #takuzu #board[solved="true"]:after {
    opacity: 1;
    top: 50%;
    transition: opacity 1s .7s, top 1s .5s;
    transform: translate(-50%, -50%);
  }
  
  #takuzu .board .block {
    display: block;
    position: relative;
    background-color: var(--socket-color);
    border-radius: 20%;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.1s;
  }
  
  #takuzu .board .block[data-type="1"]:after,
  #takuzu .board .block[data-type="2"]:after {
    content: "";
    position: absolute;
    width: 90%;
    height: 12%;
    border-radius: 1em;
    background-color: rgba(83, 83, 83, 0.2);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }
  
  #takuzu .board .block[data-locked="true"] {
    cursor: not-allowed;
  }
  
  #takuzu .board .block[data-locked="true"]:before {
    content: "";
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    opacity: 0.3;
    background-image: url("https://ocdn.eu/kiskegyed/games/prod/takuzu/lock.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 50%;
    height: 50%;
  }
  
  #takuzu .board .block[data-type="1"] {
    background-color: var(--color1);
  }
  
  #takuzu .board .block[data-type="2"] {
    background-color: var(--color2);
  }
  
  #takuzu .controls-group {
    display: flex;
    gap: 1em;
    max-width: 400px;
    margin-inline: auto;
    justify-content: space-between;
    margin-bottom: 1.5em;
  }
  
  #takuzu .controls button {
    border: 2px solid #d22a52;
    padding: 10px;
    color: #d22a52;
    border-radius: 5px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    background-color: transparent;
    transition: background-color .2s, color .2s;
    position: relative;
  }
  
  #takuzu .controls button[disabled] {
    cursor: not-allowed;
    border: 2px solid rgb(99, 99, 99);
    color: rgb(99, 99, 99);
  }
  
  #takuzu .controls button:not([disabled]):hover {
    color: white;
    background-color: #d22a52;
  }
  
  #takuzu dialog {
    font-family: sans-serif;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 95%;
    max-width: 800px;
    background-color: white;
    transform: translate(-50%, -50%);
    z-index: 10;
    border-radius: 16px;
    box-shadow: 4px 6px 13px -1px #b3b3b3;
    border: none;
    padding: 2em;
  }
  
  #takuzu dialog form {
    height: 100%;
    display: flex !important;
    flex-direction: column;
    text-align: center;
  }
  
  #takuzu dialog .dialog-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 1em;
  }
  
  #takuzu dialog p {
    font-size: 1.4em;
    margin-top: .5em;
  }
  
  #takuzu dialog .block {
    width: 50px !important;
    height: 50px !important;
  }
  
  #takuzu .blocks-container {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-block: .5em;
  }
  
  #takuzu .wrong {
    position: relative;
  }
  
  #takuzu .wrong:after {
    content: "X";
    color: red;
    font-size: 5em;
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0px 0px 8px #4e4e4e;
  }
  
  #takuzu dialog button {
    border: 2px solid #d22a52;
    padding: .5em 2.5em;
    color: white;
    border-radius: 5px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    background-color: #d22a52;
    transition: background-color .2s, color .2s;
    position: relative;
    margin-top: 2em;
    margin-inline: auto;
  }
  
  #takuzu dialog button:hover {
    background-color: white;
    color: #d22a52;
  }