Files
vyryi-front/src/index.css
Redsandy f0733d6918 Refactor game API and introduce Forest Fortune game
- Updated API types to replace `GameStub` with `GameInfo` and added `SessionSpinResult` and `SpinOutcome` types.
- Modified API requests in `api.ts` to use the new game types.
- Implemented the `ForestFortuneGame` component with game logic, including spinning mechanics and win animations.
- Created supporting components: `CoinFlight`, `ReelColumn`, `WinCounter`, and `WinLinesOverlay` for game UI.
- Added CSS styles for the Forest Fortune game layout and animations.
- Updated `GamePage` and `HomePage` to integrate the new game and reflect its status correctly.
2026-08-12 15:27:27 +03:00

1019 lines
18 KiB
CSS

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Source+Sans+3:wght@400;500;600&display=swap');
:root {
--bg-deep: #1a1b16;
--bg: #2f3027;
--bg-lift: #3a3b31;
--gold: #a68946;
--gold-soft: #c4a96a;
--burgundy: #8c2b2b;
--eye: #c8d97d;
--cream: #e8e0d0;
--muted: #9a9486;
--ink: #0f100d;
--radius: 10px;
--font-display: 'Cormorant Garamond', 'Palatino Linotype', serif;
--font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
color: var(--cream);
background: var(--bg-deep);
font-family: var(--font-body);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body,
#root {
min-height: 100%;
margin: 0;
}
body {
min-height: 100vh;
background:
radial-gradient(ellipse 80% 50% at 50% -10%, rgba(166, 137, 70, 0.18), transparent 55%),
radial-gradient(ellipse 60% 40% at 80% 100%, rgba(140, 43, 43, 0.12), transparent 50%),
linear-gradient(165deg, var(--bg-deep) 0%, var(--bg) 45%, #25261f 100%);
background-attachment: fixed;
}
body::before {
content: '';
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0.07;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
z-index: 0;
}
#root {
position: relative;
z-index: 1;
}
a {
color: inherit;
text-decoration: none;
}
button,
input {
font: inherit;
}
.brand {
margin: 0;
font-family: var(--font-display);
font-weight: 700;
font-size: clamp(2.8rem, 10vw, 4rem);
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--gold-soft);
text-shadow: 0 2px 24px rgba(166, 137, 70, 0.35);
animation: brand-in 0.9s ease-out both;
}
.brand--sm {
font-size: 1.35rem;
letter-spacing: 0.12em;
animation: none;
}
.boot {
min-height: 100vh;
display: grid;
place-content: center;
gap: 0.75rem;
text-align: center;
}
.boot__logo {
width: min(42vw, 180px);
margin: 0 auto;
animation: logo-rise 1.1s ease-out both;
filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55));
}
.gate {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem 1.25rem 3rem;
position: relative;
overflow: hidden;
transform-origin: center center;
}
.gate__glow {
position: absolute;
width: 280px;
height: 280px;
border-radius: 50%;
background: radial-gradient(circle, rgba(200, 217, 125, 0.16), transparent 70%);
top: 12%;
left: 50%;
transform: translateX(-50%);
animation: pulse-glow 4s ease-in-out infinite;
pointer-events: none;
}
.gate__content {
width: min(100%, 420px);
text-align: center;
position: relative;
}
.gate__logo {
width: min(58vw, 220px);
display: block;
margin: 0 auto 0.5rem;
animation: logo-rise 1.1s ease-out both;
filter: drop-shadow(0 10px 32px rgba(0, 0, 0, 0.6));
}
.gate__tagline {
margin: 0.35rem 0 1.75rem;
color: var(--muted);
font-size: 1.05rem;
font-style: italic;
font-family: var(--font-display);
animation: fade-up 1s 0.2s ease-out both;
}
.agreement {
text-align: left;
animation: fade-up 0.9s 0.35s ease-out both;
}
.agreement__check {
display: flex;
gap: 0.65rem;
align-items: flex-start;
margin-bottom: 1rem;
color: var(--cream);
font-size: 0.95rem;
cursor: pointer;
}
.agreement__check input {
margin-top: 0.2rem;
accent-color: var(--gold);
}
.legal-link {
color: var(--gold-soft);
text-decoration: underline;
text-underline-offset: 0.15em;
}
.legal-link:hover {
color: var(--eye);
}
.legal-page {
max-width: 560px;
margin: 0 auto;
padding: 1.25rem 1.15rem 2.5rem;
}
.legal-doc {
margin-top: 1.25rem;
}
.legal-doc h1 {
margin: 0 0 1rem;
font-family: var(--font-display);
font-size: clamp(1.6rem, 5vw, 2rem);
font-weight: 600;
color: var(--gold-soft);
}
.legal-doc p {
margin: 0 0 0.9rem;
color: var(--muted);
line-height: 1.55;
font-size: 0.98rem;
}
.legal-doc p:last-child {
margin-bottom: 0;
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
border: none;
border-radius: var(--radius);
padding: 0.85rem 1.1rem;
cursor: pointer;
transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.btn:not(:disabled):active {
transform: translateY(1px);
}
.btn--gold {
background: linear-gradient(180deg, var(--gold-soft), var(--gold));
color: var(--ink);
font-weight: 600;
letter-spacing: 0.04em;
}
.btn--gold:not(:disabled):hover {
filter: brightness(1.06);
}
.btn--sm {
width: auto;
padding: 0.45rem 0.85rem;
font-size: 0.85rem;
}
.btn--outline {
background: transparent;
border: 1px solid var(--gold);
color: var(--gold-soft);
}
.btn--outline:not(:disabled):hover {
background: rgba(166, 137, 70, 0.12);
}
.btn--ghost {
background: transparent;
color: var(--muted);
margin-top: 0.5rem;
}
.error {
color: #e8a0a0;
font-size: 0.9rem;
margin: 0 0 0.75rem;
}
.linkish {
display: inline;
margin-left: 0.5rem;
background: none;
border: none;
color: var(--eye);
cursor: pointer;
text-decoration: underline;
padding: 0;
}
.home {
max-width: 520px;
margin: 0 auto;
padding: 1.25rem 1.15rem 2.5rem;
}
.home__top {
display: flex;
flex-direction: column;
gap: 1rem;
margin-bottom: 1.5rem;
}
.home__brand-row {
display: flex;
align-items: center;
gap: 0.65rem;
}
.home__mark {
width: 42px;
height: 42px;
object-fit: contain;
}
.balance-panel {
display: grid;
grid-template-columns: 1fr auto;
grid-template-areas:
'label btn'
'value btn';
gap: 0.15rem 1rem;
align-items: center;
padding: 0.9rem 1rem;
background: rgba(15, 16, 13, 0.4);
border-bottom: 1px solid rgba(166, 137, 70, 0.4);
}
.balance-panel__label {
grid-area: label;
color: var(--muted);
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.balance-panel__value {
grid-area: value;
font-family: var(--font-display);
font-size: 2rem;
font-weight: 600;
color: var(--eye);
}
.balance-panel .btn {
grid-area: btn;
}
.section-lead {
margin: 0 0 1rem;
color: var(--muted);
font-size: 0.95rem;
}
.games h2 {
margin: 0 0 0.35rem;
font-family: var(--font-display);
font-size: 1.75rem;
font-weight: 600;
color: var(--gold-soft);
}
.games__list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.game-link {
display: grid;
grid-template-columns: 1fr auto;
gap: 0.25rem 0.75rem;
padding: 0.95rem 0.25rem 1rem;
border-bottom: 1px solid rgba(166, 137, 70, 0.22);
transition: background 0.2s ease, padding-left 0.2s ease;
}
.game-link:hover {
background: rgba(166, 137, 70, 0.06);
padding-left: 0.35rem;
}
.game-link__title {
font-family: var(--font-display);
font-size: 1.25rem;
font-weight: 600;
}
.game-link__status {
color: var(--burgundy);
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.1em;
align-self: center;
}
.game-link__desc {
grid-column: 1 / -1;
color: var(--muted);
font-size: 0.9rem;
}
.toast {
margin: 0 0 1rem;
color: var(--eye);
font-size: 0.9rem;
}
.modal {
position: fixed;
inset: 0;
background: rgba(10, 10, 8, 0.72);
display: grid;
place-items: center;
padding: 1.25rem;
z-index: 20;
animation: fade-in 0.2s ease;
}
.modal__panel {
width: min(100%, 360px);
padding: 1.35rem 1.2rem;
background: linear-gradient(180deg, var(--bg-lift), var(--bg));
border: 1px solid rgba(166, 137, 70, 0.4);
border-radius: var(--radius);
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.modal__panel h3 {
margin: 0 0 0.35rem;
font-family: var(--font-display);
font-size: 1.5rem;
color: var(--gold-soft);
}
.deposit-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0.5rem;
margin-bottom: 0.5rem;
}
.game-page {
max-width: 520px;
margin: 0 auto;
padding: 1.25rem 1.15rem 2.5rem;
}
.back-link {
color: var(--muted);
font-size: 0.9rem;
}
.back-link:hover {
color: var(--gold-soft);
}
.game-stub {
margin-top: 2rem;
text-align: center;
}
.game-stub__mark {
width: 120px;
margin-bottom: 1rem;
opacity: 0.9;
animation: logo-rise 0.8s ease-out both;
}
.game-stub h1 {
margin: 0 0 0.5rem;
font-family: var(--font-display);
font-size: 2rem;
color: var(--gold-soft);
}
.game-stub p {
color: var(--muted);
margin: 0 0 1rem;
}
.game-stub__badge {
display: inline-block;
color: var(--burgundy);
border: 1px solid rgba(140, 43, 43, 0.5);
padding: 0.35rem 0.85rem;
letter-spacing: 0.12em;
text-transform: uppercase;
font-size: 0.75rem;
}
@keyframes logo-rise {
from {
opacity: 0;
transform: translateY(18px) scale(0.96);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@keyframes brand-in {
from {
opacity: 0;
letter-spacing: 0.2em;
}
to {
opacity: 1;
letter-spacing: 0.08em;
}
}
@keyframes fade-up {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes pulse-glow {
0%,
100% {
opacity: 0.55;
transform: translateX(-50%) scale(1);
}
50% {
opacity: 1;
transform: translateX(-50%) scale(1.08);
}
}
@media (min-width: 640px) {
.home__top {
flex-direction: row;
align-items: center;
justify-content: space-between;
}
}
/* Gate logo fly-in transit */
html.gate-transit-lock,
html.gate-transit-lock body {
overflow: hidden;
touch-action: none;
}
.gate-transit {
position: fixed;
inset: 0;
z-index: 9000;
pointer-events: none;
overflow: hidden;
}
.gate-transit__stage {
position: absolute;
inset: 0;
perspective: 1400px;
perspective-origin: 50% 50%;
}
.gate-transit__hero {
/* Hidden until JS pins it over .gate__logo — avoids first-frame size flash */
position: fixed;
top: 0;
left: 0;
width: 0;
height: 0;
opacity: 0;
visibility: hidden;
display: block;
margin: 0;
pointer-events: none;
user-select: none;
object-fit: contain;
filter: drop-shadow(0 10px 32px rgba(0, 0, 0, 0.6));
z-index: 1;
}
.gate-transit__ravens {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
}
.gate-transit__ravens canvas {
display: block;
width: 100% !important;
height: 100% !important;
}
.gate-transit__veil {
position: absolute;
inset: 0;
background: #000;
opacity: 0;
z-index: 3;
}
.home--from-gate {
animation: home-from-void 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes home-from-void {
from {
opacity: 0;
transform: translateY(18px) scale(0.985);
filter: blur(8px);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
filter: blur(0);
}
}
@media (prefers-reduced-motion: reduce) {
.home--from-gate {
animation: fade-in 0.45s ease-out both;
}
}
/* Forest Fortune */
.ff {
display: grid;
gap: 1.1rem;
max-width: 420px;
margin: 0 auto;
padding-bottom: 2rem;
}
.ff__header {
text-align: center;
}
.ff__title {
margin: 0;
font-family: var(--font-display);
font-size: clamp(1.8rem, 6vw, 2.4rem);
color: var(--gold-soft);
letter-spacing: 0.04em;
}
.ff__lead {
margin: 0.35rem 0 0;
color: var(--muted);
font-size: 0.95rem;
}
.ff__meta {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.75rem 1.1rem;
margin-top: 0.85rem;
font-size: 0.9rem;
color: var(--cream);
}
.ff__meta strong {
color: var(--gold-soft);
}
.ff__stage {
display: grid;
gap: 0.75rem;
}
.ff-win {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 0.75rem;
padding: 0.7rem 0.95rem;
border-radius: 10px;
background: linear-gradient(135deg, rgba(26, 27, 22, 0.9), rgba(58, 59, 49, 0.55));
border: 1px solid rgba(166, 137, 70, 0.4);
box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.25);
}
.ff-win__label {
font-size: 0.85rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--muted);
}
.ff-win__value {
font-family: var(--font-display);
font-size: 1.65rem;
color: var(--gold-soft);
font-variant-numeric: tabular-nums;
}
.ff-win--pulse {
animation: ff-win-pulse 0.45s ease-out;
border-color: var(--gold);
}
@keyframes ff-win-pulse {
0% {
transform: scale(1);
box-shadow: 0 0 0 rgba(166, 137, 70, 0);
}
40% {
transform: scale(1.03);
box-shadow: 0 0 22px rgba(166, 137, 70, 0.35);
}
100% {
transform: scale(1);
}
}
.ff__board-wrap {
position: relative;
}
.ff__board {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 0.35rem;
padding: 0.65rem;
border-radius: 12px;
background:
linear-gradient(160deg, rgba(58, 70, 42, 0.55), rgba(26, 27, 22, 0.9)),
radial-gradient(circle at 30% 20%, rgba(166, 137, 70, 0.18), transparent 55%);
border: 1px solid rgba(166, 137, 70, 0.35);
box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}
.ff__board--reels {
position: relative;
aspect-ratio: 1;
gap: 0;
overflow: hidden;
padding: 0.55rem;
}
.ff-reel {
position: relative;
overflow: hidden;
border-radius: 0;
background: rgba(15, 16, 13, 0.55);
border: none;
box-shadow: inset -1px 0 0 rgba(154, 148, 134, 0.16);
height: 100%;
min-height: 0;
}
.ff-reel:last-child {
box-shadow: none;
}
.ff-reel__viewport {
height: 100%;
overflow: hidden;
}
.ff-reel__strip {
display: flex;
flex-direction: column;
height: 100%;
}
.ff-reel--spin .ff-reel__strip {
height: 200%;
animation: ff-reel-spin var(--ff-spin-ms, 280ms) linear infinite;
}
.ff-reel--spin .ff-reel__cell {
filter: blur(1.2px);
opacity: 0.88;
}
.ff-reel--stop {
animation: ff-reel-land 0.28s cubic-bezier(0.12, 0.78, 0.18, 1);
}
@keyframes ff-reel-spin {
from {
transform: translateY(0);
}
to {
transform: translateY(-50%);
}
}
@keyframes ff-reel-land {
0% {
transform: translateY(-10px);
}
60% {
transform: translateY(3px);
}
100% {
transform: translateY(0);
}
}
.ff-reel__cell {
flex: 1 0 0;
min-height: 0;
display: grid;
place-items: center;
border-bottom: 1px solid rgba(154, 148, 134, 0.08);
}
.ff-reel--spin .ff-reel__cell {
flex: 1 0 10%;
}
.ff-reel__cell--win {
background: rgba(166, 137, 70, 0.22);
box-shadow: inset 0 0 0 1px rgba(166, 137, 70, 0.55);
}
.ff-reel__cell--scatter {
box-shadow: inset 0 0 16px rgba(200, 217, 125, 0.28);
}
.ff-reel__glyph {
font-size: clamp(1.2rem, 5.2vw, 1.75rem);
line-height: 1;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.ff-lines {
position: absolute;
inset: 0.55rem;
width: calc(100% - 1.1rem);
height: calc(100% - 1.1rem);
pointer-events: none;
z-index: 3;
overflow: visible;
}
.ff-lines__glow {
opacity: 1;
filter: blur(1.5px);
}
.ff-lines__path {
opacity: 1;
}
.ff-lines__dot,
.ff-lines__dot-glow {
opacity: 0;
animation: ff-scatter-pop 0.28s ease-out forwards;
}
.ff-lines__dot-glow {
filter: blur(2px);
}
@keyframes ff-line-trace {
to {
stroke-dashoffset: 0;
}
}
.ff-lines__scatter {
opacity: 0;
animation: ff-scatter-pop 0.4s ease-out 0.15s forwards;
}
@keyframes ff-scatter-pop {
from {
opacity: 0;
transform: scale(0.6);
}
to {
opacity: 1;
transform: scale(1);
}
}
.ff-coins {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 4;
overflow: visible;
}
.ff-coins__coin {
position: absolute;
bottom: 42%;
font-size: 0.95rem;
color: var(--gold-soft);
text-shadow: 0 0 8px rgba(166, 137, 70, 0.7);
animation-name: ff-coin-fly;
animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
animation-fill-mode: forwards;
opacity: 0;
}
@keyframes ff-coin-fly {
0% {
opacity: 0;
transform: translate(-50%, 0) scale(0.6);
}
15% {
opacity: 1;
}
100% {
opacity: 0;
transform: translate(-50%, -120px) scale(1.15);
}
}
.ff__controls {
display: grid;
gap: 0.75rem;
}
.ff__row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.65rem;
}
.ff__row--actions {
grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
.ff__field {
display: grid;
gap: 0.3rem;
font-size: 0.85rem;
color: var(--muted);
}
.ff__field input {
width: 100%;
padding: 0.65rem 0.75rem;
border-radius: 8px;
border: 1px solid rgba(166, 137, 70, 0.35);
background: rgba(15, 16, 13, 0.55);
color: var(--cream);
}
.ff__speed {
min-height: 2.8rem;
width: 100%;
font-size: 0.9rem;
}
.ff__spin {
width: 100%;
min-height: 2.8rem;
}
.ff__spin-info {
margin: 0;
text-align: center;
color: var(--cream);
font-size: 0.92rem;
}
.ff__summary {
padding: 0.9rem 1rem;
border-radius: 10px;
background: rgba(15, 16, 13, 0.45);
border: 1px solid rgba(166, 137, 70, 0.28);
text-align: center;
}
.ff__summary h2 {
margin: 0 0 0.4rem;
font-family: var(--font-display);
font-size: 1.25rem;
color: var(--gold-soft);
}
.ff__summary p {
margin: 0.25rem 0;
color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
.ff-reel--spin .ff-reel__strip,
.ff-reel--stop {
animation: none;
}
.ff-reel--spin .ff-reel__cell {
filter: none;
}
.ff-lines__path,
.ff-lines__glow {
animation: none !important;
stroke-dashoffset: 0 !important;
opacity: 1;
}
.ff-lines__dot,
.ff-lines__dot-glow,
.ff-lines__scatter,
.ff-coins__coin,
.ff-win--pulse {
animation: none;
opacity: 1;
}
}