/* #region Variables & Reset */

body.light {
    --bg: rgb(232, 232, 232);
    --panel-bg: rgba(220, 220, 220, 0.70);
    --panel-text: rgba(0, 0, 0, 0.82);
    --panel-subtext: rgba(0, 0, 0, 0.48);
    --btn-bg: rgba(0, 0, 0, 0.08);
    --btn-bg-hover: rgba(0, 0, 0, 0.16);
    --btn-bg-active: rgba(0, 0, 0, 0.24);
    --btn-color: rgba(0, 0, 0, 0.65);
    --divider: rgba(0, 0, 0, 0.08);

    --logo-fill: rgb(60, 60, 60);
    --cube-u: rgb(80, 80, 80);
    --cube-l: rgb(40, 40, 40);
    --cube-r: rgb(60, 60, 60);
    --cube-flash: rgb(120, 120, 120);
    --seg-empty: rgba(0, 0, 0, 0.12);
    --seg-filled: rgba(0, 0, 0, 0.55);
    --msg-color: rgba(0, 0, 0, 0.45);

    --footer-filter: none;
    --header-bg: rgba(232, 232, 232, 0.88);
    --footer-bg: rgba(232, 232, 232, 0.88);
   
}

body.dark {
    --bg: rgb(26, 26, 26);
    --panel-bg: rgba(60, 60, 60, 0.92);
    --panel-text: rgba(255, 255, 255, 0.85);
    --panel-subtext: rgba(255, 255, 255, 0.50);
    --btn-bg: rgba(255, 255, 255, 0.10);
    --btn-bg-hover: rgba(255, 255, 255, 0.20);
    --btn-bg-active: rgba(255, 255, 255, 0.28);
    --btn-color: rgba(255, 255, 255, 0.70);
    --divider: rgba(255, 255, 255, 0.08);

    --logo-fill: rgb(180, 180, 180);
    --cube-u: rgb(50, 50, 50);
    --cube-l: rgb(30, 30, 30);
    --cube-r: rgb(40, 40, 40);
    --cube-flash: rgb(180, 180, 180);
    --seg-empty: rgba(255, 255, 255, 0.12);
    --seg-filled: rgba(255, 255, 255, 0.65);
    --msg-color: rgba(255, 255, 255, 0.45);

    --footer-filter: invert();
    --header-bg: rgba(26, 26, 26, 0.92);
    --footer-bg: rgba(26, 26, 26, 0.92);
    
}

:root {
    --logo-block-size: 10vh;
    --logo-bar-thickness: 1vh;

    --content-margin: 20px;
    --split-h: 50vh;

    --transition-duration: 0.4s;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);

    --tile-size: 200px;
    --tile-gap: 16px;

    --accent: rgba(255, 185, 50, 1);
    --new: rgba(120, 225, 115, 1);
}

* {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", sans-serif;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
    transition: background 0.3s ease;
}

/* #endregion */


#beta-tag {
    font-size: 1rem;
    font-weight: bold;
    color: var(--btn-color);
    background-color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    position: fixed;
    right: 8px;
    top: 8px;
    z-index: 9999;
    cursor: default;
}


/* #region Header nav */

header {
    /* ensure header keeps its content inside viewport */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 4px;
    /* add horizontal breathing room */
    display: flex;
    align-items: center;
    z-index: 1000;
    /* background-color: var(--header-bg); */
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

header.header-hidden {
    opacity: 0;
    pointer-events: none;
}

header a,
header button.nav-btn {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease;
    padding: 0;
}

header a:hover,
header button.nav-btn:hover {
    opacity: 1;
}

header svg {
    width: 100%;
    height: 100%;
}

/* #endregion */




/* #region Background */

#bg-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#bg-layer-front {
    z-index: 1;
}

#bg-layer-back {
    z-index: 0;
}

