Files
Battle-for-Tismo/client/css/style.css
T

450 lines
13 KiB
CSS

:root {
--hex-w: 63px;
--hex-h: 56px;
--panel-bg: linear-gradient(160deg, rgba(40, 52, 70, 0.96), rgba(18, 24, 34, 0.96));
--panel-border: rgba(150, 190, 240, 0.35);
--text: #e8eef7;
--muted: #9fb0c8;
--accent: #6cb6ff;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
height: 100%;
overflow: hidden;
background: #05070c;
color: var(--text);
font-family: "Segoe UI", "DejaVu Sans", Roboto, sans-serif;
font-size: 14px;
user-select: none;
}
#screens { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
/* ---------------------------------------------------------------- menus -- */
#screen-menu, #screen-new, #screen-join {
display: none;
align-items: center;
justify-content: center;
background:
radial-gradient(circle at 50% 20%, rgba(60, 90, 140, 0.35), transparent 60%),
linear-gradient(180deg, #0b1220, #05070c);
}
#screen-menu.active, #screen-new.active, #screen-join.active { display: flex; }
.menu-card {
width: 380px;
padding: 28px 32px;
border-radius: 14px;
background: var(--panel-bg);
border: 1px solid var(--panel-border);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
text-align: center;
}
.menu-card.wide { width: 520px; text-align: left; }
.menu-card h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: 1px; }
.menu-card.wide h1 { text-align: center; }
.tagline { color: var(--muted); margin: 0 0 24px; }
.field { display: block; margin: 14px 0; }
.field > span:first-child { display: block; color: var(--muted); margin-bottom: 5px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.field .inline { display: flex; gap: 8px; }
.field .inline input { flex: 1; }
input, select {
width: 100%;
padding: 9px 11px;
border-radius: 7px;
border: 1px solid rgba(160, 190, 230, 0.3);
background: rgba(8, 12, 20, 0.85);
color: var(--text);
font-size: 14px;
outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.menu-card.wide .row { justify-content: flex-end; }
.aero {
cursor: pointer;
padding: 9px 18px;
border-radius: 8px;
border: 1px solid rgba(150, 190, 240, 0.45);
background: linear-gradient(180deg, rgba(90, 130, 190, 0.55), rgba(35, 55, 90, 0.85));
color: var(--text);
font-size: 14px;
transition: filter 0.12s ease, transform 0.05s ease;
}
.aero:hover { filter: brightness(1.25); }
.aero:active { transform: translateY(1px); }
.aero:disabled { opacity: 0.4; cursor: default; filter: none; }
.aero.primary { background: linear-gradient(180deg, rgba(110, 175, 255, 0.7), rgba(40, 95, 175, 0.9)); }
.aero.big { display: block; width: 100%; margin: 10px 0; padding: 14px; font-size: 17px; }
.status { min-height: 20px; margin: 14px 0 0; color: #ffcf7a; text-align: center; }
.game-list {
list-style: none;
margin: 6px 0 14px;
padding: 0;
max-height: 190px;
overflow-y: auto;
border-radius: 8px;
background: rgba(0, 0, 0, 0.3);
border: 1px solid rgba(150, 190, 240, 0.15);
}
.game-list li { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); }
.game-list li:hover { background: rgba(110, 175, 255, 0.15); }
.game-list li.selected { background: rgba(110, 175, 255, 0.3); }
/* ------------------------------------------------------------- world map -- */
#screen-game.active { display: block; }
#map-viewport {
position: absolute;
inset: 0;
overflow: hidden;
background-image: url("../assets/map_background.png");
background-size: 512px 512px;
background-color: #05070c;
cursor: grab;
}
#map-viewport.dragging { cursor: grabbing; }
#map-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
/* Promote the map to its own layer only while panning, so a drag is a GPU
translation instead of a repaint of every hex. Keeping it off when idle
avoids holding a huge composited layer in memory. */
#map-viewport.dragging #map-world { will-change: transform; }
.layer { position: absolute; left: 0; top: 0; }
/* Zoomed-out level of detail: the detailed hex/fog/border layers are hidden and
a single simplified canvas is shown instead. */
#layer-overview { display: none; }
#map-world.lod #layer-overview { display: block; }
#map-world.lod .detail-layer { display: none; }
.overview-block { position: absolute; }
.hex {
position: absolute;
width: var(--hex-w);
height: var(--hex-h);
clip-path: polygon(100% 50%, 75% 0, 25% 0, 0 50%, 25% 100%, 75% 100%);
}
.hex.terrain {
background-image: url("../assets/terrain.png");
background-repeat: no-repeat;
background-size: 441px 56px;
}
.hex.territory { pointer-events: none; }
.hex.fog { pointer-events: none; }
.fog-unexplored { background: #04040a; }
.fog-explored { background: rgba(4, 6, 18, 0.62); }
.border-seg {
position: absolute;
height: 6px;
border-radius: 3px;
transform-origin: 0 50%;
pointer-events: none;
}
.tile-selection {
position: absolute;
width: var(--hex-w);
height: var(--hex-h);
clip-path: polygon(100% 50%, 75% 0, 25% 0, 0 50%, 25% 100%, 75% 100%);
border: none;
box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
pointer-events: none;
}
.entity { position: absolute; }
.unit {
--unit-size: 38px;
width: 38px;
height: 38px;
margin-left: -19px;
margin-top: -19px;
cursor: pointer;
}
.unit .unit-statuses,
.city .city-statuses {
position: absolute;
display: flex;
gap: 1px;
pointer-events: none;
z-index: 2;
}
.unit .unit-statuses { top: -4px; right: -4px; }
.city .city-statuses { top: -6px; left: 50%; transform: translateX(-50%); }
.status-icon {
width: calc(var(--unit-size, 38px) / 5);
height: calc(var(--unit-size, 38px) / 5);
display: block;
filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9));
}
.unit .body {
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid rgba(0, 0, 0, 0.65);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.unit .body img { width: 78%; height: 78%; image-rendering: auto; }
.unit.selected .body { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0,0,0,0.6); }
.unit .health {
position: absolute;
left: 3px;
right: 3px;
bottom: -7px;
height: 5px;
background: rgba(30, 0, 0, 0.85);
border: 1px solid rgba(0, 0, 0, 0.7);
border-radius: 3px;
overflow: hidden;
}
.unit .health .fill { height: 100%; background: #46d36a; }
.city {
transform: translate(-50%, -50%);
text-align: center;
}
.city .marker {
width: 26px;
height: 26px;
margin: 0 auto;
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.8);
background-color: #333;
background-size: cover;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
/* City names live in their own layer above every unit, marker and status icon,
so they stay legible instead of being covered by whatever is nearby. */
.city-label-layer { pointer-events: none; }
.city-label {
position: absolute;
transform: translate(-50%, 0);
margin-top: 15px;
font-size: 11px;
color: #fff;
text-align: center;
text-shadow: 0 1px 2px #000, 0 0 4px #000;
white-space: nowrap;
pointer-events: none;
}
.path-seg {
position: absolute;
height: 4px;
border-radius: 2px;
transform-origin: 0 50%;
pointer-events: none;
opacity: 0.85;
}
/* ------------------------------------------------------------------ HUD -- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud .panel { pointer-events: auto; }
.hidden { display: none !important; }
.panel {
position: absolute;
background: var(--panel-bg);
border: 1px solid var(--panel-border);
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
#top-panel {
left: 12px;
top: 12px;
min-width: 420px;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 14px;
}
.flag-button {
width: 64px;
height: 64px;
padding: 0;
border-radius: 10px;
border: 1px solid var(--panel-border);
background: rgba(0, 0, 0, 0.3);
cursor: pointer;
overflow: hidden;
flex: 0 0 auto;
}
.flag-button img { width: 100%; height: 100%; object-fit: cover; }
.flag-button:hover { filter: brightness(1.2); }
.top-text { flex: 0 0 auto; min-width: 150px; }
.civ-name { font-size: 19px; font-weight: 600; }
.player-name { color: var(--muted); }
.admin-label { color: #ffcf7a; font-size: 12px; }
.top-stats { display: flex; gap: 16px; margin-left: auto; }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat-value { font-size: 15px; font-variant-numeric: tabular-nums; }
#fps-label {
position: absolute;
right: 14px;
top: 12px;
font-size: 13px;
color: #8fdc8f;
text-shadow: 0 1px 2px #000;
}
#bottom-panel {
left: 50%;
bottom: 14px;
transform: translateX(-50%);
min-width: 420px;
max-width: 720px;
padding: 12px 18px;
}
.info-section.hidden { display: none !important; }
.info-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
#bottom-panel .row { justify-content: flex-start; margin-top: 10px; }
.health-bar { width: 220px; height: 12px; background: rgba(30, 0, 0, 0.8); border-radius: 6px; overflow: hidden; margin-top: 6px; }
#unit-health-fill { height: 100%; background: linear-gradient(180deg, #6fe08a, #2fa04d); }
.unit-stats { display: flex; gap: 16px; margin-top: 6px; }
.unit-stat {
font-size: 13px;
color: var(--muted);
border-bottom: 1px dotted rgba(159, 176, 200, 0.5);
cursor: help;
}
.unit-stat:hover { color: var(--text); }
.tooltip {
position: absolute;
z-index: 80;
max-width: 280px;
padding: 6px 10px;
border-radius: 7px;
background: rgba(8, 12, 20, 0.97);
border: 1px solid var(--panel-border);
color: var(--text);
font-size: 12px;
white-space: nowrap;
pointer-events: none;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
/* --------------------------------------------------------------- modals -- */
.modal {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.55);
display: flex;
align-items: center;
justify-content: center;
z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
width: 620px;
max-height: 80vh;
display: flex;
flex-direction: column;
border-radius: 14px;
background: var(--panel-bg);
border: 1px solid var(--panel-border);
box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
overflow: hidden;
}
.modal-head {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 18px;
font-size: 19px;
font-weight: 600;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-sub { padding: 10px 18px; color: var(--muted); }
.modal-body { padding: 12px 18px 18px; overflow-y: auto; }
.modal-close { padding: 4px 11px; }
.tabs { display: flex; gap: 6px; padding: 10px 18px 0; }
.tab {
cursor: pointer;
padding: 8px 16px;
border-radius: 8px 8px 0 0;
border: 1px solid transparent;
border-bottom: none;
background: rgba(0, 0, 0, 0.25);
color: var(--muted);
}
.tab.active { background: rgba(110, 175, 255, 0.22); color: var(--text); }
.tab-page { display: none; }
.tab-page.active { display: block; }
.row-card {
display: flex;
gap: 14px;
padding: 10px 12px;
margin-bottom: 8px;
border-radius: 9px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.05);
}
.row-card .info { flex: 1; }
.row-card .name { font-weight: 600; }
.row-card .desc { color: var(--muted); font-size: 12px; margin: 3px 0; }
.row-card .effects { font-size: 12px; color: #bcd4ff; }
.row-card .cost { font-size: 12px; color: var(--muted); margin-top: 3px; }
.row-card .actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.row-card .actions .aero { min-width: 170px; }
.row-card .value {
display: flex;
align-items: flex-start;
justify-content: flex-end;
min-width: 140px;
font-weight: 600;
}
.row-card .value.positive { color: #8fe3a8; }
.row-card .value.negative { color: #ff9a9a; }
.row-card .budget-detail { margin-top: 4px; }
.row-card .budget-line { font-size: 12px; color: var(--muted); margin-top: 2px; }
.training-status { padding: 0 18px 16px; }
.progress { height: 14px; margin-top: 8px; background: rgba(0, 0, 0, 0.5); border-radius: 7px; overflow: hidden; }
#train-progress, #buildings-progress { height: 100%; width: 0; background: linear-gradient(180deg, #7fc4ff, #2f7fd0); }
.banner {
position: absolute;
left: 50%;
top: 12px;
transform: translateX(-50%);
padding: 10px 20px;
border-radius: 8px;
background: rgba(140, 20, 20, 0.9);
border: 1px solid rgba(255, 120, 120, 0.6);
z-index: 60;
}