SOURCE / PINNED RELEASE
Made of little things.
Mini Samurai
- Release
- a7beb798adbc…
- Author-recorded commit
- 4f97be1515b8…
- License
- LICENSE
- Author’s source reference
- nostr://npub12lm3rxsva8kfempyjkxupt09e02n3fezurkyadyqfejdc5e0r2kscqty6r/wss%3A%2F%2Fgit.napplet.soy%2F/n-3b28f0efc5b
Archive hash verified: 401ec9347ab8f8cd…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
/*
Mini Samurai: rice paper, sumi ink and vermilion lacquer.
The 3D house is warm and toy-like; the interface reads like a scroll
stamped with a hanko seal. App-owned colours, never host-themed.
*/
:root {
--paper: #f3e9d6;
--paper-2: #e6d6b8;
--paper-edge: #cdb78f;
--ink: #1c1a1f;
--ink-soft: #4d4552;
--vermilion: #c8372d;
--vermilion-dark: #8f231c;
--indigo: #2f56a8;
--gold: #e3b23c;
--hp: #f5efe2;
--serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "Noto Serif", Georgia, "Times New Roman", serif;
--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
color-scheme: light;
font: 15px/1.4 var(--sans);
}
* {
box-sizing: border-box;
}
:where(html, body, body *) {
-webkit-user-select: none;
user-select: none;
}
html,
body,
#app {
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: #2a2220;
color: var(--ink);
}
button {
font: inherit;
color: inherit;
cursor: pointer;
}
button:focus-visible,
summary:focus-visible {
outline: 3px solid var(--gold);
outline-offset: 2px;
}
[hidden] {
display: none !important;
}
.app {
position: fixed;
inset: 0;
overflow: hidden;
}
#view {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
outline: none;
touch-action: none;
}
/* ---- Shared paper card ---------------------------------------------------- */
.screen {
position: absolute;
inset: 0;
display: flex;
padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
max(16px, env(safe-area-inset-left));
}
.card {
background:
radial-gradient(circle at 15% 10%, rgb(255 255 255 / 0.5), transparent 40%),
linear-gradient(175deg, var(--paper), var(--paper-2));
border: 2px solid var(--ink);
border-radius: 4px 14px 4px 14px;
box-shadow: 6px 6px 0 rgb(28 26 31 / 0.85), 0 18px 40px rgb(0 0 0 / 0.35);
padding: 20px 22px;
}
.seal {
display: inline-grid;
place-items: center;
flex: none;
width: 54px;
height: 54px;
background: var(--vermilion);
color: var(--paper);
border-radius: 6px;
font: 700 20px/1 var(--serif);
writing-mode: vertical-rl;
letter-spacing: 2px;
transform: rotate(-4deg);
box-shadow: inset 0 0 0 3px rgb(243 233 214 / 0.35);
}
.seal.big {
width: 76px;
height: 76px;
font-size: 44px;
writing-mode: horizontal-tb;
}
h1,
h2,
h3 {
font-family: var(--serif);
margin: 0;
}
/* ---- Main menu --------------------------------------------------------------- */
.menu {
align-items: center;
justify-content: flex-start;
pointer-events: none;
}
.menu-card {
pointer-events: auto;
width: min(440px, 100%);
max-height: 100%;
overflow: auto;
display: flex;
flex-direction: column;
gap: 10px;
scrollbar-width: thin;
}
.title {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 4px;
}
.title .logo {
margin: 0;
font-family: var(--serif);
font-size: 36px;
font-weight: 800;
line-height: 1;
letter-spacing: 0.5px;
}
.tagline {
margin: 4px 0 0;
color: var(--ink-soft);
font-style: italic;
}
.opt {
display: grid;
grid-template-columns: 88px 1fr;
align-items: center;
gap: 10px;
}
.opt-label {
font: 700 13px/1.2 var(--serif);
text-transform: uppercase;
letter-spacing: 1.5px;
color: var(--ink-soft);
}
.seg {
display: flex;
gap: 6px;
}
.seg button {
flex: 1;
min-height: 40px;
padding: 6px 8px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.35);
font-weight: 600;
transition: transform 0.08s, background 0.12s, color 0.12s;
}
.seg button:hover {
background: rgb(255 255 255 / 0.65);
}
.seg button:active {
transform: translateY(1px);
}
.seg button.on {
background: var(--ink);
color: var(--paper);
}
.speed {
display: flex;
align-items: center;
gap: 10px;
}
.speed input {
flex: 1;
min-width: 0;
height: 32px;
accent-color: var(--vermilion);
cursor: pointer;
}
.speed-value {
min-width: 3.2em;
text-align: right;
font: 700 14px/1 var(--serif);
}
.pause-speed {
flex-wrap: wrap;
text-align: left;
}
.pause-speed .opt-label {
flex-basis: 100%;
}
.rooms-label {
margin-top: 4px;
}
.rooms {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.rooms .room {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
text-align: left;
min-height: 72px;
padding: 8px 10px 8px 14px;
position: relative;
overflow: hidden;
}
.rooms .room::before {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 6px;
background: var(--swatch);
}
.room-living {
--swatch: linear-gradient(#8a5a3b, #d9a63a, #2d8b8b);
}
.room-kitchen {
--swatch: linear-gradient(#f2ead4, #8fd1b5, #c8372d);
}
.room-bedroom {
--swatch: linear-gradient(#b9a3d6, #8fb3e0, #6e8f5a);
}
.room-bathroom {
--swatch: linear-gradient(#7fd3d6, #ffffff, #f2c94c);
}
.room-garage {
--swatch: linear-gradient(#b9bcb8, #f2c14e, #3f8a4a);
}
.room-house {
--swatch: linear-gradient(#8a5a3b, #8fa889, #c8323c, #b9a3d6, #7fd3d6);
grid-column: 1 / -1;
}
.room-name {
font: 700 16px/1.1 var(--serif);
}
.room-blurb {
font-size: 12px;
font-weight: 400;
line-height: 1.25;
opacity: 0.8;
}
.start {
min-height: 52px;
border: 2px solid var(--ink);
border-radius: 3px;
background: var(--vermilion);
color: var(--paper);
font: 800 22px/1 var(--serif);
letter-spacing: 3px;
box-shadow: 4px 4px 0 var(--ink);
transition: transform 0.08s, box-shadow 0.08s;
}
.start:hover {
background: #d8443a;
}
.start:active {
transform: translate(3px, 3px);
box-shadow: 1px 1px 0 var(--ink);
}
.controls summary {
cursor: pointer;
font: 700 14px/1.2 var(--serif);
padding: 6px 0;
}
.controls-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
}
.controls h3 {
font-size: 14px;
border-bottom: 2px solid var(--ink);
margin-bottom: 4px;
}
.controls dl {
display: grid;
grid-template-columns: auto 1fr;
gap: 2px 8px;
margin: 0;
font-size: 12px;
}
.controls dt {
color: var(--ink-soft);
}
.controls dd {
margin: 0;
font-weight: 600;
}
.hint {
font-size: 12px;
color: var(--ink-soft);
margin: 8px 0 0;
}
/* ---- Pause and results ------------------------------------------------------------ */
.overlay {
z-index: 5;
align-items: center;
justify-content: center;
background: rgb(20 14 12 / 0.45);
}
.small-card {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 10px;
width: min(320px, 100%);
text-align: center;
}
.small-card .seal {
align-self: center;
}
.small-card h2 {
font-size: 28px;
margin: 4px 0 6px;
}
.small-card button:not(.start) {
min-height: 44px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.4);
font-weight: 600;
}
/* ---- Too small notice --------------------------------------------------------------- */
.too-small {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
padding: 12px;
background: var(--paper);
text-align: center;
font: 600 14px/1.3 var(--serif);
z-index: 20;
}
.too-small p {
margin: 0;
max-width: 220px;
}
/* ---- HUD ---------------------------------------------------------------------------- */
.hud {
position: absolute;
inset: 0;
pointer-events: none;
font-family: var(--sans);
}
.hud-top {
position: absolute;
top: max(10px, env(safe-area-inset-top));
left: 12px;
right: 12px;
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: start;
gap: 12px;
}
.hud-team {
display: flex;
flex-direction: column;
gap: 6px;
}
.hud-team[data-team="1"] {
align-items: flex-end;
}
.hud-row {
width: min(320px, 100%);
}
.hud-name {
display: flex;
align-items: baseline;
gap: 8px;
color: #fff;
text-shadow: 0 1px 0 #000, 0 0 6px rgb(0 0 0 / 0.6);
font-size: 13px;
}
.hud-team[data-team="1"] .hud-name {
flex-direction: row-reverse;
}
.hud-name b {
background: var(--team);
padding: 0 7px;
border: 2px solid var(--ink);
border-radius: 2px;
font: 800 13px/1.35 var(--serif);
text-shadow: none;
}
.hud-weapon {
font-size: 12px;
opacity: 0.95;
}
.hud-bar {
position: relative;
height: 16px;
margin-top: 3px;
background: rgb(28 26 31 / 0.85);
border: 2px solid var(--ink);
transform: skewX(-18deg);
overflow: hidden;
box-shadow: 3px 3px 0 rgb(0 0 0 / 0.35);
}
.hud-team[data-team="1"] .hud-bar {
transform: skewX(18deg) scaleX(-1);
}
.hud-hp,
.hud-lag {
position: absolute;
inset: 0 auto 0 0;
transition: width 0.08s linear;
}
.hud-lag {
background: #ffcf7a;
}
.hud-hp {
background: linear-gradient(180deg, var(--hp), var(--armor) 160%);
border-right: 2px solid var(--ink);
}
.hud-row.low .hud-hp {
background: linear-gradient(180deg, #ff9b84, var(--vermilion));
}
.hud-row.hurt .hud-bar {
animation: hud-shake 0.2s linear;
}
.hud-row.out {
opacity: 0.45;
}
@keyframes hud-shake {
25% {
translate: -3px 0;
}
75% {
translate: 3px 0;
}
}
.hud.explore .hud-mid {
visibility: hidden;
}
.hud-mid {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.hud-wave {
min-width: 56px;
padding: 2px 8px;
background: var(--paper);
border: 2px solid var(--ink);
border-radius: 3px;
box-shadow: 3px 3px 0 rgb(0 0 0 / 0.4);
text-align: center;
font: 800 24px/1.1 var(--serif);
}
.hud-pips {
display: flex;
gap: 8px;
padding: 3px 10px;
background: rgb(28 26 31 / 0.7);
border: 2px solid var(--ink);
border-radius: 3px;
font-size: 16px;
letter-spacing: 2px;
text-shadow: 0 1px 0 #000;
}
.hud-pips span {
color: var(--team);
}
.hud-layer {
position: absolute;
inset: 0;
overflow: hidden;
}
.hud-tag {
position: absolute;
left: 0;
top: 0;
margin: -22px 0 0 -14px;
width: 28px;
text-align: center;
font: 800 11px/1 var(--serif);
color: #fff;
text-shadow: 0 1px 0 #000;
}
.hud-tag::after {
content: "";
display: block;
width: 0;
height: 0;
margin: 2px auto 0;
border: 6px solid transparent;
border-top-color: var(--team);
filter: drop-shadow(0 1px 0 #000);
}
.hud-tag:not(.human)::after {
border-width: 4px;
opacity: 0.8;
}
.hud-popup {
position: absolute;
left: 0;
top: 0;
white-space: nowrap;
font: 800 18px/1 var(--serif);
-webkit-text-stroke: 4px var(--ink);
paint-order: stroke fill;
}
.hud-banner {
position: absolute;
left: 0;
right: 0;
top: 38%;
text-align: center;
}
.hud-banner-text {
display: inline-block;
padding: 6px 28px 10px;
background: var(--ink);
color: var(--paper);
font: 900 clamp(34px, 8vw, 72px) / 1 var(--serif);
letter-spacing: 4px;
border-top: 4px solid var(--vermilion);
border-bottom: 4px solid var(--vermilion);
transform: skewX(-8deg);
box-shadow: 0 10px 30px rgb(0 0 0 / 0.4);
}
.hud-banner-sub {
margin-top: 10px;
color: #fff;
font: 700 clamp(16px, 3vw, 24px) / 1.2 var(--serif);
text-shadow: 0 2px 0 #000, 0 0 10px rgb(0 0 0 / 0.7);
}
.hud-banner.stamp > * {
animation: stamp 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.hud-banner.stamp .hud-banner-sub {
animation-delay: 0.15s;
}
.hud-banner.fade {
opacity: 0;
transition: opacity 0.4s;
}
@keyframes stamp {
from {
opacity: 0;
transform: scale(1.8) skewX(-8deg);
}
to {
opacity: 1;
}
}
/* ---- Touch controls ------------------------------------------------------------------ */
.touch {
position: absolute;
inset: 0;
pointer-events: none;
}
.touch-stick {
position: absolute;
left: 0;
bottom: 0;
width: 50%;
height: 65%;
pointer-events: auto;
touch-action: none;
}
.touch-base {
position: absolute;
left: 90px;
top: calc(100% - 110px);
width: 104px;
height: 104px;
margin: -52px 0 0 -52px;
border-radius: 50%;
border: 3px solid rgb(243 233 214 / 0.7);
background: rgb(28 26 31 / 0.25);
opacity: 0.6;
}
.touch-base.on {
opacity: 1;
}
.touch-knob {
position: absolute;
left: 50%;
top: 50%;
width: 48px;
height: 48px;
margin: -24px 0 0 -24px;
border-radius: 50%;
background: var(--paper);
border: 3px solid var(--ink);
}
.touch-buttons {
position: absolute;
right: max(12px, env(safe-area-inset-right));
bottom: max(12px, env(safe-area-inset-bottom));
display: grid;
grid-template-columns: repeat(3, 56px);
gap: 10px;
pointer-events: auto;
touch-action: none;
}
.touch-buttons button {
width: 56px;
height: 56px;
border-radius: 50%;
border: 3px solid var(--ink);
background: rgb(243 233 214 / 0.85);
font: 800 22px/1 var(--serif);
touch-action: none;
}
.touch-buttons button small {
display: block;
margin-top: 1px;
font: 700 9px/1 var(--sans);
letter-spacing: 0.3px;
}
.touch-buttons button.big {
background: var(--vermilion);
color: var(--paper);
}
.touch-buttons button.down {
transform: scale(0.92);
background: var(--ink);
color: var(--paper);
}
/* ---- Small frames -------------------------------------------------------------------- */
.compact .menu {
padding: 8px;
}
.compact .menu-card {
width: min(400px, 100%);
padding: 12px 14px;
gap: 7px;
}
.compact .title .logo {
font-size: 26px;
}
.compact .seal:not(.big) {
width: 42px;
height: 42px;
font-size: 16px;
}
.compact .opt {
grid-template-columns: 72px 1fr;
}
.compact .seg button {
min-height: 36px;
font-size: 13px;
}
.compact .room-blurb {
display: none;
}
.compact .rooms .room {
min-height: 40px;
}
.compact .hud-row {
width: min(200px, 100%);
}
.compact .hud-weapon {
display: none;
}
.compact .hud-wave {
font-size: 18px;
min-width: 40px;
}
@media (max-width: 520px) {
.menu {
justify-content: center;
}
.controls-grid {
grid-template-columns: 1fr;
}
}
@media (pointer: coarse) {
.seg button {
min-height: 44px;
}
}
@media (prefers-reduced-motion: reduce) {
.hud-banner.stamp > *,
.hud-row.hurt .hud-bar {
animation: none;
}
}
.hud-tally {
color: #fff;
font: 700 13px/1.2 var(--serif);
letter-spacing: 0.5px;
}
.compact .seg[data-key="mode"] button {
padding: 6px 2px;
font-size: 12px;
}
.fullscreen-btn {
min-height: 40px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.4);
font-weight: 600;
}
.fullscreen-btn:hover {
background: rgb(255 255 255 / 0.7);
}
.fullscreen-btn::before {
content: "⛶ ";
}
.title-fs {
margin-left: auto;
align-self: flex-start;
flex: none;
width: 38px;
height: 38px;
min-height: 0;
padding: 0;
font-size: 20px;
line-height: 1;
}
.title-fs::before {
content: "⛶";
}
.title-fs.on {
background: var(--ink);
color: var(--paper);
}
/* Split-screen divider: an ink stroke with a vermilion core. */
.hud-split {
position: absolute;
left: 0;
right: 0;
height: 6px;
margin-top: -3px;
background: var(--ink);
border-top: 2px solid var(--ink);
border-bottom: 2px solid var(--ink);
box-shadow: inset 0 0 0 1px var(--vermilion);
}
.hud-split.wide {
top: 0;
bottom: 0;
right: auto;
width: 6px;
height: auto;
margin: 0 0 0 -3px;
border: 0;
border-left: 2px solid var(--ink);
border-right: 2px solid var(--ink);
}
/* ---- Controls screen ------------------------------------------------------------ */
.controls-btn {
min-height: 40px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.4);
font: 700 15px/1 var(--serif);
}
.controls-btn:hover {
background: rgb(255 255 255 / 0.7);
}
.controls-screen {
z-index: 8;
}
.controls-card {
display: flex;
flex-direction: column;
gap: 10px;
width: min(620px, 100%);
max-height: 100%;
padding: 16px 18px;
}
.controls-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.controls-head h2 {
font-size: 26px;
}
.ctl-done {
min-height: 40px;
padding: 0 22px;
font-size: 18px;
}
.ctl-tabs {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 6px;
}
.ctl-tabs button {
min-height: 38px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.35);
font-weight: 700;
font-size: 13px;
}
.ctl-tabs button.on {
background: var(--ink);
color: var(--paper);
}
.ctl-body {
overflow: auto;
min-height: 0;
display: flex;
flex-direction: column;
gap: 4px;
padding-right: 4px;
scrollbar-width: thin;
}
.ctl-row {
display: grid;
grid-template-columns: 1fr minmax(150px, 46%);
align-items: center;
gap: 10px;
padding: 3px 0;
border-bottom: 1px dashed rgb(28 26 31 / 0.2);
}
.ctl-label {
display: flex;
flex-direction: column;
font-size: 14px;
}
.ctl-label small {
color: var(--ink-soft);
font-size: 12px;
}
.ctl-bind {
min-height: 36px;
padding: 4px 10px;
border: 2px solid var(--ink);
border-radius: 3px;
background: var(--paper);
font-weight: 700;
box-shadow: 2px 2px 0 var(--ink);
}
.ctl-bind:hover {
background: #fff;
}
.ctl-row.waiting .ctl-bind {
background: var(--vermilion);
color: var(--paper);
animation: ctl-blink 0.8s ease-in-out infinite alternate;
}
@keyframes ctl-blink {
to {
opacity: 0.65;
}
}
.ctl-note {
margin: 8px 0 2px;
font-size: 12px;
color: var(--ink-soft);
}
.ctl-foot {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.ctl-status {
font-size: 13px;
font-weight: 600;
}
.ctl-foot button {
min-height: 36px;
padding: 0 12px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.4);
font-weight: 600;
white-space: nowrap;
}
.compact .ctl-tabs {
grid-template-columns: repeat(2, 1fr);
}
.compact .ctl-row {
grid-template-columns: 1fr minmax(120px, 50%);
}
/* Controller connected / disconnected notice. */
.toast {
position: absolute;
left: 50%;
bottom: max(18px, env(safe-area-inset-bottom));
transform: translateX(-50%);
z-index: 30;
padding: 8px 16px;
background: var(--ink);
color: var(--paper);
border: 2px solid var(--vermilion);
border-radius: 3px;
font: 700 14px/1.2 var(--serif);
pointer-events: none;
}
.seg button:disabled {
opacity: 0.35;
cursor: not-allowed;
}
/* Who has joined: P1 on the keyboard, P2-P4 as controllers press a button. */
.players-row {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 6px;
}
.pchip {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 40px;
padding: 3px 4px;
border: 2px dashed rgb(28 26 31 / 0.35);
border-radius: 3px;
color: var(--ink-soft);
font-size: 10px;
line-height: 1.15;
text-align: center;
}
.pchip b {
font: 800 14px/1.1 var(--serif);
}
.pchip.on {
border: 2px solid var(--ink);
background: var(--pc);
color: #fff;
text-shadow: 0 1px 0 rgb(0 0 0 / 0.5);
}
.ctl-tabs {
grid-template-columns: repeat(3, 1fr);
}
.compact .ctl-tabs {
grid-template-columns: repeat(3, 1fr);
}
.ctl-empty {
justify-self: center;
color: var(--ink-soft);
}
.ctl-row.joined .ctl-label b::after {
content: " ●";
color: #3a9a4a;
}
/* ---- Split-screen health: each player's own bar in their own view ---------------- */
.hud.split .hud-team {
display: none;
}
.hud-views {
position: absolute;
inset: 0;
}
.hud-view {
position: absolute;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 10px;
padding: 10px 14px;
}
.hud-view .hud-own {
width: min(280px, 50%);
}
/* The nearest foe: smaller, mirrored on the right of the player's view. */
.hud-view .hud-foe {
width: min(190px, 36%);
opacity: 0.92;
}
.hud-foe .hud-name {
flex-direction: row-reverse;
font-size: 11px;
}
.hud-foe .hud-name b {
font-size: 11px;
}
.hud-foe .hud-bar {
height: 10px;
transform: skewX(18deg) scaleX(-1);
}
.hud-view.narrow .hud-weapon {
display: none;
}
.hud-view.narrow .hud-own .hud-bar {
height: 13px;
}
/* With each player's bars in their own corners, round pips and the wave count move to the
bottom centre, on the split line, where they don't cover anyone's health. */
.hud.split .hud-top {
top: auto;
bottom: max(8px, env(safe-area-inset-bottom));
display: flex;
justify-content: center;
/* Above the split lines it sits on. */
z-index: 2;
}
.hud.split .hud-mid {
flex-direction: column-reverse;
}
.hud.split .hud-pips {
background: var(--ink);
}
/* Live controller check on the Controls screen. */
.ctl-diag {
margin-top: 10px;
padding: 8px 10px;
border: 2px solid var(--ink);
border-radius: 3px;
background: rgb(255 255 255 / 0.55);
font-size: 12px;
line-height: 1.35;
}
.ctl-diag > b {
display: block;
margin-bottom: 4px;
font: 700 13px/1.2 var(--serif);
}
.ctl-diag-body > div + div {
margin-top: 6px;
}
.ctl-diag .good {
color: #2e7d32;
font-weight: 700;
}
.ctl-diag .bad {
color: var(--vermilion-dark);
font-weight: 700;
}
