diff --git a/apps/api/package.json b/apps/api/package.json index c5b8eaf..00e2eb9 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -15,6 +15,7 @@ "dependencies": { "@fastify/cookie": "^11.0.2", "@fastify/cors": "^11.1.0", + "@fastify/rate-limit": "^10.3.0", "@fastify/static": "^9.1.3", "@tinywaste/content": "workspace:*", "@tinywaste/game-core": "workspace:*", diff --git a/apps/api/src/features/auth/auth.routes.ts b/apps/api/src/features/auth/auth.routes.ts index 5883637..09d50eb 100644 --- a/apps/api/src/features/auth/auth.routes.ts +++ b/apps/api/src/features/auth/auth.routes.ts @@ -8,13 +8,13 @@ export const registerAuthRoutes = (app: FastifyInstance, authService: AuthServic return { user }; }); - app.post('/api/auth/register', async (request, reply) => { + app.post('/api/auth/register', { config: { rateLimit: { max: 5, timeWindow: '1 minute' } } }, async (request, reply) => { const input = registerSchema.parse(request.body); const user = await authService.register(input, reply); return { user }; }); - app.post('/api/auth/login', async (request, reply) => { + app.post('/api/auth/login', { config: { rateLimit: { max: 10, timeWindow: '1 minute' } } }, async (request, reply) => { const input = loginSchema.parse(request.body); const user = await authService.login(input, reply); return { user }; diff --git a/apps/api/src/features/auth/auth.service.ts b/apps/api/src/features/auth/auth.service.ts index 43212b7..215e16e 100644 --- a/apps/api/src/features/auth/auth.service.ts +++ b/apps/api/src/features/auth/auth.service.ts @@ -48,7 +48,7 @@ export class AuthService { sameSite: 'lax', path: '/', maxAge: SESSION_TTL_MS / 1000, - secure: false, + secure: env.isProduction, }); } diff --git a/apps/api/src/features/game/game.repository.ts b/apps/api/src/features/game/game.repository.ts index 09f1ad8..ca3c86e 100644 --- a/apps/api/src/features/game/game.repository.ts +++ b/apps/api/src/features/game/game.repository.ts @@ -13,11 +13,15 @@ export class GameRepository { }); } - async upsertMainSlot(userId: string, stateJson: string, label: string) { + async upsertMainSlot(userId: string, stateJson: string, label: string, expectedRevision?: number) { const existing = await this.getMainSlot(userId); const now = Date.now(); if (existing) { + if (expectedRevision !== undefined && existing.revision !== expectedRevision) { + return null; + } + this.db .update(saveSlotsTable) .set({ diff --git a/apps/api/src/features/game/game.service.ts b/apps/api/src/features/game/game.service.ts index ef66ac9..20cfd77 100644 --- a/apps/api/src/features/game/game.service.ts +++ b/apps/api/src/features/game/game.service.ts @@ -43,7 +43,10 @@ export class GameService { const state = JSON.parse(slot.stateJson) as GameState; const result = applyGameAction(state, gameContent, action); - await this.repository.upsertMainSlot(userId, JSON.stringify(result.state), slot.label); + const saved = await this.repository.upsertMainSlot(userId, JSON.stringify(result.state), slot.label, slot.revision); + if (!saved) { + throw new AppError(409, 'SAVE_CONFLICT', '存档已被其他请求修改,请重试。'); + } return buildGameView(result.state, gameContent); } } diff --git a/apps/api/src/server.ts b/apps/api/src/server.ts index ebea549..7984f72 100644 --- a/apps/api/src/server.ts +++ b/apps/api/src/server.ts @@ -2,6 +2,7 @@ import { existsSync } from 'node:fs'; import Fastify from 'fastify'; import cookie from '@fastify/cookie'; import cors from '@fastify/cors'; +import rateLimit from '@fastify/rate-limit'; import fastifyStatic from '@fastify/static'; import { ZodError } from 'zod'; import { db } from './shared/database/client'; @@ -25,6 +26,11 @@ await app.register(cors, { credentials: true, }); +await app.register(rateLimit, { + max: env.isProduction ? 100 : 1000, + timeWindow: '1 minute', +}); + const authRepository = new AuthRepository(db); const authService = new AuthService(authRepository); const gameRepository = new GameRepository(db); diff --git a/apps/api/src/shared/env.ts b/apps/api/src/shared/env.ts index 03b4bf5..cd80a9b 100644 --- a/apps/api/src/shared/env.ts +++ b/apps/api/src/shared/env.ts @@ -8,6 +8,7 @@ loadDotenv({ }); const envSchema = z.object({ + NODE_ENV: z.enum(['development', 'production', 'test']).default('development'), API_PORT: z.coerce.number().int().positive().default(3001), WEB_ORIGIN: z.string().url().default('http://localhost:5173'), WEB_DIST_DIR: z.string().min(1).default('../web/dist'), @@ -26,6 +27,8 @@ const webDistPath = resolve(process.cwd(), parsed.data.WEB_DIST_DIR); mkdirSync(dirname(databasePath), { recursive: true }); export const env = { + nodeEnv: parsed.data.NODE_ENV, + isProduction: parsed.data.NODE_ENV === 'production', port: parsed.data.API_PORT, webOrigin: parsed.data.WEB_ORIGIN, webDistPath, diff --git a/apps/web/public/generated/hud/atlases/hud-chrome-atlas-source.png b/apps/web/public/generated/hud/atlases/hud-chrome-atlas-source.png new file mode 100644 index 0000000..c160105 Binary files /dev/null and b/apps/web/public/generated/hud/atlases/hud-chrome-atlas-source.png differ diff --git a/apps/web/public/generated/hud/atlases/hud-chrome-atlas.png b/apps/web/public/generated/hud/atlases/hud-chrome-atlas.png new file mode 100644 index 0000000..6e6b10b Binary files /dev/null and b/apps/web/public/generated/hud/atlases/hud-chrome-atlas.png differ diff --git a/apps/web/public/generated/hud/atlases/hud-icon-atlas-source.png b/apps/web/public/generated/hud/atlases/hud-icon-atlas-source.png new file mode 100644 index 0000000..2666e5d Binary files /dev/null and b/apps/web/public/generated/hud/atlases/hud-icon-atlas-source.png differ diff --git a/apps/web/public/generated/hud/atlases/hud-icon-atlas.png b/apps/web/public/generated/hud/atlases/hud-icon-atlas.png new file mode 100644 index 0000000..87cba20 Binary files /dev/null and b/apps/web/public/generated/hud/atlases/hud-icon-atlas.png differ diff --git a/apps/web/public/generated/hud/chrome/action-card-primary.png b/apps/web/public/generated/hud/chrome/action-card-primary.png new file mode 100644 index 0000000..9cfe97a Binary files /dev/null and b/apps/web/public/generated/hud/chrome/action-card-primary.png differ diff --git a/apps/web/public/generated/hud/chrome/action-card-secondary.png b/apps/web/public/generated/hud/chrome/action-card-secondary.png new file mode 100644 index 0000000..8d18e2a Binary files /dev/null and b/apps/web/public/generated/hud/chrome/action-card-secondary.png differ diff --git a/apps/web/public/generated/hud/chrome/divider-ornament.png b/apps/web/public/generated/hud/chrome/divider-ornament.png new file mode 100644 index 0000000..527b2ef Binary files /dev/null and b/apps/web/public/generated/hud/chrome/divider-ornament.png differ diff --git a/apps/web/public/generated/hud/chrome/dock-tab-active.png b/apps/web/public/generated/hud/chrome/dock-tab-active.png new file mode 100644 index 0000000..a5f6897 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/dock-tab-active.png differ diff --git a/apps/web/public/generated/hud/chrome/dock-tab-idle.png b/apps/web/public/generated/hud/chrome/dock-tab-idle.png new file mode 100644 index 0000000..031d911 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/dock-tab-idle.png differ diff --git a/apps/web/public/generated/hud/chrome/panel-card.png b/apps/web/public/generated/hud/chrome/panel-card.png new file mode 100644 index 0000000..344c9f4 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/panel-card.png differ diff --git a/apps/web/public/generated/hud/chrome/panel-compact.png b/apps/web/public/generated/hud/chrome/panel-compact.png new file mode 100644 index 0000000..a46c0da Binary files /dev/null and b/apps/web/public/generated/hud/chrome/panel-compact.png differ diff --git a/apps/web/public/generated/hud/chrome/panel-tall.png b/apps/web/public/generated/hud/chrome/panel-tall.png new file mode 100644 index 0000000..415aa25 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/panel-tall.png differ diff --git a/apps/web/public/generated/hud/chrome/panel-wide.png b/apps/web/public/generated/hud/chrome/panel-wide.png new file mode 100644 index 0000000..96323db Binary files /dev/null and b/apps/web/public/generated/hud/chrome/panel-wide.png differ diff --git a/apps/web/public/generated/hud/chrome/quick-strip-locked.png b/apps/web/public/generated/hud/chrome/quick-strip-locked.png new file mode 100644 index 0000000..3e205b9 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/quick-strip-locked.png differ diff --git a/apps/web/public/generated/hud/chrome/quick-strip.png b/apps/web/public/generated/hud/chrome/quick-strip.png new file mode 100644 index 0000000..f0d5007 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/quick-strip.png differ diff --git a/apps/web/public/generated/hud/chrome/route-card-active.png b/apps/web/public/generated/hud/chrome/route-card-active.png new file mode 100644 index 0000000..19943c1 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/route-card-active.png differ diff --git a/apps/web/public/generated/hud/chrome/route-card-idle.png b/apps/web/public/generated/hud/chrome/route-card-idle.png new file mode 100644 index 0000000..3fe0e3e Binary files /dev/null and b/apps/web/public/generated/hud/chrome/route-card-idle.png differ diff --git a/apps/web/public/generated/hud/chrome/status-capsule.png b/apps/web/public/generated/hud/chrome/status-capsule.png new file mode 100644 index 0000000..c360902 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/status-capsule.png differ diff --git a/apps/web/public/generated/hud/chrome/status-meter.png b/apps/web/public/generated/hud/chrome/status-meter.png new file mode 100644 index 0000000..18f07c9 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/status-meter.png differ diff --git a/apps/web/public/generated/hud/chrome/warning-strip.png b/apps/web/public/generated/hud/chrome/warning-strip.png new file mode 100644 index 0000000..a9c0e91 Binary files /dev/null and b/apps/web/public/generated/hud/chrome/warning-strip.png differ diff --git a/apps/web/public/generated/hud/icons/clock.png b/apps/web/public/generated/hud/icons/clock.png new file mode 100644 index 0000000..3999915 Binary files /dev/null and b/apps/web/public/generated/hud/icons/clock.png differ diff --git a/apps/web/public/generated/hud/icons/crafting.png b/apps/web/public/generated/hud/icons/crafting.png new file mode 100644 index 0000000..70220e1 Binary files /dev/null and b/apps/web/public/generated/hud/icons/crafting.png differ diff --git a/apps/web/public/generated/hud/icons/expedition.png b/apps/web/public/generated/hud/icons/expedition.png new file mode 100644 index 0000000..651f1ac Binary files /dev/null and b/apps/web/public/generated/hud/icons/expedition.png differ diff --git a/apps/web/public/generated/hud/icons/factions.png b/apps/web/public/generated/hud/icons/factions.png new file mode 100644 index 0000000..1ad558f Binary files /dev/null and b/apps/web/public/generated/hud/icons/factions.png differ diff --git a/apps/web/public/generated/hud/icons/inventory.png b/apps/web/public/generated/hud/icons/inventory.png new file mode 100644 index 0000000..12a69c4 Binary files /dev/null and b/apps/web/public/generated/hud/icons/inventory.png differ diff --git a/apps/web/public/generated/hud/icons/logout.png b/apps/web/public/generated/hud/icons/logout.png new file mode 100644 index 0000000..7b73a29 Binary files /dev/null and b/apps/web/public/generated/hud/icons/logout.png differ diff --git a/apps/web/public/generated/hud/icons/map.png b/apps/web/public/generated/hud/icons/map.png new file mode 100644 index 0000000..464e212 Binary files /dev/null and b/apps/web/public/generated/hud/icons/map.png differ diff --git a/apps/web/public/generated/hud/icons/repair.png b/apps/web/public/generated/hud/icons/repair.png new file mode 100644 index 0000000..a0234d3 Binary files /dev/null and b/apps/web/public/generated/hud/icons/repair.png differ diff --git a/apps/web/public/generated/hud/icons/rest.png b/apps/web/public/generated/hud/icons/rest.png new file mode 100644 index 0000000..2ab882c Binary files /dev/null and b/apps/web/public/generated/hud/icons/rest.png differ diff --git a/apps/web/public/generated/hud/icons/route-pin.png b/apps/web/public/generated/hud/icons/route-pin.png new file mode 100644 index 0000000..4021ea9 Binary files /dev/null and b/apps/web/public/generated/hud/icons/route-pin.png differ diff --git a/apps/web/public/generated/hud/icons/scavenge.png b/apps/web/public/generated/hud/icons/scavenge.png new file mode 100644 index 0000000..6e7a611 Binary files /dev/null and b/apps/web/public/generated/hud/icons/scavenge.png differ diff --git a/apps/web/public/generated/hud/icons/settings.png b/apps/web/public/generated/hud/icons/settings.png new file mode 100644 index 0000000..045f3d2 Binary files /dev/null and b/apps/web/public/generated/hud/icons/settings.png differ diff --git a/apps/web/public/generated/hud/icons/shelter.png b/apps/web/public/generated/hud/icons/shelter.png new file mode 100644 index 0000000..5399e3b Binary files /dev/null and b/apps/web/public/generated/hud/icons/shelter.png differ diff --git a/apps/web/public/generated/hud/icons/signal.png b/apps/web/public/generated/hud/icons/signal.png new file mode 100644 index 0000000..36ad450 Binary files /dev/null and b/apps/web/public/generated/hud/icons/signal.png differ diff --git a/apps/web/public/generated/hud/icons/skills.png b/apps/web/public/generated/hud/icons/skills.png new file mode 100644 index 0000000..b09239b Binary files /dev/null and b/apps/web/public/generated/hud/icons/skills.png differ diff --git a/apps/web/public/generated/hud/icons/weather.png b/apps/web/public/generated/hud/icons/weather.png new file mode 100644 index 0000000..37746e1 Binary files /dev/null and b/apps/web/public/generated/hud/icons/weather.png differ diff --git a/apps/web/public/generated/hud/manifest.json b/apps/web/public/generated/hud/manifest.json new file mode 100644 index 0000000..71a22b2 --- /dev/null +++ b/apps/web/public/generated/hud/manifest.json @@ -0,0 +1,52 @@ +{ + "reference": { + "canonical": "/generated/hud/reference/tinywaste-hud-reference.png", + "notes": "Current no-character HUD reference. Replaces the earlier right-side portrait layout." + }, + "atlases": { + "chromeSource": "/generated/hud/atlases/hud-chrome-atlas-source.png", + "chromeTransparent": "/generated/hud/atlases/hud-chrome-atlas.png", + "iconSource": "/generated/hud/atlases/hud-icon-atlas-source.png", + "iconTransparent": "/generated/hud/atlases/hud-icon-atlas.png" + }, + "chrome": { + "panelWide": "/generated/hud/chrome/panel-wide.png", + "panelTall": "/generated/hud/chrome/panel-tall.png", + "panelCard": "/generated/hud/chrome/panel-card.png", + "panelCompact": "/generated/hud/chrome/panel-compact.png", + "routeCardIdle": "/generated/hud/chrome/route-card-idle.png", + "routeCardActive": "/generated/hud/chrome/route-card-active.png", + "actionCardPrimary": "/generated/hud/chrome/action-card-primary.png", + "actionCardSecondary": "/generated/hud/chrome/action-card-secondary.png", + "statusCapsule": "/generated/hud/chrome/status-capsule.png", + "statusMeter": "/generated/hud/chrome/status-meter.png", + "quickStrip": "/generated/hud/chrome/quick-strip.png", + "quickStripLocked": "/generated/hud/chrome/quick-strip-locked.png", + "dockTabIdle": "/generated/hud/chrome/dock-tab-idle.png", + "dockTabActive": "/generated/hud/chrome/dock-tab-active.png", + "warningStrip": "/generated/hud/chrome/warning-strip.png", + "dividerOrnament": "/generated/hud/chrome/divider-ornament.png" + }, + "icons": { + "shelter": "/generated/hud/icons/shelter.png", + "expedition": "/generated/hud/icons/expedition.png", + "inventory": "/generated/hud/icons/inventory.png", + "crafting": "/generated/hud/icons/crafting.png", + "skills": "/generated/hud/icons/skills.png", + "factions": "/generated/hud/icons/factions.png", + "map": "/generated/hud/icons/map.png", + "weather": "/generated/hud/icons/weather.png", + "clock": "/generated/hud/icons/clock.png", + "routePin": "/generated/hud/icons/route-pin.png", + "rest": "/generated/hud/icons/rest.png", + "repair": "/generated/hud/icons/repair.png", + "scavenge": "/generated/hud/icons/scavenge.png", + "signal": "/generated/hud/icons/signal.png", + "settings": "/generated/hud/icons/settings.png", + "logout": "/generated/hud/icons/logout.png" + }, + "pipeline": { + "transparentCleanup": "python3 \"$HOME/.codex/skills/.system/imagegen/scripts/remove_chroma_key.py\"", + "sliceScript": "scripts/slice_hud_atlas.py" + } +} diff --git a/apps/web/public/generated/hud/reference/tinywaste-hud-reference.png b/apps/web/public/generated/hud/reference/tinywaste-hud-reference.png new file mode 100644 index 0000000..20def0a Binary files /dev/null and b/apps/web/public/generated/hud/reference/tinywaste-hud-reference.png differ diff --git a/apps/web/public/generated/ui/character-preview.png b/apps/web/public/generated/ui/character-preview.png deleted file mode 100644 index 56752ec..0000000 Binary files a/apps/web/public/generated/ui/character-preview.png and /dev/null differ diff --git a/apps/web/src/App.css b/apps/web/src/App.css index 38575fc..1057922 100644 --- a/apps/web/src/App.css +++ b/apps/web/src/App.css @@ -75,27 +75,12 @@ input, .auth-hero, .new-game-card, .loading-card, -.route-card, -.action-card, -.trade-card, -.recipe-card, -.inventory-card, -.quest-card, -.quick-slot, .stat-meter, .hud-chip, .command-dock, .top-hud, .brand-block, -.clock-block, -.route-summary-card, -.loadout-slot, -.character-figure, -.objective-card, -.mini-intel-card, -.attribute-card, -.effect-card, -.map-node-card { +.clock-block { border: 1px solid var(--panel-border-soft); } @@ -117,16 +102,16 @@ input, .app-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; - gap: 0.75rem; - min-height: 100dvh; - padding: 0.75rem; + gap: 0.5rem; + height: 100dvh; + padding: 0.5rem; overflow: hidden; } .panel, .subpanel { min-height: 0; - overflow: hidden; + overflow: auto; border-radius: 24px; border-color: var(--panel-border); } @@ -160,8 +145,7 @@ input, line-height: 1.45; } -.eyebrow, -.intel-kicker { +.eyebrow { margin: 0; color: var(--muted); font-size: 0.72rem; @@ -178,11 +162,8 @@ input, .primary-button, .secondary-button, .small-button, -.rest-button, .combat-button, .modal-option, -.panel-tabs button, -.command-tabs button, .dock-tab { border-radius: 14px; transition: transform 150ms ease, opacity 150ms ease, background 150ms ease, border-color 150ms ease; @@ -191,11 +172,8 @@ input, .primary-button:hover, .secondary-button:hover, .small-button:hover, -.rest-button:hover, .combat-button:hover, .modal-option:hover, -.panel-tabs button:hover, -.command-tabs button:hover, .dock-tab:hover { transform: translateY(-1px); } @@ -209,12 +187,9 @@ input, } .secondary-button, -.rest-button, .combat-button, .modal-option, .small-button.secondary, -.panel-tabs button, -.command-tabs button, .dock-tab { min-height: 42px; border: 1px solid var(--panel-border-soft); @@ -232,11 +207,8 @@ input, .primary-button:disabled, .secondary-button:disabled, .small-button:disabled, -.rest-button:disabled, .combat-button:disabled, .modal-option:disabled, -.panel-tabs button:disabled, -.command-tabs button:disabled, .dock-tab:disabled { opacity: 0.72; transform: none; @@ -317,7 +289,7 @@ input, align-items: stretch; border-color: var(--panel-border); border-radius: 22px; - padding: 0.65rem; + padding: 0.5rem; } .brand-block, @@ -447,6 +419,7 @@ input, display: grid; grid-template-columns: 304px minmax(0, 1fr) 396px; gap: 0.75rem; + overflow: hidden; } .panel-route { @@ -483,16 +456,7 @@ input, .viewport-copy p, .auth-hero-copy p, .new-game-copy p, -.modal-copy, -.route-card p, -.action-card p, -.trade-card p, -.recipe-card p, -.inventory-card p, -.quest-card p, -.mini-intel-card p, -.objective-card p, -.effect-card p { +.modal-copy { color: rgba(239, 226, 206, 0.78); line-height: 1.5; } @@ -532,16 +496,10 @@ input, margin-top: 0.85rem; } -.route-list, -.map-node-grid, -.action-grid, -.trade-list, -.recipe-list, -.log-list, -.objective-list, .inventory-list, +.recipe-list, .quest-list, -.loadout-scroll, +.log-list, .combat-log, .modal-option-list { min-height: 0; @@ -549,33 +507,18 @@ input, padding-right: 0.2rem; } -.route-list, -.map-node-grid, -.trade-list, -.recipe-list, -.log-list, -.objective-list, .inventory-list, +.recipe-list, .quest-list, -.loadout-scroll, +.log-list, .combat-log, .modal-option-list { display: grid; gap: 0.55rem; } -.route-card, -.action-card, -.trade-card, -.recipe-card, .inventory-card, -.quest-card, -.quick-slot, -.objective-card, -.loadout-slot, -.attribute-card, -.effect-card, -.map-node-card { +.quest-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), rgba(9, 8, 7, 0.52); @@ -583,15 +526,6 @@ input, border-radius: 16px; } -.route-card { - display: grid; - grid-template-columns: 80px minmax(0, 1fr) auto; - gap: 0.7rem; - width: 100%; - padding: 0.65rem; - text-align: left; -} - .route-card-thumb { min-height: 88px; border-radius: 14px; @@ -600,37 +534,12 @@ input, background-size: cover; } -.route-card-copy strong, -.action-card strong, -.trade-card strong, -.recipe-card strong, .inventory-card strong, -.quest-card strong, -.quick-slot strong, -.objective-card strong, -.slot-copy strong, -.attribute-card strong, -.effect-card strong, -.mini-intel-card strong { +.quest-card strong { font-size: 0.94rem; } -.route-card p, -.action-card p, -.trade-card p, -.recipe-card p, -.inventory-card p, -.objective-card p, -.mini-intel-card p { - margin: 0.35rem 0 0; - font-size: 0.82rem; -} - -.route-card-detail, -.action-card-meta, -.recipe-copy small, -.inventory-copy small, -.quick-slot-copy span { +.route-card-detail { display: flex; flex-wrap: wrap; gap: 0.45rem; @@ -638,25 +547,6 @@ input, font-size: 0.72rem; } -.route-card-state { - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-end; - min-width: 64px; - color: var(--muted); - font-size: 0.72rem; -} - -.route-card-state em, -.action-card em, -.trade-card em, -.recipe-actions em, -.inventory-card em { - color: #f1b675; - font-style: normal; -} - .risk-dots { display: flex; gap: 0.28rem; @@ -671,21 +561,6 @@ input, background: rgba(255, 255, 255, 0.03); } -.route-card.tone-safe .risk-dots span.active { - background: var(--safe); - border-color: rgba(141, 194, 106, 0.6); -} - -.route-card.tone-warn .risk-dots span.active { - background: var(--warn); - border-color: rgba(224, 180, 102, 0.6); -} - -.route-card.tone-danger .risk-dots span.active { - background: var(--danger); - border-color: rgba(225, 109, 76, 0.6); -} - .world-map-panel { min-height: 0; display: grid; @@ -700,13 +575,6 @@ input, padding: 0.75rem; } -.map-node-card.current { - border-color: rgba(215, 138, 51, 0.46); - background: rgba(215, 138, 51, 0.11); -} - -.map-node-card span, -.action-kind, .quest-card header span { display: inline-flex; align-items: center; @@ -721,15 +589,9 @@ input, text-transform: uppercase; } -.map-node-card small, -.trade-card small, -.action-card small, -.recipe-copy small, -.inventory-copy small, -.slot-copy small, -.attribute-card small { +.quest-card header div small { display: block; - margin-top: 0.28rem; + margin-top: 0.25rem; color: var(--muted); font-size: 0.72rem; } @@ -810,354 +672,36 @@ input, margin: 0; } -.command-surface { - min-height: 0; - display: grid; - grid-template-rows: auto minmax(0, 1fr); - gap: 0.75rem; -} - -.command-tabs, -.panel-tabs { - display: flex; - gap: 0.45rem; -} - -.command-tabs button, -.panel-tabs button { - flex: 1; - justify-content: center; -} - -.command-tabs button.active, -.panel-tabs button.active, .dock-tab.active { border-color: rgba(215, 138, 51, 0.35); background: rgba(215, 138, 51, 0.1); color: var(--text); } -.command-tabs-static .active, -.panel-tabs .active { - pointer-events: none; -} - -.command-stage { - min-height: 0; - display: grid; - grid-template-columns: minmax(0, 1.4fr) 320px; - gap: 0.75rem; -} - -.stage-main, -.command-side-column, -.mission-panel, -.rest-panel { - min-height: 0; - display: grid; -} - -.stage-main { - grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 0.85fr); -} - -.action-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 0.6rem; -} - -.action-card, -.trade-card, -.recipe-card, .inventory-card { width: 100%; text-align: left; padding: 0.8rem; } -.action-card { - min-height: 108px; -} - -.action-card-top, -.inventory-title-row, -.objective-card, .combat-health { display: flex; justify-content: space-between; gap: 0.65rem; } -.trade-block { - min-height: 0; - display: grid; - grid-template-rows: auto minmax(0, 1fr); - margin-top: 0.55rem; -} - -.action-card.utility { - border-color: rgba(215, 138, 51, 0.24); - background: - linear-gradient(180deg, rgba(215, 138, 51, 0.08), rgba(255, 255, 255, 0)), - rgba(9, 8, 7, 0.52); -} - -.trade-list.compact, .recipe-list, .inventory-list, .quest-list { align-content: start; } -.trade-card small, -.action-card small, -.recipe-actions em { - margin-top: 0.28rem; -} - -.command-side-column { - grid-template-rows: minmax(0, 0.9fr) minmax(0, 1fr); - gap: 0.75rem; -} - -.objective-panel, -.log-panel, -.intel-panel { - grid-template-rows: auto minmax(0, 1fr); -} - -.objective-card { - align-items: flex-start; - padding: 0.8rem; -} - -.objective-card.done { - border-color: rgba(141, 194, 106, 0.3); -} - -.objective-card span { - color: #f2bb6a; - font-size: 0.8rem; - font-weight: 600; -} - -.log-list.expanded { - gap: 0.2rem; -} - -.mini-intel-card strong, -.effect-card strong { - display: block; -} - -.intel-stack { - display: grid; - gap: 0.55rem; -} - .panel-loadout { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0.75rem; } -.loadout-scroll { - display: grid; - gap: 0.75rem; -} - -.loadout-matrix { - display: grid; - grid-template-columns: 124px minmax(0, 1fr) 124px; - gap: 0.75rem; - min-height: 370px; -} - -.slot-column { - display: grid; - gap: 0.6rem; - align-content: stretch; -} - -.loadout-slot { - display: grid; - gap: 0.55rem; - padding: 0.7rem; -} - -.slot-thumb { - width: 100%; - min-width: 0; - aspect-ratio: 1; -} - -.slot-copy span { - display: block; - margin-bottom: 0.26rem; - color: var(--muted); - font-size: 0.68rem; - letter-spacing: 0.14em; - text-transform: uppercase; -} - -.loadout-slot.equipped { - border-color: rgba(215, 138, 51, 0.35); -} - -.character-figure { - position: relative; - overflow: hidden; - background: - linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2)), - rgba(6, 6, 5, 0.9); -} - -.character-figure img { - width: 100%; - height: 100%; - object-fit: cover; - object-position: center top; -} - -.character-figure-overlay { - position: absolute; - right: 1rem; - bottom: 1rem; - padding: 0.65rem 0.75rem; - border-radius: 14px; - background: rgba(8, 8, 7, 0.74); - border: 1px solid rgba(255, 255, 255, 0.08); - text-align: right; -} - -.character-figure-overlay span { - display: block; - color: var(--muted); - font-size: 0.68rem; - letter-spacing: 0.14em; - text-transform: uppercase; -} - -.character-meta-grid { - display: grid; - grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); - gap: 0.75rem; -} - -.attribute-panel, -.effects-panel, -.quick-slot-panel { - grid-template-rows: auto minmax(0, 1fr); -} - -.attribute-grid { - display: grid; - grid-template-columns: repeat(5, minmax(0, 1fr)); - gap: 0.5rem; -} - -.attribute-card { - padding: 0.75rem; - text-align: center; -} - -.attribute-card span { - display: block; - margin-bottom: 0.28rem; - color: var(--muted); - font-size: 0.68rem; - letter-spacing: 0.12em; -} - -.attribute-card strong { - font-size: 1.15rem; -} - -.effects-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 0.5rem; -} - -.effect-card { - padding: 0.75rem; -} - -.effect-card-head { - display: flex; - align-items: center; - gap: 0.65rem; -} - -.status-effect-icon { - width: 42px; - height: 42px; - object-fit: cover; - border-radius: 12px; - border: 1px solid rgba(255, 255, 255, 0.08); - background: rgba(0, 0, 0, 0.36); -} - -.effect-card p { - margin: 0.35rem 0 0; - font-size: 0.78rem; -} - -.effect-card small { - display: block; - margin-top: 0.45rem; - color: var(--muted); - line-height: 1.45; -} - -.effect-card.tone-good { - border-color: rgba(141, 194, 106, 0.24); -} - -.effect-card.tone-warn { - border-color: rgba(224, 180, 102, 0.24); -} - -.effect-card.tone-danger { - border-color: rgba(225, 109, 76, 0.24); -} - -.quick-slot-grid { - display: grid; - grid-template-columns: repeat(4, minmax(0, 1fr)); - gap: 0.5rem; -} - -.quick-slot { - min-height: 118px; - padding: 0.65rem; - display: grid; - align-content: space-between; - gap: 0.45rem; -} - -.quick-slot .asset-thumb { - width: 100%; - min-width: 0; -} - -.quick-slot-copy span { - margin-top: 0.3rem; - color: #f1c27b; -} - -.quick-slot.locked { - place-items: center; - border-style: dashed; -} - -.quick-slot-lock { - color: var(--muted); - font-size: 0.72rem; - letter-spacing: 0.14em; -} - .inventory-card { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; @@ -1173,35 +717,12 @@ input, color: #f1c27b; } -.inventory-actions, -.recipe-actions, -.rest-actions, -.combat-actions, -.new-game-actions { +.combat-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; } -.recipe-card { - display: grid; - grid-template-columns: 72px minmax(0, 1fr) auto; - gap: 0.75rem; -} - -.recipe-card.craftable { - border-color: rgba(141, 194, 106, 0.28); -} - -.recipe-actions { - align-content: start; -} - -.mission-panel, -.rest-panel { - grid-template-rows: auto minmax(0, 1fr); -} - .quest-card { padding: 0.75rem; } @@ -1238,21 +759,6 @@ input, color: #a8e288; } -.rest-actions { - display: grid; - grid-template-columns: 1fr; -} - -.panel-link-grid { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 0.5rem; -} - -.panel-link-button { - width: 100%; -} - .log-entry { display: grid; grid-template-columns: auto 1fr; @@ -1669,31 +1175,19 @@ input, color: var(--muted); } -.route-list::-webkit-scrollbar, -.map-node-grid::-webkit-scrollbar, -.action-grid::-webkit-scrollbar, -.trade-list::-webkit-scrollbar, .recipe-list::-webkit-scrollbar, .log-list::-webkit-scrollbar, -.objective-list::-webkit-scrollbar, .inventory-list::-webkit-scrollbar, .quest-list::-webkit-scrollbar, -.loadout-scroll::-webkit-scrollbar, .combat-log::-webkit-scrollbar, .modal-option-list::-webkit-scrollbar { width: 8px; } -.route-list::-webkit-scrollbar-thumb, -.map-node-grid::-webkit-scrollbar-thumb, -.action-grid::-webkit-scrollbar-thumb, -.trade-list::-webkit-scrollbar-thumb, .recipe-list::-webkit-scrollbar-thumb, .log-list::-webkit-scrollbar-thumb, -.objective-list::-webkit-scrollbar-thumb, .inventory-list::-webkit-scrollbar-thumb, .quest-list::-webkit-scrollbar-thumb, -.loadout-scroll::-webkit-scrollbar-thumb, .combat-log::-webkit-scrollbar-thumb, .modal-option-list::-webkit-scrollbar-thumb { border-radius: 999px; @@ -2221,17 +1715,11 @@ input, grid-template-columns: 1fr; } - .command-stage, - .character-meta-grid, .auth-shell, .command-dock { grid-template-columns: 1fr; } - .command-side-column { - grid-template-rows: auto; - } - .command-dock { align-items: start; } @@ -2261,6 +1749,8 @@ input, .theater-deck, .theater-intel-grid, + .theater-intel-strip, + .theater-action-zone, .survivor-rig, .tactical-dock { grid-template-columns: 1fr; @@ -2285,12 +1775,8 @@ input, } .status-strip, - .action-grid, - .attribute-grid, - .effects-grid, .combat-actions, - .overlay-summary-grid, - .panel-link-grid { + .overlay-summary-grid { grid-template-columns: 1fr; } @@ -2317,20 +1803,19 @@ input, .expedition-status-grid, .theater-intel-grid, + .theater-intel-strip, + .theater-action-zone, .survivor-metrics-strip, .rig-column, - .survivor-supply-grid { + .survivor-supply-grid, + .equipment-metrics-row, + .equipment-grid, + .ready-pack-columns { grid-template-columns: 1fr; } - .quick-slot-grid { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } - - .route-card, .inventory-card, .recipe-card, - .loadout-matrix, .inventory-overlay-grid, .blueprint-overlay-grid, .mission-overlay-grid, @@ -2338,14 +1823,6 @@ input, grid-template-columns: 1fr; } - .route-card-state { - align-items: flex-start; - } - - .map-node-grid { - grid-template-columns: 1fr; - } - .auth-hero, .new-game-card { min-height: 420px; @@ -2355,3 +1832,1540 @@ input, grid-template-columns: 1fr; } } + +:root { + --hud-frame-wide: url('/generated/hud/chrome/panel-wide.png'); + --hud-frame-tall: url('/generated/hud/chrome/panel-tall.png'); + --hud-frame-card: url('/generated/hud/chrome/panel-card.png'); + --hud-frame-compact: url('/generated/hud/chrome/panel-compact.png'); + --hud-frame-route-idle: url('/generated/hud/chrome/route-card-idle.png'); + --hud-frame-route-active: url('/generated/hud/chrome/route-card-active.png'); + --hud-frame-action-primary: url('/generated/hud/chrome/action-card-primary.png'); + --hud-frame-action-secondary: url('/generated/hud/chrome/action-card-secondary.png'); + --hud-frame-status: url('/generated/hud/chrome/status-meter.png'); + --hud-frame-warning: url('/generated/hud/chrome/warning-strip.png'); + --hud-frame-dock-idle: url('/generated/hud/chrome/dock-tab-idle.png'); + --hud-frame-dock-active: url('/generated/hud/chrome/dock-tab-active.png'); + --hud-divider: url('/generated/hud/chrome/divider-ornament.png'); +} + +.hud-surface, +.hud-card-frame, +.hud-warning-frame, +.expedition-route-card, +.dock-tab, +.stat-meter, +.brand-block, +.clock-block { + position: relative; + isolation: isolate; + border-color: transparent; +} + +.hud-surface::before, +.hud-card-frame::before, +.hud-warning-frame::before, +.expedition-route-card::before, +.dock-tab::before, +.stat-meter::before, +.brand-block::before, +.clock-block::before { + content: ''; + position: absolute; + inset: 0; + z-index: 0; + pointer-events: none; + background-repeat: no-repeat; + background-position: center; + background-size: 100% 100%; +} + +.hud-surface::before { + opacity: 0.3; +} + +.hud-card-frame::before, +.hud-warning-frame::before, +.expedition-route-card::before, +.dock-tab::before, +.stat-meter::before, +.brand-block::before, +.clock-block::before { + opacity: 0.96; +} + +.hud-surface > *, +.hud-card-frame > *, +.hud-warning-frame > *, +.expedition-route-card > *, +.dock-tab > *, +.stat-meter > *, +.brand-block > *, +.clock-block > * { + position: relative; + z-index: 1; +} + +.hud-surface-wide::before, +.hud-top-frame::before, +.hud-dock-frame::before { + background-image: var(--hud-frame-wide); +} + +.hud-surface-tall::before { + background-image: var(--hud-frame-tall); +} + +.hud-card-frame::before { + background-image: var(--hud-frame-card); +} + +.hud-card-frame-primary::before { + display: none; +} + +.hud-warning-frame::before { + background-image: var(--hud-frame-warning); +} + +.brand-block::before, +.clock-block::before { + background-image: var(--hud-frame-compact); +} + +.stat-meter::before { + background-image: var(--hud-frame-status); +} + +.panel-header { + align-items: center; +} + +.panel-header::after { + content: ''; + flex: 1; + align-self: center; + min-width: 80px; + height: 10px; + opacity: 0.42; + background: var(--hud-divider) center right / contain no-repeat; +} + +.panel-header-copy { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + gap: 0.7rem; + align-items: center; +} + +.panel-header-mark { + display: grid; + place-items: center; + width: 34px; + height: 34px; + border-radius: 10px; + background: rgba(7, 6, 5, 0.44); +} + +.panel-header-mark img, +.hud-icon { + width: 100%; + height: 100%; + object-fit: contain; +} + +.section-glyph { + width: 36px; + height: 36px; + flex: 0 0 36px; + opacity: 0.92; +} + +.expedition-head-copy, +.survivor-head-copy { + display: flex; + align-items: center; + gap: 0.7rem; +} + +.survivor-head, +.expedition-head { + align-items: center; +} + +.survivor-head-side { + display: grid; + gap: 0.55rem; + justify-items: end; +} + +.top-action-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.45rem; +} + +.top-action-icon, +.clock-icon { + width: 18px; + height: 18px; + flex: 0 0 18px; +} + +.clock-block { + display: grid; + grid-template-columns: 22px 1fr; + align-items: center; + justify-items: start; + gap: 0.55rem; + padding: 0.65rem 0.8rem; +} + +.clock-block div { + display: grid; + gap: 0.08rem; +} + +.status-strip { + gap: 0.45rem; +} + +.stat-meter { + padding: 0.55rem 0.72rem 0.62rem; + background: transparent; +} + +.stat-meter-copy { + display: grid; + grid-template-columns: 18px minmax(0, 1fr); + align-items: center; + gap: 0.5rem; + margin-bottom: 0.45rem; +} + +.stat-meter-copy > div { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 0.4rem; +} + +.stat-meter-icon { + width: 18px; + height: 18px; + object-fit: contain; + opacity: 0.92; +} + +.meter-track { + background: rgba(255, 255, 255, 0.06); +} + +.game-grid { + grid-template-columns: 286px minmax(0, 1fr) 370px; + gap: 0.85rem; + height: calc(100dvh - 176px); +} + +.panel-route.expedition-panel, +.panel-command.theater-panel, +.panel-loadout.survivor-panel, +.top-hud, +.command-dock { + background: rgba(7, 6, 5, 0.74); +} + +.command-dock { + position: sticky; + bottom: 0; + z-index: 5; +} + +.expedition-core, +.equipment-grid-panel, +.survivor-resource-panel, +.intel-focus-card, +.survivor-metric-card, +.secondary-operation-card, +.overlay-summary-card { + background: rgba(7, 6, 5, 0.42); +} + +.expedition-core, +.equipment-grid-panel, +.survivor-resource-panel { + padding: 0.85rem; +} + +.expedition-route-card { + background: rgba(5, 5, 4, 0.48); + border: 0; +} + +.expedition-route-card::before { + background-image: var(--hud-frame-route-idle); +} + +.expedition-route-card.recommended::before { + background-image: var(--hud-frame-route-active); +} + +.expedition-route-card .route-card-thumb { + border-radius: 12px; + overflow: hidden; + border: 1px solid rgba(255, 255, 255, 0.08); +} + +.theater-panel { + grid-template-rows: auto auto auto; +} + +.theater-scene { + background-color: rgba(6, 5, 4, 0.72); +} + +.primary-operation-card { + gap: 0.72rem; + background: rgba(10, 8, 6, 0.42); + border: 1px solid rgba(215, 138, 51, 0.22); + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03); + padding: 0.82rem; +} + +.primary-operation-head { + display: flex; + align-items: center; + gap: 0.65rem; +} + +.operation-glyph { + width: 22px; + height: 22px; + flex: 0 0 22px; +} + +.operation-glyph-primary { + width: 32px; + height: 32px; + flex-basis: 32px; +} + +.secondary-operation-card { + grid-template-columns: 22px minmax(0, 1fr); + align-items: start; + gap: 0.65rem; + min-height: 94px; +} + +.secondary-operation-card::before { + background-image: var(--hud-frame-compact); +} + +.secondary-operation-card p { + margin-top: 0.18rem; +} + +.theater-intel-grid { + gap: 0.65rem; +} + +.theater-scene-copy h2 { + font-size: clamp(2rem, 3.2vw, 3.15rem); +} + +.theater-scene-copy p:last-child { + max-width: 26rem; + font-size: 0.92rem; +} + +.scene-focus-card { + padding: 0.7rem; +} + +.primary-operation-copy h3 { + font-size: clamp(1.4rem, 2vw, 2rem); +} + +.operation-chip-row span { + min-height: 1.7rem; + padding: 0 0.55rem; + font-size: 0.68rem; +} + +.primary-operation-card small { + font-size: 0.72rem; +} + +.secondary-operation-stack { + align-content: start; +} + +.intel-focus-card { + min-height: 108px; + padding: 0.78rem; +} + +.survivor-panel { + grid-template-rows: auto auto auto auto auto; + gap: 0.65rem; +} + +.survivor-metrics-row { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; +} + +.survivor-equipment-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 0.55rem; +} + +.equipment-module { + grid-template-columns: 68px minmax(0, 1fr); + align-items: center; + min-height: 110px; + background: rgba(8, 7, 6, 0.52); +} + +.equipment-module.equipped { + box-shadow: inset 0 0 0 1px rgba(215, 138, 51, 0.22); +} + +.survivor-warning-card { + border: 0; + background: rgba(7, 6, 5, 0.5); +} + +.survivor-supply-card, +.survivor-stash-card { + border: 0; + background: rgba(8, 7, 6, 0.52); +} + +.survivor-supply-card { + min-height: 98px; +} + +.survivor-supply-card.locked { + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), + rgba(8, 7, 6, 0.28); +} + +.survivor-stash-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; +} + +.survivor-resource-grid { + display: grid; + grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr); + gap: 0.65rem; +} + +.survivor-resource-column { + display: grid; + gap: 0.55rem; + align-content: start; +} + +.resource-column-head { + display: flex; + align-items: center; + gap: 0.55rem; +} + +.resource-column-head strong, +.resource-column-head span { + display: block; +} + +.resource-column-head strong { + font-size: 0.85rem; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.resource-column-head span { + margin-top: 0.16rem; + color: var(--muted); + font-size: 0.72rem; +} + +.survivor-supply-grid.compact { + grid-template-columns: repeat(4, minmax(0, 1fr)); +} + +.survivor-stash-grid.compact { + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.survivor-stash-card { + display: grid; + grid-template-columns: 56px minmax(0, 1fr); + align-items: center; + gap: 0.55rem; + padding: 0.55rem; +} + +.survivor-stash-card .asset-thumb { + width: 56px; + min-width: 56px; + border-radius: 12px; +} + +.survivor-stash-open { + grid-column: 1 / -1; +} + +.operator-card { + background: rgba(8, 7, 6, 0.38); +} + +.dock-tabs { + gap: 0.55rem; +} + +.dock-tab { + min-height: 74px; + padding: 0.55rem 0.8rem; + border: 0; + background: transparent; + display: grid; + justify-items: center; + align-content: center; + gap: 0.3rem; +} + +.dock-tab::before { + background-image: var(--hud-frame-dock-idle); +} + +.dock-tab.active::before { + background-image: var(--hud-frame-dock-active); +} + +.dock-tab-icon { + width: 22px; + height: 22px; + flex: 0 0 22px; +} + +.dock-tab span { + font-size: 0.7rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.dock-commit-button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; +} + +.dock-commit-icon { + width: 18px; + height: 18px; +} + +.overlay-summary-card { + border: 0; +} + +@media (max-width: 1340px) and (min-width: 961px) { + body { + overflow: hidden; + } + + .app-shell { + overflow: hidden; + } + + .top-hud { + grid-template-columns: 236px 112px minmax(0, 1fr); + } + + .top-actions { + grid-column: 1 / -1; + justify-content: flex-start; + } + + .game-grid { + grid-template-columns: 228px minmax(0, 1fr) 320px; + height: calc(100dvh - 214px); + } + + .theater-scene-copy { + right: 15rem; + } + + .theater-scene-side { + width: 220px; + } + + .survivor-resource-grid { + grid-template-columns: 1fr; + } +} + +/* ============================================================ + NEW COMPONENT CLASSES — theater / expedition / equipment / ready-pack + Added to match the component rewrite (CommandCenter, RoutePanel, LoadoutPanel) + ============================================================ */ + +/* --- CommandCenter: theater scene stage --- */ + +.theater-scene-stage { + position: relative; + display: grid; + grid-template-rows: 1fr auto; + min-height: 0; + overflow: hidden; + border-radius: 20px; + border: 1px solid rgba(215, 138, 51, 0.2); +} + +.theater-scene-image { + position: absolute; + inset: 0; + background-position: center; + background-size: cover; + z-index: 0; +} + +.theater-scene-image::after { + content: ''; + position: absolute; + inset: 0; + background: + linear-gradient(180deg, rgba(6, 5, 4, 0.15), rgba(6, 5, 4, 0.82)), + linear-gradient(90deg, rgba(6, 5, 4, 0.06), rgba(6, 5, 4, 0.5) 70%); + z-index: 1; +} + +.theater-action-zone { + position: relative; + z-index: 2; + display: grid; + grid-template-columns: minmax(0, 1.3fr) 260px; + gap: 0.75rem; + padding: 0.85rem; + align-content: end; + min-height: 200px; +} + +.theater-titlebar { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 0.75rem; + margin-bottom: 0.55rem; +} + +.theater-titlebar h2 { + margin: 0; + font-size: 1.15rem; + letter-spacing: 0.12em; + line-height: 1; +} + +.theater-titlebar p { + margin: 0.25rem 0 0; + color: var(--muted); + font-size: 0.78rem; + line-height: 1.45; +} + +.theater-titlebar-metrics { + display: flex; + gap: 0.65rem; + flex-shrink: 0; +} + +.theater-titlebar-metrics article { + display: grid; + gap: 0.15rem; + padding: 0.45rem 0.65rem; + border-radius: 12px; + background: rgba(8, 7, 6, 0.6); + border: 1px solid rgba(255, 255, 255, 0.06); + text-align: center; +} + +.theater-titlebar-metrics article span { + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.theater-titlebar-metrics article strong { + font-size: 0.88rem; +} + +/* --- CommandCenter: primary & secondary action cards --- */ + +.theater-primary-card { + display: grid; + gap: 0.65rem; + padding: 0.85rem; + border-radius: 18px; + border: 1px solid rgba(215, 138, 51, 0.22); + background: + radial-gradient(circle at top right, rgba(215, 138, 51, 0.1), transparent 30%), + linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), + rgba(10, 8, 6, 0.72); + backdrop-filter: blur(14px); +} + +.theater-primary-head { + display: flex; + align-items: center; + gap: 0.6rem; +} + +.theater-primary-head span { + color: var(--muted); + font-size: 0.68rem; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.theater-action-icon { + width: 22px; + height: 22px; + flex: 0 0 22px; + opacity: 0.9; +} + +.theater-primary-copy h3 { + margin: 0; + font-size: clamp(1.2rem, 2vw, 1.6rem); + line-height: 1; + letter-spacing: -0.02em; +} + +.theater-primary-copy p { + margin: 0.3rem 0 0; + color: rgba(239, 226, 206, 0.78); + font-size: 0.82rem; + line-height: 1.45; +} + +.theater-find-row { + display: flex; + gap: 0.65rem; +} + +.theater-find-meta { + display: grid; + gap: 0.12rem; + padding: 0.5rem 0.7rem; + border-radius: 12px; + background: rgba(255, 255, 255, 0.04); + border: 1px solid rgba(255, 255, 255, 0.06); + flex: 1; +} + +.theater-find-meta span { + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.theater-find-meta strong { + font-size: 0.92rem; +} + +.theater-potential-finds { + display: flex; + gap: 0.45rem; + overflow: auto; +} + +.potential-find-thumb { + width: 48px; + min-width: 48px; +} + +.potential-find-thumb .asset-thumb { + width: 48px; + min-width: 48px; + border-radius: 12px; +} + +.theater-primary-button { + width: min(100%, 200px); +} + +.theater-secondary-column { + display: grid; + gap: 0.5rem; + align-content: start; +} + +.theater-secondary-card { + display: grid; + grid-template-columns: 22px minmax(0, 1fr) auto; + align-items: center; + gap: 0.55rem; + text-align: left; + padding: 0.7rem 0.75rem; + border-radius: 14px; + border: 1px solid rgba(255, 255, 255, 0.07); + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), + rgba(9, 8, 7, 0.56); + color: var(--text); + transition: transform 150ms ease, border-color 150ms ease; +} + +.theater-secondary-card:hover { + border-color: rgba(215, 138, 51, 0.22); + transform: translateY(-1px); +} + +.theater-secondary-card strong { + font-size: 0.88rem; +} + +.theater-secondary-card p { + margin: 0.15rem 0 0; + color: var(--muted); + font-size: 0.72rem; + line-height: 1.4; +} + +.theater-secondary-card > span { + color: var(--muted); + font-size: 0.68rem; + letter-spacing: 0.08em; + text-transform: uppercase; + white-space: nowrap; +} + +/* --- CommandCenter: intel strip --- */ + +.theater-intel-strip { + display: grid; + grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 0.7fr)); + gap: 0.5rem; +} + +.theater-intel-block { + padding: 0.6rem 0.7rem; + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(8, 7, 6, 0.55); + display: grid; + gap: 0.2rem; +} + +.theater-intel-block span { + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.theater-intel-block p { + margin: 0; + color: rgba(239, 226, 206, 0.78); + font-size: 0.78rem; + line-height: 1.4; +} + +.theater-intel-block.compact { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.theater-intel-block.compact strong { + font-size: 0.82rem; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.theater-intel-icon { + width: 18px; + height: 18px; + flex: 0 0 18px; + opacity: 0.8; +} + +/* --- RoutePanel: expedition panel --- */ + +.expedition-panel-head { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 0.75rem; + margin-bottom: 0.55rem; +} + +.expedition-panel-head h2 { + margin: 0.25rem 0 0; + font-size: 1.15rem; + line-height: 1; + letter-spacing: -0.02em; +} + +.expedition-location-card { + padding: 0.85rem; + border-radius: 16px; + border: 1px solid rgba(215, 138, 51, 0.18); + background: + linear-gradient(180deg, rgba(215, 138, 51, 0.06), rgba(255, 255, 255, 0)), + rgba(9, 8, 7, 0.52); + display: grid; + gap: 0.5rem; +} + +.expedition-location-card strong { + font-size: 1.05rem; +} + +.expedition-weather-block { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.55rem 0.7rem; + border-radius: 12px; + background: rgba(255, 255, 255, 0.03); + border: 1px solid rgba(255, 255, 255, 0.06); +} + +.expedition-weather-main { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.expedition-weather-icon { + width: 20px; + height: 20px; + flex: 0 0 20px; + opacity: 0.85; +} + +.expedition-weather-main span { + font-size: 0.88rem; +} + +.expedition-weather-meta { + display: flex; + gap: 0.65rem; + color: var(--muted); + font-size: 0.72rem; +} + +.expedition-risk-line { + display: flex; + justify-content: space-between; + align-items: center; + padding-top: 0.35rem; + border-top: 1px solid rgba(255, 255, 255, 0.06); +} + +.expedition-risk-line span { + color: var(--muted); + font-size: 0.72rem; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.expedition-risk-line strong { + font-size: 0.88rem; +} + +/* --- RoutePanel: routes section --- */ + +.expedition-routes-card { + display: grid; + gap: 0.55rem; + min-height: 0; +} + +.expedition-section-head { + display: flex; + justify-content: space-between; + align-items: center; + gap: 0.5rem; +} + +.expedition-section-head > span { + font-size: 0.82rem; + font-weight: 600; + letter-spacing: 0.06em; +} + +.expedition-toggle { + min-height: 30px; + padding: 0 0.7rem; + border-radius: 999px; + border: 1px solid rgba(255, 255, 255, 0.1); + background: rgba(255, 255, 255, 0.04); + color: var(--muted); + font-size: 0.66rem; + letter-spacing: 0.1em; + text-transform: uppercase; + transition: border-color 150ms ease, background 150ms ease; +} + +.expedition-toggle:hover { + border-color: rgba(215, 138, 51, 0.28); + background: rgba(215, 138, 51, 0.08); + color: var(--text); +} + +.expedition-toggle.active { + border-color: rgba(141, 194, 106, 0.32); + background: rgba(141, 194, 106, 0.1); + color: #addb7f; +} + +.expedition-route-stack { + display: grid; + gap: 0.5rem; + min-height: 0; + overflow: auto; + align-content: start; +} + +.expedition-route-card { + display: grid; + grid-template-columns: 72px minmax(0, 1fr); + gap: 0.65rem; + width: 100%; + padding: 0.6rem; + text-align: left; + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), + rgba(8, 7, 6, 0.48); + color: var(--text); + border-radius: 16px; + border: 1px solid rgba(255, 255, 255, 0.06); + transition: border-color 150ms ease, transform 150ms ease; +} + +.expedition-route-card:hover:not(:disabled) { + border-color: rgba(215, 138, 51, 0.22); + transform: translateY(-1px); +} + +.expedition-route-card.active { + border-color: rgba(215, 138, 51, 0.28); +} + +.expedition-route-card.tone-safe .risk-dots span.active { + background: var(--safe); + border-color: rgba(141, 194, 106, 0.6); +} + +.expedition-route-card.tone-warn .risk-dots span.active { + background: var(--warn); + border-color: rgba(224, 180, 102, 0.6); +} + +.expedition-route-card.tone-danger .risk-dots span.active { + background: var(--danger); + border-color: rgba(225, 109, 76, 0.6); +} + +.expedition-route-card .route-card-thumb { + min-height: 80px; + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.08); + background-position: center; + background-size: cover; +} + +.expedition-route-card .route-card-copy { + display: grid; + gap: 0.2rem; + align-content: center; +} + +.route-card-topline { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 0.5rem; +} + +.route-card-topline strong { + font-size: 0.94rem; +} + +.route-card-topline span { + color: var(--muted); + font-size: 0.66rem; + letter-spacing: 0.08em; +} + +.expedition-route-card .route-card-copy p { + margin: 0.2rem 0 0; + color: rgba(239, 226, 206, 0.72); + font-size: 0.78rem; + line-height: 1.4; +} + +.route-card-detail { + display: flex; + gap: 0.55rem; + margin-top: 0.35rem; + color: var(--muted); + font-size: 0.72rem; +} + +/* --- RoutePanel: expedition status --- */ + +.expedition-status-card { + display: grid; + gap: 0.65rem; + padding: 0.85rem; + border-radius: 16px; + border: 1px solid rgba(255, 255, 255, 0.08); + background: rgba(9, 8, 7, 0.48); +} + +.expedition-status-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; +} + +.expedition-status-cell { + padding: 0.55rem; + border-radius: 12px; + background: rgba(255, 255, 255, 0.04); + border: 1px solid rgba(255, 255, 255, 0.06); + text-align: center; +} + +.expedition-status-cell small { + display: block; + margin-bottom: 0.2rem; + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.expedition-status-cell strong { + font-size: 1rem; +} + +.expedition-launch-button { + width: 100%; +} + +/* --- LoadoutPanel: equipment terminal --- */ + +.equipment-terminal { + display: grid; + grid-template-rows: auto auto auto auto auto; + gap: 0.65rem; + padding: 0.85rem; +} + +.equipment-terminal-head { + display: flex; + justify-content: space-between; + align-items: center; + gap: 0.75rem; +} + +.equipment-terminal-title { + display: flex; + align-items: center; + gap: 0.7rem; +} + +.equipment-terminal-badges { + display: flex; + gap: 0.45rem; + flex-wrap: wrap; +} + +.equipment-grid-frame { + display: grid; + gap: 0.55rem; +} + +.equipment-grid-head { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 0.5rem; +} + +.equipment-grid-head span { + font-size: 0.82rem; + font-weight: 600; + letter-spacing: 0.06em; +} + +.equipment-grid-head p { + margin: 0; + color: var(--muted); + font-size: 0.72rem; +} + +.equipment-grid { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; +} + +.equipment-slot-card { + display: grid; + gap: 0.45rem; + padding: 0.65rem; + border-radius: 14px; + border: 1px solid rgba(255, 255, 255, 0.07); + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)), + rgba(9, 8, 7, 0.5); + text-align: center; +} + +.equipment-slot-card.equipped { + border-color: rgba(215, 138, 51, 0.28); + background: + linear-gradient(180deg, rgba(215, 138, 51, 0.06), rgba(255, 255, 255, 0)), + rgba(9, 8, 7, 0.5); +} + +.equipment-slot-card.placeholder { + place-items: center; + border-style: dashed; + border-color: rgba(255, 255, 255, 0.1); +} + +.equipment-slot-top span { + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.14em; + text-transform: uppercase; +} + +.equipment-slot-thumb { + width: 100%; + min-width: 0; +} + +.equipment-slot-thumb .asset-thumb { + width: 100%; + min-width: 0; + border-radius: 12px; +} + +.equipment-slot-copy strong { + display: block; + font-size: 0.85rem; +} + +.equipment-slot-copy small { + display: block; + margin-top: 0.15rem; + color: var(--muted); + font-size: 0.68rem; +} + +.equipment-slot-placeholder { + display: grid; + place-items: center; + width: 44px; + height: 44px; + border-radius: 12px; + border: 1px dashed rgba(255, 255, 255, 0.12); + color: var(--muted); + font-size: 1.1rem; +} + +/* --- LoadoutPanel: metrics row --- */ + +.equipment-metrics-row { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.5rem; +} + +.equipment-metric-box { + padding: 0.6rem; + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(8, 7, 6, 0.5); + text-align: center; +} + +.equipment-metric-box span { + display: block; + margin-bottom: 0.2rem; + color: var(--muted); + font-size: 0.62rem; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.equipment-metric-box strong { + font-size: 1.05rem; +} + +/* --- LoadoutPanel: warning terminal --- */ + +.warning-terminal { + display: grid; + gap: 0.55rem; +} + +.warning-terminal-head { + display: flex; + justify-content: space-between; + align-items: center; + gap: 0.5rem; +} + +.warning-terminal-head > span { + font-size: 0.82rem; + font-weight: 600; + letter-spacing: 0.06em; +} + +.warning-terminal-button { + min-height: 28px; + padding: 0 0.6rem; + border-radius: 999px; + border: 1px solid rgba(255, 255, 255, 0.08); + background: rgba(255, 255, 255, 0.03); + color: var(--muted); + font-size: 0.64rem; + letter-spacing: 0.1em; + text-transform: uppercase; +} + +.warning-terminal-list { + display: grid; + gap: 0.4rem; +} + +.warning-meter { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + gap: 0.55rem; + align-items: center; + padding: 0.5rem 0.65rem; + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(9, 8, 7, 0.42); +} + +.warning-meter.tone-good { + border-color: rgba(141, 194, 106, 0.18); +} + +.warning-meter.tone-warn { + border-color: rgba(224, 180, 102, 0.18); +} + +.warning-meter.tone-danger { + border-color: rgba(225, 109, 76, 0.18); +} + +.warning-meter-head { + display: flex; + align-items: center; + gap: 0.45rem; +} + +.warning-meter-icon { + width: 16px; + height: 16px; + flex: 0 0 16px; + opacity: 0.75; +} + +.warning-meter-head span { + font-size: 0.76rem; + white-space: nowrap; +} + +.warning-meter-track { + height: 5px; + border-radius: 999px; + background: rgba(255, 255, 255, 0.08); + overflow: hidden; +} + +.warning-meter-fill { + height: 100%; + border-radius: inherit; + background: linear-gradient(90deg, #f2b55e, #df7a27); + transition: width 300ms ease; +} + +.tone-good .warning-meter-fill { + background: linear-gradient(90deg, #9dda74, #53b96f); +} + +.tone-warn .warning-meter-fill { + background: linear-gradient(90deg, #f4cc76, #e0a030); +} + +.tone-danger .warning-meter-fill { + background: linear-gradient(90deg, #f4cc76, #eb6650); +} + +/* --- LoadoutPanel: ready pack --- */ + +.ready-pack-frame { + display: grid; + gap: 0.55rem; + padding: 0.75rem; + border-radius: 14px; + border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(9, 8, 7, 0.4); +} + +.ready-pack-head { + display: flex; + justify-content: space-between; + align-items: baseline; + gap: 0.5rem; +} + +.ready-pack-head > span { + font-size: 0.82rem; + font-weight: 600; + letter-spacing: 0.06em; +} + +.ready-pack-head p { + margin: 0; + color: var(--muted); + font-size: 0.72rem; +} + +.ready-pack-columns { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 0.75rem; +} + +.ready-pack-columns > div > strong { + display: block; + margin-bottom: 0.4rem; + font-size: 0.76rem; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--muted); +} + +.quick-access-row { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 0.4rem; +} + +.quick-access-slot { + display: grid; + place-items: center; + gap: 0.2rem; + padding: 0.45rem; + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.07); + background: rgba(8, 7, 6, 0.48); + color: var(--text); + min-height: 68px; + transition: border-color 150ms ease; +} + +.quick-access-slot:hover:not(:disabled):not(.locked) { + border-color: rgba(215, 138, 51, 0.25); +} + +.quick-access-slot.locked { + border-style: dashed; + border-color: rgba(255, 255, 255, 0.1); + color: var(--muted); + font-size: 0.66rem; + letter-spacing: 0.1em; +} + +.quick-access-thumb { + width: 100%; + min-width: 0; +} + +.quick-access-thumb .asset-thumb { + width: 100%; + min-width: 0; + border-radius: 10px; +} + +.quick-access-slot span { + font-size: 0.72rem; + color: #f1c27b; + font-weight: 600; +} + +.stash-row { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 0.4rem; +} + +.stash-slot { + display: grid; + place-items: center; + gap: 0.2rem; + padding: 0.4rem; + border-radius: 10px; + border: 1px solid rgba(255, 255, 255, 0.06); + background: rgba(8, 7, 6, 0.4); + min-height: 54px; +} + +.stash-slot span { + font-size: 0.68rem; + color: #f1c27b; +} + +.stash-slot.stash-open { + cursor: pointer; + color: var(--muted); + font-size: 1rem; + border-style: dashed; + border-color: rgba(255, 255, 255, 0.1); + transition: border-color 150ms ease, color 150ms ease; +} + +.stash-slot.stash-open:hover { + border-color: rgba(215, 138, 51, 0.28); + color: var(--text); +} + +.stash-slot .asset-thumb { + width: 40px; + min-width: 40px; + border-radius: 8px; +} + +/* --- LoadoutPanel: terminal open button --- */ + +.equipment-terminal-button { + width: 100%; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; +} diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 025a0f3..6abbbfa 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -2,6 +2,7 @@ import './App.css'; import { AuthScreen } from './features/auth/components/AuthScreen'; import { NewGameScreen } from './features/auth/components/NewGameScreen'; import { GameHud } from './features/game/components/GameHud'; +import { ErrorBoundary } from './features/shared/components/ErrorBoundary'; import { LoadingScreen } from './features/shared/components/LoadingScreen'; import { useGameSession } from './features/session/useGameSession'; @@ -45,17 +46,19 @@ function App() { } return ( - + + + ); } diff --git a/apps/web/src/assets/hero.png b/apps/web/src/assets/hero.png deleted file mode 100644 index 02251f4..0000000 Binary files a/apps/web/src/assets/hero.png and /dev/null differ diff --git a/apps/web/src/assets/react.svg b/apps/web/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/apps/web/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/web/src/assets/vite.svg b/apps/web/src/assets/vite.svg deleted file mode 100644 index 5101b67..0000000 --- a/apps/web/src/assets/vite.svg +++ /dev/null @@ -1 +0,0 @@ -Vite diff --git a/apps/web/src/features/game/components/BottomDock.tsx b/apps/web/src/features/game/components/BottomDock.tsx index 04f0181..f166517 100644 --- a/apps/web/src/features/game/components/BottomDock.tsx +++ b/apps/web/src/features/game/components/BottomDock.tsx @@ -1,6 +1,7 @@ import type { OverlayPanel } from '../types'; import type { GameAction, GameView } from '@tinywaste/game-core'; import { getActiveQuestCount, getCurrentPlace, getDominantAlert, getSupplyCounts } from '../hudModel'; +import { HudIcon } from './HudIcon'; export function BottomDock({ activePanel, @@ -9,7 +10,7 @@ export function BottomDock({ view, }: { activePanel: OverlayPanel | null; - onOpenPanel: (panel: OverlayPanel) => void; + onOpenPanel: (panel: OverlayPanel | null) => void; onSendAction: (action: GameAction) => void; view: GameView; }) { @@ -18,44 +19,47 @@ export function BottomDock({ const currentPlace = getCurrentPlace(view); const homeRoute = view.map.edges.find((edge) => edge.to === 'home'); const dominantAlert = getDominantAlert(view); + const dockTabs: Array<{ + id: OverlayPanel | 'local'; + label: string; + icon: 'shelter' | 'expedition' | 'inventory' | 'crafting' | 'skills' | 'factions' | 'map'; + onClick?: () => void; + }> = [ + { id: 'local', label: currentPlace?.name ?? 'Expedition', icon: 'expedition' }, + { id: 'inventory', label: '背包', icon: 'inventory', onClick: () => onOpenPanel('inventory') }, + { id: 'blueprints', label: '蓝图', icon: 'crafting', onClick: () => onOpenPanel('blueprints') }, + { id: 'missions', label: '任务', icon: 'skills', onClick: () => onOpenPanel('missions') }, + { id: 'logs', label: '日志', icon: 'factions', onClick: () => onOpenPanel('logs') }, + { id: 'local', label: '地图', icon: 'map', onClick: () => onOpenPanel(null) }, + ]; return ( -