:root { --carrot: #ff9a3c; --berry: #8c7bff; --ink: #3b2f4a; --cream: #fff8ef; --pink: #ff7fb0;
  /* Deeper shades of the same colours for anything with white text on it (4.5:1 or better). */
  --carrot-fill: #b85c08; --berry-fill: #6452d9; --pink-fill: #cc3a78; }
/* One variable font file, served by us: the page makes no third-party request. */
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
* { box-sizing: border-box; }
/* 500 is the weight plain text has always had here: the old font link only carried 500 and 700. */
html, body { margin: 0; height: 100%; overflow: hidden; background: #bfe6ff; font-family: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif; font-weight: 500; color: var(--ink); user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

/* The panel centres itself with auto margins: unlike align-items, they never push its top out of reach on a short screen. */
#menu { position: fixed; inset: 0; display: flex; justify-content: flex-end; padding: 3vh 4vw; overflow: auto; }
#panel { width: min(560px, 100%); margin: auto 0; background: rgba(255, 248, 239, .93); border: 4px solid #fff; border-radius: 28px; padding: 22px 26px; box-shadow: 0 12px 0 rgba(59, 47, 74, .18); }
#panel h1 { margin: 0; font-size: 54px; line-height: 1; letter-spacing: -1px; color: var(--carrot); text-shadow: 0 4px 0 #fff, 0 7px 0 rgba(59, 47, 74, .15); }
#panel h1 span { color: var(--pink); }
.tag { margin: 6px 0 14px; font-size: 16px; opacity: .8; }
#touch { margin: 0 0 14px; padding: 10px 14px; font-size: 15px; background: #fff0f6; border: 3px solid var(--pink); border-radius: 16px; }
#panel h2 { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; opacity: .6; }
label { font-size: 15px; display: flex; gap: 10px; align-items: center; }
#name { flex: 1; font: inherit; font-size: 18px; padding: 8px 14px; border-radius: 14px; border: 3px solid #f0dcc8; background: #fff; color: var(--ink); outline: none; }
#name:focus { border-color: var(--pink); }
#heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero { text-align: left; font: inherit; color: var(--ink); background: #fff; border: 3px solid #f0dcc8; border-radius: 16px; padding: 8px 10px; cursor: pointer; }
.hero b { display: block; font-size: 17px; }
.hero i { display: block; font-style: normal; font-size: 12px; color: var(--pink); font-weight: 700; }
.hero small { display: block; font-size: 11.5px; line-height: 1.25; opacity: .75; margin-top: 3px; }
.hero.on, .hat.on { border-color: var(--pink); background: #fff0f6; box-shadow: 0 4px 0 rgba(255, 127, 176, .35); }
#hats { display: flex; flex-wrap: wrap; gap: 6px; }
.hat { font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 3px solid #f0dcc8; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
#start-btn { margin-top: 16px; width: 100%; font: inherit; font-size: 26px; font-weight: 700; color: #fff; background: var(--pink-fill); border: 0; border-radius: 18px; padding: 12px; cursor: pointer; box-shadow: 0 6px 0 #d95c8d; }
#start-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d95c8d; }
#start-btn:disabled { background: #cfc4cd; box-shadow: 0 6px 0 #ab9faa; transform: none; cursor: default; }
#status { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: #c0392b; }
.keys { font-size: 12px; opacity: .7; margin: 6px 0 0; line-height: 1.5; }
@media (max-width: 520px) {
  #panel { padding: 16px; }
  #panel h1 { font-size: 46px; }
  #heroes { grid-template-columns: repeat(2, 1fr); }
}

#hud { position: fixed; inset: 0; pointer-events: none; font-weight: 700; }
#top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 6px; }
.team { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-radius: 16px; color: #fff; font-size: 15px; border: 3px solid #fff; }
.team b { font-size: 28px; }
.t0 { background: var(--carrot-fill); } .t1 { background: var(--berry-fill); }
#clock { background: var(--cream); border: 3px solid #fff; border-radius: 16px; padding: 4px 14px; text-align: center; min-width: 120px; }
#clock b { display: block; font-size: 22px; line-height: 1.1; }
#clock span { font-size: 11px; opacity: .7; }
#feed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
#feed div { background: rgba(255, 248, 239, .9); border-radius: 12px; padding: 3px 10px; animation: pop .25s; }
#feed .c0 { color: #e07810; } #feed .c1 { color: #6a58e0; }
#banner { position: absolute; top: 20%; left: 0; right: 0; text-align: center; font-size: 44px; color: #fff; text-shadow: 0 4px 0 var(--pink), 0 8px 0 rgba(59, 47, 74, .25); opacity: 0; transition: opacity .3s; }
#banner.on { opacity: 1; animation: pop .35s; }
#banner small { display: block; font-size: 18px; text-shadow: 0 2px 0 rgba(59, 47, 74, .4); }
@keyframes pop { from { transform: scale(.6); } 60% { transform: scale(1.12); } to { transform: scale(1); } }
#cross { position: absolute; left: 50%; top: 50%; }
#cross i { position: absolute; background: #fff; border-radius: 3px; box-shadow: 0 0 0 2px rgba(59, 47, 74, .45); }
#cross i:nth-child(1) { width: 4px; height: 10px; left: -2px; top: -18px; } #cross i:nth-child(2) { width: 4px; height: 10px; left: -2px; top: 8px; }
#cross i:nth-child(3) { width: 10px; height: 4px; left: -18px; top: -2px; } #cross i:nth-child(4) { width: 10px; height: 4px; left: 8px; top: -2px; }
#hitmark { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border: 4px solid var(--pink); border-radius: 50%; opacity: 0; }
#hitmark.on { animation: hit .25s; }
@keyframes hit { from { opacity: 1; transform: scale(.5); } to { opacity: 0; transform: scale(1.5); } }
#vitals { position: absolute; left: 16px; bottom: 16px; width: 280px; }
#heroname { font-size: 16px; color: #fff; text-shadow: 0 2px 0 rgba(59, 47, 74, .5); margin-bottom: 4px; }
#hpbar { position: relative; height: 26px; background: rgba(59, 47, 74, .45); border: 3px solid #fff; border-radius: 14px; overflow: hidden; }
#hpfill { position: absolute; inset: 0 auto 0 0; background: var(--pink); border-radius: 10px; transition: width .15s; }
#shieldfill { position: absolute; inset: 0 auto 0 0; background: #ffd640; opacity: .85; transition: width .15s; }
#hptext { position: absolute; inset: 0; text-align: center; line-height: 20px; color: #fff; font-size: 14px; }
#buffs { display: flex; gap: 6px; margin-top: 6px; font-size: 12px; min-height: 22px; }
#buffs span { background: var(--cream); border-radius: 10px; padding: 2px 8px; }
#ability { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); min-width: 190px; height: 38px; background: rgba(59, 47, 74, .5); border: 3px solid #fff; border-radius: 16px; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #fff; font-size: 15px; }
#abfill { position: absolute; inset: 0 auto 0 0; background: #57c98a; }
#ability.ready #abfill { background: #ffb02e; }
#ability kbd, #ability span { position: relative; }
#ability kbd { font: inherit; background: #fff; color: var(--ink); border-radius: 8px; padding: 0 7px; }
#hurt { position: absolute; inset: 0; box-shadow: inset 0 0 120px 40px rgba(255, 60, 110, .8); opacity: 0; transition: opacity .4s; }
#dead, #over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(59, 47, 74, .35); color: #fff; text-align: center; }
#dead h2 { font-size: 40px; margin: 0; text-shadow: 0 4px 0 var(--pink); }
#dead p { font-size: 18px; margin: 8px 0 14px; }
#swap { display: flex; gap: 6px; }
#swap span { background: var(--cream); color: var(--ink); border-radius: 12px; padding: 4px 10px; font-size: 13px; }
#swap span.on { background: var(--pink-fill); color: #fff; }
#over h2 { font-size: 64px; margin: 0; text-shadow: 0 5px 0 var(--pink), 0 10px 0 rgba(59, 47, 74, .3); }
#over p { font-size: 20px; }
#board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 12px; background: rgba(255, 248, 239, .95); border: 4px solid #fff; border-radius: 22px; padding: 14px; font-size: 13px; }
#board table { border-collapse: collapse; min-width: 240px; }
#board th { text-align: left; color: #fff; padding: 4px 8px; }
#board .h0 th { background: var(--carrot-fill); } #board .h1 th { background: var(--berry-fill); }
#board td { padding: 2px 8px; font-weight: 500; }
#board tr.me td { font-weight: 700; background: #fff0f6; }
#tags div { position: absolute; left: 0; top: 0; transform-origin: 0 0; white-space: nowrap; font-size: 12px; color: #fff; padding: 1px 8px; border-radius: 10px; text-align: center; will-change: transform; }
#tags .c0 { background: rgba(184, 92, 8, .92); } #tags .c1 { background: rgba(100, 82, 217, .92); }
#tags u { display: block; height: 4px; background: rgba(59, 47, 74, .5); border-radius: 2px; margin: 1px 0 2px; overflow: hidden; }
#tags u s { display: block; height: 100%; background: #7dff9c; }
#subtitle { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); color: #fff; font-size: 17px; text-shadow: 0 2px 0 rgba(59, 47, 74, .7); opacity: 0; transition: opacity .3s; white-space: nowrap; }
#subtitle.on { opacity: 1; }
#ult { position: absolute; left: calc(50% + 115px); bottom: 18px; width: 150px; height: 38px; background: rgba(59, 47, 74, .5); border: 3px solid #fff; border-radius: 16px; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #fff; font-size: 15px; }
#ultfill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff5d8f, #ffb02e, #ffe14d, #57c98a, #5aa9ff, #a57bff); background-size: 150px 100%; }
#ult kbd, #ult span { position: relative; }
#ult kbd { font: inherit; background: #fff; color: var(--ink); border-radius: 8px; padding: 0 7px; }
#ult.ready { animation: ultpulse .5s infinite alternate; }
#ult.active { border-color: #ffe14d; }
@keyframes ultpulse { from { transform: scale(1); } to { transform: scale(1.09); box-shadow: 0 0 18px #ffe14d; } }
#ability { transform: translateX(calc(-50% - 85px)); }
#online { display: inline-block; margin: -6px 0 12px; padding: 3px 12px; border-radius: 999px; background: #e9f8ee; color: #1f7a45; font-size: 13px; font-weight: 700; }
#tags i { font-style: normal; font-size: 9px; opacity: .85; margin-left: 5px; text-transform: uppercase; letter-spacing: .6px; }
.mode { margin-top: 12px; font-size: 13px; gap: 8px; cursor: pointer; } .mode input { flex: none; width: 18px; height: 18px; padding: 0; accent-color: var(--ink); } .mode b { margin-right: 4px; }
/* The pause panel is the one part of the HUD that takes the mouse. It covers the whole screen, so no click reaches the game behind it. */
#pause { position: absolute; inset: 0; display: flex; padding: 16px; overflow: auto; background: rgba(59, 47, 74, .45); pointer-events: auto; font-weight: 500; }
#pause-card { width: min(380px, 100%); margin: auto; display: flex; flex-direction: column; gap: 14px; background: rgba(255, 248, 239, .96); border: 4px solid #fff; border-radius: 24px; padding: 20px 24px; box-shadow: 0 10px 0 rgba(59, 47, 74, .25); animation: pop .25s; }
#pause-card h2 { margin: 0; font-size: 34px; line-height: 1; color: var(--pink); }
#pause-card p { margin: -8px 0 0; font-size: 14px; opacity: .7; }
#pause-card button { font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); background: #fff; border: 3px solid #f0dcc8; border-radius: 14px; padding: 8px; cursor: pointer; }
#pause-card #resume-btn { font-size: 22px; color: #fff; background: var(--pink-fill); border: 0; padding: 10px; box-shadow: 0 5px 0 #d95c8d; }
#pause-card input { accent-color: var(--pink); margin: 0; }
#pause-card input[type=range] { flex: 1; min-width: 0; }
#pause-card input[type=checkbox] { width: 20px; height: 20px; }
#pause-card output { min-width: 42px; text-align: right; font-weight: 700; }
#broke { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); width: max-content; max-width: 90vw; text-align: center; font-size: 22px; font-weight: 700; color: #fff; background: #c0392b; border: 4px solid #fff; border-radius: 18px; padding: 14px 26px; box-shadow: 0 8px 0 rgba(59, 47, 74, .25); pointer-events: none; }

/* People who ask their system for less motion get a still interface; the game also drops its camera shake and flashes. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Quick chat: the list of things a bunny can say, shown while Z is the last key pressed. */
#chat { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; background: rgba(59, 47, 74, .6); border: 3px solid #fff; border-radius: 16px; padding: 10px 14px; color: #fff; font-size: 15px; }
#chat b { display: inline-block; min-width: 20px; background: #fff; color: var(--ink); border-radius: 6px; text-align: center; margin-right: 8px; }
#feed .said { font-weight: 500; }
#pause-card #invite-link { font: inherit; font-size: 13px; padding: 6px 8px; border: 3px solid #f0dcc8; border-radius: 10px; }

/* Touch controls. The pad covers the screen so that it, and not the page, gets the thumbs; only its children look
   like anything. Sizes are in viewport units so they suit a phone held sideways and a tablet alike. */
#pad { position: absolute; inset: 0; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
#stick { position: absolute; left: 6vmin; bottom: 8vmin; width: 30vmin; height: 30vmin; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 3px solid rgba(255, 255, 255, .5); opacity: .45; pointer-events: none; }
#stick.on { opacity: 1; } /* under the thumb: the stick comes to wherever the left thumb lands */
#stick i { position: absolute; left: 50%; top: 50%; width: 12vmin; height: 12vmin; margin: -6vmin; border-radius: 50%; background: rgba(255, 255, 255, .7); }
#pad button { position: absolute; font: inherit; font-size: 3.2vmin; font-weight: 700; color: #fff; background: rgba(59, 47, 74, .55); border: 3px solid rgba(255, 255, 255, .7); border-radius: 50%; width: 15vmin; height: 15vmin; padding: 0; touch-action: none; }
#pad button.on { background: var(--pink-fill); }
#tb-fire { right: 6vmin; bottom: 10vmin; width: 22vmin !important; height: 22vmin !important; }
#tb-jump { right: 31vmin; bottom: 6vmin; }
#tb-ab { right: 31vmin; bottom: 24vmin; }
#tb-bonk { right: 9vmin; bottom: 35vmin; }
#tb-ult { right: 27vmin; bottom: 42vmin; }
#tb-decoy { right: 29vmin; bottom: 60vmin; width: 13vmin !important; height: 13vmin !important; font-size: 2.4vmin !important; } /* placed from the bottom like the rest and clear of the menu button's corner, so a short screen (a phone browser's bars) cannot push it onto either */
#tb-menu { right: 3vmin; top: 3vmin; width: 10vmin !important; height: 10vmin !important; }
@media (orientation: portrait) { #pad::before { content: 'Turn your phone sideways'; position: absolute; left: 0; right: 0; top: 30%; text-align: center; color: #fff; font-size: 6vmin; font-weight: 700; text-shadow: 0 2px 0 rgba(59, 47, 74, .7); } }
/* On a touch screen the HUD moves out from under the thumbs: health to the top left, the news feed below it, the two
   charge bars side by side between the stick and the buttons, and no keyboard hints. */
#hud.touch #vitals { left: 12px; top: 10px; bottom: auto; width: min(24vw, calc(50vw - 195px)); }
#hud.touch #heroname { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hud.touch #feed { left: 12px; right: auto; top: 92px; align-items: flex-start; max-height: 24vh; overflow: hidden; }
#hud.touch #ability { left: calc(50% - 5vmin); transform: translateX(calc(-100% - 4px)); min-width: 0; width: 150px; bottom: 10px; }
#hud.touch #ult { left: calc(50% - 5vmin + 4px); bottom: 10px; }
#hud.touch kbd { display: none; }
#hud.touch #swap { pointer-events: auto; flex-wrap: wrap; justify-content: center; }
#hud.touch #swap span { padding: 10px 14px; font-size: 15px; }
#cross.lock i { background: var(--pink); } /* touch: an enemy is in the sights and the game is shooting */
/* Touch screens: a long press must not select the game's text or open the copy menu, and the keyboard help is no use. */
html.touch, html.touch body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html.touch input { -webkit-user-select: text; user-select: text; }
html.touch .keys { display: none; }
/* The start button and the line that says what happened when it was pressed stay in reach together: a phone held
   sideways shows little of the menu at once. */
html.touch #go { position: sticky; bottom: -16px; z-index: 1; margin: 0 -8px; padding: 0 8px 16px; background: rgba(255, 248, 239, .96); border-radius: 18px; }
html.touch #go #start-btn { margin-top: 8px; }
#dbg { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); margin: 0; padding: 4px 10px; font: 600 13px/1.4 ui-monospace, monospace; color: #fff; background: rgba(0, 0, 0, .55); border-radius: 8px; text-align: center; }
/* The short description of the game on the menu, and the links to the pages that say more. */
#what { margin: 12px 0 0; font-size: 14px; }
#what summary { cursor: pointer; font-weight: 700; }
#what p { margin: 8px 0 0; font-weight: 500; }
nav.keys a { white-space: nowrap; }
.nojs { position: fixed; inset: auto 0 0 0; margin: 0; padding: 14px 18px; background: #fff8ef; text-align: center; }
