/* ===================================================================== */
/* Lobby screen (#lobby): the CoreCraftia fantasy frame - bright blue      */
/* borders, wooden sign titles, leaf corners and 3D buttons - matching the */
/* in-game windows and the login screen. Presentation only: markup, ids    */
/* and behaviour are untouched. Loaded after corecraftia-ui.css/windows.css*/
/* so it uses "body #lobby" and !important where those sheets do.          */
/* ===================================================================== */

body #lobby{
  --lb-frame: #2f93ff;
  --lb-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --lb-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --lb-leaf-tl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%200%29%20scale%281%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --lb-leaf-tr: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%200%29%20scale%28-1%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --lb-leaf-bl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%2070%29%20scale%281%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --lb-leaf-br: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%2070%29%20scale%28-1%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  font-family: Georgia, "Times New Roman", serif;
}

/* ---- room for the signs / leaves that overhang the frames ---- */
body #lobby .lobby-stage{ padding-top: clamp(16px, 2.6vh, 26px); overflow: visible; }
body #lobby .lobby-stage-left{ overflow: visible !important; }
body #lobby .lobby-stage-center{ gap: clamp(30px, 4.6vh, 40px); }
body #lobby .lobby-grid{ overflow: visible !important; }

/* ---- framed panels ---- */
body #lobby .lobby-player-strip,
body #lobby .lobby-join,
body #lobby .lobby-panel.lobby-worlds-panel,
body #lobby .lobby-panel.lobby-actions-panel{
  position: relative;
  overflow: visible !important;
  border: 4px solid var(--lb-frame) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #123c72 0%, #0b2750 52%, #081b38 100%) !important;
  box-shadow:
    0 0 0 2px #082f66,
    0 18px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(150, 210, 255, 0.35),
    inset 0 3px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body #lobby .lobby-panel.lobby-actions-panel{ padding: 14px !important; }
body #lobby .lobby-panel.lobby-worlds-panel{ padding: clamp(28px, 3.8vh, 38px) 10px 12px !important; }
body #lobby .lobby-join{ padding: clamp(38px, 5.4vh, 48px) 16px 12px !important; }
body #lobby .lobby-player-strip{ padding: 8px 14px 8px 8px; }

/* leaf corners */
body #lobby .lobby-player-strip::after,
body #lobby .lobby-join::after,
body #lobby .lobby-panel.lobby-worlds-panel::after,
body #lobby .lobby-panel.lobby-actions-panel::after{
  content: "";
  position: absolute;
  inset: -14px;
  z-index: 4;
  display: block !important;
  width: auto;
  height: auto;
  opacity: 1 !important;
  pointer-events: none;
  background:
    var(--lb-leaf-tl) left top / 52px 40px no-repeat,
    var(--lb-leaf-tr) right top / 52px 40px no-repeat,
    var(--lb-leaf-bl) left bottom / 52px 40px no-repeat,
    var(--lb-leaf-br) right bottom / 52px 40px no-repeat !important;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}
body #lobby .lobby-player-strip::before,
body #lobby .lobby-panel.lobby-actions-panel::before{ display: none !important; }

