mancala/apps/frontend/src/styles/app.css
Halit Aksoy 6f88658c60 feat(frontend): simplify the header as in the updated design
The header is now the logo, the page's actions, how to play, settings
and the account. The theme swatches move into a settings menu; the
account shows the player's initials and is on every page through an
AuthUserContext. On phones the home page's actions leave the header for
a row of two buttons. Checked menu items get a check at their end.
2026-10-17 02:59:26 +03:00

312 lines
9.7 KiB
CSS

/* Themes, base styles and the building blocks shared by the pages. The theme class is set on <html>. */
.t-ceviz {
--bg: #1f1712; --surface: #2a2019; --surface2: #382a20; --line: rgba(246, 234, 216, .10);
--ink: #f6ead8; --muted: #c4ad93; --accent: #f2b84b; --onAccent: #2a1a0a;
--accentSoft: rgba(242, 184, 75, .45); --accentGlow: rgba(242, 184, 75, .35); --lastRing: rgba(246, 234, 216, .55);
--chip: #1a110b; --chipInk: #f6ead8; --rim: #8a5d3b; --pit: #2c1d13; --live: #ff8a73;
--miniBg: #5b3d28; --miniPit: #2c1d13;
--boardBg: repeating-linear-gradient(94deg, rgba(255, 255, 255, .025) 0 3px, rgba(0, 0, 0, .04) 3px 9px, rgba(255, 255, 255, .015) 9px 14px), linear-gradient(180deg, #6e4a30, #573822);
--boardShadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 26px 50px rgba(0, 0, 0, .45), 0 0 0 1px #3a2516;
--pitShadow: inset 0 8px 16px rgba(0, 0, 0, .6), inset 0 -2px 0 rgba(255, 255, 255, .07), 0 1px 0 rgba(255, 255, 255, .08);
--stoneShadow: 0 3px 4px rgba(0, 0, 0, .45);
color-scheme: dark;
}
.t-gece {
--bg: #0c1220; --surface: #141c30; --surface2: #1d2744; --line: rgba(238, 241, 248, .09);
--ink: #eef1f8; --muted: #9aa6c2; --accent: #e2b36a; --onAccent: #241707;
--accentSoft: rgba(226, 179, 106, .45); --accentGlow: rgba(226, 179, 106, .35); --lastRing: rgba(238, 241, 248, .5);
--chip: #0a0f1c; --chipInk: #eef1f8; --rim: #b8925a; --pit: #0b1020; --live: #ff8a7a;
--miniBg: #1d2a4d; --miniPit: #0b1020;
--boardBg: linear-gradient(180deg, #1d2a4d, #141d38);
--boardShadow: inset 0 0 0 2px #b8925a, inset 0 0 0 7px #18223f, inset 0 0 0 8px rgba(184, 146, 90, .35), 0 26px 50px rgba(0, 0, 0, .5);
--pitShadow: inset 0 8px 18px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(184, 146, 90, .28), 0 1px 0 rgba(255, 255, 255, .06);
--stoneShadow: 0 3px 5px rgba(0, 0, 0, .55);
color-scheme: dark;
}
.t-yesim {
--bg: #e9ebe3; --surface: #f7f8f3; --surface2: #dde0d3; --line: rgba(29, 39, 33, .12);
--ink: #1d2721; --muted: #4f5d55; --accent: #2a7650; --onAccent: #ffffff;
--accentSoft: rgba(42, 118, 80, .4); --accentGlow: rgba(42, 118, 80, .28); --lastRing: rgba(29, 39, 33, .5);
--chip: #1d2721; --chipInk: #ffffff; --rim: #e9ebe3; --pit: #c3c7b6; --live: #b43a26;
--miniBg: #d3d6c8; --miniPit: #bcc0ae;
--boardBg: linear-gradient(180deg, #dcdfd2, #cfd2c3);
--boardShadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(0, 0, 0, .08), 0 22px 44px rgba(40, 50, 40, .2), 0 0 0 1px #bcc0ae;
--pitShadow: inset 0 7px 14px rgba(40, 50, 40, .38), inset 0 -2px 0 rgba(255, 255, 255, .55), 0 1px 0 rgba(255, 255, 255, .75);
--stoneShadow: 0 3px 4px rgba(30, 40, 30, .35);
color-scheme: light;
}
html, body, #main { min-height: 100%; }
body {
margin: 0;
background: var(--bg);
color: var(--ink);
font-family: 'Bricolage Grotesque', system-ui, sans-serif;
transition: background .3s, color .3s;
}
#main { display: flex; flex-direction: column; min-height: 100vh; }
a { color: inherit; }
/* Page */
.page { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wrap {
width: 100%;
max-width: 1180px;
margin: 0 auto;
padding: 28px 32px 56px;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 26px;
}
/* Header */
.hdr {
position: sticky;
top: 0;
z-index: 10;
display: flex;
align-items: center;
gap: 12px;
padding: 12px 32px;
background: var(--bg);
border-bottom: 1px solid var(--line);
transition: background .3s;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
margin-right: auto;
min-width: 0;
color: var(--ink);
text-decoration: none;
font-weight: 800;
font-size: 24px;
letter-spacing: -.02em;
}
.logo svg { flex: none; }
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* How to play, settings and the account: round icon buttons at the end of the header */
.hdr-tools { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.ibtn {
position: relative;
width: 44px;
height: 44px;
flex: none;
border-radius: 50%;
border: none;
padding: 0;
background: transparent;
color: var(--ink);
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
@media (hover: hover) { .ibtn:hover { background: var(--surface); } }
.ibtn.on { background: var(--surface); }
.me-av {
width: 36px;
height: 36px;
border-radius: 50%;
background: var(--accent);
color: var(--onAccent);
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
font-size: 14px;
}
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 44px;
padding: 0 18px;
border-radius: 22px;
border: none;
font: inherit;
font-weight: 700;
font-size: 15px;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
box-sizing: border-box;
}
.btn.pri { background: var(--accent); color: var(--onAccent); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .4; cursor: default; }
.ibtn:focus-visible, .btn:focus-visible, .card:focus-visible, .logo:focus-visible {
outline: 3px solid var(--accent);
outline-offset: 3px;
}
/* Pills, cards */
.pill {
display: inline-flex;
align-items: center;
gap: 6px;
height: 26px;
padding: 0 10px;
border-radius: 13px;
font-size: 12px;
font-weight: 700;
background: var(--surface2);
color: var(--ink);
white-space: nowrap;
}
.pill.live, .pill.lose { color: var(--live); }
.pill.live::before {
content: '';
width: 7px;
height: 7px;
border-radius: 50%;
background: currentColor;
animation: kpulse 1.6s ease-in-out infinite;
}
.pill.win { background: var(--accent); color: var(--onAccent); }
.panel { border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; animation: kpulse 1.6s ease-in-out infinite; }
@keyframes kpulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: .35; transform: scale(.7); }
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
}
/* Menus (@szhsin/react-menu): settings, account, bot levels */
.szh-menu {
min-width: 220px;
background: var(--surface);
color: var(--ink);
border-radius: 20px;
padding: 8px;
box-shadow: 0 0 0 1px var(--line), 0 18px 40px rgba(0, 0, 0, .28);
font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}
.szh-menu__header { padding: 10px 12px 6px; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: none; }
.szh-menu.settings .szh-menu__header { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.szh-menu__item { gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.szh-menu__item--hover { background: var(--surface2); }
.szh-menu.settings { width: 260px; }
.szh-menu__item--checked { background: var(--surface2); }
/* A checked item (the theme, the last bot level) has a check at its end instead of the library's mark in front. */
.szh-menu__item--type-checkbox { padding-left: 12px; }
.szh-menu__item--type-checkbox.szh-menu__item--checked::before { content: none; }
.szh-menu__item--type-checkbox.szh-menu__item--checked::after {
content: "";
width: 18px;
height: 18px;
margin-left: auto;
flex: none;
background: var(--accent);
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.swd { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
/* On phones the home page's actions leave the header for a row of two buttons. */
.show-m { display: none; }
.qa { grid-template-columns: 1fr 1fr; gap: 10px; }
.qa .szh-menu-button, .qa > .btn { width: 100%; }
/* Dialogs (sweetalert) */
.swal-modal { background: var(--surface); border-radius: 24px; font-family: 'Bricolage Grotesque', system-ui, sans-serif; }
.swal-title, .swal-text { color: var(--ink); }
.swal-button { border-radius: 22px; font-family: inherit; }
@media (max-width: 640px) {
.hdr { padding: 10px 16px; gap: 8px; }
.logo { font-size: 20px; gap: 8px; }
.logo svg { width: 28px; height: 28px; }
.hide-m { display: none !important; }
.show-m { display: grid !important; }
.hdr-tools { margin-left: 4px; gap: 2px; }
.ic-m { width: 44px; padding: 0; }
.wrap { padding: 16px 16px 32px; gap: 16px; }
}
@media (max-width: 360px) {
.logo span { display: none; }
}
/* Short messages (util/Notyf.ts): below the header at the top centre, as an inverted chip of the theme. */
.notyf { padding: 84px 16px 16px; }
.notyf .notyf__toast {
max-width: min(420px, 100%);
width: auto;
padding: 0 18px;
border-radius: 18px;
color: var(--bg);
font-family: 'Bricolage Grotesque', system-ui, sans-serif;
font-weight: 700;
font-size: 15px;
box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
cursor: pointer;
}
.notyf .notyf__toast--upper { margin-bottom: 10px; }
.notyf .notyf__wrapper { padding: 11px 0; }
.notyf .notyf__icon { display: none; }
.notyf .notyf__message { line-height: 1.35; text-align: center; }
@media (max-width: 640px) {
.notyf { padding-top: 76px; }
}