Battle result dialog, speed toggle, and topbar refactor for mobile.

- End-of-battle result is now a centered dialog (Victory/Defeat/Draw) with
  'Next round' and 'Not yet'; 'Not yet' dismisses it to rewatch the battle,
  and a toolbar button remains to advance. A modal is always fully on screen,
  fixing the next-round button being unreachable below the arena on phones.
- Also make the play area genuinely scrollable on phones (stretch the body
  so table-main's overflow can engage) as a safety net.
- Collapse the 5-button playback speed picker into one button that cycles
  through the options, keeping the battle controls on a single row.
- Topbar: show the round as a die face (1-6 pips) on all screens, move the
  room code and Leave into a '...' dropdown menu, and drop the wordmark on
  phones so the rail stays one row (die + players + menu).
- On phones, strip battle cards to art + power/damage + name (no suit, tier,
  or ability text); the magnified view still shows the full card.
This commit is contained in:
Greyson Parrelli
2026-07-26 15:15:18 -04:00
parent de9bb480c2
commit 33bef8f58a
4 changed files with 217 additions and 64 deletions
+105 -27
View File
@@ -422,14 +422,17 @@ h3 {
letter-spacing: 0.04em;
}
/* The round shows as a die face — 16 pips, like the real game's round marker. */
.topbar-round {
font-size: 0.95rem;
font-weight: 700;
color: rgba(255, 245, 225, 0.9);
display: flex;
align-items: center;
}
.topbar-round strong {
color: var(--gold);
.topbar-die {
width: 26px;
height: 26px;
display: block;
filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.topbar-players {
@@ -514,7 +517,7 @@ h3 {
line-height: 1;
}
/* The room code, stamped like a label on a card tray. */
/* The room code, stamped like a label on a card tray. Lives inside the ⋯ menu. */
.topbar-code {
font-family: var(--font-display);
letter-spacing: 0.28em;
@@ -525,6 +528,54 @@ h3 {
border-radius: 8px;
}
/* The ⋯ menu holds the room code and Leave, pushed to the right of the rail so
the middle is just the players and their stats. */
.topbar-menu {
position: relative;
margin-left: auto;
}
.topbar-menu-btn {
font-size: 1.15rem;
line-height: 1;
padding: 5px 12px;
}
/* A full-viewport catcher so a click anywhere off the menu closes it. */
.topbar-menu-backdrop {
position: fixed;
inset: 0;
z-index: 20;
}
.topbar-menu-pop {
position: absolute;
right: 0;
top: calc(100% + 8px);
z-index: 21;
min-width: 190px;
display: flex;
flex-direction: column;
gap: 12px;
padding: 14px;
background:
repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.05) 0 3px, transparent 3px 7px),
linear-gradient(180deg, var(--wood-light), var(--wood) 70%, var(--wood-dark));
border: 2px solid var(--wood-dark);
border-radius: 12px;
box-shadow:
inset 0 1px 0 rgba(255, 220, 170, 0.25),
0 14px 30px rgba(0, 0, 0, 0.55);
}
.topbar-menu-code {
display: flex;
flex-direction: column;
gap: 5px;
align-items: flex-start;
font-size: 0.78rem;
}
.table-body {
flex: 1;
display: flex;
@@ -2666,14 +2717,11 @@ h3 {
z-index: 5;
}
.battle-result {
text-align: center;
display: flex;
flex-direction: column;
gap: 12px;
align-items: center;
padding: 8px 0;
animation: result-in 400ms ease;
/* The end-of-battle result dialog: a centered modal so it's always fully on
screen (even on a phone where the arena fills the viewport). */
.battle-result-modal {
gap: 14px;
min-width: min(320px, 86vw);
}
@keyframes result-in {
@@ -2693,15 +2741,15 @@ h3 {
text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.battle-result.is-win .battle-result-title {
.battle-result-modal.is-win .battle-result-title {
color: var(--gold);
}
.battle-result.is-loss .battle-result-title {
.battle-result-modal.is-loss .battle-result-title {
color: #ff8f7a;
}
.battle-result.is-draw .battle-result-title {
.battle-result-modal.is-draw .battle-result-title {
color: #6fd6c2;
}
@@ -2710,6 +2758,11 @@ h3 {
font-weight: 700;
}
/* The toolbar's "advance the round" button stands out from the ghost controls. */
.battle-next {
margin-left: 2px;
}
/* ---------- game over ---------- */
.gameover {
@@ -2856,19 +2909,23 @@ h3 {
gap: 5px 8px;
padding: 5px 9px;
}
/* Drop the wordmark entirely on a phone — the die, the player tags, and the
⋯ menu are all that's needed, and losing it helps the rail stay one row. */
.topbar-brand {
font-size: 1.05rem;
}
/* The wordmark is redundant next to the paw on a phone — drop it to buy width
so the rail packs onto fewer rows. */
.topbar-brand span {
display: none;
}
/* Let the tags pack tight instead of stretching across a whole row. */
.topbar-die {
width: 23px;
height: 23px;
}
/* Let the tags pack tight; the ⋯ menu is pushed to the right by margin-auto. */
.topbar-players {
flex: 0 1 auto;
gap: 6px;
}
.topbar-menu-btn {
padding: 4px 10px;
}
.topbar-round {
font-size: 0.82rem;
}
@@ -3065,6 +3122,30 @@ h3 {
min-width: 72px;
min-height: 112px;
}
/* A battle card is small and glanced at, not read — so on a phone strip it to
the essentials: big art, the power badge and any damage marker, and the
name. No suit dot, tier die, or ability text (the magnified view still shows
the full card). The scene grows to fill the space the panel gives up. */
.battle-unit .card-scene {
flex: 1 1 auto;
}
.battle-unit .card-panel {
flex: 0 0 auto;
}
.battle-unit .card-effect,
.battle-unit .card-suit,
.battle-unit .card-die,
.battle-unit .card-panel-slot {
display: none;
}
.battle-unit .card-panel-head {
grid-template-columns: 1fr;
border-bottom: none;
padding-bottom: 0;
}
.battle-unit .card-art {
font-size: 2.1rem;
}
.card-back {
width: 56px;
height: 78px;
@@ -3078,13 +3159,10 @@ h3 {
.food-fan-card:not(:first-child) {
margin-left: -50px;
}
.battle-result {
gap: 8px;
}
.battle-result-title {
font-size: 1.7rem;
}
.battle-result .btn-big {
.battle-result-modal .btn-big {
font-size: 1.05rem;
padding: 11px 22px;
}