/* ---- wooden sign titles ---- */
body #lobby .lobby-panel.lobby-worlds-panel .lobby-panel-title,
body #lobby .lobby-join::before{
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -52%);
  z-index: 5;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 !important;
  padding: 6px 22px 8px !important;
  border: 3px solid #4a2a10;
  border-radius: 10px;
  background: var(--lb-grain), var(--lb-wood);
  box-shadow: 0 4px 0 #2a1507, inset 0 3px 0 rgba(255, 233, 190, 0.45), inset 0 -4px 0 rgba(60, 28, 6, 0.35);
  color: #fff !important;
  font: 900 clamp(13px, 1.3vw, 19px)/1.05 Georgia, "Times New Roman", serif !important;
  letter-spacing: 0.03em !important;
  text-align: center;
  text-transform: uppercase !important;
  -webkit-text-stroke: 4px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(6, 14, 34, 0.85);
  white-space: nowrap;
}
body #lobby .lobby-join::before{
  content: "PICK A WORLD";
  display: block !important;
  right: auto;
  bottom: auto;
  opacity: 1;
  pointer-events: none;
}
/* sign icons come from the shared icons tilemap (zero-based column/row) */
body #lobby .lobby-panel.lobby-worlds-panel .lobby-panel-title::before{
  content: "";
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: -4px 0 -4px -10px;
  background: url("/photos/icons_tilemap.png") no-repeat;
  background-size: 286px 208px;
  background-position: -234px 0;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 2px 0 rgba(30, 14, 4, 0.55));
}
body #lobby .lobby-worlds-panel:nth-child(2) .lobby-panel-title::before{ background-position: -260px 0; }
body #lobby .lobby-worlds-panel:nth-child(3) .lobby-panel-title::before{ background-position: -78px -26px; }

/* ---- join row ---- */
body #lobby .lobby-join-title{
  color: #fff !important;
  font: 800 clamp(11px, 1vw, 14px)/1.25 Georgia, serif !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
body #lobby .lobby-field input{
  height: clamp(40px, 4.4vh, 50px);
  border: 3px solid #4aa8ff !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #06193a, #0a2347) !important;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.6) !important;
  color: #f4fbff !important;
  font: 800 clamp(13px, 1.1vw, 15px) Georgia, serif;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body #lobby .lobby-field input::placeholder{ color: rgba(190, 226, 245, 0.55); }
body #lobby .lobby-field input:focus{
  border-color: #8fd2ff !important;
  box-shadow: 0 0 10px rgba(80, 170, 255, 0.6), inset 0 3px 7px rgba(0, 0, 0, 0.6) !important;
}
body #lobby .lobby-hint{ color: #cfe9ff !important; font-weight: 800 !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
body #lobby .lobby-hint:empty{ display: none; }

/* ---- 3D buttons ---- */
body #lobby .lobby-utility-btn,
body #lobby .lobby-action-button,
body #lobby button#joinWorld.lobby-cta{
  position: relative;
  border: 3px solid #0b2c5e !important;
  border-radius: 14px !important;
  color: #fff !important;
  font-family: Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  background: linear-gradient(180deg, #1b5fb8 0%, #123f86 52%, #0c2c62 100%) !important;
  box-shadow: 0 0 0 2px #061a38, 0 4px 0 2px #061a38, inset 0 3px 0 rgba(255, 255, 255, 0.3) !important;
  transition: transform 120ms ease, filter 120ms ease;
}
body #lobby .lobby-action-button--green,
body #lobby button#joinWorld.lobby-cta{
  background: linear-gradient(180deg, #4aa6ff 0%, #2677e6 50%, #1757bd 100%) !important;
  box-shadow: 0 0 0 2px #061a38, 0 4px 0 2px #061a38, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
}
body #lobby .lobby-utility-danger{
  border-color: #5a0f0c !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 0 0 2px #2f0907, 0 4px 0 2px #2f0907, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
}
body #lobby .lobby-utility-btn:hover,
body #lobby .lobby-action-button:hover,
body #lobby button#joinWorld.lobby-cta:hover{
  filter: brightness(1.12) !important;
  transform: translateY(-2px);
  border-color: #0b2c5e !important;
}
body #lobby .lobby-utility-danger:hover{ border-color: #5a0f0c !important; }
body #lobby .lobby-action-button--green:hover,
body #lobby button#joinWorld.lobby-cta:hover{ background: linear-gradient(180deg, #4aa6ff 0%, #2677e6 50%, #1757bd 100%) !important; }
body #lobby .lobby-action-button--blue:hover,
body #lobby .lobby-action-button--purple:hover,
body #lobby .lobby-utility-btn:hover:not(.lobby-utility-danger){ background: linear-gradient(180deg, #1b5fb8 0%, #123f86 52%, #0c2c62 100%) !important; }
body #lobby .lobby-utility-btn:active,
body #lobby .lobby-action-button:active,
body #lobby button#joinWorld.lobby-cta:active{ filter: brightness(0.94) !important; transform: translateY(2px) scale(0.985); }
body #lobby .lobby-utility-btn:focus-visible,
body #lobby .lobby-action-button:focus-visible,
body #lobby button#joinWorld.lobby-cta:focus-visible,
body #lobby .world-list button:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 2px; }
body #lobby .lobby-action-title{ color: #fff; font-weight: 900; font-size: clamp(14px, 1.25vw, 18px); text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85); }
body #lobby .lobby-actions-stack{ gap: 12px; }

