 :root {
   --tile: 48px;
   --game-max-width: min(650px, calc(100vw - 24px));

      --bg: #ececec;
      --wall-base: #d96759;
      --wall-line: #8e4e48;

      --target-main: #f2c318;
      --target-soft: rgba(242, 195, 24, 0.18);
      --target-glow: rgba(242, 195, 24, 0.45);

      --box-fallback: #c99756;
      --player-fallback: #7bb3e6;

      
      --ui: #0b84d8;
      --ui-dark: #0667a8;
      --text: #222;
      --panel: #f7f7f7;
      --shadow: rgba(0,0,0,.12);
    }


    .grafika-obal {
    position: relative;
    box-sizing: border-box;
    max-width: 720px;
    margin: 0;
    border-radius: 8px;
    background:var(--player-fallback);
    padding: 20px 5px;
    font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
 
}

.grafika-obal p {
    font-family: "Barlow", sans-serif;
    font-size: 17px;
    line-height: 1.7;
    padding: 20px 0;
    margin: 0;
    color: #fff;
}
 

@media (max-width: 600px) {
  :root {
    --game-max-width: calc(100vw - 16px);
  }
}

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0; 
      padding:0;
   
    }

    .wrap {
      width: 100%;
      max-width: 760px;
      text-align: center;
      padding-bottom: 15px;
    }

    h1 {
      margin: 0 0 10px;
      font-size: 28px;
      display: none;
    }

    .topbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      align-items: center;
      margin-bottom: 10px;
    }

    button {
      border: 0;
      background: var(--ui);
      color: white;
      padding: 10px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: bold;
      border: 2px solid #fff;
      box-shadow: 0 0 0px 2px #000;
    }

    button:hover {
      background: var(--ui-dark);
    }

   .meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 500px;
    margin: 12px auto;
    font-size: 15px;
    background: var(--panel);
    border-radius: 4px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px var(--shadow);
}

    .meta-item strong {
      margin-left: 4px;
    }

    .game-frame {
      width: 100%;
      display: flex;
      justify-content: center;
    }

    .start-screen__text {
      color: #fff;
    }

    #game {
      display: inline-grid;
      gap: 0;
      background: var(--bg);
      padding: 10px;
      box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset, 0 3px 10px var(--shadow);
      user-select: none;
      width: fit-content;
      max-width: var(--game-max-width);
      border-radius: 4px;
      touch-action: manipulation;
    }

    .tile {
      width: var(--tile);
      height: var(--tile);
      position: relative;
      background: var(--bg);
      overflow: hidden;
    }

    .void {
      background: transparent;
    }

    .floor {
      background: var(--bg);
    }

    .wall {
      background-color: var(--wall-base);
      background-image: url("./assets/cihly.png");
      background-size: cover;
      background-position: center;
      background-repeat:
        no-repeat;
    }

    .target::before {
      content: "";
      position: absolute;
      inset: 6px;
      background: var(--target-soft);
      border-radius: 4px;
      z-index: 1;
      pointer-events: none;
    }

    .target::after {
      content: "";
      position: absolute;
      inset: 7px;
      border: 3px dashed var(--target-main);
      border-radius: 3px;
      box-shadow: 0 0 6px var(--target-glow);
      z-index: 2;
      pointer-events: none;
    }

    .target-inner {
      position: absolute;
      inset: 13px;
      border: 2px dashed rgba(242, 195, 24, 0.95);
      border-radius: 2px;
      z-index: 2;
      pointer-events: none;
    }

    .box {
      position: absolute;
      inset: 4px;
      z-index: 3;
      border-radius: 6px;
      
      background-image: url("./assets/bedna.png");
      background-size: 100% 100%, contain;
      background-position: center, center;
      background-repeat: no-repeat, no-repeat;
   /*   box-shadow: inset 0 0 0 2px rgba(0,0,0,.08);*/
    }
/*
    .box::before,
    .box::after {
      content: "";
      position: absolute;
      left: 22%;
      right: 22%;
      top: 50%;
      height: 3px;
      background: rgba(120, 77, 28, 0.45);
      transform: translateY(-50%) rotate(45deg);
      border-radius: 2px;
      pointer-events: none;
    }

    .box::after {
      transform: translateY(-50%) rotate(-45deg);
    }
*/
    .box.on-target {
      box-shadow:
        inset 0 0 0 2px rgba(0,0,0,.08),
        0 0 0 4px rgba(242, 195, 24, 0.75),
        0 0 12px rgba(242, 195, 24, 0.45);
    }

    .player {
      position: absolute;
      inset: 4px;
      z-index: 4;
      border-radius: 50%;
   
      background-image:    var(--player-image, none);
      background-size: contain;
      background-position: center;
      background-repeat: no-repeat ;
   
    }
 

    .controls {
      margin-top: 14px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
    }

    .controls button {
      min-width: 54px;
      min-height: 46px;
      font-size: 18px;
    }

    .hint {
      margin-top: 10px;
      font-size: 14px;
      color: #444;
    }

    .overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.45);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      z-index: 999;
    }

    .overlay.show {
      display: flex;
    }

    .modal {
      width: min(420px, 100%);
      background: white;
      border-radius: 14px;
      padding: 22px 18px;
      box-shadow: 0 12px 40px rgba(0,0,0,.22);
      text-align: center;
    }

    .modal h2 {
      margin: 0 0 10px;
      font-size: 26px;
    }

    .modal p {
      margin: 8px 0;
      line-height: 1.45;
    }

    .modal-actions {
      margin-top: 16px;
      display: flex;
      gap: 8px;
      justify-content: center;
      flex-wrap: wrap;
    }




    .start-screen {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
   background: var(--player-fallback);
  transition:
    transform 0.6s ease,
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.start-screen:after {
    content: "";
    display: block;
    position: absolute;
    top: 40px;
    right: 50px;
    width: 36px;
    height: 36px;
    z-index: 15;
    background-size: cover;
    background-image: url(./assets/aktualne-logo.svg);
}

.start-screen__inner {
   
  width: 100%;
  text-align: center;
  background: var(--player-fallback);
  border-radius: 8px;
  padding: 10px  ;
  color: #fff;
  
}

.start-screen__logo {
  max-width:100%;
  height: auto;
  display: block;
  margin: 0 auto ;
    border-radius: 8px;
}

.start-screen__title {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1;
  color: #ffffff;
  text-shadow: 2px 2px 0 #fff;
}

.start-screen__text {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.4;
  color: #222;
}

#successOverlay p{
  color: #222;
}

 

.start-screen.hide {
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.grafika-obal {
  position: relative;
  overflow: hidden;
}

 




    @media (max-width: 600px) {



      .start-screen:after {
 
    top: 15px;
    right: 15px;
     
}


    .start-screen {
  
  padding: 24px 0;
   
}


      body {
        padding: 10px;
      }

      h1 {
        font-size: 22px;
      }

      button {
        padding: 9px 12px;
        font-size: 13px;
      }

      .meta {
        font-size: 14px;
        gap: 10px;
      }

      .hint {
        font-size: 13px;
      }
    }