/* PixelCity — strona gracza: menu map, zaproszenia, poczekalnia, nakładki trybu wieloosobowego */
body.play { overflow: hidden; }
.screen { position: absolute; inset: 0; z-index: 20; overflow: auto; background: linear-gradient(180deg, #f4f1ea 0%, #eae4d6 100%); }
.screen[hidden] { display: none !important; }
.screen-inner { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.screen-inner.narrow { max-width: 520px; padding-top: 8vh; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 6px 0 8px; }
.hero p { margin: 0 0 22px; color: var(--ink-2); font-size: 16px; max-width: 640px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.map-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; font: inherit; color: var(--ink); box-shadow: 0 4px 14px rgba(40, 32, 20, 0.08); transition: transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; }
.map-card:hover, .map-card:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(40, 32, 20, 0.18); outline: none; }
.map-card img { width: 100%; aspect-ratio: 7 / 4; object-fit: cover; background: #cfd8dc; display: block; }
.map-card .mc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.map-card b { font-size: 16px; }
.map-card span { font-size: 12px; color: var(--ink-2); }
.panel { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-size: 20px; margin-bottom: 2px; }
.input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; width: 100%; background: #fff; }
.input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.err { margin: 0; color: #c62828; font-size: 13px; }
.lobby { display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .lobby { grid-template-columns: 1fr; } }
.share { display: flex; gap: 8px; }
.share .input { font-size: 13px; }
.host-only[hidden] { display: none; }
.row2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12px; }
.row2 label { display: flex; flex-direction: column; gap: 3px; font-weight: 700; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; }
.player-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.player-list i { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); }
.player-list .tag { margin-left: auto; font-size: 11px; color: var(--ink-2); }
.player-list .kick { margin-left: 6px; border: 0; background: none; color: #c62828; cursor: pointer; font-size: 12px; }
.progress { height: 8px; background: rgba(31, 36, 48, 0.1); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 3%; background: var(--accent); border-radius: 99px; transition: width 0.25s; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(20, 24, 32, 0.55); padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { width: min(720px, 100%); background: #fff; border-radius: 18px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
@media (max-width: 680px) { .modal-card { grid-template-columns: 1fr; } }
.modal-card img { width: 100%; height: 100%; min-height: 200px; object-fit: cover; background: #cfd8dc; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; align-self: flex-start; }
.mp-only[hidden] { display: none; }
/* nakładki w grze */
.mp-feed { position: absolute; right: 16px; top: 76px; z-index: 9; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; pointer-events: none; }
.mp-feed div { background: rgba(20, 24, 32, 0.78); color: #fff; padding: 5px 10px; border-radius: 8px; font-size: 13px; animation: feed-in 0.2s; }
.mp-feed b.me { color: #ffd166; }
@keyframes feed-in { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.mp-chat { position: absolute; left: 16px; bottom: 120px; z-index: 9; width: min(380px, 60vw); pointer-events: none; }
.mp-chat-log { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.mp-chat-log div { background: rgba(20, 24, 32, 0.6); color: #fff; padding: 4px 9px; border-radius: 8px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.mp-chat-log div.old { opacity: 0.0; transition: opacity 1.2s; }
.mp-chat-log .sys { color: #ffe9a8; font-style: italic; }
.mp-chat.open .mp-chat-log div.old { opacity: 1; }
.mp-chat input { pointer-events: auto; margin-top: 6px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; font: inherit; background: rgba(255, 255, 255, 0.95); }
.lobby-chat { max-height: 150px; overflow: auto; }
.lobby-chat div { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.mp-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 12; background: rgba(20, 24, 32, 0.85); color: #fff; padding: 14px 26px; border-radius: 14px; font-size: 20px; font-weight: 700; text-align: center; pointer-events: none; }
.mp-score { position: absolute; left: 50%; top: 90px; transform: translateX(-50%); z-index: 14; padding: 14px 18px; min-width: min(480px, 92vw); max-height: 70vh; overflow: auto; }
.mp-score h3 { margin: 0 0 8px; }
.mp-score table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-score th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--ink-2); padding: 3px 6px; }
.mp-score td { padding: 4px 6px; border-top: 1px solid var(--line); }
.mp-score td:nth-child(n+2), .mp-score th:nth-child(n+2) { text-align: center; }
.mp-score .me td { font-weight: 800; background: var(--accent-soft); }
.mp-score i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.mp-conn { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 30; background: #c62828; color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700; }
.play-start, .pause { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(20, 24, 32, 0.5); backdrop-filter: blur(3px); padding: 16px; }
.play-start[hidden], .pause[hidden], .mp-banner[hidden], .mp-score[hidden], .mp-conn[hidden], .mp-chat[hidden] { display: none; }
.play-start-card { background: #fff; padding: 28px 34px; border-radius: 18px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.pause-card { width: min(380px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.pause-card h2 { margin: 0; }
#toast-container { z-index: 120; }

.create { padding: 20px; margin-bottom: 26px; display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.create h2 { font-size: 20px; margin: 0; }
.create-row { display: flex; gap: 8px; }
.create-row .input { flex: 1; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); }
.chips button:hover { border-color: var(--accent); color: var(--accent-2); }
.grid-h { font-size: 18px; margin: 0 0 12px; }
@media (max-width: 560px) { .create-row { flex-direction: column; } }
