 /*
 2008 -  https://web.archive.org/web/20081216161345/http://www.vetopedia.pl/article87-1-Zespol_konskiego_ogona_.html
 grammarly - 24% AI 
 antip.la - 91% AI
 justdone.com - 66% AI 
 ai-detector.com - 75% AI
 getsolved.ai - 77% AI
 humalingo.com - 94% AI
 zerogpt.com - 76.5% AI
 paraphraser.io - 20% AI

 2005 https://web.archive.org/web/20050215155819/http://vetopedia.pl/index.php?news=25
 gramarly - 7% AI
 antip.la - 67% AI
 justdone.com - 83% AI
 ai-detector.com - only one free, after pay 119 monthly :-)
 getsolved.ai - 78% AI
 humalingo.com - 94% AI
 zerogpt.com - 27%
 paraphraser.io - 20% AI

 2005 https://web.archive.org/web/20081223045954/http://www.vetopedia.pl/article88-1-Wscieklizna.html
 gramarly - 16% AI
 antip.la - 99% AI
 justdone.com - 83% AI
 ai-detector.com - only one free
 getsolved.ai - 77% AI
 humalingo.com - 92% AI
 zerogpt.com - 80,5% AI
 paraphraser.io - 20% AI

 What?? AI content 2005? World record? Time traveler? 
 And now ladies and gentelman...!
 Test QwenAI generated text is only 20% AI! WTF? 
 Well, these systems can only check the weather. 
 They won’t get that wrong – there’s always going to be some sort of weather.


 */
 
 :root {
     --bg: #0f1420;
     --panel: #1a2233;
     --panel2: #20293d;
     --accent: #5ec9ff;
     --accent2: #ffd166;
     --ok: #5fd68b;
     --text: #e8edf5;
     --muted: #8a95ab;
     --cell-size: 90px;
     --cell-sizeW: 90px;
     --cell-sizeH: 90px;
     --text-dim: #dddddd;
     --cell-text-size: 0.55;
     --cell-bg: #ffffff;
     /*#20293d;  #ffffff; */
     --cell-color: #000000;
     /*#e8edf5;  #000000;*/
     --cell-selecting: #309227;
     /*#35da26; #309227; */
     /*--cell-selecting:#17ff02;*/
     --minwysokoscOkna: 550px;
 }

 body {
     background-color: #fefefe;
 }

#rotate-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    z-index: 9999;
    text-align: center;
    padding-top: 20%;
    font-family: sans-serif;
}

#rotate-warning svg {
    width: 200px;
    height: 200px;
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    #rotate-warning {
        display: block;
    }

    body {
        overflow: hidden;

    }
}

