/* Life In One - the HTML around the canvas: build panel, unit panel, HUD, buttons and the title logo.
   --k (set by js/menus.js) grows everything on big screens; 1 on a phone. */
.gameContainer {
    --k: 1;
    --cyan: #4fe3ff;
    --violet: #8a5cff;
    --amber: #ffb13b;
    --glass: rgba(14, 12, 38, 0.78);
    --glass2: rgba(30, 22, 70, 0.78);
    --line: rgba(127, 246, 255, 0.28);
    --font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    position: absolute; inset: 0; overflow: hidden;
    background: #07051a;
    font-family: var(--font);
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.gameContainer * { margin: 0; box-sizing: content-box; }
#gameSurface { position: absolute; left: 0; top: 0; display: block; }
#mainAd { position: absolute; top: 0; left: 0; width: 0; height: 0; }
#console { position: absolute; left: -10000px; }
.view { }

/* ---------------------------------------------------------------- shared buttons */
.lio-btn {
    width: calc(38px * var(--k)); height: calc(38px * var(--k));
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(80, 70, 160, 0.95), rgba(18, 14, 46, 0.92));
    border: 1.5px solid var(--line);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .12s, border-color .12s, box-shadow .12s;
}
.lio-btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(79, 227, 255, 0.45), 0 4px 14px rgba(0, 0, 0, 0.45); transform: translateY(-1px); }
.lio-btn svg, #pbclose svg { width: 58%; height: 58%; fill: none; stroke: #dffbff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.button {
    float: left;
    min-width: calc(60px * var(--k)); padding: 0 calc(10px * var(--k));
    height: calc(30px * var(--k)); line-height: calc(30px * var(--k));
    margin: 0 calc(5px * var(--k)) calc(5px * var(--k)) 0;
    text-align: center; white-space: nowrap;
    border-radius: 999px; cursor: pointer;
    color: #e8fbff; font-weight: bold; font-size: calc(12.5px * var(--k)); letter-spacing: .04em; text-transform: uppercase;
    background: linear-gradient(180deg, rgba(79, 227, 255, 0.22), rgba(79, 227, 255, 0.06));
    border: 1.5px solid rgba(79, 227, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: background .12s, color .12s, box-shadow .12s;
}
.button:hover { background: linear-gradient(180deg, rgba(79, 227, 255, 0.45), rgba(79, 227, 255, 0.2)); box-shadow: 0 0 12px rgba(79, 227, 255, 0.5); }
.button.sel, .button.off { background: linear-gradient(180deg, #7ff6ff, #2bb6e0); color: #06202b; border-color: #bffaff; }
.button.sell, .button.cancelBuild { border-color: rgba(255, 120, 140, 0.7); background: linear-gradient(180deg, rgba(255, 110, 140, 0.25), rgba(255, 110, 140, 0.06)); }
.button.launch, .button.build { border-color: rgba(255, 190, 90, 0.8); background: linear-gradient(180deg, rgba(255, 180, 70, 0.35), rgba(255, 140, 40, 0.1)); }
.button.repair { border-color: rgba(110, 255, 170, 0.7); background: linear-gradient(180deg, rgba(110, 255, 170, 0.25), rgba(110, 255, 170, 0.06)); }

/* ---------------------------------------------------------------- panels */
.floatingPanel { z-index: 2; position: absolute; }
.floatingPanel .panel {
    overflow: hidden;
    background: linear-gradient(180deg, var(--glass2), var(--glass));
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border: 1.5px solid var(--line);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
#topPanel { right: 0; width: calc(320px * var(--k)); max-width: calc(100% - 8px); }
#topPanel .panel { border-top: none; border-right: none; border-radius: 0 0 0 calc(18px * var(--k)); }
.floatingPanel .inner { padding: calc(6px * var(--k)) 0 calc(6px * var(--k)) calc(6px * var(--k)); }
.floatingPanel .inner .panelItem { overflow: hidden; }
.floatingPanel .itemPlace .viewport { overflow-x: hidden; max-width: 100%; }
.floatingPanel .itemPlace .viewport .library { overflow: hidden; }
.floatingPanel .itemInfo { overflow: hidden; }
.floatingPanel .itemInfo > .buildItem { width: calc(79px * var(--k)) !important; }
.floatingPanel .itemInfo .info { float: left; padding: calc(4px * var(--k)) 0 0 calc(8px * var(--k)); font-size: calc(12px * var(--k)); max-width: calc(220px * var(--k)); }
.floatingPanel .itemInfo .info .row { overflow: hidden; display: block; }
.floatingPanel .itemInfo .info .row.controls { margin: calc(6px * var(--k)) 0 0 0; }
.floatingPanel .itemInfo .info .row.controls p { color: #fff; }
.floatingPanel .itemInfo .info .row.passengers { overflow: hidden; }
.floatingPanel .itemInfo .info .row.passengers .item { float: left; cursor: pointer; }
.floatingPanel .itemInfo .info .row.passengers .item .inner {
    display: block; padding: 2px; margin: 0 calc(4px * var(--k)) calc(4px * var(--k)) 0;
    background: rgba(255, 255, 255, 0.06); border: 1.5px solid var(--line); border-radius: calc(8px * var(--k));
}
.floatingPanel .itemInfo .info .row.passengers .item .inner img { width: calc(30px * var(--k)); display: block; }
.floatingPanel .itemInfo .info .row.passengers .item .inner .empty { width: calc(30px * var(--k)); height: calc(30px * var(--k)); display: block; border-radius: 6px; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 4px, transparent 4px 8px); }

/* build items: a card with the picture, cost on top and the name underneath */
.buildItem { display: block; overflow: hidden; float: left; cursor: pointer; }
.buildItem.dis { opacity: 0.45; filter: grayscale(0.6); }
.buildItem .inner {
    position: relative; margin: 0 calc(6px * var(--k)) calc(6px * var(--k)) 0;
    border-radius: calc(12px * var(--k)); overflow: hidden;
    background: radial-gradient(circle at 50% 38%, rgba(110, 90, 220, 0.55), rgba(20, 16, 52, 0.95) 70%);
    border: 1.5px solid rgba(160, 140, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: border-color .12s, box-shadow .12s, transform .12s;
}
.buildItem:hover .inner { border-color: var(--cyan); box-shadow: 0 0 14px rgba(79, 227, 255, 0.45); transform: translateY(-1px); }
.buildItem .inner img { width: 100%; display: block; background: none !important; }
.buildItem .inner .split { display: none; }
.buildItem .inner .title { display: block; width: 100%; padding: calc(3px * var(--k)) 0 calc(4px * var(--k)); background: rgba(6, 4, 20, 0.7); }
.buildItem .inner .title span { color: #eaf6ff; text-align: center; display: block; font-size: calc(9.5px * var(--k)); line-height: 1.15; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.buildItem .inner .qty { position: absolute; top: calc(20px * var(--k)); right: calc(4px * var(--k)); min-width: 1.4em; text-align: center; padding: 1px 5px; border-radius: 999px; background: var(--cyan); color: #06202b; font-size: calc(11px * var(--k)); font-weight: bold; }
.buildItem .inner .min { display: block; height: calc(15px * var(--k)); position: relative; background: rgba(6, 4, 20, 0.7); }
.buildItem .inner .min .m { position: absolute; top: 0; overflow: hidden; font-size: calc(9.5px * var(--k)); line-height: calc(15px * var(--k)); font-weight: bold; display: block; }
.buildItem .inner .min .ml { left: calc(3px * var(--k)); color: #ffd27a; }
.buildItem .inner .min .mr { right: calc(3px * var(--k)); color: #8ff3ff; }
.buildItem .inner .min .m img { float: left; width: calc(11px * var(--k)); margin-top: calc(2px * var(--k)); }
.buildItem .inner .min .m span { float: left; margin-left: 1px; }
.buildItem.sep { }

/* the round buttons that hang under the top panel */
#topPanelTab, #save, #pause { position: absolute; bottom: calc(-48px * var(--k) - 18px); z-index: 2; }
#topPanelTab { right: calc(8px * var(--k)); }
#save { right: calc(54px * var(--k)); }
#pause { right: calc(100px * var(--k)); }
#topPanelTab svg { transition: transform .2s; }

/* research notice, bottom right */
#bottomPanel { right: calc(8px * var(--k)); width: calc(300px * var(--k)); max-width: calc(100% - 16px); transition: none; }
#bottomPanel .panel { border-radius: calc(16px * var(--k)) calc(16px * var(--k)) 0 0; border-bottom: none; }
#bottomPanel .content { padding: calc(8px * var(--k)) calc(30px * var(--k)) calc(8px * var(--k)) calc(8px * var(--k)); overflow: hidden; }
#bottomPanel .content .item { width: calc(60px * var(--k)); }
#bottomPanel .content .item .inner { margin: 0; }
#bottomPanel .content .desc { margin-left: calc(70px * var(--k)); font-size: calc(12.5px * var(--k)); color: #eaf6ff; line-height: 1.35; }
#bottomPanel .content .desc .inner { padding: calc(6px * var(--k)) 0 0 0; }
#bottomPanel .content .desc strong { color: var(--cyan); }
#pbclose { position: absolute; top: calc(8px * var(--k)); right: calc(8px * var(--k)); width: calc(20px * var(--k)); height: calc(20px * var(--k)); cursor: pointer; display: flex; align-items: center; justify-content: center; }
#pbclose svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- HUD */
#playerHud {
    position: absolute; left: calc(10px * var(--k)); bottom: calc(10px * var(--k)); z-index: 2;
    padding: calc(8px * var(--k)) calc(12px * var(--k));
    min-width: calc(128px * var(--k));
    background: linear-gradient(180deg, var(--glass2), var(--glass));
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    border: 1.5px solid var(--line); border-radius: calc(16px * var(--k));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
#playerHud .row { overflow: hidden; margin: calc(2px * var(--k)) 0; white-space: nowrap; }
#playerHud .row .t { float: left; color: #fff; font-weight: bold; font-size: calc(15px * var(--k)); line-height: calc(22px * var(--k)); font-variant-numeric: tabular-nums; }
#playerHud .row .t img { float: left; width: calc(20px * var(--k)); height: calc(20px * var(--k)); margin: calc(1px * var(--k)) calc(6px * var(--k)) 0 0; }
#playerHud .row.min0 .t { color: #ffe2a0; text-shadow: 0 0 10px rgba(255, 177, 59, 0.5); }
#playerHud .row.min1 .t { color: #c8f8ff; text-shadow: 0 0 10px rgba(79, 227, 255, 0.5); }
#playerHud .row .g { float: left; padding-left: calc(8px * var(--k)); font-size: calc(11px * var(--k)); line-height: calc(22px * var(--k)); font-weight: bold; color: #6dffa8; }
#playerHud .row .g:empty { display: none; }
#playerHud .lio-extra { display: none; margin-top: calc(5px * var(--k)); padding-top: calc(5px * var(--k)); border-top: 1px solid rgba(255, 255, 255, 0.12); }
.lio-playing #playerHud .lio-extra { display: block; }
#lioHeart { float: left; display: flex; align-items: center; }
#lioHeart img { width: calc(20px * var(--k)); height: calc(20px * var(--k)); margin-right: calc(6px * var(--k)); }
#lioHeart .bar { display: block; width: calc(64px * var(--k)); height: calc(8px * var(--k)); border-radius: 99px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.25); overflow: hidden; }
#lioHeart .fill { display: block; height: 100%; width: 100%; border-radius: 99px; background: linear-gradient(90deg, #ff4f8a, #ff9cc0); box-shadow: 0 0 8px rgba(255, 80, 140, 0.8); transition: width .3s; }
#lioHeart.low .fill { animation: lio-pulse .6s infinite alternate; }
#lioAliens { float: left; margin-left: calc(10px * var(--k)); color: #b9ff8a; font-weight: bold; font-size: calc(13px * var(--k)); line-height: calc(20px * var(--k)); opacity: 0.35; display: flex; align-items: center; }
#lioAliens.on { opacity: 1; text-shadow: 0 0 8px rgba(150, 255, 90, 0.7); }
#lioAliens i { display: inline-block; width: calc(14px * var(--k)); height: calc(14px * var(--k)); margin-right: calc(4px * var(--k)); border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 35% 40%, #fff 0 18%, #111 19% 27%, transparent 28%), radial-gradient(circle at 68% 40%, #fff 0 18%, #111 19% 27%, transparent 28%), radial-gradient(circle at 50% 40%, #b9ff8a, #2b7a24); }
.negative { color: #ff6b7a !important; }
.positive { color: #6dffa8 !important; }
@keyframes lio-pulse { from { opacity: 1; } to { opacity: 0.35; } }

/* ---------------------------------------------------------------- loading */
#pleaseWait { position: absolute; left: 50%; top: 50%; z-index: 100; transform: translate(-50%, -50%); }
#pleaseWait .inner {
    display: flex; align-items: center; gap: 12px; padding: 14px 22px;
    color: #eaf6ff; font-weight: bold; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
    background: linear-gradient(180deg, var(--glass2), var(--glass)); border: 1.5px solid var(--line); border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
#pleaseWait i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(79, 227, 255, 0.25); border-top-color: var(--cyan); animation: lio-spin .8s linear infinite; }
@keyframes lio-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- title logo (over the demo planet) */
#lioLogo {
    position: absolute; left: 50%; top: 9%; z-index: 3; transform: translate(-50%, -12px);
    text-align: center; pointer-events: none; opacity: 0; transition: opacity .6s, transform .6s;
    width: 92%;
}
#lioLogo.on { opacity: 1; transform: translate(-50%, 0); }
#lioLogo .heart { width: clamp(56px, 11vmin, 120px); height: auto; filter: drop-shadow(0 0 18px rgba(255, 90, 150, 0.8)); animation: lio-beat 1.6s ease-in-out infinite; }
#lioLogo h1 {
    margin-top: 0.1em;
    font: 900 clamp(38px, 10vmin, 112px)/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
    background: linear-gradient(180deg, #ffffff 0%, #bff6ff 40%, #4fe3ff 62%, #8a5cff 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 4px 0 rgba(20, 8, 60, 0.9)) drop-shadow(0 0 22px rgba(79, 227, 255, 0.45));
}
#lioLogo p { margin-top: .5em; color: #ffd9c2; font: bold clamp(13px, 2.4vmin, 24px) var(--font); letter-spacing: .35em; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
@keyframes lio-beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.07); } }

/* the old start screen, popup and name entry are SgPopup screens now */
#front, #popupCover, #mainPopup { display: none !important; }

/* ---------------------------------------------------------------- SgPopup: unit info */
.lio-pop .lio-info { display: flex; gap: 1em; align-items: flex-start; text-align: left; }
.lio-pop .lio-info .pic { flex: 0 0 5.5em; height: 5.5em; border-radius: .8em; background: radial-gradient(circle at 50% 40%, rgba(110, 90, 220, 0.6), rgba(20, 16, 52, 0.9) 72%); border: 1.5px solid rgba(160, 140, 255, 0.35); }
.lio-pop .lio-info .pic img { width: 100%; height: 100%; display: block; }
.lio-pop .lio-info .txt p { margin: 0 0 .5em; line-height: 1.45; }
.lio-pop .lio-info .metal { color: #ffc56b; font-weight: bold; }
.lio-pop .lio-info .energy { color: #7ff6ff; font-weight: bold; }
.sgp.lio-pop { --sgp-card: rgba(22, 16, 54, 0.94); --sgp-card-2: rgba(12, 9, 32, 0.96); --sgp-font: "Trebuchet MS", "Segoe UI", Arial, sans-serif; }

@media (prefers-reduced-motion: reduce) {
    #lioLogo .heart, #lioHeart.low .fill, #pleaseWait i { animation: none; }
}
