.device-mobile {
   /* height: calc(var(--vh, 1vh) * 100); */
}

.device-desktop {}

.mode-pwa {
/*   padding-top: 0;
   brak paska przeglądarki */
}

.mode-browser {
   /* padding-top: 56px; */
}
html,
body {
    height: 100%;
    margin: 0;
}
body {
    min-height: 100vh;
    overflow-y: auto;
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: 0.5px;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
background: radial-gradient(circle at 20% 20%, #363f4b 10%, #493a2c 70%);
    background-attachment: fixed;
    user-select: none;
    touch-action: manipulation;
}

:root {
    --primary: transparent;
    --secondary: red;
    /* Kolor dla ClearPosition */
    --focus: green;
    /* Kolor po najechaniu */
    --light: #ffeeee;
    /* Jasny kolor tekstu */
    --border-color: #bdc3c7;
    /* Kolor obramowania */
    --color: #5a5e61;
}
.main {
  flex: 1;
  padding-top: 50px;
  color: var(--light);
  margin: 0;
  overflow-y: auto;
  position: relative;
}
.premium-icon {
    color: #00e1ff; /* błękit */
    margin-right: 5px;
    text-shadow:
        0 0 5px #00e1ff,
        0 0 10px #00c8ff,
        0 0 15px rgba(0, 225, 255, 0.6);
}
.info {
    font-size: 20px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #000;
    width: fit-content;
}

.user-game,
.useropponent-game {
    max-width: 800px;
    height: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

.user-game {
    margin-top: 10px;
}

.useropponent-game {
    margin-bottom: 15px;
}
.user-info-wrapper,
.useropponent-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.user-info,
.useropponent-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-image,
.useropponent-image {
    width: 50px;
    height: 50px;
}
.username-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 6px;
}

.username, .username-opponent {
    font-size: 16px;
    font-weight: bold;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    /* NIE POZWALA SIĘ ZMNIEJSZAĆ */
}

#taskResult {
    font-weight: bold;
    font-size: 16px;
    color: green;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center; 
    justify-content: center;
    line-height: 1;
}
.user-timegame,
.useropponent-timegame {
    padding: 0.3rem 1rem;
    font-family: inherit;
    letter-spacing: .2rem;
    border: 1px solid var(--border-color);
    border-radius: 100rem;
    color: var(--light);
    background: transparent;
    transition: .2s;
    text-align: center;
}
.user-timegame.time-warning {
    background-color: #c62828;
    color: #fff;
}
.user-timegame {
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

/* setne sekundy */
.user-timegame .time-ms {
    font-size: 0.65em;        /* mniejsze niż MM:SS */
    letter-spacing: 0.05rem; /* mniej rozstrzelone */
    opacity: 0.85;
    margin-top: -0.15em;     /* lekkie podniesienie */
}

/* ostatnie 10 sekund */
.user-timegame.time-warning {
    background-color: #c62828;
    color: #fff;
}

/* setne w warningu jeszcze czytelne */
.user-timegame.time-warning .time-ms {
    opacity: 1;
}
.fire-icon {
    color: transparent;
    position: relative;
    /* potrzebne dla absolutnego pozycjonowania flasha */
    display: inline-block;
    margin-left: 4px;
}

/* Ikona ognia */
.fire-icon i {
    transition: transform 0.3s ease;
}

/* Kolory w zależności od stanu */
.fire-icon-low {
    color: #ff9800;
    /* pomarańczowy */
}

.fire-icon-high {
    color: #e53935;
    /* czerwony */
}

/* Animacja powiększenia */
@keyframes fire-bonus-anim {
    0% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.2) translateY(-5px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

.fire-bonus-anim {
    animation: fire-bonus-anim 1s ease forwards;
}

/* Rozbłysk */
.fire-bonus-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(229, 57, 53, 0.8) 0%, rgba(229, 57, 53, 0) 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    pointer-events: none;
    animation: fire-flash 0.6s ease forwards;
    z-index: -1;
    /* za ikoną */
}

@keyframes fire-flash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.5);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}
/* Styl standardowy */
.chessboard-standard {
    background-image: url(../img/board-background-standard.png);
}

