Files
h-school/src/HSchool.Client/src/style.css
T

628 lines
11 KiB
CSS

:root {
color-scheme: dark;
--surface: #10141c;
--surface-raised: #171d28;
--surface-sunken: #0c1017;
--border: #2a3242;
--text: #d7e0ef;
--text-muted: #8b98ad;
--accent: #4cc9f0;
--danger: #f2536d;
font-family: system-ui, "Segoe UI", sans-serif;
color: var(--text);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100dvh;
background: var(--surface);
}
/*
* The shell fills the window. A management screen that stops halfway down a very wide page reads
* as a half-loaded document rather than a game, so every screen is a full-height flex column and
* decides its own comfortable width.
*/
#app {
display: flex;
min-height: 100dvh;
padding: 24px 24px 52px;
}
.screen {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
min-height: 0;
width: 100%;
margin: 0 auto;
}
/* A short list of saves sits in the middle of the window instead of clinging to the top edge. */
.screen.menu {
max-width: 900px;
justify-content: center;
}
.screen.game {
max-width: 1500px;
}
#status {
position: fixed;
right: 16px;
bottom: 12px;
display: flex;
align-items: center;
gap: 14px;
font-size: 12px;
color: var(--text-muted);
}
.locale-switch {
display: flex;
gap: 4px;
}
.locale-switch__button {
padding: 3px 8px;
border: 1px solid var(--border);
border-radius: 6px;
background: transparent;
color: var(--text-muted);
font: inherit;
font-size: 11px;
letter-spacing: 0.04em;
cursor: pointer;
}
.locale-switch__button:hover {
border-color: var(--accent);
color: var(--text);
}
.locale-switch__button[aria-pressed='true'] {
border-color: var(--accent);
color: var(--accent);
}
/* Screens */
.screen__header {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
.screen__title {
margin: 0;
font-size: 24px;
font-weight: 600;
}
.screen__actions {
margin-left: auto;
}
.hint {
margin: 0 0 16px;
color: var(--text-muted);
font-size: 14px;
}
.hint--error {
color: var(--danger);
}
/* School cards */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
align-content: start;
gap: 16px;
}
.card {
display: flex;
flex-direction: column;
gap: 6px;
padding: 18px;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--surface-raised);
cursor: pointer;
transition: border-color 120ms ease, transform 120ms ease;
}
.card:hover,
.card:focus-visible {
border-color: var(--accent);
transform: translateY(-2px);
outline: none;
}
.card__title {
margin: 0;
font-size: 17px;
font-weight: 600;
}
.card__meta {
display: flex;
align-items: center;
gap: 10px;
}
.card__time {
margin: 0;
color: var(--text-muted);
font-size: 14px;
font-variant-numeric: tabular-nums;
}
.card__badge {
padding: 2px 8px;
border: 1px solid var(--border);
border-radius: 999px;
color: var(--text-muted);
font-size: 12px;
}
.card__actions {
display: flex;
justify-content: flex-end;
margin-top: 10px;
}
/* Clock */
/*
* Inside a school the calendar is a toolbar, not a hero banner: the panels below are the screen,
* and a 56px centred clock pushed them down for no information gained.
*/
.clockbar {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
padding: 12px 18px;
border: 1px solid var(--border);
border-radius: 14px;
background: var(--surface-raised);
}
.clockbar__now {
display: flex;
align-items: center;
gap: 16px;
min-width: 0;
}
.clock__time {
margin: 0;
font-size: 34px;
font-weight: 600;
font-variant-numeric: tabular-nums;
letter-spacing: 0.02em;
line-height: 1.1;
}
.clockbar__labels {
display: flex;
flex-direction: column;
min-width: 0;
}
.clock__date {
margin: 0;
font-size: 15px;
}
.clock__weekday {
margin: 0;
color: var(--text-muted);
font-size: 13px;
text-transform: capitalize;
}
.clock__controls {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
margin-left: auto;
}
/* Manager */
.manager {
display: grid;
grid-template-columns: minmax(210px, 0.85fr) minmax(240px, 1fr) minmax(280px, 1.25fr);
gap: 16px;
flex: 1;
min-height: 0;
margin-top: 16px;
}
.panel {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
border: 1px solid var(--border);
border-radius: 12px;
background: var(--surface-raised);
}
.panel__title {
flex: 0 0 auto;
margin: 0;
padding: 11px 16px;
border-bottom: 1px solid var(--border);
color: var(--text-muted);
font-size: 12px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
}
/* The body scrolls, the title stays: a long tree must not push the panel out of the window. */
.panel__body {
flex: 1;
min-height: 0;
overflow: auto;
padding: 12px 12px 16px;
}
.panel__name {
margin: 0 0 12px;
font-size: 18px;
font-weight: 600;
}
.panel__section {
margin-top: 14px;
}
.panel__section:first-child {
margin-top: 0;
}
.panel__section-title {
margin: 0 0 4px;
font-size: 12px;
font-weight: 600;
color: var(--text-muted);
letter-spacing: 0.02em;
}
.panel__empty {
margin: 0;
color: var(--text-muted);
font-size: 13px;
}
.panel__list {
margin: 0;
padding-left: 18px;
font-size: 13px;
}
.tree {
margin: 0;
padding: 0;
list-style: none;
}
.tree .tree {
margin-top: 2px;
}
.tree__button {
display: block;
width: 100%;
padding: 6px 8px;
border: 1px solid transparent;
border-radius: 6px;
background: transparent;
color: var(--text);
font: inherit;
font-size: 13px;
text-align: left;
cursor: pointer;
}
.tree__button:hover {
border-color: var(--border);
}
.tree__button--active {
border-color: var(--accent);
background: rgba(76, 201, 240, 0.16);
color: var(--accent);
}
/* Below three columns the panels stop competing for height and the page scrolls instead. */
@media (max-width: 900px) {
#app {
min-height: 0;
}
.manager {
display: flex;
flex-direction: column;
flex: 0 0 auto;
}
.panel__body {
overflow: visible;
}
}
/* Controls */
.button {
padding: 8px 14px;
border: 1px solid var(--border);
border-radius: 8px;
background: transparent;
color: var(--text);
font: inherit;
font-size: 14px;
white-space: nowrap;
cursor: pointer;
transition: border-color 120ms ease, background 120ms ease;
}
.button:hover:not([disabled]) {
border-color: var(--accent);
}
.button[disabled] {
opacity: 0.45;
cursor: not-allowed;
}
.button--primary {
border-color: var(--accent);
color: var(--accent);
}
.button--danger {
border-color: var(--danger);
color: var(--danger);
}
.button--small {
padding: 6px 10px;
font-size: 13px;
}
.button--icon {
min-width: 44px;
font-size: 16px;
}
.button--active {
border-color: var(--accent);
background: rgba(76, 201, 240, 0.16);
color: var(--accent);
}
.input {
min-width: 0;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--surface-sunken);
color: var(--text);
font: inherit;
font-size: 14px;
}
.input:focus {
border-color: var(--accent);
outline: none;
}
/* Dialogs */
.dialog {
min-width: 340px;
max-width: 460px;
padding: 24px;
border: 1px solid var(--border);
border-radius: 14px;
background: var(--surface-raised);
color: var(--text);
}
/*
* The editor grows with its map instead of always claiming 800px: a two-room school framed by a
* half-empty window was the loudest thing on screen.
*/
.dialog--screen[open] {
display: flex;
flex-direction: column;
min-width: unset;
max-width: none;
width: min(1080px, calc(100vw - 32px));
/* A modal dialog is absolutely positioned with `inset: 0`, so `height: auto` stretches it to the
max instead of shrink-wrapping. `fit-content` is what actually lets it size to its map. */
height: fit-content;
max-height: calc(100dvh - 48px);
padding: 16px 20px 20px;
}
.dialog--screen .screen__header {
flex: 0 0 auto;
margin-bottom: 12px;
}
.dialog--screen .screen__title {
font-size: 19px;
}
.dialog--screen .map-editor {
flex: 1 1 auto;
min-height: min(400px, 55dvh);
grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.3fr);
gap: 16px;
}
.dialog--screen .dialog__actions {
flex: 0 0 auto;
margin-top: 12px;
}
.dialog::backdrop {
background: rgba(6, 9, 14, 0.7);
}
.dialog__title {
margin: 0 0 12px;
font-size: 19px;
}
.dialog__message {
margin: 0 0 20px;
color: var(--text-muted);
}
.dialog__error {
margin: 0;
color: var(--danger);
font-size: 14px;
}
.dialog__actions {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 20px;
}
.form {
display: flex;
flex-direction: column;
gap: 16px;
}
.field {
display: flex;
flex-direction: column;
gap: 6px;
}
.field__label {
font-size: 13px;
color: var(--text-muted);
}
/*
* Without this the rows fell back to inline-block flow, `.input { flex: 1 }` never applied and
* every field in the create form ended up a different width.
*/
.field__row {
display: flex;
align-items: center;
gap: 8px;
}
.field__row > .input {
flex: 1;
}
.field .hint {
margin: 0;
font-size: 13px;
}
.mod-list {
display: flex;
flex-wrap: wrap;
gap: 8px 16px;
}
.mod-list__item {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
}
/* Map editor */
.map-editor {
display: grid;
grid-template-columns: minmax(200px, 0.9fr) minmax(280px, 1.3fr);
gap: 12px;
}
.map-editor__pane,
.map-editor__details {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
gap: 12px;
overflow: auto;
}
.editor-section {
display: flex;
flex-direction: column;
gap: 8px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface-sunken);
}
.editor-section--grow {
flex: 1;
min-height: 0;
overflow: auto;
}
.editor-section__title {
margin: 0;
color: var(--text-muted);
font-size: 12px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.editor-section__hint {
margin: 0;
color: var(--text-muted);
font-size: 13px;
}
.map-editor__links {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: column;
gap: 6px;
}
.map-editor__link {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
font-size: 13px;
}