:root {
    --padding-s: 10px;
    --padding-m: 20px;
    --padding-l: 40px;
}

/*Fixa så att skärmen inte har vita kanter runt sig*/
body, html {
    margin: 0;
}

button:hover {
    cursor: pointer;
}

.roles {
    display: flex;
    gap: 12px;
    margin-block: var(--padding-m);
}

/*Stil för testui*/
.panel {
    position: relative;
    padding: 1em;
    border-radius: 20px;
    background: #2a2a40;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 12px; /* border-tjocklek */
    border-radius: 20px;

    background: linear-gradient(
        to right,
        #E22424 0%,
        #E22424 40%,
        #7a0033 49%,
        #491aa0 51%,
        #4552ff 60%,
        #4552ff 100%
    );

    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
            mask-composite: exclude;

    pointer-events: none;
}

.gamemode, .smallbutton {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background-color: #5c5c5c;
    transition: all 0.2s ease;
}

.gamemode:hover, .smallbutton:hover {
    background-color: #777;
}

.gamemode.selected {
    background-color: #ffffff;
    color: #1e1e2f;
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.flex-center, .main, .mainsubcontainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main {
    background: linear-gradient(180deg, #1e1e2f, #2a2a40);
    border-radius: 20px;
    box-shadow: 0 60px 80px rgba(0,0,0,0.5);
    max-width: 600px;
    width: 100%;
    padding-inline: var(--padding-l);
    /*This will make the border fit inside the screen*/
    box-sizing: border-box;
}

#pickrole > p {
    margin-block: var(--padding-m);
}

.title + .mainsubcontainer {
    margin-top: 0; /*Remove the top padding when placed under the title since the title has margins*/
}

.mainsubcontainer {
    margin: var(--padding-l);
    max-width: 300px;
    width: 100%;
}

.mainsubcontainer > *:first-child, .mainsubcontainer > *:first-child > *:first-child {
    /*To make padding consistant up and down*/
    margin-top: 0;
}

#ui {
    /*Så man inte kan markera text i spelet*/
    user-select: none;
}

html, button {
    /*Makes all text this font and white*/
    font-family: "OCR A Std", monospace;
    color: white;
}

.vstext {
    font-size: 1.5rem;
    font-style: italic;
}

.ingametext {
    font-size: 20px;
    text-align: center;
}

#timer {
    width: 3ch;
    font-size: 5rem;
    margin-top: -0.5rem;
}

.timecritical {
    /*Make the time flash*/
    color: #ff1060;
    animation: blink 0.5s ease-out 0s infinite forwards;
}

@keyframes blink {
    0% {transform: scale(100%);}
    5% {transform: scale(130%);}
    100% {transform: scale(100%);}
}

.turnui {
    display: flex;
    top: -1rem !important; /*Cancel the padding on the ui container*/
    flex-direction: column;
    gap: var(--padding-s);
}

.activeturn .youindicator {
    color: white;
}

.timercontainer, .turncontainer {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.turncontainer img {
    filter: saturate(0%);
    transition: filter 0.2s ease-in-out;
}
.activeturn img {
    filter: saturate(100%);
}

.youindicator {
    /*Center the "you" text on the icon*/
    font-size: 2rem;
    color: slategray; /*Set to gray so we can set it to white when it's your turn*/
    transition: color 0.2s ease-in-out;
    margin-top: -0.55rem; /*Move slighty up*/
}

.turnindicator {
    display: flex;
    flex-direction: row;
    gap: var(--padding-s);
    background-color: #00000040;
    background: linear-gradient(180deg, #000000cc, #00000000);
    padding: 1rem;
    padding-bottom: 0;
}

@media only screen and (max-width: 1100px) {
    #timer {
        font-size: 3rem;
    }
    .turncontainer img {
        width: 60px;
        height: 60px;
    }
    .vstext {
        font-size: 1rem;
    }
    .youindicator {
        font-size: 1.5rem;
    }
}

.title {
    color:rgb(255, 255, 255);
    text-align: center;
    font-size: 35px;
    font-family: 'Gajraj One', sans-serif;
    text-shadow: 3px 3px 3px #000000;
    margin-block: var(--padding-l);
}

.modelist {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    gap: var(--padding-s);
    margin-bottom: var(--padding-s);
}

.modelist > button {
    padding: var(--padding-s);
    font-size: 16px;
    border-radius: 10px;
    border: none;
    background-color: #5c5c5c;
}

#description {
    color:rgb(255, 255, 255);
    text-align: left;
    white-space: pre-line;
}

.undertext {
    color:aqua;
    text-align: center;
    font-size: 18px;
    font-family: 'Gajraj One', sans-serif;
}

.tutorialimage {
    width: 500px;
    height: 500px;
}

.lowest {
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

#start {
    width: 100%;
}

