* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0f0f0f;
    color: #f1f1f1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#bingoInput {
background-color: #0f0f0f;
    color: #ffffff;
}

textarea {
  resize: none;
  padding: 5px;
  font-size: 15px;
}

#diceRoll {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

div {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center; 
}

#container {
  background: none;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: row;       /* Wymusza układ obok siebie (w poziomie) */
  justify-content: center;   /* Wyśrodkowuje oba kontenery na ekranie */
  gap: 2rem;                 /* Tworzy ładny odstęp między lewym a prawym divem */
  width: 100%;               /* Pozwala kontenerowi rozciągnąć się na szerokość */
  max-width: 1400px;          /* Zapobiega zbytniemu rozjechaniu się na wielkich ekranach */
}


div:hover {
    transform: translateY(-5px);
}

#middle {
  min-width: 400px;
}


#generateBingo {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

generateBingo:hover {
    background-color: #cc0000;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}

generateBingo:active {
    transform: scale(0.98);
}

generateBingo:disabled {
    background-color: #555555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

button#search {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

button#search:hover {
    background-color: #cc0000;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}

button#search:active {
    transform: scale(0.98);
}

button#search:disabled {
    background-color: #555555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

br {
    display: none;
}

a#link {
    display: inline-block;
    margin-top: 1.5rem;
    color: #3ea6ff;
    text-decoration: none;
    font-size: 1rem;
    word-break: break-all;
    line-height: 1.4;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-bottom 0.2s ease;
}

a#link:hover {
    color: #65b8ff;
    border-bottom: 1px solid #65b8ff;
}

a#link:empty {
    display: none;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 2rem;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.page-title .accent {
    color: #ff0000;
    position: relative;
}

.page-title .accent::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #ff0000;
    border-radius: 2px;
}

.autoplay-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #aaa;
    user-select: none;
    transition: color 0.2s ease;
}

.autoplay-container:hover {
    color: #fff;
}

.autoplay-container input {
    display: none;
}



.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 4px;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.autoplay-container input:checked ~ .checkmark {
    background-color: #ff0000;
    border-color: #ff0000;
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.autoplay-container input:checked ~ .checkmark::after {
    display: block;
}

a#link.spin-done {
    animation: popAndGlow 0.3s ease-out forwards; /* Przyspieszona z 0.5s */
}

@keyframes popAndGlow {
    0% {
        transform: scale(0.8);
        text-shadow: 0 0 20px #3ea6ff;
        color: #fff;
    }
    50% {
        transform: scale(1.1); /* Zmniejszony overshoot */
        text-shadow: 0 0 30px #3ea6ff, 0 0 10px #3ea6ff;
        color: #3ea6ff;
    }
    100% {
        transform: scale(1);
        text-shadow: none;
    }
}


#bingo-board {
  width: 100%;
  min-width: 700px;
}

/* Style dla planszy Bingo */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Siatka 5x5 */
    gap: 8px;
    margin-top: 1.5rem;
    width: 100%;
    min-width: 500px;
}

.bingo-cell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    aspect-ratio: 1 / 1; /* Idealne kwadraty */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5px;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, transform 0.1s;
}

.bingo-cell:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.02);
}

/* Stan po kliknięciu pola w bingo */
.bingo-cell.active {
    background: rgba(255, 0, 0, 0.4);
    border-color: #ff0000;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Mały fix dla Twojego błędnego selektora w CSS (brakowało kropki/hasha) */
#generateBingo:hover {
    background-color: #cc0000;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}
#generateBingo:active {
    transform: scale(0.98);
}