/* The Restaurant page (public/restaurant.html). Shares tokens, buttons, chips, the modal, toast and the
   Chef's Locker from style.css; everything here is restaurant-only. */
.restaurant { background: #16222a; touch-action: manipulation;
  /* The HUD's pixel corners (the name plates' and the hotbar's): one pixel off each corner of a 1 px --line box. */
  --rcorners: polygon(0 1px, 1px 1px, 1px 0, calc(100% - 1px) 0, calc(100% - 1px) 1px, 100% 1px, 100% calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) 100%, 1px 100%, 1px calc(100% - 1px), 0 calc(100% - 1px)); }
.rworld { position: fixed; left: 0; top: 0; image-rendering: pixelated; z-index: 0; touch-action: manipulation; }
.restaurant .crt { z-index: 3; }
.rtop, .hotbar, .rhint, .rpeek, .rstatus { will-change: transform; }

/* Top bar: back, the floor (opens the floor list), your nickname, the locker. */
.rtop { position: fixed; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; }
.rtop > *, .rtop__right > * { pointer-events: auto; }
.rtop__back { text-decoration: none; color: var(--ink); }
.rtop__right { margin-left: auto; display: inline-flex; gap: 8px; }
.rtop__locker .uicon { width: 16px; height: 16px; }
/* The floor chip: the same dark chip as its neighbours (style.css .chip: --panel, a 1 px --line edge, --ink pixel text). */
.rfloorbtn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 30px; padding: 0 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); font: 700 12px var(--pixel); letter-spacing: 0; max-width: 46vw; cursor: pointer; }
.rfloorbtn b { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfloorbtn small { min-width: 0; font: 11px var(--mono); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfloorbtn__more { flex: none; font-size: 11px; color: var(--ink-soft); }
.rfloorbtn:hover { border-color: var(--ink-soft); }

.rhint { position: fixed; z-index: 9; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px); transform: translateX(-50%); margin: 0; padding: 4px 10px; background: var(--panel); color: var(--ink-soft); white-space: nowrap; pointer-events: none; animation: hint 7s 1s both; }
/* phones: the hint wraps inside the screen (long languages ran past both edges and over the chat button) */
@media (max-width: 700px) { .restaurant .rhint.rhint { white-space: normal; width: max-content; max-width: calc(100vw - 32px); text-align: center; text-wrap: balance; bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--hotbar-h, 80px) + 60px); } } /* above the hotbar and the chat button's row */
@keyframes hint { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* A tapped guest: "<name> · Guest chef". */
.rpeek { position: fixed; z-index: 11; width: 160px; padding: 8px 10px; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line); clip-path: var(--rcorners); text-align: center; pointer-events: none; animation: rise-in 0.2s; }
.rpeek b { display: block; font: 700 12px var(--pixel); letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rpeek small { color: var(--ink-soft); }

/* Connection notes and the floor-change fade. */
.rstatus { position: fixed; z-index: 20; left: 50%; top: 64px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 4px 0 #0006; max-width: calc(100vw - 24px); }
.rstatus p { margin: 0; font: 700 12px var(--pixel); letter-spacing: 1px; }
.rstatus .btn { text-decoration: none; white-space: nowrap; }
.rfade { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: #0b141a; opacity: 0; pointer-events: none; transition: opacity 0.26s steps(5, end); }
.rfade.is-on { opacity: 1; }
.rfade p { margin: 0; font: 700 24px var(--pixel); letter-spacing: 2px; text-transform: uppercase; color: var(--cream); }

/* The floor list. */
.rfloors { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.rfloors li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #ffffff2a; background: #14222b; }
.rfloors li.is-here { border-color: var(--focus); }
.rfloors__no { width: 28px; height: 28px; display: grid; place-items: center; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line); clip-path: var(--rcorners); font: 700 12px var(--pixel); flex: none; }
.rfloors li.is-here .rfloors__no { border-color: var(--focus); color: var(--focus); }
.rfloors__games { font-style: normal; color: var(--green, #8fe0a0); } /* the Pool Room's games in play */
/* "Go": a dark chip button, like the top bar's */
.rfloors .btn { background: #1a2a34; color: var(--ink); border: 1px solid var(--line); outline: 0; box-shadow: none; }
.rfloors .btn:hover:not(:disabled) { filter: none; border-color: var(--ink-soft); }
.rfloors .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: none), (pointer: coarse) { .rfloors .btn { min-width: 56px; min-height: 44px; } }
.rfloors__name { flex: 1; min-width: 0; }
.rfloors__name b { display: block; font: 700 12px var(--pixel); letter-spacing: 1px; text-transform: uppercase; }
.rfloors__name small { color: var(--ink-soft); }
.rfloors em { font-style: normal; color: var(--focus); font: 700 12px var(--pixel); letter-spacing: 1px; text-transform: uppercase; }

/* The emote picker. */
.remotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 0 0 10px; }
.remotes__btn { display: grid; justify-items: center; gap: 4px; padding: 10px 4px 6px; background: #1a2a34; border: 1px solid #ffffff2a; }
.remotes__btn[aria-pressed="true"] { border-color: var(--focus); background: #2a3a2a; }
.remotes__btn small { color: var(--ink-soft); }

@media (max-width: 640px) {
  .rtop { gap: 6px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .rtop__label { display: none; }
  .rtop .chip { padding: 0 8px; }
  .rtop .chip [data-bind="name"] { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rfloorbtn { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 38px; line-height: 14px; max-width: 42vw; }
  .rfloorbtn b, .rfloorbtn small { max-width: 100%; }
  .rfloorbtn::after { content: ''; position: absolute; left: -1px; right: -1px; top: -4px; bottom: -4px; } /* a 46 px tall touch target */
  .rfloorbtn__more { display: none; }
  .rfade p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .rhint { animation: none; opacity: 0; } .rfade { transition: none; } }
.remotes__btn .emicon { width: 40px; height: 40px; image-rendering: pixelated; }
.remotes__btn.is-locked .emicon { filter: grayscale(1) brightness(0.45); }
/* "The restaurant opens soon": a calm card over the empty floor while the live rooms aren't open yet. */
.rstatus.is-soon { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 76px); flex-direction: column; gap: 10px; padding: 16px 22px; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line); box-shadow: none; clip-path: var(--rcorners); text-align: center; }
.rstatus.is-soon p { font-size: 24px; line-height: 28px; text-transform: uppercase; }

/* Phones held sideways (QA2: at 844 x 390 the hotbar, the chat button above it and the hint took ~30 % of the height):
   the hotbar drops to the edge, the chat button moves down beside it on the same row, the top bar tightens, no hint. */
@media (max-height: 500px) and (orientation: landscape) {
  .restaurant .rtop { padding-top: max(6px, env(safe-area-inset-top)); }
  .restaurant .hotbar.hotbar { bottom: max(4px, env(safe-area-inset-bottom)); }
  .restaurant .rchatbtn.rchatbtn { bottom: max(4px, env(safe-area-inset-bottom)); }
  .restaurant .rhint.rhint { display: none; }
  .restaurant .rstatus.is-soon.is-soon { bottom: calc(max(4px, env(safe-area-inset-bottom)) + var(--hotbar-h, 80px) + 8px); }
}
