@font-face {
    font-family: 'PFDinTextCondPro-Bold';
    src: url('fonts/PFDinTextCondPro-Bold.ttf') format('truetype');
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: black;
    font-family: 'PFDinTextCondPro-Bold', sans-serif;
}

html,
body {
    overflow: hidden !important;
}

.main-menu {
    background-image: url('assets/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align to top for predictable positioning */
    z-index: 0;
}

.side-bar {
    position: absolute;
    top: 0;
    height: 100vh;
    width: auto;
    object-fit: contain;
    z-index: 1;
}

.left-bar {
    left: 0;
}

.right-bar {
    right: 0;
}

.menu-line {
    position: absolute;
    top: 3%;
    /* Poprawa z ~3/4 na 3% */
    left: 0;
    width: 100vw;
    height: 18px;
    /* Thickness of line.webp */
    background: url('assets/line.webp') repeat-x center;
    background-size: contain;
    z-index: 100;
    pointer-events: none;
}

/* Container holding Banner and Selection Panel */
.content-container {
    position: absolute;
    top: calc(3% + 17px);
    /* Przyklejone do dolnej krawedzi line.webp we wnetrzu */
    left: 50%;
    transform: translateX(-50%);
    transform-origin: top center;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    /* keep them centered when resizing */
    max-width: none;
    gap: 0;
    transition: transform 0.3s;
    z-index: 10;
    height: calc(97vh - 17px);
    /* Stala dostepna wysokosc */
}

.menu-wrapper {
    position: relative;
    height: 100%;
    display: inline-block;
    z-index: 50;
    /* Gwarantuje przykrycie panelu wyborów */
}

.center-menu {
    display: block;
    height: 100%;
    width: auto;
}

.button-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}

.menu-button {
    position: absolute;
    width: 39.72%;
    height: 5.56%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button {
    top: calc(43.61% - 11.12%);
    left: 50%;
    transform: translate(-50%, -50%);
}

.test-menu-button {
    top: calc(49.44% - 11.12%);
    left: 50%;
    transform: translate(-50%, -50%);
}

.discord-menu-button {
    top: calc(55.27% - 11.12%);
    left: 50%;
    transform: translate(-50%, -50%);
}

.info-menu-button {
    top: calc(61.10% - 11.12%);
    left: 50%;
    transform: translate(-50%, -50%);
}

.hover-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Tag jest img, wiec to pyli */
    display: none;
}

.menu-button:hover .hover-frame {
    display: block;
}

.menu-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #c7a76e;
    font-size: 2.5rem;
    text-transform: uppercase;
    z-index: 4;
}

.menu-label-play {
    position: absolute;
    top: calc(43.61% - 11.12%);
    transform: translateY(-50%);
    font-size: 3.4vh;
}

.menu-label-test {
    position: absolute;
    top: calc(49.44% - 11.12%);
    transform: translateY(-50%);
    font-size: 3.4vh;
}

.menu-label-discord {
    position: absolute;
    top: calc(55.27% - 11.12%);
    transform: translateY(-50%);
    font-size: 3.4vh;
}

.menu-label-info {
    position: absolute;
    top: calc(61.10% - 11.12%);
    transform: translateY(-50%);
    font-size: 3.4vh;
}

/* Side Panel - Wybor trybów */
.side-panel {
    max-width: 0;
    height: 100%;
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.5s ease;
    display: flex;
    margin-left: 0;
    position: relative;
    z-index: 10;
}

.side-panel.active {
    max-width: none;
    /* Rozwijamy auto na widoczne */
    opacity: 1;
    margin-left: -100px;
}

.wybor-mode-container {
    position: relative;
    display: inline-block;
    height: 100%;
}

.wybor-bg {
    display: block;
    height: 100%;
    width: auto;
    z-index: 1;
    position: relative;
}

.wybor-pixel-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    z-index: 2;
}

/* Karuzela kafelków rozlana, celujemy w Y=29 dla linii dzielnika */
.mode-carousel {
    position: absolute;
    top: -20px;
    /* Przesunięcie w górę tak, by środek dzielnika był na ~29px */
    left: 300px;
    width: 930px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    z-index: 50;
}