.bg-layer .bg-graphics {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-layer .bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.bg-layer .bg-border {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* #endregion */




/* #region Content pane */

/* Position (left/top/width/height) and border-radius are set via inline styles by JS.
   CSS provides the appearance, transitions, and visibility only. */
.content-pane {
    position: absolute;
    background-color: var(--panel-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 5px;
    opacity: 1;

    transition:
        left var(--transition-duration) var(--transition-easing),
        top var(--transition-duration) var(--transition-easing),
        bottom var(--transition-duration) var(--transition-easing),
        width var(--transition-duration) var(--transition-easing),
        height var(--transition-duration) var(--transition-easing),
        border-radius var(--transition-duration) var(--transition-easing),
        background-color 0.3s ease,
        border-color 0.3s ease,
        opacity var(--transition-duration) var(--transition-easing);
}

.content-pane.off {
    display: none;
    opacity: 0;
}

.content-pane.visible {
    pointer-events: auto;
}


.content-pane.left {
    left: var(--content-margin);
    top: 50%;
    width: calc(var(--pane-split, 50%) - var(--content-margin) * 1.5);
    height: calc(var(--split-h) - var(--content-margin) * 2);
    transform: translateY(-50%);
}

.content-pane.right {
    right: var(--content-margin);
    top: 50%;
    width: calc(var(--pane-split, 50%) - var(--content-margin) * 1.5);
    height: calc(var(--split-h) - var(--content-margin) * 2);
    transform: translateY(-50%);
}

.content-pane.top {
    left: 50%;
    top: var(--content-margin);
    width: calc(var(--split-h) - var(--content-margin) * 2);
    height: calc(var(--pane-split, 50%) - var(--content-margin) * 2);
    transform: translateX(-50%);
}

.content-pane.bottom {
    left: var(--content-margin);
    right: var(--content-margin);
    top: calc(100% - var(--pane-split, 50%));
    bottom: var(--content-margin);
}

body.footer-visible .content-pane.bottom {
    bottom: calc(var(--content-margin) + var(--footer-h, 0px));
}

body.header-visible .content-pane.top {
    top: calc(var(--content-margin) + var(--header-h, 0px));
}

.content-pane.fullscreen {
    inset: var(--content-margin);

    transform: none;
    border-radius: 0;
}

.content-pane.fullscreen.plain-text {
    border-radius: 5px;
}

.content-pane.paused {
    border: 1.5px solid var(--accent);
}



/* Post header — visible on first slide only */
.content-pane .header {
    flex-shrink: 0;
    padding: 0.75em 1em;
    max-height: 200px;
    overflow: hidden;
    border-bottom: 1px solid var(--divider);
    transition:
        opacity var(--transition-duration) var(--transition-easing),
        max-height var(--transition-duration) var(--transition-easing),
        padding var(--transition-duration) var(--transition-easing),
        border-color 0.3s ease;
}

.content-pane .header h1 {
    font-size: clamp(1.4rem, 3.5vw, 2.8rem);
    color: var(--panel-text);
    margin: 0 0 4px;
    line-height: 1.15;
    transition: color 0.3s ease;
}

.content-pane .header h2 {
    display: block;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: var(--panel-subtext);
    transition: color 0.3s ease;
}

.content-pane .header h3 {
    display: block;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    color: var(--panel-subtext);
    font-style: italic;
    font-weight: 400;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.content-pane .header h3:empty {
    display: none;
}

/* Hide header on slide 2+ */
.content-pane.slide-2 .header {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Scrollable body — header + section scroll together */
.content-pane>.scroll-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--btn-bg-hover) transparent;
}

.content-pane>.scroll-body::-webkit-scrollbar {
    width: 5px;
}

.content-pane>.scroll-body::-webkit-scrollbar-track {
    background: transparent;
}

.content-pane>.scroll-body::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: var(--btn-bg-hover);
}

.content-pane>.scroll-body::-webkit-scrollbar-thumb:hover {
    background: var(--btn-bg-active);
}

.content-pane .section {
    padding: 0.75em 1em;
}

.content-pane .section h2 {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--panel-text);
    margin: 0 0 8px;
    transition: color 0.3s ease;
}

.content-pane .section p {
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    line-height: 1.6;
    margin: 0 0 12px;
    color: var(--panel-subtext);
    transition: color 0.3s ease;
}

.content-pane .section h1 {
    font-size: clamp(1.4rem, 3.5vw, 2.8rem);
    color: var(--panel-text);
    margin: 8px;
    line-height: 1.15;
    transition: color 0.3s ease;
}

.content-pane .section ul {
    margin: 0 0 12px;
    padding-left: 1.4em;
}

.content-pane .section li {
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    line-height: 1.6;
    color: var(--panel-subtext);
    transition: color 0.3s ease;
}

/* Controls bar — playback on left, navigation on right */
.content-pane>.controls {
    position: relative;
    z-index: 15;
    flex-shrink: 0;
    min-height: calc(2.4rem + 24px);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--divider);
    transition: border-color 0.3s ease;
}

