* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #091c45;
    color: #ffffff;
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.game-shell {
    position: relative;
    width: 100%;
    height: 100%;

    overflow: hidden;
    background: #193f8f;
}

.side-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    width: 31vh;
    min-width: 270px;
    padding: 2vh;
    background: #0b1d49;
    border-right: 0.5vh solid #35d9e8;
}

.brand-panel,
.score-panel,
.join-panel,
.turn-card,
.stage-footer {
    border: 0.25vh solid rgba(255, 255, 255, 0.22);
    background: #102b68;
}

.brand-panel {
    display: table;
    width: 100%;
    padding: 1.2vh;
    border-radius: 1.8vh;
}

.brand-ball,
.brand-panel > div {
    display: table-cell;
    vertical-align: middle;
}

.brand-ball {
    width: 7.4vh;
    color: #ffda33;
    font-size: 6vh;
    line-height: 1;
    text-align: center;
    transform: rotate(-12deg);
}

.eyebrow {
    margin: 0;
    color: #7af1f6;
    font-size: 1.25vh;
    font-weight: bold;
    letter-spacing: 0.23vh;
    text-transform: uppercase;
}

h1 {
    margin: 0.2vh 0;
    color: #ffda33;
    font-size: 3.8vh;
    line-height: 0.95;
    letter-spacing: 0.08vh;
}

.network-status {
    margin: 0.5vh 0 0;
    color: #ffffff;
    font-size: 1.35vh;
}

.score-panel {
    position: absolute;
    top: 14.5vh;
    right: 2vh;
    bottom: 28vh;
    left: 2vh;
    padding: 1.25vh;
    overflow: hidden;
    border-radius: 1.8vh;
}

.panel-heading-row {
    display: table;
    width: 100%;
    margin-bottom: 1vh;
}

.panel-heading-row h2,
.panel-heading-row .count-badge {
    display: table-cell;
    vertical-align: middle;
}

.panel-heading-row h2 {
    margin: 0;
    color: #ffffff;
    font-size: 2.1vh;
    text-transform: uppercase;
}

.count-badge {
    color: #7af1f6;
    font-size: 1.25vh;
    text-align: right;
}

.score-head,
.score-row {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.score-head span,
.score-row span {
    display: table-cell;
    padding: 0.55vh 0.25vh;
    text-align: center;
}

.score-head span:first-child,
.score-row span:first-child {
    width: 48%;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-head {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.05vh;
    font-weight: bold;
    letter-spacing: 0.08vh;
    text-transform: uppercase;
}

.score-table {
    max-height: calc(100% - 6vh);
    overflow: hidden;
}

.score-row {
    margin-bottom: 0.5vh;
    border-radius: 0.8vh;
    background: #173b88;
    color: #ffffff;
    font-size: 1.35vh;
}

.score-row.current {
    background: #e84478;
}

.score-row.disconnected {
    opacity: 0.48;
}

.score-row .player-name {
    border-left: 0.55vh solid #35d9e8;
    padding-left: 0.7vh;
    font-weight: bold;
}

.empty-score {
    margin: 2vh 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4vh;
    line-height: 1.4;
    text-align: center;
}

.join-panel {
    position: absolute;
    right: 2vh;
    bottom: 2vh;
    left: 2vh;
    height: 24vh;
    padding: 0.8vh;
    overflow: hidden;
    border-radius: 1.8vh;
    text-align: center;
}

.qr-panel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}


.rcRoomQrCodeLink,
.rcRoomQrCodeLink * {
    box-sizing: content-box;
}

.rcRoomQrCodeLink {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 150px;
    margin: -114px 0 0 -81px;
    border: 6px solid #ffffff;
    border-radius: 8px;
    background: #ffffff;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    transform: scale(0.95);
    transform-origin: center center;
}

.rcTechLabel,
.rcRoomId {
    background: #0b1d49;
    color: #ffffff;
    font-family: monospace;
    font-weight: bold;
}

.rcTechLabel {
    margin: 0 0 8px;
    padding: 4px;
    font-size: 13px;
    letter-spacing: 0.2em;
}

.rcRoomQrCode {
    width: 150px;
    height: 150px;
}

.rcRoomId {
    margin: 8px 0 0;
    padding: 4px;
    font-size: 16px;
    letter-spacing: 0.2em;
}

.match-stage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 31vh;
    overflow: hidden;
    background: #245db4;
}

.crowd-strip {
    position: absolute;
    right: 0;
    left: 0;
    overflow: hidden;
    white-space: nowrap;
}

.crowd-back {
    top: 0;
    height: 11.5vh;
    border-bottom: 0.35vh solid #35d9e8;
    background: #0b1d49;
}

