@import 'star-rating.min.css';

:root {
    --color-red: #E1251B;
    --color-green: #00A651;
    --color-yellow: #FFD100;
    --color-blue: #0F3A85;
    --color-black: #141414;
    --color-pink: #FBCFC8;
    --color-white: #FFFFFF;
    --gl-star-size: 40px;
}

html {
    height: 100%;
    background: url('../images/1_4.jpg') center / cover no-repeat fixed;
    overscroll-behavior: auto;
    transition: 1s ease;
}

html,
body {
    overscroll-behavior: auto;
}

body {
    font-family: "Roboto", sans-serif;
    font-size: 1.25rem;
    line-height: 1.75rem;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

img {
    max-width: 100%;
    max-height: 20vh;
}

h1 {
    font-size: 2rem;
    line-height: 2.5rem;
    margin: 1rem 0;
}

h2 {
    font-size: 1.75rem;
    line-height: 2.25rem;
    margin: 1rem 0;
}

h3 {
    font-size: 1.5rem;
    line-height: 2rem;
    margin: 1rem 0;
    display: flex;
    align-items: anchor-center;
}

h3 img {
    height: 40px;
    margin-right: 10px;
    margin-left: -5px;
}

p {
    margin: 0 0 1rem;
}

.smaller {
    font-size: 14px;
    line-height: 18px;
}

#connected-players {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    font-size: 25px;
    opacity: 1;
}

#connected-players img {
    width: 20px;
}

#connected-players.hidden {
    opacity: 0;
}

header,
footer {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
}

footer {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
}

button,
.button,
.option {
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    display: block;
    background: var(--color-red);
    border: 1px solid var(--color-red);
    color: var(--color-white);
    text-decoration: none;
    padding: 12px 24px;
    cursor: pointer;
    margin: 10px auto;
    transition: background 0.5s;
}

button.nowrap,
.button.nowrap {
    white-space: nowrap;
}

button:hover,
.button:hover,
.option:hover {
    background: var(--color-blue);
    border-color: var(--color-blue);
}

.black {
    background: var(--color-black);
    border-color: var(--color-black);
}

button.disabled,
.button.disabled,
.option.disabled {
    background: var(--color-pink);
    border-color: var(--color-pink);
    cursor: not-allowed;
}

button.full-width,
.button.full-width {
    width: 100%;
    box-sizing: border-box;
}

.back-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.back-btn svg {
    display: block;
    width: calc(100% - 20px);
    height: auto;
    margin: auto;
}

#results p {
    margin: 10px 0;
}

.options {
    margin: 15px 0;
}

.option.selected {
    background: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
}

.slider {
    width: 100%;
    height: 40px;
    background: #fff;
    border-radius: 8px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-runnable-track {
    height: 10px;
    background: var(--color-pink);
    border-radius: 12px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 40px;
    width: 40px;
    background: var(--color-red);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -15px;
}

.slider::-moz-range-track {
    height: 6px;
    background: var(--color-pink);
    border-radius: 8px;
}

.slider::-moz-range-thumb {
    height: 30px;
    width: 30px;
    background: var(--color-red);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    cursor: pointer;
}

.sortable-item {
    cursor: grab;
    padding: 10px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    margin-bottom: 5px;
}

/* Game container */
#game-container {
    width: 600px;
    text-align: center;
    margin: 2rem;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-container.wider {
    width: 750px;
}

#game-container-inner {
    background: var(--color-white);
    padding: 2rem 2.5rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

#game-container .main-logo {
    display: none;
}

.activeGame #game-container .main-logo {
    width: 80px;
}

#game-container #screen-title,
#game-container #screen-description,
#game-container .screen-buttons,
#game-container #question-container #question-title,
#game-container #question-container #questionText,
#game-container #question-container #options {
    text-align: left;
}

#game-container #screen-back {
    text-align: left;
}

#game-container #screen-description {
    margin-bottom: 2rem;
}

.screen-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.screen-buttons .screen-btn,
#confirmBtn {
    width: auto;
    margin: 10px 0;
}

.screen-buttons.full-width button {
    flex: auto;
}

#question-container #options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#question-container #options .option {
    margin: 0 0 15px;
    text-align: center;
}

#question-container #options .slider-option {
    font-size: 1.15rem;
}

#budgetRemaining span,
#question-container #options .slider-option span {
    color: var(--color-red);
}

#budgetRemaining {
    margin: 15px 0;
    text-align: right;
}

#questionText {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

#mid-continue,
#confirmBtn {
    float: right;
    margin-top: 15px;
}

#notification-next {
    margin-top: 15px;
}

#mid-results,
#results-container {
    text-align: left;
}

.ui-sortable,
#results ul,
#orderable-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-block {
    margin-bottom: 30px;
}

.result-block:last-child {
    margin-bottom: 0;
}

.result-block h2 {
    font-size: 1.75rem;
    line-height: 3rem;
    margin: 1rem 0;
    border-bottom: 1px solid rgb(125, 125, 125);
}

.result-block.audiences,
#categoryChart,
#audienceChart {
    margin-bottom: 2rem;
}

.timeline-bar {
    position: relative;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

#timeline-progress {
    height: 100%;
    width: 0;
    background-color: #3b82f6;
    transition: width 0.4s ease-in-out;
}

.timeline-marker {
    position: absolute;
    top: -25px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    transform: translateX(-50%);
    white-space: nowrap;
}

