/* =====================================================
   FONT
===================================================== */
@font-face {
    font-family: 'GiorgioSans';
    src: url('../font/GiorgioSans-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* =====================================================
   RESET / BASE
===================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    font-family: 'GiorgioSans', sans-serif;
    color: #fff;
}

/* =====================================================
   LETTERBOX CONTAINER
===================================================== */
/*
  Bazowe proporcje: 9:16 (pion)
  Letterbox = skalowanie + czarne pasy
*/
#app {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000;
    z-index: -1;
}

/* =====================================================
   SCREEN BASE
===================================================== */
.screen {
    position: absolute;
    width: 100vmin;
    height: calc(100vmin * (16 / 9));
    max-height: 100vh;
    max-width: calc(100vh * (9 / 16));
    aspect-ratio: 9 / 16;

    display: none;
    overflow: hidden;
}

.screen-active {
    display: block;
}

/* =====================================================
   FULLSCREEN IMAGE (START / END)
===================================================== */
.fullscreen-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =====================================================
   VIDEO BACKGROUND
===================================================== */
.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* =====================================================
   MAIN OVERLAY (LOGOS PNG)
===================================================== */
.overlay-main {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

/* =====================================================
   UI LAYERS
===================================================== */
.ui-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding-bottom: 2vh;
}

.hidden {
    display: none !important;
}

/* =====================================================
   COUNTDOWN
===================================================== */
.ui-title {
    font-size: 5vh;
    margin-bottom: 3vh;
    text-transform: uppercase;
}

.ui-countdown-number {
    font-size: 15vh;
    line-height: 1;
}

/* =====================================================
   GAME UI
===================================================== */
.ui-top {
    position: absolute;
    top: 3vh;
    width: 100%;
    text-align: center;
    font-size: 3vh;
}

.ui-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ceb2ad80;
    padding: 3vh;
    /*border: 2px solid red;*/
    border-radius:1vh;
}

.ui-reps {
    font-size: 18vh;
    line-height: 1;
}

.ui-reps-label {
    margin-top: 0vh;
    font-size: 4vh;
    letter-spacing: 0.3vh;
    
}

/* =====================================================
   RESULT SCREEN
===================================================== */
.result-overlay {
    position: absolute;
    z-index: 2;
    top: 39vh;
    left: 8.8vw;
    /* albo right / bottom */
    display: flex;
    flex-direction: column;
    /*align-items: center;*/
    /*text-align: center;*/
}

.result-title {
    font-size: 6vh;
    margin-bottom: 4vh;
}

.result-score {
    font-size: 5.9vh;
}

.result-score span {
    /*display: block;*/
    /*font-size: vh;*/
    /*margin-top: 2vh;*/
}

/* =====================================================
   SETTINGS BUTTON (BOTTOM RIGHT)
===================================================== */
#settings-button {
    position: absolute;
    right: 0vh;
    bottom: 0vh;
    width: 3vh;
    height: 3vh;
    z-index: 3;
    cursor: pointer;
}

#settings-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* =====================================================
   SETTINGS PANEL
===================================================== */
#settings-panel {
    position: absolute;
    right: 2vh;
    bottom: 10vh;
    width: 40vh;
    max-width: 90%;
    padding: 2vh;

    background: rgba(0, 0, 0, 0.85);
    border: 0.2vh solid rgba(255, 255, 255, 0.3);
    border-radius: 1.5vh;

    z-index: 6;
    font-size: 2vh;
}

.settings-header {
    font-size: 3vh;
    margin-bottom: 2vh;
    text-align: center;
}

.settings-section {
    margin-bottom: 2vh;
}

.ui-time{
    font-size:4vh;
}

.settings-section canvas {
    width: 100%;
    height: 8vh;
    background: #111;
    margin-bottom: 1vh;
}

#connect-btn {
    width: 100%;
    padding: 1.5vh;
    font-size: 2.2vh;
    background: #fff;
    color: #000;
    border: none;
    cursor: pointer;
    font-family: 'GiorgioSans', sans-serif;
}

/* =====================================================
   CONNECTION INDICATOR
===================================================== */

#connection-indicator {
    position: absolute;
    left: 1vh;
    bottom: 1vh;

    width: 0.5vh;
    height: 0.5vh;
    border-radius: 50%;

    z-index: 9999;              /* 🔥 ponad video i overlay */
    
    /*background: #ffffff;         🔴 DOMYŚLNIE RED */
    box-shadow:
        0 0 1vh rgba(255, 255, 255, 0.8),
        0 0 2vh rgba(255, 255, 255, 0.5);
}

.conn-ok {
    background: #00ff66;
    box-shadow:
        0 0 1vh rgba(0, 255, 102, 0.9),
        0 0 2vh rgba(0, 255, 102, 0.6);
}

.conn-bad {
    background: #ff3333;
    box-shadow:
        0 0 1vh rgba(255, 255, 51, 0.9),
        0 0 2vh rgba(255, 255, 51, 0.6);
}

/* Wszystkie ekrany domyślnie niewidoczne */
#screen-start,
#screen-game,
#screen-result {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--screen-transition-ms, 400ms) ease;
}

/* Aktywny ekran – widoczny */
#screen-start.screen-active,
#screen-game.screen-active,
#screen-result.screen-active {
  opacity: 1;
  pointer-events: auto;
}