#mainTopScroll{
    min-height: var(--minwysokoscOkna);
}

 .header-title {
     font-size: 2rem;
     color: rgb(18, 55, 21);
     text-align: center;
     text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);

     font-weight: 700;
     /*font-size: clamp(1rem, 2.7rem, 1.4rem);*/
     letter-spacing: 0.08em;
 }


 .layout {
     display: flex;
     gap: 20px;
     width: 100%;
     max-width: 800px;
     flex-wrap: wrap;
     justify-content: center;
     align-items: flex-start;
 }

 .panel {
     background: var(--panel);
     border-radius: 12px;
     padding: 14px 16px;
     box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
 }

 .config {
     max-width: 800px;
 }

 .config-group {
     width: 100%;
     align-items: center;
     min-height: 50px;
 }
 .star-rating-container{
    min-height: 45px;
 }

 .select-group {
     flex: 1 1 250px;
     display: flex;
     flex-direction: column;
     gap: 4px;
 }

 .select-group-radio {
     flex-basis: calc(33% - 0.5rem);
     min-width: 150px;
 }

 .select-line {
     width: 100%;
     flex: 1;
 }

 select {
     appearance: none;
     background-color: #fff;
     border: 1px solid #ccc;
     border-radius: 6px;
     padding: 10px 36px 10px 12px;
     font-size: 14px;
     color: #333;
     background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://w3.org"><path d="M7 10l5 5 5-5z"/></svg>');
     background-repeat: no-repeat;
     background-position: right 10px center;
     cursor: pointer;
 }

 select:focus {
     border-color: #0066ff;
     outline: none;
 }

 .dropdown-menu {
     background: #e9e9e9;
     cursor: pointer;
 }

 .dropdown-item {
     color: #000000;
     font-weight: 600;
 }

 .dropdown-item:hover {
     color: #ffffff;
     background: #0d6efd;
 }

 .dropdown-toggle {
     color: #000000;
     font-weight: 700;
 }

 .dropdown-toggle span {
     padding-right: 10px;
 }

 textarea {
     width: 100%;
     min-height: 150px;
     background: var(--panel2);
     color: var(--text);
     border: 1px solid #34405c;
     border-radius: 8px;
     padding: 8px;
     font-family: monospace;
     font-size: 0.85rem;
     resize: vertical;
 }

 label {
     display: block;
     font-size: 1rem;
     color: #000000;
     margin: 10px 0 4px;
 }

 .select-group label,
 .filllabel 
 {
     font-weight: 600;
 }


 input[type=number] {
     background-color: #dedede;
     color: #222222;
     border: 1px solid #34405c;
     border-radius: 6px;
     padding: 6px 8px;
     width: 100%;
     font-weight: 700;
 }

 .status {
     font-size: 0.8rem;
     color: var(--muted);
     margin-top: 8px;
     line-height: 1.4;
 }

 .board-wrap {
     flex: 1 1 800px;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 16px;

 }

 .board-stage {
     position: relative;
     display: inline-block;
 }

 .config-wrap {
     margin-left: auto;
     margin-right: auto;
     align-items: center;
     gap: 16px;
     max-width: 700px;
 }

 .gridCotainer {
     position: relative;
     display: inline-block;
 }

 #gridCanvas {
     position: absolute;
     top: 0;
     left: 0;
     pointer-events: none;
     z-index: 2;
 }

 #lineCanvas {
     position: absolute;
     top: 0;
     left: 0;
     pointer-events: none;
     z-index: 5;
 }

 #wordCanvas {
     position: absolute;
     top: 0;
     left: 0;
     pointer-events: none;
     z-index: 8;
 }

 #finCanvas {
     position: absolute;
     top: 0;
     left: 0;
     pointer-events: none;
     z-index: 20;
 }

 .finCanvasActive{
    pointer-events: auto;
 }

 #grid {
     display: grid;
     gap: 2px;
     background: #34405c;
     padding: 2px;
     border-radius: 8px;
     user-select: none;
     touch-action: none;
 }

 .cell {
     width: var(--cell-size);
     height: var(--cell-size);
     background: var(--cell-bg);
     display: flex;
     align-items: center;
     justify-content: center;
     font-weight: 700;
     font-size: calc(var(--cell-size) * var(--cell-text-size));
     /*border-radius: 0px;*/
     cursor: pointer;
     color: var(--cell-color);
 }

 .podpowiedzColor {
     background: rgb(226, 18, 230) !important;
     background-color: rgb(226, 18, 230) !important;
 }

 .cell.selecting {
     /*background: #b1b1b1;*/
     color: var(--cell-selecting);
 }

 .cell.found {
     background: var(--ok);
     color: #08240f;
 }

 #wordlist {
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
     /*max-width: 900px;*/
     justify-content: center;
     transition: height 0.15s ease;
     min-height: 30px;
 }

 .word-chip {
     padding: 3px 6px;
     border-radius: 15px;
     font-size: 0.5rem;
     font-weight: 700;
     border: 1px solid #34405c;
     max-height: 28px;
 }

 .word-chip.img {
     pointer-events: none;
 }

 .word-chip.found {
     background: var(--ok);
     color: #08240f;
     text-decoration: underline;
 }

 .win-msg {
     color: var(--accent2);
     font-weight: 700;
     font-size: 1.1rem;
     display: none;
 }

 select {
     color: #222222;
     border: 1px solid #34405c;
     border-radius: 6px;
     padding: 6px 8px;
     width: 100%;
     font-weight: 700;
 }

 .optgroupstyle {
     font-weight: 700;
     color: #bc2525;
     font-style: normal;
 }


 #countdown-overlay {
     position: absolute;
     inset: 0;
     /*background: rgba(10, 10, 15, 0.22);*/
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     z-index: 200;
     pointer-events: none;
     opacity: 0;
     transition: all 0.8s cubic-bezier(0.175, 0.885, 0.320, 1.275);
     width: 100%;
     margin: 0 0 0;
 }

 #countdown-overlay.visible {
     opacity: 1;
     pointer-events: none;
     z-index: 200;
 }


 .countdown-num {
     font-size: clamp(3.5rem, 15vw, 8rem);
     font-weight: 900;
     color: white;
     line-height: 1;
     animation: pulse-num 2s ease-out;
     z-index: 500;
     pointer-events: none;
     text-shadow:
         -1px -1px 0 #000,
         1px -1px 0 #000,
         -1px 1px 0 #000,
         1px 1px 0 #000;
 }

 .countdown-label {
     font-size: 0.75rem;
     letter-spacing: 0.2em;
     text-transform: uppercase;
     color: var(--text-dim);
     margin-top: 12px;
     pointer-events: none;
 }

 @keyframes pulse-num {
     0% {
         transform: scale(0.1);
         opacity: 0;
     }

     40% {
         opacity: 1;
     }

     80% {
         opacity: 0.8;
     }


     100% {
         transform: scale(1.8);
         opacity: 0;
     }
 }