.kafelek-wrapper {
    width: 135px;
    /* Skorygowane aby "nożyce" sięgały bliżej dzielnika */
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    transition: width 0.3s, overflow 0.3s;
    position: relative;
    justify-content: center;
}

.kafelek-wrapper:has(.carousel-kafelek:hover),
.kafelek-wrapper:has(.carousel-kafelek.active) {
    overflow: visible;
    /* Wyłączamy nożyce dla wybranych/najechanych */
    width: 140px;
    z-index: 150 !important;
}

.carousel-kafelek {
    width: 140px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s, z-index 0s, margin 0.2s;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

.carousel-kafelek:hover {
    z-index: 100 !important;
    transform: scale(1.15) translateY(-5px);
}

.carousel-kafelek.active {
    transform: scale(1.3) translateY(-8px);
    z-index: 90 !important;
    filter: brightness(1.2);
}

.carousel-kafelek-hover-text {
    position: absolute;
    top: 105px;
    /* Wyraźnie pod ikoną */
    left: 50%;
    transform: translateX(-50%);
    color: #c7a76e;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 8px;
    border: 1px solid #c7a76e;
    display: none;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
}

.carousel-kafelek:hover .carousel-kafelek-hover-text {
    display: block;
}

.dzielnik-img {
    height: auto;
    width: auto;
    user-select: none;
    pointer-events: none;
    z-index: 110;
    /* Dzielnik zawsze na wierzchu ("nożyce") */
    margin: 0 -15px;
    /* Ściskanie dzielnika */
}

/* Opis 281, 146 x 738, 326 */
.mode-desc {
    position: absolute;
    left: 281px;
    top: 146px;
    width: 457px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #c7a76e;
    font-size: 1.8rem;
    padding: 10px;
    box-sizing: border-box;
    white-space: pre-line;
}

/* Obrazek 845, 153 x 1141, 322 */
.mode-image {
    position: absolute;
    left: 845px;
    top: 153px;
    width: 296px;
    height: 169px;
    z-index: 5;
    /* Poniżej karuzeli i opisów pod trybami */
}

.mode-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pasek na dole - Kontener na oba paski */
.mode-bottom-container {
    position: absolute;
    left: 282px;
    top: 346px;
    /* Startowa pozycja pierwszego paska */
    width: 922px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Odstęp między paskami */
}

.mode-bottom {
    position: relative;
    width: 100%;
}

.pasek-bg {
    width: 100%;
    height: auto;
    display: block;
}

/* Kod: po lewej, DOŁĄCZ po prawej */
.code-generator {
    position: absolute;
    left: -8px;
    top: 2px;
    width: 459px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.lobby-code {
    color: #c7a76e;
    font-size: 2.2rem;
}

.reload-btn {
    height: 40px;
    cursor: pointer;
    transition: 0.5s;
}

.reload-btn:hover {
    opacity: 0.8;
}

.reload-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

.join-area {
    position: absolute;
    left: 469px;
    top: 2px;
    width: 453px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #c7a76e;
    font-size: 1.8rem;
}

/* Sekcja nicków w drugim pasku */
.nickname-setup-area {
    position: absolute;
    left: -8px;
    top: 2px;
    width: 459px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nickname-setup-area input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #c7a76e;
    color: #c7a76e;
    font-size: 1.8rem;
    padding: 5px 10px;
    font-family: inherit;
    width: 320px;
    text-align: center;
    outline: none;
}

.nickname-setup-area input.nickname-faded {
    opacity: 0.5;
}

.save-nick-btn {
    height: 35px;
    filter: sepia(100%) saturate(300%) hue-rotate(10deg);
}

.opponent-nickname-area {
    position: absolute;
    left: 469px;
    top: 2px;
    width: 453px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #c7a76e;
    font-size: 2.2rem;
}

.icon-btn {
    height: 30px;
    cursor: pointer;
    transition: 0.3s;
    filter: sepia(100%) saturate(300%) hue-rotate(10deg);
}

.icon-btn:hover {
    transform: scale(1.1);
    filter: sepia(100%) saturate(500%) hue-rotate(10deg) brightness(1.2);
}

.input-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.join-area input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #c7a76e;
    color: #c7a76e;
    font-size: 1.8rem;
    padding: 5px 30px 5px 10px;
    font-family: inherit;
    width: 140px;
    text-align: center;
    outline: none;
}

.join-area.locked {
    opacity: 0.3;
    pointer-events: none;
}

.inner-paste-btn {
    position: absolute;
    right: 5px;
    height: 20px;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0.6;
    filter: sepia(100%) saturate(300%) hue-rotate(10deg);
}

.inner-paste-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Przycisk Fullscreen */
.fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 3000;
    transition: transform 0.2s;
    filter: sepia(100%) saturate(200%);
}