.content-pane>.controls>.playback,
.content-pane>.controls>.navigation {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}

.content-pane>.controls button {
    width: 2.0rem;
    height: 2.0rem;
    padding: 4px;
    border: none;
    border-radius: 5px;
    background: var(--btn-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--btn-color);
    transition: color 0.15s, background 0.15s, transform 0.15s;
}

.content-pane>.controls button:hover {
    color: var(--panel-text);
    background: var(--btn-bg-hover);
    transform: scale(1.1);
}

.content-pane>.controls>.center-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
}

/* Default — presentation-only buttons hidden until plain-text mode */
.content-pane>.controls>.center-controls button.presentation-btn,
.content-pane>.controls>.center-controls button.theme-light,
.content-pane>.controls>.center-controls button.theme-dark {
    display: none;
}

/* Plain-text mode — swap visible buttons */
.content-pane.plain-text>.controls>.playback,
.content-pane.plain-text>.controls>.navigation {
    display: none;
}

.content-pane.plain-text>.controls>.center-controls button.plain-text-btn,
.content-pane.plain-text>.controls>.center-controls button.help {
    display: none;
}

.content-pane.plain-text>.controls>.center-controls button.presentation-btn {
    display: flex;
}

body.light .content-pane.plain-text>.controls>.center-controls button.theme-dark,
body.dark .content-pane.plain-text>.controls>.center-controls button.theme-light {
    display: flex;
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: 0 0 8px 3px rgba(67, 255, 50, 0.55);
    }
}

.content-pane>.controls button.glow {
    animation: glow-pulse 1.4s ease-in-out infinite;
}

.content-pane>.controls button.btn-nav-disabled {
    opacity: 0.2;
    pointer-events: none;
    cursor: default;
    transition: opacity 0.2s ease;
}

@keyframes content-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content-item {
    animation: content-fade-in var(--transition-duration) var(--transition-easing) both;
}

/* Plain text mode — hide pane header (title rendered in section instead) */
.content-pane.plain-text>.header {
    display: none;
}

/* Plain text mode — section paragraphs use full text colour (not subtext) */
.content-pane.plain-text>.section p,
.content-pane.plain-text>.section li {
    color: var(--panel-text);
}

/* Help overlay */
.help-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background-color: var(--panel-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.2em 1.5em 1.5em;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    transition: background-color 0.3s ease;
}

.help-overlay.help-hidden {
    display: none;
}

.help-overlay .help-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--panel-subtext);
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.help-overlay .help-close:hover {
    color: var(--panel-text);
}

.help-overlay h3 {
    margin: 0.6em 0 0.2em;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--panel-subtext);
    transition: color 0.3s ease;
}

.help-overlay ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.help-overlay li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--panel-text);
    transition: color 0.3s ease;
}

.help-overlay .help-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-shrink: 0;
    color: var(--btn-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.help-overlay .help-icon svg {
    width: 100%;
    height: 100%;
}

/* #endregion */




/* #region CTA Tile buttons */

#tiles {
    position: absolute;
    bottom: 180px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: row;
    gap: var(--tile-gap);
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    transition: opacity var(--transition-duration) var(--transition-easing);
}