.small-kategory{
    font-size: 1.1rem;
    letter-spacing: 0px;
}

 @media (max-width: 768px) {
     .header-title {
         font-size: 0.85rem;
         margin-bottom: 0.5rem !important;
     }
     .small-kategory{
        font-size: 0.55rem;
     }
 }

 .checkboxItem {
     display: inline-flex;
     align-items: center;
     column-gap: 10px;
     line-height: 1;
     cursor: pointer;
 }

 .checkboxItem:not(:last-of-type) {
     margin-right: 16px;
 }

 .checkbox {
     appearance: none;
     position: relative;
     width: 30px;
     height: 30px;
     border: 4px solid #0746d5;
     border-radius: 11px;
     background-color: #ffffff;
     cursor: pointer;
 }

 .checkbox:checked {
     border: 3px solid #0fc91d;
     background-color: #18ba0d;
 }

 .checkbox:checked::after {
     content: "";
     position: absolute;
     top: 5px;
     left: 3px;
     width: 18px;
     height: 10px;
     border-bottom: 5px solid #ffffff;
     border-left: 5px solid #ffffff;
     transform: rotate(-45deg);
 }

 /* okno config */
 #config-overlay {
     position: absolute;
     inset: 0;
     background:linear-gradient(120deg, #ffffff 0%, #e1e1f4 100%);
     /* rgba(247, 245, 227, 0.88);*/
     
     display:block;
     z-index: 0;
     opacity: 0;
     pointer-events: none;
     margin-left: auto;
     margin-right: auto;
     max-width: 500px;
     height:fit-content;
     backdrop-filter: blur(10px);
     padding: 20px;
     margin-top: 60px;
     -webkit-box-shadow: 0px 0px 18px 7px rgba(0, 0, 0, 0.37);
     box-shadow: 0px 0px 18px 7px rgba(0, 0, 0, 0.37);
     border-radius: 20px;
     border: 7px solid #50c1ff;
    transition: all 1s cubic-bezier(0.175, 0.885, 0.320, 1.275);
 }

 #config-overlay.show {
     z-index: 50;
     opacity: 1;
     pointer-events: all;
 }

.my-custom-dropdown .btn{
    min-height: 25px;
  padding: 6px 10px;
  font-size: 15px;
  border-radius: 15px;
}

.osmismerka-art p,
.osmismerka-art ul li {
    font-size: 1.15rem;
}

#headerAnim{
    margin-left: auto;
    margin-right: auto;
}

.lotnisko-kontener {
  display: flex; /* Układa litery w jednej linii */
  /*font-family: sans-serif;*/ /* Zwykła czcionka proporcjonalna */
  font-size: 1.7rem;
  font-weight: 800;
}

/* Każde okienko na literę ma stałą szerokość */
.lotnisko-kontener span {
  display: inline-block;
  width: 20px; /* Sztywna szerokość okienka */
  text-align: center; /* Wyśrodkowanie litery w okienku */
  /*background: #222;*/ /* Opcjonalnie: tło jak na lotnisku */
  color: #030303;
  margin-right: 2px;
  border-radius: 4px;
  font-weight: 700;
}

/*****************************/
/** info window **************/
/*****************************/
.okienko {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /*transition: opacity 0.6s;*/
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.320, 1.275);
}
/* show */
#okienko.visible {
    pointer-events: auto;
}

/* inner */
.okienko .innerOkienko {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    width: min(80%, 600px);
    min-height: 30%;
    /*max-height: 90%;*/
    /*min-width: 50%;
    min-height: 30%;*/
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 32px 30px rgba(85, 84, 84, 0.7);
    color: #0a360a;
    overflow: hidden;
    opacity: 0;
    /*transition: opacity 0.6s;*/
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.320, 1.275);
}

#okienko.visible .innerOkienko {
    opacity: 1;
}

