* {
    box-sizing: border-box;
}

html,
body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
}

.player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

html[data-bk-display-rotation="cw"] .player {
    width: 100vh;
    height: 100vw;
    transform: translateX(100vw) rotate(90deg);
    transform-origin: 0 0;
}

html[data-bk-display-rotation="ccw"] .player {
    width: 100vh;
    height: 100vw;
    transform: translateY(100vh) rotate(-90deg);
    transform-origin: 0 0;
}

body.is-blackout .player > * {
    visibility: hidden !important;
}

video,
canvas,
img {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

video {
    pointer-events: none;
}

video::-webkit-media-controls {
    display: none !important;
}

canvas.is-visible {
    z-index: 4;
    display: block;
}

video.is-visible,
img.is-visible {
    display: block;
}

video.is-visible {
    z-index: 2;
}

video.is-buffering {
    z-index: 1;
    display: block;
    visibility: hidden;
    pointer-events: none;
}

img.is-visible {
    z-index: 3;
}

.player-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    background: #000;
    text-align: center;
}

.player-message.is-hidden {
    display: none;
}

.pairing-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    background: #f4f3f0;
    color: #1c1c1c;
    text-align: center;
}

.pairing-panel[hidden] {
    display: none;
}

.pairing-brand {
    display: grid;
    width: 74px;
    height: 74px;
    margin-bottom: 10px;
    place-items: center;
    border-radius: 8px;
    background: #d62300;
    color: #fff;
    font-size: 30px;
    font-weight: 800;
}

.pairing-label {
    color: #6b6b6b;
    font-size: clamp(18px, 2vw, 30px);
}

.pairing-code {
    padding: 14px 24px;
    border: 2px solid #d8d4cd;
    border-radius: 8px;
    background: #fff;
    color: #1c1c1c;
    font-size: clamp(42px, 8vw, 96px);
    line-height: 1;
    letter-spacing: 0;
}

.pairing-state {
    color: #6b6b6b;
    font-size: clamp(15px, 1.6vw, 24px);
}

.player-message strong {
    font-size: clamp(24px, 4vw, 54px);
}

.player-message span {
    max-width: 720px;
    color: #b8b8b8;
    font-size: clamp(16px, 2vw, 28px);
}

.start-button {
    position: absolute;
    left: 50%;
    bottom: 8vh;
    display: none;
    min-height: 64px;
    padding: 0 32px;
    transform: translateX(-50%);
    border: 0;
    border-radius: 6px;
    background: #ff7a00;
    color: #111;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.start-button.is-visible {
    display: block;
}