.crowd-front,
.crowd-strip span {
    display: none;
}

.turn-card {
    position: absolute;
    top: 1.3vh;
    right: 3vh;
    left: 3vh;
    z-index: 8;
    width: auto;
    height: 8.4vh;
    margin-left: 0;
    padding: 1.15vh 36% 1vh 2.3vh;
    border-left: 0.65vh solid #ffda33;
    border-radius: 1.4vh;
    text-align: left;
}

.turn-kicker,
.turn-name,
.turn-hint {
    display: block;
}

.turn-kicker {
    color: #7af1f6;
    font-size: 1.1vh;
    font-weight: bold;
    letter-spacing: 0.2vh;
    text-transform: uppercase;
}

.turn-name {
    margin: 0.35vh 0 0;
    color: #ffda33;
    font-size: 3vh;
    line-height: 1;
    text-transform: uppercase;
}

.turn-hint {
    position: absolute;
    top: 50%;
    right: 2.5vh;
    width: 32%;
    margin-top: -0.8vh;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3vh;
    line-height: 1.5;
    text-align: right;
}

.goal-scene {
    position: absolute;
    top: 13vh;
    right: 3vh;
    bottom: 6vh;
    left: 3vh;
    overflow: hidden;
    background: #31a75b;
    border: 0.4vh solid #87ef8b;
    border-radius: 2.5vh;
}

.goal-scene:before,
.goal-scene:after {
    position: absolute;
    top: 0;
    bottom: 0;
    content: "";
    background: rgba(255, 255, 255, 0.05);
}

.goal-scene:before {
    left: 0;
    width: 25%;
}

.goal-scene:after {
    left: 50%;
    width: 25%;
}