.tile {
    width: var(--tile-size);
    min-width: var(--tile-size);
    height: var(--tile-size);
    padding: 0;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: var(--panel-bg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.tile-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: rgba(60, 60, 60, 0.25);
    opacity: 0.35;
}

.tile-title {
    position: relative;
    padding: 5px 8px 2px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--panel-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-subtitle {
    position: relative;
    padding: 0 8px 4px;
    font-size: 0.65rem;
    color: var(--panel-subtext);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-date {
    position: relative;
    padding: 0px 8px 8px 8px;
    font-size: 0.6rem;
    color: var(--panel-subtext);
}

.tile:hover,
.tile:focus {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    outline: none;
}

.tile:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.tile-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--panel-bg) 100%);
    pointer-events: none;
}

@keyframes tile-border-pulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    }

    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), 0 0 14px 4px var(--accent);
    }
}

.tile.newest {
    border: 1px solid var(--accent);
    animation: tile-border-pulse 2s ease-in-out infinite;
}

.tile-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: bold;
    background: var(--new);
    color: #111;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* #endregion */




/* #region Fade-out when pane is open */

body.pane-open .logos {
    opacity: 0;
    pointer-events: none;
}

body.pane-open .buttons {
    opacity: 0;
    pointer-events: none;
}

/* #endregion */




/* #region SVG styling */

.logos {
    position: absolute;
    left: 5%;
    right: 5%;
    top: 50px;
    bottom: 80%;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: auto;

    transition: opacity var(--transition-duration) var(--transition-easing);
}


.logos>.left {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 0;
}



.logos>.centre {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.logos>.right {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 0;
}


.logo-icon {
    width: var(--logo-block-size);
    height: var(--logo-block-size);
}

.bold-text {
    font-family: "Trebuchet MS";
    font-weight: bold;
    fill: var(--logo-fill);
    stroke: none;
    font-size: 3.7px;
}

.logo-letters {
    width: var(--logo-block-size);
    height: var(--logo-block-size);
}

.logo-bar-horizontal {
    fill: var(--logo-fill);
    stroke: none;
    width: var(--logo-block-size);
    height: var(--logo-bar-thickness);
}

.logo-bar-vertical {
    fill: var(--logo-fill);
    stroke: none;
    width: var(--logo-bar-thickness);
    height: var(--logo-block-size);
}

.dm-cube-u {
    fill: var(--cube-u);
}

.dm-cube-l {
    fill: var(--cube-l);
}

.dm-cube-r {
    fill: var(--cube-r);
}

.tat-logo {
    fill: var(--logo-fill);
    stroke: none;
}

.tat-text>* {
    font-family: "Trebuchet MS";
    font-weight: bold;
    fill: var(--logo-fill);
    stroke: none;
    font-size: 3.7px;
}

.gt-mciat-name,
.gt-mciat-pn,
.gt-mciat-bar {
    font-family: "Trebuchet MS";
    fill: var(--logo-fill);
    stroke: none;
}

.gt-mciat-name {
    font-size: 2px;
}

.gt-mciat-pn {
    font-size: 3px;
    font-weight: bold;
}

.gt_mciat_long {
    font-family: "Trebuchet MS";
    fill: var(--logo-fill);
    stroke: none;
    font-weight: bold;
    height: 26px;
}

.gt_mciat_long_name {
    font-size: 12px;
}

.gt_mciat_long_title {
    font-size: 6px;

}


/* #endregion */




/* #region Footer */

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    z-index: 1000;
    /* background-color: var(--footer-bg); */
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

footer.footer-hidden {
    opacity: 0;
    pointer-events: none;
}

footer .left,
footer .right {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

footer .centre {
    text-align: center;
    font-size: 0.62rem;
    color: var(--panel-subtext);
    transition: color 0.3s ease;
}

footer .centre p {
    margin: 0;
}

footer .social {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0.55;
    transition: opacity 0.2s ease;
}

footer .social img {
    width: 26px;
    height: 26px;

    filter: var(--footer-filter, none);

}

footer .social:hover {
    opacity: 1;
}




/* #endregion */




/* #region Tracking Banner */

#tracking-banner {
    position: absolute;
    top: 60%;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 220, 220, 0.95);
    padding: 12px 20px;

    justify-content: center;
    align-items: center;
    z-index: 1000;

    flex-direction: column;
    gap: 12px;
    overflow: none;
}