#abort {
    min-width: 200px;
}

.settingsbutton {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.wintext {
    font-family: 'Gajraj One', sans-serif;
    font-size: 45px;
    text-align: center;
    line-height: 1em;
    text-shadow: 5px 5px 0px black;
    margin-bottom: 1rem;
}

.winpanel > button {
    font-size: larger;
    width: 200px;
    align-self: center;
}

.rulepanel {
    padding: var(--padding-l);
}

.rulelist {
    display: flex;
    flex-direction: column;
    gap: var(--padding-s);
    align-items: stretch;
    margin-top: var(--padding-s);
}

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

.align-stretch {
    align-self: stretch;
}

#rulesbutton {
    margin-top:50px;
    color: black;
    width: 100px;
}

.red {
    color: #ff0060;
}

.blue {
    color: #0000ff;
    color: #33c4fd;
}

.description {
    display: flex;
    align-items: center;  
    gap: var(--padding-s);                
    width: 100%;
    max-width: 800px;
}

.tutimage {
    width: 100px;             
    height: auto;
    flex-shrink: 0;           
}

#norulesbutton {
    margin-top: var(--padding-m);
}

.hidden {
    display: none;
}

.margin-top {
    margin-top: var(--padding-l);
}

.row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.row > .icon-btn {
    padding: 0;
}

.start-btn {
    width: 100%;
    padding: var(--padding-m);
    font-size: 20px;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    background: linear-gradient(90deg, #ff0040, #ff6a00);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
}

.start-container {
    display: flex;
    flex-direction: column;
    gap: var(--padding-s);
    margin-top: var(--padding-s);
    margin-bottom: var(--padding-s);
    align-self: stretch;
}

.gap {
    gap: var(--padding-s);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.6);
}


@media only screen and (max-height: 600px) {
    .start-container {
        flex-direction: row;
        align-items: stretch;
    }
    .main.widen {
        max-width: 700px;
    }
    .main.widen > .mainsubcontainer {
        max-width: 500px;
    }

    .rulelist {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    :root {
        /*Make whitespace smaller*/
        --padding-l: 30px;
        --padding-m: 15px;
    }

}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

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

@font-face {
    font-family: 'Gajraj One';
    src: url('ui/fonts/gajraj-one-v7-latin-regular.woff2') format('woff2');
}

.backb {
    display: grid;
    text-align: center;
    gap: var(--padding-s)10px;
}

.backb > button {
    padding: var(--padding-s) 18px;
    border-radius: 12px;
    border: none;
    background-color: #5c5c5c;
    color: white;
    transition: all 0.2s ease;
    margin-top: var(--padding-m);
}

.backbutton {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background-color: #5c5c5c;
    color: white;
    transition: all 0.2s ease;
}

.backbutton:hover {
    background-color: #777;
}

.backbutton.selected {
    background-color: #ffffff;
    color: #1e1e2f;
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.settingsrow {
    display: flex;
    gap: var(--padding-l);
    align-items: center;
}

.queue-role {
    padding: var(--padding-s) 18px;
    border-radius: 12px;
    border: none;
    background-color: #5c5c5c;
    color: white;
    transition: all 0.2s ease;
    height: 50px;
}

.queue-role:hover {
    background-color: #777;
}

.queue-role.selected {
    background-color: white;
    color: #1e1e2f;
    box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 30px;
    background: #13131f;
    border-radius: 30px;
    cursor: pointer;
    direction: ltr; /*Makes it not break on arabic*/
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    transition: transform 0.3s;
    background: #cacaca;
}

.toggle-switch input:checked + .toggle-slider {
    transform: translateX(18px);
    background: #ffffff;
}

.toggle-switch:has(input:checked) {
    background: #04c804;
}

.icon-settings {
    padding: 6px;
}

.igSettings {
    display: flex;
    flex-direction: column;
    gap: var(--padding-s);
}

.igSettings button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.igSettings button:hover {
    transform: scale(1.4);
}

.gamecontrols {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

#midleavebutton {
    grid-column: 2;
}

#specnextmatch {
    justify-self: end;
}

.bottomrow {
    position: relative;
}

.center-btn {
    text-align: center;
    width: 100%;
}

#languageIconBtn {
    position: absolute;   
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.menubuttons {
    display: flex;
    flex-direction: row;
    justify-content: space-between; 
    width: 100%;
    align-items: center;
}


.menubuttons .icon-btn {
    padding-inline: 0; /*Align all the way to the edge*/
}

.middle-buttons {
    display: flex;
    gap: var(--padding-s);         
}

.middle-buttons .smallbutton {
    flex: 1;            
    min-width: 100px;   
    text-align: center; 
}

#qrShow {
    background:white;
    padding:5px;
}

#qrShow > * {
    height:10vw;
    width:10vw
}