/* The menus (src/menus.js): the title, pause, joining with a code, how to play, the awards. Laid out for 1280 x 720 and
   scaled with --ui like the HUD. The loading screen's styles (and the name, the embers, the shade) are in index.html. */
.menu-ui { --gold: #ffe9a8; --ink: #14121a; --stone: #4c5270; --night: #0e1019; text-shadow: none; }
.menu-ui .nm { font-size: 0; }
.menu-ui p { margin: 4px 0; font-size: 24px; color: #c9cfe4; max-width: 860px; text-align: center; text-shadow: 2px 2px 0 #000; }

/* ---- buttons: dark stone, lit gold when chosen, a pointer either side ---- */
.menu-ui .btns { display: flex; flex-direction: column; align-items: stretch; gap: 9px; margin-top: 14px; min-width: 400px; }
.menu-ui .btn { position: relative; font: inherit; font-size: 30px; line-height: 1; letter-spacing: 1px; color: #f4ead0; text-align: center; padding: 8px 22px 9px; background: #171a28; border: 3px solid var(--ink); outline: 2px solid var(--stone); box-shadow: inset 0 3px 0 #ffffff12, 0 5px 0 #000; text-shadow: 2px 2px 0 #000; cursor: pointer; pointer-events: auto; }
.menu-ui .btn.sel { color: var(--ink); background: linear-gradient(#ffe39a 0 48%, #ffc062 48% 100%); outline-color: #fff3cf; box-shadow: inset 0 3px 0 #fffbea, inset 0 -4px 0 #d9822f, 0 5px 0 #000; text-shadow: none; }
.menu-ui .btn.sel::before, .menu-ui .btn.sel::after { content: ''; position: absolute; top: 50%; width: 18px; height: 27px; margin-top: -13px; background: var(--arw) center / contain no-repeat; image-rendering: pixelated; animation: poke .5s steps(2) infinite alternate; }
.menu-ui .btn.sel::before { left: -36px; }
.menu-ui .btn.sel::after { right: -36px; transform: scaleX(-1); animation-name: poke2; }
@keyframes poke { to { transform: translateX(5px); } }
@keyframes poke2 { from { transform: scaleX(-1); } to { transform: scaleX(-1) translateX(5px); } }
.menu-ui .btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 #ffffff12, 0 2px 0 #000; }
.menu-ui .btn.off { opacity: .4; cursor: default; }

/* ---- pictures of what to press ---- */
.menu-ui .k { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.menu-ui .pic { display: inline-block; background: center / 100% 100% no-repeat; image-rendering: pixelated; flex: none; }
.menu-ui .kc { display: inline-block; min-width: 14px; height: 24px; padding: 0 6px; font-size: 21px; line-height: 23px; text-align: center; color: var(--ink); background: #f4ead0; border: 2px solid var(--ink); border-radius: 3px; box-shadow: inset 0 -3px 0 #c8bc9c, 0 2px 0 #000; text-shadow: none; box-sizing: content-box; }
.menu-ui .kc .ar { display: inline-block; vertical-align: middle; image-rendering: pixelated; margin-top: -2px; }
.menu-ui .cl { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; font-style: normal; }
.menu-ui .cl span { display: flex; gap: 2px; }
.menu-ui .cl .kc { min-width: 10px; height: 15px; padding: 0 4px; font-size: 15px; line-height: 15px; box-shadow: inset 0 -2px 0 #c8bc9c, 0 1px 0 #000; }
.menu-ui .pr { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.menu-ui .w { color: #b9c0d8; }

/* the controls, all of them (pause, how to play) */
.menu-ui .keys { margin-top: 18px; padding: 12px 18px 14px; display: grid; grid-template-columns: repeat(3, max-content max-content); justify-content: center; gap: 9px 10px; align-items: center; font-size: 21px; color: #b9c0d8; background: #0007; border: 2px solid var(--ink); outline: 1px solid #2c3044; }
.menu-ui .keys span { margin-right: 0; }      /* game.css spaces every span in .keys for the old list */
.menu-ui .keys .k { justify-self: end; }
.menu-ui .keys > .w { margin-right: 30px; text-align: left; } .menu-ui .keys > .w:nth-child(6n + 1) { margin-right: 0; }
.menu-ui .keys .cap { grid-column: 1 / -1; text-align: center; font-size: 17px; letter-spacing: 2px; color: #8a90aa; margin-bottom: 2px; }
.menu-ui .foot { display: flex; justify-content: center; gap: 26px; margin-top: 16px; font-size: 29px; color: #c2c7da; }      /* (gunner, r3) 19px read as 6 px specks on the end card */
.menu-ui .foot .w { color: #8a90aa; }

/* ---- the title: the castle behind, the name on top (as on the loading screen), one big way in ---- */
.menu-ui.m-title { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 0; background: none; }
.m-title .logo { position: relative; top: auto; margin-top: 46px; }      /* where the loading screen has it: index.html .logo */
.m-title .shade, .m-title .fx { position: absolute; }
/* lighter than the loading screen's in the middle: the castle is the picture now */
.m-title .shade { background: linear-gradient(to bottom, rgba(5, 7, 16, .72) 0%, rgba(5, 7, 16, .28) 34%, rgba(5, 7, 16, .05) 52%, rgba(5, 4, 8, .4) 80%, rgba(5, 4, 8, .82) 100%), radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(3, 3, 8, .45) 100%); }
.m-title .tbox { position: relative; margin-top: 22px; display: flex; flex-direction: column; align-items: center; }
.m-title .btns { margin-top: 0; min-width: 420px; }
.m-title .btn { font-size: 27px; padding: 7px 22px 8px; }
.m-title .btn.first { font-size: 44px; padding: 9px 30px 10px; margin-bottom: 6px; letter-spacing: 2px; }
.m-title .btn.first.sel { animation: lit 2.4s steps(1) infinite; }
@keyframes lit { 0%, 100% { outline-color: #fff3cf; } 30% { outline-color: #ffd47c; } 55% { outline-color: #fffbea; } 80% { outline-color: #ffc062; } }
.m-title .btns { order: 1; } .m-title p { order: 2; font-size: 21px; margin-top: 14px; color: #b9c0d8; }
.m-title .bottom { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; align-items: center; gap: 30px; font-size: 28px; }      /* (pacing, r4) 21px: the reviewer could not read the keys */
.m-title .bottom .foot { margin: 0; gap: 26px; font-size: 28px; }
.m-title .bottom .sep { width: 3px; height: 30px; background: #ffffff1f; }
.m-title .kmini { display: flex; gap: 22px; }

.m-title .btn, .m-title .bottom { animation: rise .4s steps(5) both; animation-delay: calc(.15s + var(--i, 5) * .07s); }
.m-title .btn.first.sel { animation: rise .4s steps(5) .15s both, lit 2.4s steps(1) .6s infinite; }
.m-title.again .btn, .m-title.again .bottom, .m-title.again .btn.first.sel { animation: none; }
.m-title.again .btn.first.sel { animation: lit 2.4s steps(1) infinite; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }

/* ---- the others: a card over the game ---- */
.menu-ui.m-card { background: rgba(4, 5, 10, .62); }
.m-card .card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 40px 18px; min-width: 460px; max-width: 1060px; background: #0e1019f2; border: 3px solid var(--ink); outline: 2px solid var(--stone); box-shadow: 0 0 0 5px #000a, 10px 10px 0 5px #0008; animation: cardin .2s steps(3); }
.m-card .card::before { content: ''; position: absolute; inset: 5px; pointer-events: none; background: linear-gradient(#ffc062, #ffc062) left top / 6px 6px, linear-gradient(#ffc062, #ffc062) right top / 6px 6px, linear-gradient(#ffc062, #ffc062) left bottom / 6px 6px, linear-gradient(#ffc062, #ffc062) right bottom / 6px 6px; background-repeat: no-repeat; opacity: .8; }
@keyframes cardin { from { transform: translateY(10px); opacity: 0; } }
.m-card h2 { margin: 2px 0 10px; display: flex; justify-content: center; }
.m-card h2 canvas { display: block; image-rendering: pixelated; }
.m-card h2.plain { font-size: 44px; color: var(--gold); }
.m-card .btns { min-width: 380px; }

/* joining with a code: a box per letter, so a controller can spell it */
.menu-ui .codebox { display: flex; gap: 10px; margin: 16px 0 6px; }
.menu-ui .codebox b { position: relative; width: 54px; height: 66px; font-size: 58px; line-height: 64px; text-align: center; font-weight: normal; color: var(--gold); background: #07080d; border: 3px solid var(--ink); outline: 2px solid var(--stone); text-shadow: 3px 3px 0 #000; }
.menu-ui .codebox b.at { outline-color: #fff3cf; animation: none; }
.menu-ui .codebox b.at::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 6px; height: 5px; background: #ffc062; animation: blink 1s steps(2) infinite; }
.menu-ui .codebox.nope { animation: shake .3s steps(6); }

/* the three lines of how to play */
.menu-ui .rules { margin: 4px 0 2px; text-align: left; }
.menu-ui .rules div { display: flex; align-items: center; gap: 16px; font-size: 30px; margin: 10px 0; max-width: 900px; color: #f4ead0; text-shadow: 2px 2px 0 #000; }
.menu-ui .rules b { flex: none; width: 44px; height: 44px; line-height: 42px; text-align: center; font-size: 36px; font-weight: normal; color: var(--ink); background: linear-gradient(#ffe39a 0 48%, #ffc062 48%); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #000; text-shadow: none; }
.menu-ui .rules em { font-style: normal; color: #ffd47c; }

/* the awards */
#awards.menu-ui .aws { margin-top: 10px; }

/* #menu (game.css) starts its panel 64px down for the old title: the title and its cards place themselves */
#menu.m-title { padding-top: 0; background: none; }
#menu.m-card { padding-top: 0; justify-content: center; background: rgba(4, 5, 10, .62); }

/* redrawn in place (the lobby, as people come and go): no entrance */
.m-card.again .card { animation: none; }

/* ---- the room before the game: the code, who is in, who is ready ---- */
.menu-ui .codebox.show b { width: 50px; height: 62px; line-height: 60px; font-size: 56px; }
.menu-ui .lobby { display: flex; flex-direction: column; align-items: center; }
.menu-ui .lplayers { display: grid; grid-template-columns: 1fr; gap: 6px; min-width: 440px; margin: 16px 0 4px; }
.menu-ui .lplayers.two { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.menu-ui .lp { display: flex; align-items: center; gap: 12px; padding: 6px 12px 7px; font-size: 26px; background: #0007; border: 2px solid var(--ink); outline: 1px solid #2c3044; color: #b9c0d8; text-shadow: 2px 2px 0 #000; }
.menu-ui .lp .mk2 { flex: none; width: 28px; height: 20px; display: flex; align-items: center; justify-content: center; }
.menu-ui .lp .mk2::before { content: ''; width: 12px; height: 12px; border: 3px solid #585f80; box-sizing: border-box; }
.menu-ui .lp .mk2:has(.cr)::before { display: none; }
.menu-ui .lp .cr { width: 28px; height: 20px; image-rendering: pixelated; }
.menu-ui .lp .who { flex: 1; text-align: left; color: #f4ead0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.menu-ui .lp em { font-style: normal; font-size: 20px; letter-spacing: 1px; color: #8a90aa; }
.menu-ui .lp.ok em { color: #9fe07a; }
.menu-ui .lp.ok .mk2::before { background: #9fe07a; border-color: var(--ink); box-shadow: 0 0 0 2px #9fe07a; }
.menu-ui .lp.me { outline-color: #ffd47c88; }
.menu-ui .lp.wait { opacity: .7; } .menu-ui .lp.wait .who { color: #8a90aa; }
.menu-ui .lp .dots b { font-weight: normal; animation: blink 1.2s steps(2) infinite; } .menu-ui .lp .dots b:nth-child(2) { animation-delay: .4s; } .menu-ui .lp .dots b:nth-child(3) { animation-delay: .8s; }
.m-lobby .card > p { color: #ffd47c; }
