/* Creeper Party (public/party.html). Sizes in GUI pixels (--u) like style.css; textures and sounds from the game. */
body.party { background: #000 var(--grass-top, none) 0 0 / calc(var(--u) * 16); image-rendering: pixelated; }
body.party.has-arena { background: #000 var(--arena) center / cover no-repeat; image-rendering: auto; }
.red { color: #ff5555; text-shadow: var(--s) var(--s) 0 #3f1515; }

/* ---------------------------------------------------------------- menu */
.party-rules { display: flex; flex-direction: column; gap: calc(var(--u) * 2); }
.stack label { text-align: left; }
.name-row { display: flex; gap: calc(var(--u) * 2); align-items: center; }
.name-row .field { flex: 1; }
.name-head { flex: none; width: calc(var(--u) * 20); height: calc(var(--u) * 20); padding: calc(var(--u) * 2); background: url('mc/tex/gui/sprites/container/slot.png') 0 0 / 100% 100%; image-rendering: pixelated; }
.name-head canvas { display: block; width: calc(var(--u) * 16); height: calc(var(--u) * 16); image-rendering: pixelated; }
.join-bar { margin: 0; }
#joinBtn { flex: none; width: calc(var(--u) * 50); }
#menuMsg:empty { display: none; }
/* Ranked: the search or the sign-in prompt, in the game's dark list-entry box. */
.ranked-box { padding: calc(var(--u) * 4); background: rgba(0, 0, 0, 0.5); }
.ranked-box .gray:empty { display: none; }
.ranked-box .btn { width: 100%; } /* not the 200u of buttons in a .stack */
.ranked-box .lobby-row.one { grid-template-columns: 1fr; } /* Cancel alone while searching */
@media (max-width: 759px) { .ranked-box .lobby-row { grid-template-columns: 1fr; } } /* "Sign in with Google" needs the whole width on a phone */
.label .tag .rt { color: #aaa; text-shadow: var(--s) var(--s) 0 #2a2a2a; }
/* Public rooms: the game's server list, in the screen's own scroll area. */
.rooms { display: flex; flex-direction: column; gap: calc(var(--u) * 6); text-align: left; }
.room-list { display: flex; flex-direction: column; gap: calc(var(--u) * 2); }
.room-empty { padding: calc(var(--u) * 2); }
.room-entry { flex: none; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.room-entry .lines { overflow-wrap: anywhere; }
.room-head canvas { width: 100%; height: 100%; }
.room-entry:disabled { cursor: default; }
.room-entry:disabled:hover { background: none; box-shadow: none; }
.room-entry:disabled:hover .link-icon::after { content: none; }

/* ---------------------------------------------------------------- the arena */
.room { position: absolute; inset: 0; overflow: hidden; user-select: none; background: var(--grass-top) 0 0 / calc(var(--u) * 16); } /* party.js sets size and position */
/* A real shot of the arena, when there is one (public/img/arena-*.jpg). */
.room.has-arena { background: #000 var(--arena) center / cover no-repeat; image-rendering: auto; } /* party.js places it */ /* party.js sets size and position */
.room::before { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.2); }
.ring, .fx, .chips { position: absolute; inset: 0; }
/* The arena's own scale (party.js layout): everything in it is sized from --a. */
.ring, .creeper, .chips { --u: var(--a, 2px); --s: var(--a, 2px); --us: var(--a, 2px); font-size: calc(var(--a, 2px) * 8); line-height: calc(var(--a, 2px) * 10); }
.chips { pointer-events: none; z-index: 5600; }
.chips .say:empty { display: none; }
.fx { width: 100%; height: 100%; pointer-events: none; z-index: 5000; image-rendering: pixelated; }
.room .prompt-tip, .room .dock, .room .big-title, .corner, .room .toasts { z-index: 6000; }
.room .prompt-tip { top: calc(var(--u) * -6); text-align: center; }
.room .prompt-tip .tip-head { text-align: left; }
.room .prompt-tip.pop { animation: tip-pop 0.3s cubic-bezier(0.2, 1.5, 0.4, 1); }
.hint { --s: var(--us); font-size: calc(var(--us) * 8); line-height: calc(var(--us) * 10); margin-top: calc(var(--u) * 2); color: #aaa; text-shadow: var(--s) var(--s) 0 #2a2a2a; }
.hint:empty { display: none; }
.room .big-title { pointer-events: none; } /* party.js puts it under the prompt box */
/* A size down from the daily dig's titles: they sit over the arena, and long names go in the line under them. */
.room .big-title p:first-child { --s: calc(var(--u) * 3); font-size: calc(var(--u) * 24); line-height: calc(var(--u) * 28); }
.room .big-title .subtitle { --s: var(--u); font-size: calc(var(--u) * 8); line-height: calc(var(--u) * 10); padding: 0 calc(var(--u) * 4); }
.room.narrow .big-title p:first-child { --s: calc(var(--u) * 2); font-size: calc(var(--u) * 16); line-height: calc(var(--u) * 20); }
.corner { position: absolute; top: calc(var(--u) * 2); }
.corner.right { right: calc(var(--u) * 2); }
.corner.mid { left: calc(var(--u) * 2); }
.room.narrow .corner.mid { left: 50%; transform: translateX(-50%); }
.room .answer-bar { margin-bottom: calc(var(--u) * 4); }
/* Over a busy picture the action bar gets the game's chat backing, so grey and red text stay readable. */
.room .action-bar:not(:empty) { background: rgba(0, 0, 0, 0.5); padding: 0 calc(var(--u) * 2); }
#goBtn { flex: none; width: calc(var(--u) * 50); }
.lobby-bar { width: 100%; display: flex; flex-direction: column; gap: calc(var(--u) * 2); margin-bottom: calc(var(--u) * 4); }
.lobby-row { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 2); }
.lobby-row:has(> [hidden]) { grid-template-columns: 1fr; }
#extraBtn, #startModeBtn { grid-column: 1 / -1; }
.room .toasts { position: absolute; right: 0; top: 0; }

/* Chat between games, styled like the game's: dark translucent lines over the picture, the game's text field. A sidebar down the
   left on wide screens; on a phone it hides behind the Chat button and takes the band between the corner buttons and the
   bottom bar (party.js layout sets its top and bottom), so it never covers the ring or the buttons unless asked to. */
.room .chat { position: absolute; z-index: 6000; left: calc(var(--u) * 2); bottom: calc(var(--u) * 2); width: calc(var(--u) * 150); max-height: calc(var(--u) * 120); display: flex; flex-direction: column; gap: calc(var(--u) * 2); text-align: left; user-select: text; }
.room.chat-toggle .chat { right: calc(var(--u) * 2); width: auto; max-height: none; }
.chat-log { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.chat-log::-webkit-scrollbar { display: none; }
.chat-log > :first-child { margin-top: auto; }
.chat-line { --s: var(--us); flex: none; padding: 0 var(--u); background: rgba(0, 0, 0, 0.5); font-size: calc(var(--us) * 8); line-height: calc(var(--us) * 9); overflow-wrap: anywhere; }
.chat-line .who { color: #fff; }
.chat-line.spec { color: #aaa; text-shadow: var(--s) var(--s) 0 #2a2a2a; }
.room.short .corner.mid.open { display: block; } /* the keyboard is up: the button that shuts the chat stays */
.chat-line.me .who { color: #55ff55; text-shadow: var(--s) var(--s) 0 #153f15; }
.chat-form { flex: none; }
.chat-hide { flex: none; align-self: flex-start; }
.chat-form .field { width: 100%; }

/* Your health and experience above the answer field, like the game's HUD above the hotbar. */
.me-hud { width: calc(var(--u) * 182); display: flex; flex-direction: column; gap: var(--u); margin-bottom: calc(var(--u) * 3); }
.me-hud .xp { margin: 0; }
.hud-hearts { display: flex; height: calc(var(--u) * 9); }

/* ---------------------------------------------------------------- the creeper (party.js buildCreeper); the 3D boxes themselves are in models.css */
/* The charged creeper (party.js buildCreeper): a shell a pixel bigger, light blue stripes sliding two ways over it. */
.shell { display: none; }
.rig.charged .shell { display: block; }
.rig.white .face.aura, .face.aura { backface-visibility: hidden; filter: none; background-image: var(--aura-a), var(--aura-b); background-size: calc(var(--u) * 32) calc(var(--u) * 32); background-repeat: repeat; animation: aura-slide 6s linear infinite; }
@keyframes aura-slide {
  from { background-position: 0 0, 0 0; }
  to { background-position: calc(var(--u) * 32) calc(var(--u) * 32), calc(var(--u) * -32) calc(var(--u) * 32); }
}
.rig.white .face { filter: brightness(calc(var(--shade, 1) * 2.6)) saturate(0.4); }
.rig.white .face.lit:not(.aura) { filter: brightness(2.6) saturate(0.4); } /* its light is in the texture already */

.creeper { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.creeper.gone { visibility: hidden; }

/* A seat stands where its player's feet are (party.js layout): the player, the name tag above like the game's, hearts
   and experience bar on the ground in front. Speech labels are in .chips, above everything. */
.seat { position: absolute; left: 0; top: 0; transition: transform 0.3s ease-out; }
.model { position: absolute; left: 0; top: 0; transform: scale(var(--ms, 1)); transform-origin: 0 0; }
.model > .rig { transform: rotateX(var(--tilt, -30deg)); } /* party.js adds the turn and the fall */
/* A player's labels (in .chips, above every model): speech, name tag, and hearts with the experience bar. */
.label { position: absolute; left: 0; top: 0; }
.label .tag, .label .under, .label .say { position: absolute; left: 0; }
.label .tag { top: var(--tag-y); transform: translate(-50%, -100%); }
.label .say { top: var(--chip-y); transform: translate(-50%, -100%); }
.label .under { top: var(--under-y); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
/* Short of room (party.js declutter): one heart and a count, then the count alone; on short screens no hearts at all. */
.hcount { display: none; line-height: calc(var(--u) * 9); margin-left: var(--u); }
.under.compact .heart:not(:first-child) { display: none; }
.under.compact .hcount { display: block; }
.under.compact .mini-xp { display: none; }
.under.tight { display: none; }
.chips[data-labels='compact'] .mini-xp { display: none; }
.chips[data-labels='compact'] .heart:not(:first-child) { display: none; }
.chips[data-labels='compact'] .hcount { display: block; }
.chips[data-labels='minimal'] .under { display: none; }
.room.narrow .hint { display: none; }
.room.short .corner, .room.short ~ .nav-btn, .room.short .me-hud { display: none; }
.chips .say {
  max-width: calc(var(--u) * 150);
  padding: var(--u) calc(var(--u) * 3);
  background: rgba(16, 0, 16, 0.92);
  box-shadow: inset 0 0 0 var(--u) #28007f, 0 0 0 var(--u) rgba(16, 0, 16, 0.92);
  line-height: calc(var(--u) * 9);
  white-space: nowrap;
  overflow: hidden;
}
.chips .say.live { box-shadow: inset 0 0 0 var(--u) #5000ff, 0 0 0 var(--u) rgba(16, 0, 16, 0.92); }
.caret { animation: blink 1s steps(1) infinite; }
.label .tag { white-space: nowrap; background: rgba(0, 0, 0, 0.35); padding: 0 var(--u); line-height: calc(var(--u) * 9); }
.seat.holder .model { animation: bob 0.5s steps(2) infinite; }
.seat.out .model, .seat.waiting .model, .seat.away .model { filter: grayscale(1) brightness(0.55); }
.label.out .tag, .label.waiting .tag { opacity: 0.6; }
.label.out .tag { top: calc(var(--u) * -8); transition: top 0.4s; } /* lying down: the name sits just above the body */
.label.out .say, .label.out .hearts, .label.out .mini-xp { display: none; } /* just "Out #3" */
.label .note { white-space: nowrap; }
.label.holder { z-index: 1; } /* what the holder types is never under a neighbour's name */
.seat.hit .model { animation: hurt 0.5s steps(2) 2; }
.hearts { display: flex; height: calc(var(--u) * 9); padding-right: var(--u); }
.heart { position: relative; flex: none; width: calc(var(--u) * 9); height: calc(var(--u) * 9); margin-right: calc(var(--u) * -1); background: url('mc/tex/gui/sprites/hud/heart/container.png') 0 0 / 100% 100%; image-rendering: pixelated; }
.heart.full::after { content: ''; position: absolute; inset: 0; background: url('mc/tex/gui/sprites/hud/heart/full.png') 0 0 / 100% 100%; image-rendering: pixelated; }
/* Absorption hearts: the ones above the room's starting hearts, golden like the game's (the heart sprite turned yellow). */
.heart.full.gold::after { filter: sepia(1) saturate(3.5) brightness(1.8) hue-rotate(10deg); }
.label.hit .heart:not(.full):last-of-type { animation: heart-blink 0.3s steps(1) 4; }
.mini-xp { position: relative; width: calc(var(--u) * 40); height: calc(var(--u) * 5); margin-top: var(--u); background: url('mc/tex/gui/sprites/hud/experience_bar_background.png') right 0 / calc(var(--u) * 182) 100% no-repeat; image-rendering: pixelated; }
.mini-xp::before { content: ''; position: absolute; left: 0; top: 0; width: var(--u); height: 100%; background: url('mc/tex/gui/sprites/hud/experience_bar_background.png') 0 0 / calc(var(--u) * 182) 100% no-repeat; image-rendering: pixelated; }
.mini-xp-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: url('mc/tex/gui/sprites/hud/experience_bar_progress.png') 0 0 / calc(var(--u) * 182) 100% no-repeat; image-rendering: pixelated; transition: width 0.4s steps(8); }
.label .note { line-height: calc(var(--u) * 9); }
/* Click a player (model or name tag): a small stack of buttons above the tag for 4 seconds, "Report skin" and, for the host, "Kick" (party.js offerActions). */
.label .tag { pointer-events: auto; cursor: pointer; }
.label .acts { position: absolute; left: 0; top: var(--tag-y); transform: translate(-50%, calc(-100% - var(--u) * 11)); z-index: 2; display: flex; flex-direction: column; align-items: stretch; gap: calc(var(--u) * 3); pointer-events: none; }
.label .acts[hidden], .label .acts > [hidden] { display: none; }
.label .acts > button { pointer-events: auto; cursor: pointer; white-space: nowrap; padding: var(--u) calc(var(--u) * 3); border: 0; background: rgba(16, 0, 16, 0.92); box-shadow: inset 0 0 0 var(--u) #5000ff, 0 0 0 var(--u) rgba(16, 0, 16, 0.92); font: inherit; line-height: calc(var(--u) * 9); color: #fff; text-shadow: var(--s) var(--s) 0 #3f3f3f; }
.label .acts > button:hover:not(:disabled), .label .acts > button:focus-visible { box-shadow: inset 0 0 0 var(--u) #fff, 0 0 0 var(--u) rgba(16, 0, 16, 0.92); outline: 0; }
.label .acts > button:disabled { cursor: default; }
.label .acts > .kick { color: #ff5555; text-shadow: var(--s) var(--s) 0 #3f1515; box-shadow: inset 0 0 0 var(--u) #aa0000, 0 0 0 var(--u) rgba(16, 0, 16, 0.92); }
.label .acts > .kick.ask { color: #fff; background: #aa0000; text-shadow: var(--s) var(--s) 0 #3f3f3f; }
.label.out .acts { top: calc(var(--u) * -8); }

/* "+12 Rare" rising from a head. */
.float { position: absolute; transform: translateX(-50%); white-space: nowrap; z-index: 5500; pointer-events: none; animation: rise 1.6s ease-out forwards; }

.room.shake .ring, .room.shake .creeper { animation: room-shake 0.45s steps(9); }
.shadow { pointer-events: none; }
.room::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5001; }
.room.flash::after { animation: white-flash 0.35s ease-out; }

@keyframes bob { 50% { translate: 0 calc(var(--u) * -1); } }
@keyframes hurt { 0% { filter: sepia(1) saturate(6) hue-rotate(-50deg) brightness(0.9); } 50% { filter: none; } }
@keyframes heart-blink { 50% { background-image: url('mc/tex/gui/sprites/hud/heart/container_blinking.png'); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { 0% { translate: 0 calc(var(--u) * 4); opacity: 0; } 15% { translate: 0 0; opacity: 1; } 70% { opacity: 1; } 100% { translate: 0 calc(var(--u) * -18); opacity: 0; } }
@keyframes white-flash { 0% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes tip-pop { from { transform: translateX(-50%) scale(0.92); } to { transform: translateX(-50%); } }
@keyframes room-shake {
  0%, 100% { translate: 0 0; }
  20% { translate: calc(var(--u) * -5) calc(var(--u) * 3); }
  40% { translate: calc(var(--u) * 4) calc(var(--u) * -4); }
  60% { translate: calc(var(--u) * -3) calc(var(--u) * 2); }
  80% { translate: calc(var(--u) * 2) calc(var(--u) * -1); }
}
@media (prefers-reduced-motion: reduce) {
  .room.shake .ring, .room.shake .creeper, .room.flash::after, .seat.holder .model, .face.aura { animation: none; }
}