.notification {
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    border: 1px solid var(--color-white);
    padding: 1.5rem;
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(10px);
}

.notification-img {
    max-width: 60px;
    float: left;
    margin-right: 16px;
}

.popup-container.hidden {
    display: none;
}

.popup-close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 30px;
    cursor: pointer;
}

.orderable-item {
    cursor: grab;
    padding: 12px 24px 12px 30px;
    color: var(--color-white);
    border: 1px solid var(--color-red);
    background: var(--color-red) url(/icons/draggable.svg) no-repeat left / 26px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    touch-action: none;
}

.orderable-item.ui-sortable-helper {
    background-color: var(--color-pink);
    border: 1px dashed var(--color-pink);
}

.room-qrcode {
    display: inline-block;
}

#qr {
    text-align: center;
    display: flex;
    justify-content: center;
}

.card-holder {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.image-card {
    width: 200px;
    background: #fff;
    text-align: center;
}

.image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.image-card h3 {
    margin-top: 1rem;
    font-size: 1.1rem;
    display: block;
}

#host-controls {
    text-align: center;
    position: fixed;
    left: 20px;
    bottom: 20px;
    color: #fff;
}

#host-controls h2 {
    color: var(--color-white);
    background: #000;
    padding: 5px;
    margin-bottom: 0;
    font-weight: normal;
}

#roomIdInput {
    font-size: 1.875rem;
    line-height: 2.5rem;
    width: calc(100% - 4px);
    padding: 0;
    margin: 0 0 2rem;
    text-align: center;
}

#join-room-btn {
    /* no default styles */
}

.category {
    flex-direction: row;
    display: flex;
    margin-bottom: 40px;
    align-items: center;
    border-right-width: 8px;
    border-right-style: solid;
    padding-right: 20px;
}

.category:nth-child(odd) {
    flex-direction: row-reverse;
    border: none;
    padding: 0;
    border-left-width: 8px;
    border-left-style: solid;
    padding-left: 20px;
}

.category.high-band {
    border-color: var(--color-green);
}

.category.medium-band {
    border-color: var(--color-yellow);
}

.category.low-band {
    border-color: var(--color-red);
}


.category .category-image {
    width: 40%;
    margin: 0;
}

.category .category-text {
    width: 60%;
    margin: 0;
}

.category .category-text h3 {
    margin-top: 0;
}

/* hide timer by default */
#timer {
    display: none;
}

/* container sizing & positioning */
#timer-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: auto;
}

/* background circle */
#timer-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 12;
}

/* animated ring */
#timer-ring {
    fill: none;
    stroke: var(--color-red);
    stroke-width: 12;
    /* full circumference = 2πr ≈ 339.292 */
    stroke-dasharray: 339.292;
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
    transform-origin: 60px 60px;
}

/* keyframes animate from 0→full offset */
@keyframes countdown {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: 339.292;
    }
}

/* central timer text */
#timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: sans-serif;
    font-size: 2rem;
    font-weight: bold;
}

#linear-timer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #eee;
    display: none;
    z-index: 1000;
}

#linear-timer-bar {
    width: 100%;
    height: 100%;
    background: var(--color-red);
    /* we'll set transition-duration in JS */
    transition-property: width;
    transition-timing-function: linear;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

#feedback-popup .gl-star-rating {
    justify-content: center;
}

body.hasFooter {
    padding-bottom: 50px;
    position: relative;
    min-height: calc(100vh - 50px);
} 

#globalFooterText {
    position: absolute;
    display: none;
    bottom: 0px;
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    min-height: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 40px;
    box-sizing: border-box;
}

/* Media queries */
@media screen and (max-width: 767px) {

    body.hasFooter {
        padding-bottom: 100px;
        min-height: calc(100vh - 100px);
    } 

    h1 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .back-btn {
        margin-top: 0;
    }

    #game-container {
        margin: 1.5rem;
        max-width: calc(100% - 3rem);
    }

    #game-container-inner {
        padding: 2rem 1.5rem;
    }

    #game-container .main-logo {
        width: 120px;
        display: none;
    }

    .screen-buttons {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }

    .screen-buttons .screen-btn,
    #confirmBtn {
        margin: 0;
        width: 100%;
    }

    #confirmBtn {
        margin-top: 15px;
    }

    #question-container #options .option {
        font-size: 1rem;
        line-height: 1.5rem;
    }



    #questionText {
        font-size: 1.35rem;
        line-height: 1.85rem;
    }

    #roomIdInput {
        font-size: 1.5rem;
    }

    #join-room-btn {
        width: 100%;
        margin: 0;
    }

    .category {
        flex-direction: column;
    }

    .category:nth-child(odd) {
        flex-direction: column;
    }

    .category .category-text {
        width: 100%;
        margin-bottom: 20px;
    }

    .image-card h3 {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .notification {
        max-width: calc(100% - 6rem);
    }

    #mid-results,
    #results-container {
        text-align: center;
    }

    .category-text h3 {
        display: flex;
        flex-direction: column;
        gap: 1em;
    }
}

#testing-mode-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 350px;
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
}

.gauge-svg {
    width: 70px;
    margin-right: 15px;
    height: auto;
}

.needle {
    transform: rotate(0deg);
    transition: transform 0.9s cubic-bezier(.2, .8, .2, 1);
}

.needle.active {
    /* angle will be set via inline style or CSS var */
}