.goal-mouth {
    position: absolute;
    top: 9%;
    right: 10%;
    left: 10%;
    height: 61%;
    background: #dff7f4;
    border: 1.2vh solid #ffffff;
    border-bottom-width: 0.8vh;
    cursor: crosshair;
    touch-action: none;
    -ms-touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.goal-aim-button {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    -ms-touch-action: none;
}
.net-lines,
.net-lines i {
    position: absolute;
    display: block;
}

.net-lines {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0.35;
}

.net-vertical i {
    top: 0;
    bottom: 0;
    width: 0.22vh;
    background: #245db4;
}

.net-vertical i:nth-child(1) { left: 12.5%; }
.net-vertical i:nth-child(2) { left: 25%; }
.net-vertical i:nth-child(3) { left: 37.5%; }
.net-vertical i:nth-child(4) { left: 50%; }
.net-vertical i:nth-child(5) { left: 62.5%; }
.net-vertical i:nth-child(6) { left: 75%; }
.net-vertical i:nth-child(7) { left: 87.5%; }

.net-horizontal i {
    right: 0;
    left: 0;
    height: 0.22vh;
    background: #245db4;
}

.net-horizontal i:nth-child(1) { top: 16.5%; }
.net-horizontal i:nth-child(2) { top: 33%; }
.net-horizontal i:nth-child(3) { top: 49.5%; }
.net-horizontal i:nth-child(4) { top: 66%; }
.net-horizontal i:nth-child(5) { top: 82.5%; }

.goal-post {
    position: absolute;
    z-index: 4;
    background: #ffffff;
}

.post-left,
.post-right {
    top: -1.2vh;
    bottom: -0.8vh;
    width: 1.2vh;
}

.post-left { left: -1.2vh; }
.post-right { right: -1.2vh; }

.crossbar {
    top: -1.2vh;
    right: -1.2vh;
    left: -1.2vh;
    height: 1.2vh;
}

.keeper {
    position: absolute;
    bottom: -2%;
    left: 50%;
    z-index: 3;
    width: 25vh;
    height: 25vh;
    margin-left: -12.5vh;
    transform: translate3d(0, 0, 0);
    transition: left 0.65s ease-in-out, bottom 0.65s ease-in-out;
}

.keeper-sprite,
.ball-sprite {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    transform-origin: center center;
}

.keeper-sprite {
    background-image: url("assets/keeper-sheet-no-ball-v2.png");
    background-size: 400% 200%;
}

.frame-ready { background-position: 0 0; }
.frame-bounce { background-position: 33.333% 0; }
.frame-dive-high { background-position: 66.666% 0; }
.frame-dive-high-alt { background-position: 100% 0; }
.frame-dive-low-left { background-position: 0 100%; }
.frame-dive-low-right { background-position: 33.333% 100%; }
.frame-catch { background-position: 66.666% 100%; }
.frame-kneel { background-position: 100% 100%; }

.ball-sprite {
    position: absolute;
    bottom: 2.5%;
    left: 50%;
    z-index: 6;
    width: 14vh;
    height: 14vh;
    margin-left: -7vh;
    background-image: url("assets/ball-sheet.png");
    background-size: 400% 200%;
    transform: translate3d(0, 0, 0);
}

.frame-ball-0 { background-position: 0 0; }
.frame-ball-1 { background-position: 33.333% 0; }
.frame-ball-2 { background-position: 66.666% 0; }
.frame-ball-3 { background-position: 100% 0; }
.frame-ball-4 { background-position: 0 100%; }
.frame-ball-5 { background-position: 33.333% 100%; }
.frame-ball-6 { background-position: 66.666% 100%; }
.frame-ball-7 { background-position: 100% 100%; }

.penalty-spot {
    position: absolute;
    bottom: 7%;
    left: 50%;
    width: 3vh;
    height: 1.3vh;
    margin-left: -1.5vh;
    border-radius: 50%;
    background: #d7f7d7;
}

.aim-flash {
    position: absolute;
    z-index: 2;
    width: 7vh;
    height: 7vh;
    margin: -3.5vh 0 0 -3.5vh;
    border: 0.65vh solid #ffda33;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.4);
}

.aim-flash.show {
    opacity: 1;
    transform: scale(1.4);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.viewer-aim {
    position: absolute;
    z-index: 7;
    width: 5vh;
    height: 5vh;
    margin: -2.5vh 0 0 -2.5vh;
    border: 0.55vh solid #e84478;
    border-radius: 50%;
    background: rgba(255, 218, 51, 0.36);
    pointer-events: none;
}

.viewer-aim:before,
.viewer-aim:after {
    position: absolute;
    display: block;
    content: "";
    background: #e84478;
}

.viewer-aim:before {
    top: 50%;
    right: -1.4vh;
    left: -1.4vh;
    height: 0.35vh;
    margin-top: -0.18vh;
}

.viewer-aim:after {
    top: -1.4vh;
    bottom: -1.4vh;
    left: 50%;
    width: 0.35vh;
    margin-left: -0.18vh;
}

.viewer-notice {
    position: absolute;
    top: 2%;
    left: 50%;
    z-index: 8;
    padding: 0.6vh 1.2vh;
    border: 0.25vh solid rgba(255, 255, 255, 0.72);
    border-radius: 2vh;
    background: #102b68;
    color: #ffda33;
    font-size: 1.25vh;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}
.countdown {
    position: absolute;
    top: 44%;
    left: 50%;
    z-index: 10;
    width: 16vh;
    height: 16vh;
    margin: -8vh 0 0 -8vh;
    border: 1vh solid #ffffff;
    border-radius: 50%;
    background: #e84478;
    color: #ffffff;
    font-size: 10vh;
    font-weight: bold;
    line-height: 14vh;
    text-align: center;
    transform: rotate(-5deg);
}

.countdown.pulse {
    transform: rotate(5deg) scale(1.14);
}

.result-banner {
    position: absolute;
    top: 42%;
    left: 50%;
    z-index: 11;
    width: 48vh;
    margin-left: -24vh;
    padding: 2vh;
    border: 0.6vh solid #ffffff;
    border-radius: 2vh;
    background: #e84478;
    color: #ffffff;
    text-align: center;
    transform: rotate(-2deg);
}

.result-banner.save { background: #245db4; }
.result-banner.miss { background: #733a96; }

.result-banner strong,
.result-banner span {
    display: block;
}

.result-banner strong {
    color: #ffda33;
    font-size: 7vh;
    line-height: 0.95;
    letter-spacing: 0.15vh;
}

.result-banner span {
    margin-top: 0.7vh;
    font-size: 2vh;
}

.stage-footer {
    position: absolute;
    right: 3vh;
    bottom: 1.4vh;
    left: 3vh;
    z-index: 9;
    height: 4vh;
    padding: 0.55vh 1.2vh;
    border-radius: 3vh;
    color: #ffffff;
    font-size: 1.45vh;
    line-height: 2.3vh;
}

.sound-button {
    float: right;
    min-height: 2.5vh;
    padding: 0 1vh;
    border: 0;
    border-radius: 2vh;
    background: #ffda33;
    color: #0b1d49;
    cursor: pointer;
    font-size: 1.25vh;
    font-weight: bold;
}

.lean-paint *,
.lean-paint *:before,
.lean-paint *:after {
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

@media (orientation: portrait) {
    .side-panel {
        top: 0;
        right: 0;
        bottom: 0;
        width: auto;
        min-width: 0;
        height: auto;
        padding: 0;
        background: transparent;
        border-right: 0;
        pointer-events: none;
    }

    .brand-panel {
        position: absolute;
        display: block;
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 8.5vh;
        padding: 1.2vh 2vh;
        border: 0;
        border-bottom: 0.35vh solid #35d9e8;
        border-radius: 0;
        pointer-events: auto;
    }

    .brand-panel > .brand-ball {
        display: none;
    }

    .brand-panel > div { display: block; }

    h1 {
        max-width: 68%;
        margin-top: 0.25vh;
        font-size: 2.8vh;
    }

    .eyebrow { font-size: 0.95vh; }

    .network-status {
        position: absolute;
        top: 50%;
        right: 2vh;
        margin: -1.4vh 0 0;
        padding: 0.45vh 1vh;
        border: 0.18vh solid rgba(122, 241, 246, 0.55);
        border-radius: 2vh;
        color: #7af1f6;
        font-size: 1vh;
        font-weight: bold;
    }

    .score-panel {
        top: auto;
        right: 1.2vh;
        bottom: 1.1vh;
        left: 1.2vh;
        height: 13.2vh;
        padding: 1vh 1.3vh;
        border-radius: 1.7vh;
        pointer-events: auto;
    }

    .panel-heading-row { margin-bottom: 0.35vh; }
    .panel-heading-row h2 { font-size: 1.4vh; }
    .count-badge { font-size: 0.95vh; }
    .score-head { font-size: 0.9vh; }
    .score-row {
        margin-bottom: 0.35vh;
        font-size: 1.1vh;
    }
    .score-row span { padding: 0.3vh 0.2vh; }
    .score-table {
        max-height: calc(100% - 4.2vh);
        overflow-y: auto;
    }
    .empty-score {
        margin: 1vh 0;
        font-size: 1.05vh;
    }

    .join-panel {
        display: none;
    }

    .match-stage {
        top: 8.5vh;
        bottom: 15.4vh;
        left: 0;
    }

    .turn-card {
        top: 1.2vh;
        right: 1.5vh;
        left: 1.5vh;
        height: 9.6vh;
        padding: 1.15vh 1.8vh;
        margin-left: 0;
        border-radius: 1.6vh;
    }

    .turn-kicker { font-size: 1.05vh; }
    .turn-name {
        margin-top: 0.3vh;
        font-size: 2.35vh;
    }
    .turn-hint {
        position: static;
        display: block;
        width: auto;
        margin-top: 0.45vh;
        color: rgba(255, 255, 255, 0.8);
        font-size: 1.1vh;
        line-height: 1.2;
        text-align: left;
    }

    .goal-scene {
        top: 12vh;
        right: 1.5vh;
        bottom: 5vh;
        left: 1.5vh;
        border-radius: 2.2vh;
    }

    .goal-mouth {
        top: 8%;
        right: 4%;
        left: 4%;
        height: 56%;
    }

    .keeper {
        width: 28vw;
        height: 28vw;
        margin-left: -14vw;
    }

    .ball-sprite {
        width: 15vw;
        height: 15vw;
        margin-left: -7.5vw;
    }

    .viewer-notice {
        max-width: 76%;
        padding: 0.7vh 1.3vh;
        font-size: 1.25vh;
        white-space: normal;
        text-align: center;
    }

    .stage-footer {
        right: 1.5vh;
        bottom: 0.7vh;
        left: 1.5vh;
        height: 3.6vh;
        padding: 0.45vh 1.1vh;
        font-size: 1.15vh;
        line-height: 2.1vh;
    }

    .sound-button {
        min-height: 2.35vh;
        font-size: 1vh;
    }

    .result-banner {
        width: 36vh;
        margin-left: -18vh;
    }

    .result-banner strong { font-size: 5.4vh; }
}
@media (max-width: 780px) and (orientation: landscape) {
    .side-panel {
        width: 36vh;
        min-width: 220px;
    }

    .match-stage {
        left: 36vh;
    }

    .score-panel { bottom: 25vh; }
    .join-panel { height: 21.5vh; }
    .rcRoomQrCodeLink { transform: scale(0.62); }
}

@media (max-height: 700px) and (orientation: landscape) {
    .side-panel {
        width: 210px;
        min-width: 210px;
    }

    .match-stage {
        left: 210px;
    }

    .score-panel {
        top: 80px;
        bottom: 148px;
    }

    .join-panel {
        height: 138px;
    }

    .rcTechLabel,
    .rcRoomId {
        display: none;
    }

    .rcRoomQrCodeLink {
        margin-top: -81px;
        transform: scale(0.74);
    }

}
