* {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    overflow: hidden;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    background: #08101d;
    color: #f8fbff;
    user-select: none;
    -webkit-user-select: none;
}

body {
    position: relative;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    touch-action: none;
}

.fruit-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.fruit-emoji {
    position: absolute;
    left: 0;
    top: 0;
    -webkit-transform-origin: center center;
    transform-origin: center center;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.hud {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: auto;
    height: 0;
    padding: 20px 22px 0;
    pointer-events: none;
}

.scanPanel {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    -webkit-transform-origin: bottom left;
    transform-origin: bottom left;
    -webkit-transform: scale(0.8);
    transform: scale(0.8);
    transition: opacity 220ms ease, transform 220ms ease, visibility 220ms ease;
}

.brand,
.message-card {
    background: rgba(7, 13, 27, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: opacity 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.brand {
    position: absolute;
    left: 22px;
    top: 20px;
    display: inline-block;
    width: auto;
    max-width: none;
    padding: 11px 14px 13px;
    border-radius: 18px;
}

.eyebrow,
.message-title {
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.22em;
    font-size: 11px;
    color: #6af6b6;
}

.brand .eyebrow {
    text-align: left;
}

.brand h1 {
    margin: 5px 0 0;
    font-size: 40px;
    line-height: 0.95;
}

.brand p,
.message-copy {
    margin: 0;
    color: rgba(232, 241, 255, 0.74);
    line-height: 1.4;
}

.scoreboard {
    display: block;
    width: 195px;
    max-width: 195px;
    text-align: right;
}

.scoreboard .score-row {
    margin-top: 8px;
}

.scoreboard .score-row:first-child {
    margin-top: 0;
}

.score-stack {
    position: absolute;
    right: 22px;
    top: 20px;
    display: block;
    width: 195px;
    text-align: right;
}

.score-stack .scoreboard {
    margin-top: 8px;
}

.best-score-panel {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(7, 13, 27, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
    transition: opacity 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.score-row {
    display: table;
    table-layout: fixed;
    width: 100%;
    padding: 0;
    border-radius: 14px;
    background: rgba(7, 13, 27, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
    font-size: 14px;
    transition: opacity 220ms ease, background-color 220ms ease, border-color 220ms ease;
}

.score-row-name {
    display: table-cell;
    width: auto;
    padding: 8px 8px 8px 10px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 18px;
}

.score-row-name span {
    display: inline-block;
    max-width: 104px;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-swatch {
    display: inline-block;
    vertical-align: middle;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.score-row-score {
    display: table-cell;
    width: 42px;
    padding: 8px 10px 8px 0;
    text-align: right;
    vertical-align: middle;
    line-height: 18px;
    font-weight: 700;
}

.center-message {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    text-align: center;
    pointer-events: none;
    padding: 24px;
}

.message-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 560px;
    max-width: 560px;
    margin-left: -280px;
    margin-top: -42px;
    text-align: center;
    border-radius: 28px;
    padding: 22px 24px;
    transition: opacity 220ms ease, transform 220ms ease;
}

.center-message.hidden .message-card {
    opacity: 0;
    -webkit-transform: translateY(8px);
    transform: translateY(8px);
}

body.hud-dimmed .brand,
body.hud-dimmed .scanPanel,
body.hud-dimmed .message-card,
body.hud-dimmed .best-score-panel,
body.hud-dimmed .score-row {
    opacity: 0.34;
}

body.hud-dimmed .brand,
body.hud-dimmed .message-card {
    background: rgba(7, 13, 27, 0.28);
    border-color: rgba(255, 255, 255, 0.05);
}

body.hud-dimmed .score-row {
    background: rgba(7, 13, 27, 0.22);
    border-color: rgba(255, 255, 255, 0.05);
}

body.hud-dimmed .best-score-panel {
    background: rgba(7, 13, 27, 0.22);
    border-color: rgba(255, 255, 255, 0.05);
}

body.start-narrow .scanPanel {
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateY(10px) scale(0.8);
    transform: translateY(10px) scale(0.8);
}

html.rich-paint,
body.rich-paint {
    background: #08101d;
    background: linear-gradient(180deg, #08101d, #020611);
    background:
        radial-gradient(circle at top left, rgba(63, 124, 255, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(106, 246, 182, 0.12), transparent 26%),
        linear-gradient(180deg, #08101d, #020611);
}

.rich-paint .fruit-emoji {
    text-shadow: 0 0 18px rgba(255, 190, 120, 0.28);
}

.rich-paint .brand,
.rich-paint .message-card {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.rich-paint .best-score-panel,
.rich-paint .score-row {
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.rich-paint .score-swatch {
    box-shadow: 0 0 14px currentColor;
}

.rich-paint.hud-dimmed .brand,
.rich-paint.hud-dimmed .message-card {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.rcRoomQrCodeLink {
    display: block;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: auto;
    margin-right: auto;
    border: solid 8px #fff;
    border-radius: 8px;
    color: #fff;
    background-color: #fff;
    box-shadow: 0 0 0 1px #fff;
    text-align: center;
    transition: opacity 1s ease;
    text-decoration: none;
    transform-origin: top left;
    transform: scale(1);
    -webkit-tap-highlight-color: transparent;
}

.rcTechLabel {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 4px;
    letter-spacing: 0.2em;
}

.rcRoomQrCode {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    width: 150px;
    height: 150px;
    overflow: hidden;
}

.rcRoomQrCode img,
.rcRoomQrCode canvas {
    display: block;
    width: 150px;
    height: 150px;
}

.rcRoomId {
    background-color: #000;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
    padding: 4px;
    margin: 8px 0 0 0;
    letter-spacing: 0.25em;
}

@media (max-width: 980px) {
    .score-stack,
    .scoreboard {
        width: 180px;
    }

    .score-row-name span {
        max-width: 90px;
    }

    .score-row-score {
        width: 40px;
    }
}

@media (max-width: 760px) {
    .brand p {
        display: none;
    }

    .brand h1 {
        font-size: 32px;
    }

    .scoreboard {
        width: 165px;
        max-width: 165px;
    }

    .score-stack {
        width: 165px;
    }

    .score-row-name span {
        max-width: 76px;
    }

    .score-row-score {
        width: 38px;
    }

    .best-score-panel {
        font-size: 13px;
    }

    .score-row {
        min-width: 0;
        font-size: 13px;
    }
}

@media (max-width: 560px) {
    .hud {
        padding: 12px 12px 0;
    }

    .brand {
        left: 12px;
        top: 12px;
        width: auto;
        max-width: none;
        padding: 8px 10px 9px;
        border-radius: 14px;
    }

    .brand h1 {
        margin: 6px 0 0;
        font-size: 24px;
    }

    .eyebrow {
        font-size: 9px;
        letter-spacing: 0.16em;
    }

    .scoreboard {
        width: 132px;
        max-width: 132px;
    }

    .score-stack {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 132px;
        max-width: 132px;
    }

    .best-score-panel {
        padding: 6px 8px;
        border-radius: 12px;
        font-size: 11px;
    }

    .score-row {
        padding: 0;
        border-radius: 12px;
        font-size: 11px;
        min-width: 0;
    }

    .score-row-name {
        padding: 6px 6px 6px 8px;
        line-height: 14px;
    }

    .score-row-name span {
        max-width: 50px;
    }

    .score-swatch {
        width: 8px;
        height: 8px;
        margin-right: 6px;
    }

    .score-row-score {
        width: 34px;
        padding: 6px 8px 6px 0;
        line-height: 14px;
    }

    .message-card {
        left: 24px;
        right: 24px;
        top: 45%;
        width: auto;
        max-width: none;
        margin-left: 0;
        margin-top: -52px;
    }

    .message-card {
        padding: 18px;
        border-radius: 22px;
    }
}

/* Lean paint path for older signage browsers such as Tizen 2.x.
   JS enables this when expensive compositing support is missing. */
html.lean-paint,
body.lean-paint {
    background: #07101d;
}

.lean-paint .fruit-layer {
    display: none;
}

.lean-paint .brand,
.lean-paint .message-card,
.lean-paint .best-score-panel,
.lean-paint .score-row {
    background: rgba(7, 13, 27, 0.88);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    text-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: opacity 120ms linear;
}

.lean-paint .score-swatch {
    box-shadow: none;
}

.lean-paint .fruit-emoji {
    text-shadow: none;
}

.lean-paint.hud-dimmed .brand,
.lean-paint.hud-dimmed .message-card,
.lean-paint.hud-dimmed .best-score-panel,
.lean-paint.hud-dimmed .score-row {
    background: rgba(7, 13, 27, 0.46);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}