/* ---- player strip ---- */
body #lobby .lobby-player-avatar{
  border: 3px solid #4aa8ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #15264e, #0a1431);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.6);
}
body #lobby .lobby-player-name{ color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
body #lobby .lobby-player-level{ color: #8fd2ff; font-weight: 900; }
body #lobby .lobby-player-xp-bar{
  border: 2px solid #07162e;
  border-radius: 999px;
  background: #0a1a33;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
body #lobby .lobby-player-xp-text,
body #lobby .lobby-player-coins-value{ color: #ffe9a0; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }

/* ---- world lists ---- */
body #lobby .world-list li{
  border: 2px solid rgba(120, 190, 255, 0.4) !important;
  border-radius: 13px !important;
  background: linear-gradient(180deg, #0c2144, #081a38) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.07) !important;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body #lobby .world-list li:hover{
  border-color: #6fc4ff !important;
  box-shadow: 0 3px 0 #061a38, 0 0 12px rgba(80, 170, 255, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.1) !important;
}
body #lobby .world-list li button,
body #lobby .world-list li button:hover{ background: transparent !important; border: 0 !important; box-shadow: none !important; font-family: Georgia, serif !important; }
body #lobby .world-list{ align-content: start !important; grid-auto-rows: min-content !important; padding-right: 8px !important; }
body #lobby .world-list li{ min-height: 0 !important; }
body #lobby .world-list li button{ grid-template-columns: 50px minmax(0, 1fr) auto !important; min-height: 46px !important; gap: 8px !important; padding: 2px 6px 2px 2px !important; }
body #lobby .world-name{ font-size: clamp(10px, 0.95vw, 12px) !important; padding: 0 !important; }
body #lobby .world-count{ min-width: 0 !important; padding: 0 6px !important; height: 34px !important; font-size: 13px !important; }
body #lobby .world-thumb{
  width: 50px !important;
  height: 50px !important;
  border: 2px solid #4aa8ff !important;
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45) !important;
}
body #lobby .world-name{ color: #fff !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
body #lobby .world-count{
  border: 2px solid rgba(120, 190, 255, 0.4) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #06193a, #0a2347) !important;
  color: #ffe9a0 !important;
}
body #lobby .world-empty{ color: rgba(207, 233, 255, 0.78) !important; font-weight: 800 !important; font-family: Georgia, serif; }
body #lobby .world-list{ scrollbar-color: #2f93ff rgba(0, 0, 0, 0.25); }

@media (max-width: 900px){
  body #lobby .lobby-player-strip::after,
  body #lobby .lobby-join::after,
  body #lobby .lobby-panel.lobby-worlds-panel::after,
  body #lobby .lobby-panel.lobby-actions-panel::after{ inset: -9px; background-size: 38px 29px; }
  body #lobby .lobby-stage-center{ gap: 34px; }
  body #lobby .lobby-grid{ margin-top: 12px; row-gap: 38px; }
}
@media (prefers-reduced-motion: reduce){
  body #lobby .lobby-utility-btn, body #lobby .lobby-action-button, body #lobby button#joinWorld.lobby-cta,
  body #lobby .world-list li, body #lobby .lobby-field input{ transition: none; }
}
