Files
game-forest/src/App.css
T

289 lines
5.4 KiB
CSS

.app {
display: flex;
flex-direction: column;
height: 100%;
}
.topbar {
display: flex;
align-items: center;
gap: 20px;
padding: 10px 16px;
background: var(--panel-bg);
border-bottom: 4px solid var(--panel-border);
box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
flex-shrink: 0;
}
.topbar__title {
font-size: 14px;
margin: 0;
color: var(--accent);
text-shadow: 2px 2px 0 var(--panel-border);
}
.topbar .spacer {
flex-grow: 1;
}
.inventory-slot {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
background: rgba(0, 0, 0, 0.25);
border: 3px solid var(--panel-border);
font-size: 14px;
}
.exit-menu-btn {
padding: 8px 12px;
background: rgba(0, 0, 0, 0.25);
border: 3px solid var(--panel-border);
color: var(--text);
font-family: inherit;
font-size: 12px;
cursor: pointer;
}
.exit-menu-btn:hover {
border-color: var(--accent);
color: var(--accent);
}
.main-menu {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 40px;
background: var(--panel-bg);
}
.main-menu__version {
position: absolute;
left: 50%;
bottom: 12px;
transform: translateX(-50%);
font-size: 10px;
color: var(--panel-border);
}
.main-menu__title {
font-size: 32px;
margin: 0;
color: var(--accent);
text-shadow: 4px 4px 0 var(--panel-border);
}
.main-menu__buttons {
display: flex;
flex-direction: column;
gap: 16px;
width: 260px;
}
/* Temporary — see MainMenu.ts/DebugCharacterPreview.ts. */
.main-menu__debug-preview {
width: 128px;
height: 128px;
}
.menu-btn {
padding: 16px;
background: rgba(0, 0, 0, 0.25);
border: 4px solid var(--panel-border);
color: var(--text);
font-family: inherit;
font-size: 14px;
cursor: pointer;
}
.menu-btn:hover:not(:disabled) {
border-color: var(--accent);
color: var(--accent);
}
.menu-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.main-row {
display: flex;
flex-direction: row;
flex-grow: 1;
min-height: 0;
}
.sidebar {
width: 260px;
flex-shrink: 0;
background: var(--panel-bg);
border-right: 4px solid var(--panel-border);
overflow-y: auto;
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}
.sidebar__title {
font-size: 13px;
margin: 0;
color: var(--accent);
text-shadow: 2px 2px 0 var(--panel-border);
}
.upgrade-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.upgrade-btn {
display: flex;
flex-direction: column;
gap: 6px;
padding: 10px;
background: rgba(0, 0, 0, 0.25);
border: 3px solid var(--panel-border);
color: var(--text);
font-family: inherit;
font-size: 10px;
line-height: 1.5;
text-align: left;
cursor: pointer;
}
.upgrade-btn:hover:not(:disabled) {
border-color: var(--accent);
}
.upgrade-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.upgrade-btn__header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
.upgrade-btn__level {
color: var(--accent);
flex-shrink: 0;
}
.upgrade-btn__effects {
display: flex;
align-items: center;
gap: 6px;
color: #cbd5c0;
}
.upgrade-btn__arrow {
color: var(--accent);
}
.upgrade-btn__cost {
display: flex;
align-items: center;
gap: 4px;
margin-top: 2px;
color: #f5c518;
}
.game-map {
position: relative;
flex-grow: 1;
overflow: hidden;
background-color: #4caf50;
background-image:
linear-gradient(45deg, #46a047 25%, transparent 25%),
linear-gradient(-45deg, #46a047 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #46a047 75%),
linear-gradient(-45deg, transparent 75%, #46a047 75%);
background-size: 32px 32px;
background-position: 0 0, 0 16px, 16px -16px, -16px 0px;
cursor: default;
touch-action: none;
user-select: none;
}
/* Wraps the blood-moon banner and death screen, both absolutely positioned over the game canvas
* (see GameOverlays.ts) — pointer-events is re-enabled on .game-over-overlay below for its button. */
.game-overlays {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 9999;
}
.blood-moon-banner {
position: absolute;
top: 15%;
left: 50%;
transform: translateX(-50%);
pointer-events: none;
z-index: 9999;
font-size: 24px;
color: #e63946;
text-shadow: 3px 3px 0 #2a0505;
animation: blood-moon-pulse 1s ease-in-out infinite;
white-space: nowrap;
}
@keyframes blood-moon-pulse {
0%, 100% {
opacity: 1;
transform: translateX(-50%) scale(1);
}
50% {
opacity: 0.75;
transform: translateX(-50%) scale(1.08);
}
}
/* Author `display: flex` below otherwise wins the cascade over the UA stylesheet's
* `[hidden] { display: none }` (equal specificity, author beats user-agent) — without this, toggling
* the `hidden` IDL property (see GameOverlays.ts) wouldn't actually hide the element. */
.game-over-overlay[hidden] {
display: none;
}
.game-over-overlay {
position: absolute;
inset: 0;
z-index: 10000;
background: rgba(0, 0, 0, 0.75);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 24px;
pointer-events: auto;
}
.game-over-overlay__message {
font-size: 16px;
color: var(--accent);
text-shadow: 2px 2px 0 var(--panel-border);
text-align: center;
padding: 0 20px;
}
.game-over-overlay__stats {
font-size: 11px;
color: var(--text);
text-align: center;
line-height: 1.8;
display: flex;
flex-direction: column;
gap: 4px;
}