.chessboard-standard .white-label {
    fill: #f0d9b5;
}

.chessboard-standard .black-label {
    fill: #b58863;
}

.chessboard-standard.flip .white-label {
    fill: #b58863;
    /* Kolor tekstu na białym tle po obrocie */
}

.chessboard-standard.flip .black-label {
    fill: #f0d9b5;
    /* Kolor tekstu na czarnym tle po obrocie */
}

/* Styl green */
.chessboard-green {
    background-image: url(../img/board-background-green.png);
}

.chessboard-green .white-label {
    fill: #e1e3ac;
}

.chessboard-green .black-label {
    fill: #779556;
}

.chessboard-green.flip .white-label {
    fill: #779556;
}

.chessboard-green.flip .black-label {
    fill: #e1e3ac;
}

/* Styl orange */
.chessboard-orange {
    background-image: url(../img/board-background-orange.png);
}

.chessboard-orange .white-label {
    fill: #ffe6c7;
}

.chessboard-orange .black-label {
    fill: #fd8d0d;
}

.chessboard-orange.flip .white-label {
    fill: #fd8d0d;
}

.chessboard-orange.flip .black-label {
    fill: #ffe6c7;
}

/* Styl marmur */
.chessboard-stone {
    background-image: url(../img/board-background-stone.png);
}

.chessboard-stone .white-label {
    fill: #f0f1f0;
}

.chessboard-stone .black-label {
    fill: #6d6d6d;
}

.chessboard-stone.flip .white-label {
    fill: #6d6d6d;
}

.chessboard-stone.flip .black-label {
    fill: #f0f1f0;
}
/* Styl fiolet */
.chessboard-purple {
    background-image: url(../img/board-background-purple.png);
}

.chessboard-purple .white-label {
    fill: #f0f1f0;
}

.chessboard-purple .black-label {
    fill: #8476ba;
}

.chessboard-purple.flip .white-label {
    fill: #8476ba;
}

.chessboard-purple.flip .black-label {
    fill: #f0f1f0;
}
/* Styl czerwony */
.chessboard-red {
    background-image: url(../img/board-background-red.png);
}

.chessboard-red .white-label {
    fill: #f5dbc3;
}

.chessboard-red .black-label {
    fill: #bb5746;
}

.chessboard-red.flip .white-label {
    fill: #bb5746;
}

.chessboard-red.flip .black-label {
    fill: #f5dbc3;
}
.chessboard-icy-sea {
    background-image: url(../img/board-background-icy-sea.png);
}
/* Styl lodowy */
.chessboard-icy-sea .white-label {
    fill: #d4dfe5;
}

.chessboard-icy-sea .black-label {
    fill: #7094a9;
}

.chessboard-icy-sea.flip .white-label {
    fill: #7094a9;
}

.chessboard-icy-sea.flip .black-label {
    fill: #d4dfe5;
}

/* Styl piekiełko */
.chessboard-hell {
    background-image: url(../img/board-background-hell.png);
}
.chessboard-hell .white-label {
    fill: #e2e2e2;
}
.chessboard-hell .black-label {
    fill: #cfcfcf;
}
.chessboard-hell.flip .white-label {
    fill: #cfcfcf;
}

.chessboard-hell.flip .black-label {
    fill: #e2e2e2;
}
/* Styl drewno */
.chessboard-wood {
    background-image: url(../img/board-background-wood.png);
}
.chessboard-wood .white-label {
    fill: #e2e2e2;
}
.chessboard-wood .black-label {
    fill: #cfcfcf;
}
.chessboard-wood.flip .white-label {
    fill: #cfcfcf;
}

.chessboard-wood.flip .black-label {
    fill: #e2e2e2;
}
/* Styl blue */
.chessboard-blue {
    background-image: url(../img/board-background-blue.png);
}
.chessboard-blue .white-label {
    fill: #aac9de;
}
.chessboard-blue .black-label {
    fill: #44799f;
}
.chessboard-blue.flip .white-label {
    fill: #44799f;
}

