Spaces:
Running
Running
File size: 5,699 Bytes
d08ebf6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | /* ============ Bun: The Great Migration — shared styles ============ */
:root {
--bun-cream: #fbf0df;
--bun-shadow: #f6dece;
--rust-orange: #f5772d;
--rust-deep: #b7410e;
--zig-yellow: #f7a41d;
--zig-dark: #8a5a00;
--ink: #1c1917;
--panel: #26221f;
--panel-2: #332d28;
--paper: #fffaf0;
--good: #4ade80;
--bad: #f87171;
--font-ui: 'Nunito', system-ui, -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
min-height: 100%;
font-family: var(--font-ui);
background: var(--ink);
color: var(--paper);
}
/* ---------- page frame used by both screens ---------- */
.frame {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 24px;
position: relative;
overflow: hidden;
}
/* floating code tokens in the background */
.bg-tokens { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-tokens span {
position: absolute;
font-family: var(--font-mono);
font-size: 14px;
opacity: 0.14;
white-space: nowrap;
animation: drift linear infinite;
}
@keyframes drift {
from { transform: translateX(105vw); }
to { transform: translateX(-120%); }
}
/* ---------- title screen ---------- */
.title-wrap {
position: relative;
z-index: 1;
max-width: 780px;
width: 100%;
text-align: center;
}
.logo-row {
display: flex;
align-items: center;
justify-content: center;
gap: 18px;
margin-bottom: 10px;
animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
.logo-bun { width: 120px; height: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.45)); }
.logo-word {
font-size: clamp(56px, 10vw, 92px);
font-weight: 900;
letter-spacing: -0.03em;
line-height: 1;
}
.subtitle {
font-family: var(--font-mono);
color: var(--zig-yellow);
font-size: clamp(14px, 2.4vw, 19px);
letter-spacing: 0.12em;
margin-bottom: 22px;
}
.subtitle .arrow { color: var(--rust-orange); }
.story {
background: rgba(38, 34, 31, 0.85);
border: 1px solid rgba(255, 250, 240, 0.12);
border-radius: 16px;
padding: 20px 24px;
font-size: 16px;
line-height: 1.65;
color: #e7e0d4;
margin-bottom: 26px;
text-align: left;
}
.story b.zig { color: var(--zig-yellow); }
.story b.rust { color: var(--rust-orange); }
.story .mono { font-family: var(--font-mono); font-size: 14px; }
.start-btn {
display: inline-block;
font-family: var(--font-ui);
font-weight: 900;
font-size: 22px;
color: #fff;
background: linear-gradient(180deg, var(--rust-orange), var(--rust-deep));
border: none;
border-radius: 14px;
padding: 16px 44px;
cursor: pointer;
box-shadow: 0 8px 0 #7c2d08, 0 16px 32px rgba(0,0,0,.4);
transition: transform .08s ease, box-shadow .08s ease;
}
.start-btn:hover { transform: translateY(2px); box-shadow: 0 6px 0 #7c2d08, 0 12px 24px rgba(0,0,0,.4); }
.start-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #7c2d08; }
.controls-card {
margin-top: 28px;
display: flex;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
}
.key {
font-family: var(--font-mono);
font-size: 13px;
background: var(--panel);
border: 1px solid rgba(255,250,240,.18);
border-bottom-width: 3px;
border-radius: 8px;
padding: 7px 12px;
color: #d8cfc0;
}
.key b { color: #fff; }
/* little bees patrolling the title screen */
.bee-flier {
position: absolute;
width: 46px;
z-index: 1;
pointer-events: none;
animation: flyBy linear infinite;
filter: drop-shadow(0 6px 8px rgba(0,0,0,.4));
}
.bee-flier.top { top: 12%; animation-duration: 14s; }
.bee-flier.bot { bottom: 14%; animation-duration: 19s; animation-delay: -8s; transform: scaleX(-1); }
@keyframes flyBy {
0% { left: -80px; margin-top: 0; }
25% { margin-top: -22px; }
50% { margin-top: 14px; }
75% { margin-top: -12px; }
100% { left: 105vw; margin-top: 0; }
}
/* ---------- game screen ---------- */
.game-shell { position: relative; z-index: 1; width: min(960px, 100%); }
.canvas-wrap {
position: relative;
border-radius: 16px;
overflow: hidden;
border: 3px solid #000;
box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 2px rgba(255,250,240,.08);
background: #0e1a2f;
}
canvas#game { display: block; width: 100%; height: auto; }
/* HTML overlay (pause / game over / win) */
.overlay {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
background: rgba(14, 12, 10, 0.78);
backdrop-filter: blur(3px);
text-align: center;
padding: 24px;
}
.overlay.hidden { display: none; }
.overlay h2 { font-size: clamp(28px, 5vw, 46px); font-weight: 900; }
.overlay p { font-family: var(--font-mono); font-size: 14px; color: #d8cfc0; line-height: 1.7; white-space: pre-line; }
.overlay .win-h { color: var(--rust-orange); text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.overlay .lose-h { color: var(--bad); text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.overlay .bun-small { width: 90px; animation: bob 2.6s ease-in-out infinite; }
.overlay .bun-small.sad {
filter: grayscale(.9);
transform: rotate(14deg) translateY(6px);
animation: none;
}
.game-foot {
margin-top: 14px;
display: flex;
justify-content: space-between;
align-items: center;
font-family: var(--font-mono);
font-size: 12px;
color: #8a8073;
}
.game-foot a { color: var(--rust-orange); text-decoration: none; }
@media (max-width: 640px) {
.story { font-size: 14px; padding: 16px; }
.controls-card .key { font-size: 11px; padding: 6px 9px; }
}
|