Private
Public Access
1
0

feat: Adding economic system to do scoring

This commit is contained in:
gauvainboiche
2026-03-30 11:28:47 +02:00
parent b19fb262a4
commit c0f66d8cc0
16 changed files with 1303 additions and 145 deletions

View File

@@ -15,57 +15,6 @@ body {
min-height: 100vh;
}
/* ── Mobile / small-screen overlay ───────────────────────────────────────── */
.mobileOverlay {
display: none; /* hidden on desktop — shown via media query below */
position: fixed;
inset: 0;
z-index: 200;
background: rgba(5, 8, 18, 0.97);
backdrop-filter: blur(16px);
align-items: center;
justify-content: center;
padding: 24px;
text-align: center;
}
.mobileOverlayCard {
max-width: 360px;
padding: 40px 28px;
border-radius: 24px;
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(15, 22, 42, 0.9);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.mobileOverlayIcon {
font-size: 52px;
margin-bottom: 16px;
}
.mobileOverlayTitle {
margin: 0 0 12px;
font-size: 22px;
font-weight: 800;
letter-spacing: 0.2px;
color: rgba(113, 199, 255, 0.95);
}
.mobileOverlayText {
margin: 0;
font-size: 14px;
line-height: 1.7;
color: rgba(233, 238, 246, 0.75);
}
/* Show overlay on small / narrow screens */
@media (max-width: 768px), (max-height: 500px) {
.mobileOverlay {
display: flex;
}
}
/* ── Auth overlay ─────────────────────────────────────────────────────────── */
.authOverlay {
@@ -242,7 +191,7 @@ body {
background: rgba(113, 199, 255, 0.28);
}
/* ── Team corner (debug) ──────────────────────────────────────────────────── */
/* ── Team corner (admin only) ─────────────────────────────────────────────── */
.teamCorner {
position: fixed;
@@ -327,6 +276,7 @@ body {
.scoreBoard {
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
padding: 10px 16px;
border-radius: 14px;
@@ -334,6 +284,7 @@ body {
background: rgba(255, 255, 255, 0.04);
font-size: 22px;
font-weight: 800;
font-family: "Courier New", Courier, monospace;
font-variant-numeric: tabular-nums;
letter-spacing: 0.5px;
}
@@ -341,9 +292,16 @@ body {
.scoreTeam {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.team-logo {
width: 64px;
height: 64px;
display: block;
}
.scoreTeamName {
font-size: 12px;
font-weight: 700;
@@ -380,17 +338,16 @@ body {
.app {
display: flex;
flex-direction: row;
align-items: stretch;
height: 100vh;
overflow: hidden;
align-items: flex-start;
justify-content: center;
min-height: 100vh;
}
/* ── Left information column ──────────────────────────────────────────────── */
.infoColumn {
flex: 1 1 0;
min-width: 260px;
max-width: 420px;
flex: 0 0 500px;
width: 500px;
display: flex;
flex-direction: column;
gap: 16px;
@@ -399,6 +356,7 @@ body {
overflow-x: hidden;
background: rgba(7, 10, 20, 0.55);
border-right: 1px solid rgba(255, 255, 255, 0.07);
min-height: 100vh;
}
/* Scrollbar styling for the info column */
@@ -413,6 +371,20 @@ body {
border-radius: 4px;
}
/* Mobile close button — hidden on desktop */
.closeMenuBtn {
display: none;
align-self: flex-end;
padding: 6px 10px;
font-size: 16px;
border: 1px solid rgba(255, 255, 255, 0.14);
background: rgba(255, 255, 255, 0.07);
color: #e9eef6;
border-radius: 8px;
cursor: pointer;
margin-bottom: 4px;
}
.infoSection--title .h1 {
font-size: 17px;
font-weight: 700;
@@ -431,6 +403,7 @@ body {
display: flex;
flex-direction: column;
gap: 6px;
font-family: "Courier New", Courier, monospace;
}
.infoRow {
@@ -455,10 +428,12 @@ body {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-family: "Courier New", Courier, monospace;
}
.infoVal code {
font-size: 11px;
font-family: "Courier New", Courier, monospace;
padding: 2px 7px;
border-radius: 7px;
background: rgba(255, 255, 255, 0.08);
@@ -493,9 +468,11 @@ body {
display: flex;
align-items: baseline;
gap: 2px;
font-family: "Courier New", Courier, monospace;
}
.countdown {
font-family: "Courier New", Courier, monospace;
font-variant-numeric: tabular-nums;
min-width: 2ch;
text-align: right;
@@ -510,6 +487,7 @@ body {
#userDisplay {
font-weight: 600;
font-size: 12px;
font-family: "Courier New", Courier, monospace;
}
.logoutBtn {
@@ -584,6 +562,7 @@ button:hover {
margin: 0;
padding: 12px 14px 14px;
font-size: 12px;
font-family: "Courier New", Courier, monospace;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-word;
@@ -595,17 +574,317 @@ button:hover {
font-style: italic;
}
/* ── Galaxy: square, pinned to the right ──────────────────────────────────── */
/* ── Collapsible panel variant ────────────────────────────────────────────── */
.panelCollapsible {
border-radius: 14px;
border: 1px solid rgba(255, 255, 255, 0.09);
background: rgba(255, 255, 255, 0.03);
overflow: hidden;
min-height: unset;
}
.panelTitleSummary {
padding: 10px 14px;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.06em;
opacity: 0.7;
cursor: pointer;
list-style: none;
user-select: none;
display: flex;
align-items: center;
gap: 6px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
transition: opacity 0.15s;
}
.panelTitleSummary::-webkit-details-marker {
display: none;
}
.panelCollapsible[open] .panelTitleSummary {
opacity: 0.9;
}
.panelTitleSummary:hover {
opacity: 1;
}
/* ── Team income summary ──────────────────────────────────────────────────── */
.econSummary {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px 12px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.03);
font-family: "Courier New", Courier, monospace;
font-size: 12px;
}
.econSummaryTeam {
display: flex;
align-items: center;
gap: 8px;
}
.econSummaryTeam--blue .econSummaryLabel { color: rgba(90, 200, 255, 0.85); }
.econSummaryTeam--blue .econSummaryVal { color: rgba(90, 200, 255, 1); font-weight: 700; }
.econSummaryTeam--red .econSummaryLabel { color: rgba(220, 75, 85, 0.85); }
.econSummaryTeam--red .econSummaryVal { color: rgba(220, 75, 85, 1); font-weight: 700; }
.econSummarySep {
opacity: 0.3;
}
/* ── Economic score (cumulative) ──────────────────────────────────────────── */
.econSummaryRow {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
gap: 8px;
}
.econSummaryRow--score {
border-top: 1px solid rgba(255, 255, 255, 0.06);
padding-top: 6px;
margin-top: 4px;
}
.econScoreVal {
font-size: 13px;
font-weight: 800;
font-family: "Courier New", Courier, monospace;
font-variant-numeric: tabular-nums;
}
.econSummaryTeam--blue .econScoreVal { color: rgba(90, 200, 255, 1); }
.econSummaryTeam--red .econScoreVal { color: rgba(220, 75, 85, 1); }
/* Delta badge */
@keyframes econDeltaFade {
0% { opacity: 0; transform: translateY(2px); }
12% { opacity: 1; transform: translateY(-3px); }
70% { opacity: 1; transform: translateY(-3px); }
100% { opacity: 0; transform: translateY(-7px); }
}
.econDelta {
font-weight: 700;
font-size: 11px;
font-family: "Courier New", Courier, monospace;
color: rgba(90, 210, 130, 0.95);
opacity: 0;
min-width: 6ch;
display: inline-block;
text-align: center;
}
.econDelta--active {
animation: econDeltaFade 3s ease forwards;
}
/* ── Economy resource table ───────────────────────────────────────────────── */
.econTableWrap {
padding: 4px 8px 10px;
overflow-x: auto;
}
.econEmpty {
margin: 10px 14px;
font-size: 12px;
opacity: 0.5;
font-style: italic;
font-family: "Courier New", Courier, monospace;
}
.econTable {
width: 100%;
border-collapse: collapse;
font-size: 11px;
font-family: "Courier New", Courier, monospace;
}
.econTable thead th {
padding: 6px 8px;
text-align: left;
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
opacity: 0.55;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
white-space: nowrap;
}
.econTh {
cursor: pointer;
user-select: none;
transition: opacity 0.15s;
}
.econTh:hover {
opacity: 0.9;
}
.econTh--active {
opacity: 0.9;
color: rgba(113, 199, 255, 0.95);
}
.econSortIcon {
font-style: normal;
opacity: 0.55;
margin-left: 2px;
font-size: 9px;
}
.econTh--active .econSortIcon {
opacity: 1;
color: rgba(113, 199, 255, 1);
}
.econTable tbody tr:hover {
background: rgba(255, 255, 255, 0.04);
}
.econTable td {
padding: 4px 8px;
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
vertical-align: middle;
}
.econ-label {
color: rgba(233, 238, 246, 0.9);
white-space: nowrap;
}
.econ-cat {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
white-space: nowrap;
}
.econ-cat--commun {
color: rgba(170, 180, 200, 0.7);
}
.econ-cat--rare {
color: rgba(255, 210, 100, 0.85);
}
.econ-worth {
text-align: right;
color: rgba(113, 199, 255, 0.85);
font-weight: 600;
white-space: nowrap;
}
.econ-income {
text-align: right;
color: rgba(233, 238, 246, 0.4);
white-space: nowrap;
}
.econ-income--positive {
color: rgba(90, 210, 130, 0.95);
font-weight: 700;
}
/* ── Options / admin section ──────────────────────────────────────────────── */
.infoSection--options {
margin-top: auto;
padding-top: 8px;
}
.optionsDetails {
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.07);
overflow: hidden;
}
.optionsSummary {
padding: 8px 12px;
font-size: 11px;
font-weight: 600;
opacity: 0.6;
cursor: pointer;
list-style: none;
user-select: none;
}
.optionsSummary::-webkit-details-marker {
display: none;
}
.optionsSummary:hover {
opacity: 0.9;
}
.optionsPanel {
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.optionsPanel .authField input[type="password"] {
padding: 8px 10px;
font-size: 12px;
font-family: "Courier New", Courier, monospace;
}
.adminUnlockBtn {
padding: 7px 12px;
font-size: 12px;
align-self: flex-start;
}
.adminStatus {
font-size: 11px;
padding: 6px 10px;
border-radius: 7px;
font-family: "Courier New", Courier, monospace;
}
.adminStatus.hidden {
display: none;
}
.adminStatus--ok {
color: rgba(90, 200, 130, 0.95);
background: rgba(30, 120, 60, 0.15);
border: 1px solid rgba(30, 150, 70, 0.25);
}
.adminStatus--err {
color: rgba(255, 130, 100, 0.95);
background: rgba(200, 50, 30, 0.12);
border: 1px solid rgba(200, 50, 30, 0.25);
}
/* ── Galaxy: square, fills viewport height, 1:1 ratio ────────────────────── */
.galaxyMain {
/* Height fills the viewport; aspect-ratio keeps it perfectly square */
flex: 0 0 auto;
/* Fit the tallest square that fits in the viewport without overlapping the info column */
--map-size: min(100vh, calc(100vw - 340px));
position: relative;
height: 100vh;
aspect-ratio: 1 / 1;
/* Constrain width so the canvas never exceeds available space */
max-width: calc(100vw - 260px);
background: #000;
width: var(--map-size);
height: var(--map-size);
flex-shrink: 0;
background: #050810;
overflow: hidden;
}
@@ -616,12 +895,35 @@ canvas {
image-rendering: pixelated;
}
/* ── Burger button (hidden on desktop) ────────────────────────────────────── */
.burgerBtn {
display: none;
position: absolute;
top: 12px;
left: 12px;
z-index: 20;
width: 44px;
height: 44px;
padding: 0;
font-size: 22px;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.18);
background: rgba(7, 10, 20, 0.82);
backdrop-filter: blur(8px);
color: #e9eef6;
align-items: center;
justify-content: center;
cursor: pointer;
}
.hint {
position: absolute;
left: 14px;
bottom: 14px;
padding: 10px 12px;
font-size: 12px;
font-family: "Courier New", Courier, monospace;
opacity: 0.8;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.1);
@@ -629,4 +931,64 @@ canvas {
backdrop-filter: blur(6px);
max-width: calc(100% - 28px);
pointer-events: none;
}
/* ── Mobile responsive (≤768px) ───────────────────────────────────────────── */
@media (max-width: 768px) {
.app {
flex-direction: column;
align-items: center;
min-height: 100dvh;
}
/* Hide the left column by default on mobile */
.infoColumn {
display: none;
position: fixed;
inset: 0;
z-index: 50;
width: 100%;
max-width: 420px;
min-height: unset;
height: 100dvh;
overflow-y: auto;
background: rgba(7, 10, 20, 0.97);
backdrop-filter: blur(16px);
border-right: none;
flex-shrink: 0;
}
/* Show the panel when open */
.infoColumn--open {
display: flex;
}
/* Show close button on mobile */
.closeMenuBtn {
display: flex;
}
/* Show burger button on mobile */
.burgerBtn {
display: flex;
}
/* Galaxy scales to viewport width (square) */
.galaxyMain {
--map-size: 100vw;
width: 100vw;
height: 100vw;
}
/* Scoreboard wraps nicely on narrow screens */
.scoreBoard {
flex-wrap: wrap;
font-size: 18px;
}
.team-logo {
width: 44px;
height: 44px;
}
}