@font-face {
    font-family: "TitleFont";
    src: url(/build/fonts/blox-brk.regular.45efeb9f.ttf) format("truetype");
}

:root {
    --color-text:           #000000;
    --color-text-dark:      #1a1a1a;
    --color-white:          #ffffff;

    --border-radius-sm:     0.3rem;
    --border-radius-md:     0.6rem;
    --border-radius-lg:     0.9rem;

    --shadow-card:          0 0.6rem 1.9rem rgba(0, 0, 0, 0.3);
    --shadow-card-color:    0 0.3rem 0.9rem rgba(90, 15, 15, 0.2);

    --transition-base:      transform 0.25s ease, box-shadow 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

a{
    text-decoration: none;
    color: inherit;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--color-white);
    background-image: radial-gradient(circle, #8c8c8c 1.2px, transparent 1.2px);
    background-size: 15px 15px;
    color: var(--color-text);
    font-family: 'Roboto', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-container {
    background: transparent;
    text-align: center;
    overflow-x: hidden;
    margin: 0 auto;
    padding: 0 1rem;
    flex: 1 0 auto;
    max-width: 90rem;
    width: 100%;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
    width: 100%;
    margin: 0 auto;
    max-width: 80rem;
}

@media (max-width: 900px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        max-width: 25rem;
        margin: 0 auto;
    }
}

.title {
    font-family: "TitleFont", sans-serif;
    display: inline-block;
    font-size: 8rem;
    color: #000000;
    font-weight: 400;
    margin: 1.5rem 0;
    user-select: none;
}

.title-wave {
    display: inline-block;
}

.title-wave span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.title-wave span:nth-child(1)  { animation-delay: 0s; }
.title-wave span:nth-child(2)  { animation-delay: 0.2s; }
.title-wave span:nth-child(3)  { animation-delay: 0.4s; }
.title-wave span:nth-child(4)  { animation-delay: 0.6s; }
.title-wave span:nth-child(5)  { animation-delay: 0.8s; }
.title-wave span:nth-child(6)  { animation-delay: 1s; }
.title-wave span:nth-child(7)  { animation-delay: 1.2s; }
.title-wave span:nth-child(8)  { animation-delay: 1.4s; }
.title-wave span:nth-child(9)  { animation-delay: 1.6s; }
.title-wave span:nth-child(10) { animation-delay: 1.8s; }
.title-wave span:nth-child(11) { animation-delay: 2s; }
.title-wave span:nth-child(12) { animation-delay: 2.2s; }
.title-wave span:nth-child(13) { animation-delay: 2.4s; }
.title-wave span:nth-child(14) { animation-delay: 2.6s; }
.title-wave span:nth-child(15) { animation-delay: 2.8s; }
.title-wave span:nth-child(16) { animation-delay: 3s; }
.title-wave span:nth-child(17) { animation-delay: 3.2s; }

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@media (max-width: 1090px) {
    .title {
        font-size: 6rem;
    }
}

@media (max-width: 830px) {
    .title {
        font-size: 4rem;
    }
}

@media (max-width: 560px) {
    .title {
        font-size: 3rem;
    }
}

@media (max-width: 430px) {
    .title {
        font-size: 2rem;
    }
}

.game-container {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 5;
    border-radius: var(--border-radius-lg);
    background-color: var(--color-white);
    box-shadow:
        var(--shadow-card),
        var(--shadow-card-color);
    transition: var(--transition-base);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    text-decoration: none;
}

a.game-container {
    cursor: pointer;
}

div.game-container {
    cursor: default;
}

.game-container:hover {
    transform: scale(1.02);
}

.game-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.site-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.6rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-white);
    border-top: 0.15rem solid var(--color-text-dark);
    margin-top: auto;
}

.footer-center {
    margin: 0;
    text-align: center;
    color: var(--color-text-dark);
}

