:root {
    --border-color: #000;
    --bg-color: #fff;
    --text-color: #000;
    --checked-bg: #000;
    --checked-text: #fff;
    --grid-gap: 4px;
    /* Slightly tighter gap for cleaner look */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px;
    /* Restore perspective */
}

header {
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    transform: rotate(-3deg);
    /* Restore header tilt */
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: var(--grid-gap);
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 4px solid var(--border-color);
    background-color: var(--border-color);
    box-shadow: 15px 15px 0px rgba(0, 0, 0, 0.8);
    /* Deeper shadow for 3D effect */

    /* Restore Tilted/Oblique Look */
    transform: rotate(-2deg) skew(-1deg);
    transition: transform 0.3s ease;
}

/* On hover, maybe straighten it slightly? Or not, to keep the effect static. */

.cell {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.1;
    /* Tighter line height for packing text */
    user-select: none;
    transition: all 0.1s ease;
    overflow: hidden;
    hyphens: auto;
    word-break: break-word;

    /* Unified Font Size */
    /* Much smaller to fit long text like 'zufällig jemanden gesehen...' */
    font-size: clamp(0.35rem, 1.8vw, 0.65rem);
    padding: 1px;
    /* Minimal padding */
}

.cell:hover {
    background-color: #f0f0f0;
}

.cell:active {
    background-color: #e0e0e0;
}

.cell.checked {
    background-color: var(--checked-bg);
    color: var(--checked-text);
}

/* Logo Cell Styling (Specific for the Joker) */
.cell.logo-cell {
    background-color: #000;
    color: #fff;
    cursor: default;
    padding: 2px;
}

.cell.logo-cell:hover,
.cell.logo-cell:active {
    background-color: #000;
}

.pruef-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2px solid white;
    padding: 2px;
}

.pruef-logo span {
    display: block;
    line-height: 0.9;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
}

.pruef-logo .top-text {
    font-size: 1.4em;
    /* Relative to cell font size */
    border-bottom: 2px solid white;
    padding-bottom: 2px;
    margin-bottom: 2px;
    width: 90%;
}

.pruef-logo .bottom-text {
    font-size: 0.7em;
    display: flex;
    flex-direction: column;
}

/* Dynamic font sizing classes applied by JS */
.cell.text-xl {
    font-size: 0.9rem;
}

.cell.text-lg {
    font-size: 0.75rem;
}

.cell.text-md {
    font-size: 0.60rem;
}

.cell.text-sm {
    font-size: 0.50rem;
}

.cell.text-xs {
    font-size: 0.45rem;
    letter-spacing: -0.02em;
}

.cell.checked {
    background-color: var(--checked-bg);
    color: var(--checked-text);
}

.cell.checked .highlight {
    background-color: transparent;
    color: white;
}


/* Highlight certain words */
.highlight {
    font-weight: 900;
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .cell.text-xl {
        font-size: 1.2rem;
    }

    .cell.text-lg {
        font-size: 1rem;
    }

    .cell.text-md {
        font-size: 0.85rem;
    }

    .cell.text-sm {
        font-size: 0.7rem;
    }

    .cell.text-xs {
        font-size: 0.6rem;
    }
}

#bingo-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #000;
    color: #fff;
    padding: 30px 50px;
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 0;
    /* Square corners */
    border: 5px solid #fff;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.2);
    z-index: 100;
    pointer-events: none;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hidden {
    display: none;
}

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

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

footer {
    margin-top: 25px;
    font-weight: bold;
    text-align: center;
}

footer a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 2px solid black;
}

#reset-btn {
    margin-top: 50px;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 900;
    background-color: white;
    color: black;
    border: 3px solid black;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 1);
    transition: transform 0.1s, box-shadow 0.1s;
}

#reset-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 1);
}

#reset-btn:active {
    transform: translate(0, 0);
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 1);
}