.chessboard-blue.flip .black-label {
    fill: #aac9de;
}
.draggable {
    cursor: grab;
}

.highlight-start,
.highlight-end {
    fill: rgba(251, 255, 0, 0.3);
}

.highlight {
    outline: 3px solid rgb(241, 242, 245) !important;
    outline-offset: -3px;
    z-index: 15;
    position: relative;
    width: 75px;
    height: 75px;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    pointer-events: auto;
}

.temp-color {
    position: relative;
    z-index: 12;
    /* Wyższy z-index, aby temp-color było na wierzchu */
}

.temp-arrow, .temp-arrowhead {
    position: relative;
    pointer-events: none;
}
.piece {
    position: absolute;
    background-size: cover;
    background-position: center;
    cursor: grab;
    transition: transform 0.5s ease;
}
.piece:active {
    cursor: grabbing;
}
/* Style do ruchów i ataków */
.possibleMoveCircle {
    fill: rgba(1, 26, 60, 0.247);
    /* Półprzezroczysty kolor */
    /* Brak obramowania */
    pointer-events: none;
    /* Zablokowanie interakcji z okręgiem */
    z-index: 12;
}

.possibleAttackCircle {
    fill: none;
    stroke: rgba(1, 26, 60, 0.247);
    stroke-width: 5px;
    pointer-events: none;
    /* Umożliwia pozycjonowanie pseudo-elementu wewnątrz kwadratu */
    z-index: 12;
}

.possibleCheckCircle {
    fill: rgba(177, 3, 3, 0.1);
    stroke: transparent;
    stroke-width: 5px;
    pointer-events: none;
    /* Umożliwia pozycjonowanie pseudo-elementu wewnątrz kwadratu */
    z-index: 12;
    /* Glow efekt (mocny, neonowy styl) */
    filter: drop-shadow(0 0 3px rgba(255, 0, 0, 0.9)) drop-shadow(0 0 3px rgba(255, 80, 80, 0.8)) drop-shadow(0 0 3px rgba(255, 120, 120, 0.7));
}

/* Koniec */
/* Dodany styl dla option-labels plus ikony */
.option-labels {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
}

.no-interaction {
  pointer-events: none;
}

.option-icon {
  position: relative;
  width: 20px;
  margin-left: 10px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #f2f2f2;
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Efekt hover (desktop) */
.option-icon:hover {
  color: var(--focus);
  transform: translateY(-0.2rem);
}

/* Efekt aktywny (mobile, sterowany JS) */
.option-icon.active {
  color: var(--focus);
  transform: translateY(-0.2rem);
}

/* Tooltip */
.option-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  transform-origin: bottom center;
}

/* Pokazanie tooltipa (hover lub aktywne na mobile) */
.option-icon:hover::after,
.option-icon.show-tooltip::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Stylizacja paska przewijania dla #pgn */
#pgn::-webkit-scrollbar {
    height: 8px;
}

#pgn::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

#pgn::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

#pgn::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
/* Stylizacja kontrolek */
#pgn-controls {
    display: flex;
    justify-content: center;   /* równe wyśrodkowanie */
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    margin-top: 4px;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* aktywacja */
#savePGN,
#pgn-controls.active {
    opacity: 1;
    pointer-events: auto;
}

#pgn-controls button {
    all: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 60px;   /* równa szerokość */
    height: 32px;
    border: 1px solid #aaa;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* hover tylko gdy aktywne */
#savePGN,
#pgn-controls.active button:hover {
    background-color: #ddd;
}
.move-number {
    color: gray;
}
.white-move,
.black-move {
    cursor: pointer;
    letter-spacing: 1.5px;
}
.game-result {
    grid-column: 1 / -1;
    text-align: left;
}
#fen {
    width: 100%;
    color: #f2f2f2;
    margin: 3 auto;
    font-family: inherit;
    letter-spacing: .2rem;
    font-size: small;
    overflow-x: auto;
    white-space: nowrap;
     /*  border: 1px solid #aaa;
    border-radius: 6px;   */
    padding: 10px;

    box-sizing: border-box;
    /* Uwzględnia padding w szerokości */
}