.footer-contact {
    position: absolute;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0.2rem 0;
    margin: 0;
    color: var(--color-text-dark);
    cursor: pointer;
    line-height: 1.2;
    transition: color 0.2s ease;
}

.footer-right {
    position: absolute;
    right: 1.5rem;
    margin: 0;
    color: var(--color-text-dark);
    line-height: 1.2;
}

.footer-contact::after,
.footer-right::after{
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--color-text-dark);
    transition: width 0.22s ease-in-out;
}

.footer-contact:hover::after,
.footer-contact:focus-visible::after,
.footer-right:hover::after,
.footer-contact:focus-visible::after {
    width: 100%;
}

.footer-contact:focus-visible, .footer-right:focus-visible {
    outline: 2px dashed var(--color-text-dark);
    outline-offset: 3px;
}

.sherlock-btn {
    position: absolute;
    right: clamp(4rem, 16vw, 18rem);
    bottom: calc(100% - 10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    z-index: 10;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.sherlock-img {
    display: block;
    width: 8.5rem;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    filter: drop-shadow(0 -2px 5px rgba(0, 0, 0, 0.1));
}

.sherlock-bubble {
    position: absolute;
    bottom: calc(100% + 4px);
    background-color: var(--color-white);
    color: var(--color-text-dark);
    border: 1.5px solid var(--color-text-dark);
    border-radius: var(--border-radius-sm);
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 2px 2px 0 var(--color-text-dark);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.85);
    transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 20;
}

.sherlock-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: var(--color-text-dark) transparent transparent transparent;
}

.sherlock-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sherlock-btn.is-bouncing .sherlock-img {
    animation: sherlock-boop 0.45s ease;
}

@keyframes sherlock-boop {
    0%   { transform: translateY(0); }
    30%  { transform: translateY(-7px) scale(1.05, 0.95); }
    60%  { transform: translateY(-1px); }
    80%  { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}

@media (max-width: 900px) {
    .sherlock-btn {
        right: 10rem;
    }

    .footer-contact, .footer-right {
        position: static;
    }
    .site-footer {
        flex-direction: column-reverse;
        gap: 0.6rem;
        padding: 0.8rem 1rem;
    }

    .sherlock-img {
        width: 7.2rem;
    }
}

@media (max-width: 600px) {
    .sherlock-btn {
        right: 10rem;
        bottom: calc(100% - 13px);
    }

    .sherlock-img {
        width: 7rem;
    }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 1rem;
}

.modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--color-white);
    border: 0.15rem solid var(--color-text-dark);
    border-radius: var(--border-radius-md);
    width: 100%;
    max-width: 27rem;
    box-shadow: 4px 4px 0 var(--color-text-dark);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    text-align: left;
}

.modal-backdrop.is-active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    border-bottom: 0.12rem solid var(--color-text-dark);
    background-color: #fafafa;
}

.modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-dark);
    letter-spacing: 0.5px;
}

.modal-close-btn {
    background: transparent;
    border: 1.5px solid var(--color-text-dark);
    border-radius: var(--border-radius-sm);
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-dark);
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    background-color: var(--color-text-dark);
    color: var(--color-white);
}

.modal-body {
    padding: 1.2rem;
}

.modal-intro {
    margin: 0 0 0.8rem 0;
    color: var(--color-text-dark);
    line-height: 1.4;
}

.modal-link {
    font-weight: 600;
    color: var(--color-text-dark);
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.modal-link:hover {
    opacity: 0.7;
}

.text-m {
    font-size: 0.85rem;
}

.text-s {
    font-size: 0.65rem;
}

.typo-writer, a {
    font-family: "Courier New", Courier, monospace;
}

.text-center {
    text-align: center;
}

.site-container.error-page {
    display: flex;
    flex-direction: column;
}

.error-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 4rem;
}

.errorText {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.6;
    max-width: 80rem;
    margin: 0 auto;
    font-family: 'Roboto', Arial, sans-serif;
}