/* header */
.innerHeader {
    padding: 12px 16px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.innerHeader h3 {
    font-size: 1.6rem;
    font-weight: 500;
}

.innerContent h2 {
    font-size: 2rem;
    font-weight: 600;
}

/* content */
.innerContent {
    padding: 16px;
    flex-grow: 1;
    /* Zajmuje całe dostępne miejsce */
    overflow-y: auto;
    /* Jeśli treść za długa – przewijanie */
}

/* bottom */
.innerFooter {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    text-align: right;
    flex-shrink: 0;
}


@media screen and (max-width: 768px) {
    .innerHeader h3 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 600px) {
    .innerHeader h3 {
        font-size: 1.2rem;
    }

    .zaba {
        opacity: 0;
    }

    .task-container {
        padding-left: 0;
    }
}

@media screen and (max-width: 480px) {
    .innerHeader h3 {
        font-size: 1rem;
    }
}

/*
        @media screen and (min-width: 320px) {
            .content {}
        }
*/

.zaba {
    position: absolute;
    bottom: 0;
    left: 2%;
    width: 200px;
    aspect-ratio: 3/4;
    max-width: 300px;
    /*border: solid red 2px;*/
    z-index: 0;
    opacity: 1;
    pointer-events: none;
}

.zaba img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

  /* ── warstwa HTML z tekstami — osobna od canvasu ─────────────── */
  #game-root {
    position: relative;
    width: 480px; height: 640px;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }


  .gs-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
    pointer-events: auto;
    z-index: 8888;
  }
 
  .gs-overlay.gs-overlay-hide {
    animation: gsFadeOut 0.35s ease forwards;
  }
 
  .gs-title {
    margin: 0 0 6px;
    font-size: clamp(28px, 8vw, 44px);
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    opacity: 0;
    animation: gsPopIn 0.6s cubic-bezier(.2,1.4,.4,1) 0.15s forwards;
  }
 
  .gs-subtitle {
    margin: 0 0 28px;
    font-size: 15px;
    font-weight: 600;
    color: #ff6b6b;
    opacity: 0;
    animation: gsFadeUp 0.5s ease 0.4s forwards;
  }
 
  .gs-stats {
    width: 100%;
    max-width: 320px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 6px 20px;
    margin-bottom: 32px;
    opacity: 0;
    animation: gsFadeUp 0.5s ease 0.45s forwards;
  }
 
  .gs-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    opacity: 0;
    transform: translateX(40px);
    animation: gsSlideIn 0.45s cubic-bezier(.2,1.4,.4,1) forwards;
  }
  .gs-stat-row:last-child { border-bottom: none; }
 
  .gs-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.65);
  }
 
  .gs-value {
    font-size: 23px;
    font-weight: 800;
    text-shadow: 0 0 6px rgba(255,215,0,0.5);
  }
 
  .gs-buttons {
    display: flex; gap: 16px;
    opacity: 0;
    animation: gsPopIn 0.5s cubic-bezier(.2,1.4,.4,1) forwards;
  }
 
  .gs-btn {
    padding: 12px 28px;
    border-radius: 24px;
    border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  /*.gs-btn:hover { background: rgba(255,255,255,0.18); }*/
 
  .gs-btn-primary {
    border: none;
    background: linear-gradient(90deg, #FFD700, #FF6B6B);
    color: #111;
    box-shadow: 0 0 16px rgba(255,215,0,0.4);
  }

  .gs-btn-primary:hover { box-shadow: 0 0 22px rgba(255,215,0,0.6); }
 
  @keyframes gsPopIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
  }
  @keyframes gsFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes gsSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes gsFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
  }
 
@media screen and (max-width: 480px) {
    .gs-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    .gs-value {
        font-size: 15px;
    }
    .gs-stat-row{
        padding: 6px 0;
    }
}

/* przycisk restartu — CAŁKOWICIE poza modułem, na stałe pod planszą */
  #external-restart {
    position: fixed;
    bottom: 24px; left: 50%; transform: translateX(-50%);
    padding: 10px 22px;
    border-radius: 20px;
    border: none;
    background: #222;
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
  }
  #external-restart:hover { background: #333; color: #fff; }
 
  #log {
    position: fixed; top: 12px; left: 12px;
    color: #6f6; font: 12px monospace;
    white-space: pre;
  }

/* shine outline */
  .feh-shiny-button {
    position: relative;
    padding: 20px 32px;
    border-radius: 12px;
    color: #f8f9f8;
    /*font-size: 18px;
    font-weight: 500;*/
    text-decoration: none; 
    /*background: #1F1F1F;*/
    transition: all 0.3s ease;
}
.feh-border-mask {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 12px;
    width: 100%;
    height: 100%;
    padding: 1px;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) border-box;
    mask-composite: exclude;
}

.feh-border-glow {
    background: conic-gradient(from 0deg, transparent 0%, #f0f2f0 12%, #000, transparent 20%);
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    transform-origin: 0 0;
    animation: rotateShine 5s linear infinite;
}

@keyframes rotateShine {
    0% { 
        transform: rotate(0deg) translate(-50%, -50%);
    }
    100% { 
        transform: rotate(360deg) translate(-50%, -50%);
    }
} 