/* Stylizacja paska przewijania */
#fen::-webkit-scrollbar {
    height: 8px;
    /* Wysokość paska przewijania */
}

#fen::-webkit-scrollbar-thumb {
    background-color: #888;
    /* Kolor uchwytu paska */
    border-radius: 4px;
    /* Zaokrąglone rogi uchwytu */
    transition: background-color 0.3s ease;
}

#fen::-webkit-scrollbar-thumb:hover {
    background-color: #555;
    /* Kolor uchwytu po najechaniu */
}

#fen::-webkit-scrollbar-track {
    background: #f1f1f1;
    /* Tło paska przewijania */
    border-radius: 4px;
    /* Zaokrąglone rogi tła */
}

/* Stylowanie chmurki */
.copy-icon {
    font-size: 1.3rem;
    cursor: pointer;
    color: #007bff;
    position: relative;
    float: right;
}

.copy-icon:hover {
    color: var(--focus);
    transform: translateY(-.2rem);
}

/* Stylowanie chmurki */
.tooltip {
    font-size: 1.6vh;
    font-family: inherit;
    letter-spacing: .2rem;
    position: absolute;
    top: 100%;
    /* Pozycjonowanie poniżej ikony */
    right: 50%;
    transform: translateX(-10%);
    background: var(--primary);
    color: #fff;
    padding: auto;
    visibility: hidden;
    opacity: 0;
    z-index: 10;
    white-space: nowrap;
    /* Zapobiega zawijaniu tekstu */
}

/* Wyświetl chmurkę podczas najechania na ikonę */
.copy-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Dodajemy animację dla pokazania chmurki po kliknięciu */
.tooltip.show {
    visibility: visible;
    opacity: 1;
}

#gamestatus {
    height: 30px;
    color: var(--light);
}


/* Przyciski */
/* Zmiana koloru przycisku, gdy najechano */
button:hover,
button:focus {
    border-color: var(--focus);
    transform: translateY(-.2rem);
}

.close {
    color: var(--secondary);
    float: right;
    font-size: 2.4rem;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: var(--focus);
    text-decoration: none;
    cursor: pointer;
    transform: translateY(-.2rem);
}

button {
    padding: 1rem 1rem;
    font-size: 1.1rem;
    font-family: inherit;
    letter-spacing: .2rem;
    border: 1px solid var(--border-color);
    border-radius: 100rem;
    color: var(--light);
    background: transparent;
    cursor: pointer;
    transition: .2s;
    text-align: center;
    margin: 0.5rem;
    /* Dodanie odległości między przyciskami */
}
/* Mały przycisk (small) */
.btn-sm {
  font-size: 12px;
  padding: 4px 8px;
  min-width: 60px;
}

/* Lekko większy przycisk (large-medium - lm) */
.btn-lm {
  font-size: 16px;
  padding: 10px 18px;
  min-width: 90px;
}
#promotionBox {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    border-radius: 5px;
    padding: 5px 0;
}
#promotionBox img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#closePromotionBox {
    position: absolute;
    top: -25px;
    left: 0;
    width: 100%;
    height: 25px;
    font-size: 16px;
    text-align: center;
    line-height: 25px;
    cursor: pointer;
    color: black;
    background-color: white;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}
.promotion-selection {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    align-items: center;
}
.selectSquare {
    width: 100%;
    flex: 1;
    /* automatycznie 1/4 wysokości boxa */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* białe tło w kształcie koła */
    background-color: rgba(105, 105, 105, 0.9);
    border-radius: 50%;
    margin: 2px 0;
}
.selectSquare img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}
.lang-flag {
    width: 20px;
}
#task {
    margin: 5px;
}

.button-disabled {
  text-decoration: line-through;
  opacity: 0.5;
  pointer-events: none;
}