.fullscreen-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-btn:hover {
    transform: scale(1.1);
}

/* Ostrzeżenie mobilne */
.mobile-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    /* Pokazywane przez JS */
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #c7a76e;
    padding: 20px;
}

.warning-box {
    border: 2px solid #c7a76e;
    padding: 30px;
    background: #111;
    max-width: 400px;
}

.warning-box p {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.warning-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.warning-box button {
    background: transparent;
    border: 1px solid #c7a76e;
    color: #c7a76e;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
}

.warning-box button:hover {
    background: rgba(199, 167, 110, 0.2);
}

.gold-btn {
    background: #c7a76e !important;
    color: #000 !important;
    font-weight: bold;
}

/* Toast System */
#toast-container {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: #c7a76e;
    padding: 8px 16px;
    margin-top: 5px;
    border: 1px solid #c7a76e;
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    text-transform: uppercase;
}

.toast.show {
    opacity: 1;
}

/* Setup actions ponizej paska y ~ 420 */
.player-entry-area {
    position: relative;
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 20;
}

.countdown-text {
    font-size: 3rem;
    color: #c7a76e;
    height: 40px;
    font-family: 'PFDinTextCondPro-Bold', serif;
}

.player-entry-area input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #c7a76e;
    color: #c7a76e;
    padding: 10px;
    font-size: 1.5rem;
    font-family: inherit;
    outline: none;
}

.entry-buttons-row {
    display: flex;
    gap: 40px;
    /* Większy odstęp dla bezpieczeństwa */
    align-items: center;
}

.game-btn {
    background: transparent;
    border: 1px solid #c7a76e;
    color: #c7a76e;
    padding: 10px 20px;
    font-size: 1.5rem;
    font-family: inherit;
    cursor: pointer;
    transition: 0.3s;
}

.game-btn:hover {
    background: rgba(199, 167, 110, 0.2);
}

.status-indicator {
    color: #c7a76e;
    font-size: 1.5rem;
}



/* Info Screen */
.info-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('assets/background2.jpg');
    background-size: cover;
    background-position: center;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.info-container {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    width: 85%;
    max-width: 1100px;
    height: 85vh;
    border: 2px solid #c7a76e;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.info-content {
    color: #eee;
    overflow-y: auto;
    flex: 1;
    padding-right: 20px;
}

.info-footer {
    margin-top: 20px;
    text-align: right;
}

.simple-btn {
    background: transparent;
    border: 1px solid #666;
    color: #aaa;
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
}

.simple-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Lobby States */
.side-setup-footer {
    position: relative;
    width: 100%;
}

.concept-overlay {
    position: absolute;
    top: 346px;
    /* Nad całym footerem */
    left: 282px;
    width: 922px;
    height: 400px;
    /* Dość wysokie aby zakryć całość */
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    /* Pokazywane via JS */
    align-items: center;
    justify-content: center;
    pointer-events: all;
    backdrop-filter: grayscale(1) blur(2px);
}

.concept-text {
    color: #c7a76e;
    font-size: 3rem;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 1), 0 0 20px #c7a76e;
    font-family: inherit;
    padding: 20px;
}

.beta-status {
    color: #ffd700;
    font-size: 1.2rem;
    text-transform: uppercase;
    margin-top: 5px;
    display: none;
    /* Pokazywane via JS */
    text-align: center;
    text-shadow: 1px 1px 2px #000;
}

.status-indicator-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-top: 2px solid #c7a76e;
    padding: 20px;
    z-index: 10000;
    display: none;
    /* Pokazywane przez JS */
    box-sizing: border-box;
}

.cookie-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #c7a76e;
    font-size: 1.4rem;
    text-transform: uppercase;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
}

@media (max-width: 800px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}