#tracking-heading {
    font-size: 1.2rem;
    font-weight: bold;
    color: rgb(60, 60, 60);
    margin: 0;
}

#tracking-text {
    color: rgb(60, 60, 60);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: rgba(60, 60, 60, 0.5) rgba(220, 220, 220, 0.95);
    flex-grow: 1;
    flex-shrink: 1;
    padding: 10px;
}

#tracking-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    flex-shrink: 0;
    flex-grow: 1;
}

#tracking-buttons button {
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    color: rgb(60, 60, 60);
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
}

#tracking-buttons button:hover {
    opacity: 1;
}

#tracking-accept {
    background: rgb(150, 250, 150);
}

#tracking-decline {
    background: rgb(250, 150, 150);
}


/* #endregion */




/* #region Debug */

#debug-console {
    position: fixed;


    z-index: 1100;
    display: flex;
    flex-direction: column;

    background: rgba(40, 40, 40);
    color: rgb(100, 250, 100);
    font-family: monospace;
    border: none;

    opacity: 0.5;
    resize: both;
    overflow: hidden;
}

#debug-console:hover {
    opacity: 0.9;
}


#debug-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(60, 60, 60);
    height: 40px;
    /* No text highlighted */
    user-select: none;
}


#debug-messages {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
}

#debug-close {
    color: rgb(250, 100, 100);
    cursor: pointer;
}


/* #endregion */




/* #region Loading Overlay */

.loading-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: background 0.3s ease, opacity 0.3s ease;
    /* opacity duration must match FADE_IN_MS in loading.ts */
    opacity: 1;
}

.loading-overlay.appearing {
    opacity: 0;
}

.loading-overlay.fading {
    opacity: 0;
}



.loading-overlay .card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-overlay .card svg.logo-icon {
    width: 160px;
    height: 160px;
}

.cubelet.flash>polygon {
    fill: var(--cube-flash) !important;
}

.loading-overlay .bar {
    display: flex;
    gap: 5px;
}

.seg {
    width: 16px;
    height: 6px;
    border-radius: 2px;
    background: var(--seg-empty);
    transition: background 0.2s ease;
}

.seg.filled {
    background: var(--seg-filled);
}

.loading-overlay .message {
    font-family: "Trebuchet MS", sans-serif;
    font-size: 0.75rem;
    color: var(--msg-color);
    letter-spacing: 0.04em;
    transition: color 0.3s ease;
}

.loading-overlay .actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-overlay .actions button {
    font-family: "Trebuchet MS", sans-serif;
    font-size: 0.78rem;
    width: 100px;
    height: 2rem;
    border: none;
    border-radius: 4px;
    background: var(--btn-bg);
    color: var(--btn-color);
    cursor: pointer;
    transition: background 0.15s;
}

.loading-overlay .actions button:hover {
    background: var(--btn-bg-hover);
}

.loading-overlay .actions button.hidden {
    display: none;
}

/* #endregion */




/* #region Orientation helpers */

.portrait {
    display: none;
}

.landscape {
    display: block;
}

@media (max-width: 768px) {
    :root {
        --logo-block-size: 20vw;
        --logo-bar-thickness: 2vw;

        --split-h: 60vh;
        --tile-size: 120px;
    }

    #logos {
        position: absolute;
        left: 10%;
        right: 10%;
        top: 50px;
        bottom: 80%;

        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: auto;

    }

    #logos>.left,
    #logos>.right {
        flex-direction: column;
        width: 10%;
        max-width: 10%;
        /* shrink content to fit */
        flex-shrink: 1;

    }

    .landscape {
        display: none;
    }

    .portrait {
        display: block;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --tile-size: min(120px, 22vh);
        --logo-block-size: min(20vw, 10vh);
        --logo-bar-thickness: min(2vw, 1vh);
    }

    #tiles {
        bottom: 15vh;
    }

    .logos {
        top: 5vh;
        bottom: 55%;
    }
}

/* #endregion */