/* The clickable ELXR preview on the games site (client.js builds it). Drawn at the app's own
   1280 x 760 and scaled to fit; colours and sizes follow launcher/scripts/look.gd. */
.demo-wrap { position: relative; width: 100%; margin-top: -96px; z-index: 1; }
/* A tab on the frame says it is live: the one yellow mark besides Play. */
.demo-wrap::before { content: "Live preview: click anything"; position: absolute; left: 16px; top: -28px; height: 28px; padding: 0 12px;
  display: flex; align-items: center; background: var(--accent); color: var(--ink); font-size: 13px; font-weight: 600;
  border-radius: 4px 4px 0 0; z-index: 2; }
.demo-wrap { cursor: pointer; scroll-margin-top: 120px; }
.demo-hint { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--dim); }
.demo-stage {
  --bg: #12110f; --panel: #1c1a18; --raised: #262421; --hover: #2f2c28; --line: #34312c; --text: #efe9de;
  --head: #f6f1e7; --dim: #aaa398; --accent: #e3b23c; --ink: #16120a; --info: #9aacbf; --quiet: #3a3631; --good: #7fb487;
  position: absolute; left: 0; top: 0; width: 1280px; height: 760px; transform-origin: 0 0; overflow: hidden;
  background: var(--bg); color: var(--text); font: 400 14px/1.4 "Barlow", sans-serif;
  border: 1px solid rgba(239, 233, 222,.14); border-radius: 8px; box-shadow: 0 24px 64px rgba(0,0,0,.55);
  display: grid; grid-template-rows: 56px 1fr; user-select: none;
}
.demo-stage button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.demo-stage .cap { font: 600 11px/1 "Barlow", sans-serif;  color: var(--dim); }

/* Top bar */
.d-top { display: flex; align-items: center; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.d-top .logo { height: 20px; margin-right: auto; }
.d-top .lnk { font: 600 13px/1 "Barlow", sans-serif;  color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.d-top .lnk:hover, .d-top .lnk.on { color: var(--head); }
.d-top .lnk svg { width: 15px; height: 15px; fill: currentColor; }
.d-top .sep { width: 1px; height: 24px; background: var(--line); }
.d-top .me { font: 600 14px/1 "Barlow", sans-serif; color: var(--head); }
.d-top .box { height: 32px; padding: 0 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); font: 600 11px/1 "Barlow", sans-serif;  color: var(--text); }
.d-top .box:hover { background: var(--hover); }
.d-top .win { width: 16px; height: 16px; color: var(--dim); display: grid; place-items: center; }
.d-top .win:hover { color: var(--head); }

/* Body */
.d-body { position: relative; display: grid; grid-template-columns: 264px 1fr 300px; min-height: 0; }
.d-body.nofriends { grid-template-columns: 264px 1fr 0; }
.d-rail { padding: 32px 24px; border-right: 1px solid var(--line); background: var(--bg); }
.d-rail .cap { display: block; margin-bottom: 20px; }
.demo-stage .d-tile { position: relative; display: block; width: 216px; height: 96px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--raised) center / cover no-repeat; }
.demo-stage .d-tile.on { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.d-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(18,17,15,.85), rgba(18,17,15,0) 70%); }
.d-tile span { position: absolute; left: 16px; bottom: 12px; font: 600 15px/1 "Barlow", sans-serif; color: var(--head); }
.d-tile .band { position: absolute; right: -36px; top: 14px; width: 140px; height: 18px; transform: rotate(32deg); background: var(--accent); color: var(--ink); font: 600 10px/18px "Barlow", sans-serif; text-align: center; }

.d-page { position: relative; overflow: hidden; background: var(--panel) center / cover no-repeat; }
.d-page::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,17,15,.55), rgba(18,17,15,0) 70%), linear-gradient(0deg, rgba(18,17,15,.85), rgba(18,17,15,0) 45%); }
.d-page > * { position: relative; }
.d-page .glogo { position: absolute; left: 48px; top: 32px; height: 70px; }
.d-page .gname { position: absolute; left: 48px; top: 40px; font: 600 64px/1 "Barlow Condensed", sans-serif; letter-spacing: .04em; color: var(--head); }
.d-page .tag { position: absolute; left: 48px; top: 122px; font: 600 13px/1 "Barlow", sans-serif;  color: rgba(246, 241, 231,.85); }
.d-page .row { position: absolute; left: 48px; bottom: 48px; display: flex; align-items: center; gap: 8px; }
.d-play { width: 240px; height: 56px; border-radius: 3px; background: var(--accent) !important; color: var(--ink) !important; font: 600 22px/1 "Barlow", sans-serif !important; }
.d-play:hover { filter: brightness(1.07); }
.d-play[disabled] { background: var(--raised) !important; color: var(--dim) !important; cursor: default; font-size: 17px !important; }
.d-more { width: 56px; height: 56px; border: 1px solid var(--line) !important; border-radius: 3px; background: var(--raised) !important; font-weight: 700 !important; letter-spacing: 2px; }
.d-more:hover { background: var(--hover) !important; }
.d-page .state { margin-left: 16px; color: var(--dim); font-size: 13px; }

.d-friends { padding: 28px 24px; border-left: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.d-body.nofriends .d-friends { display: none; }
.d-friends .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.d-friends .head small { color: var(--dim); font-size: 12px; margin-left: auto; margin-right: 12px; }
.d-add { display: flex; gap: 8px; margin-bottom: 28px; }
.d-add input { flex: 1; height: 40px; min-width: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); color: var(--text); font: 400 14px "Barlow", sans-serif; }
.d-add input:focus { outline: 1px solid var(--accent); }
.d-add button { height: 40px; padding: 0 14px; border: 1px solid var(--line) !important; border-radius: 3px; background: var(--raised) !important; font: 600 11px/1 "Barlow", sans-serif !important; }
.d-group { margin: 0 0 8px; }
.d-friend { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; margin: 0 -8px 4px; border-radius: 3px; text-align: left; }
.d-friend:hover { background: var(--raised); }
.d-friend i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-friend b { display: block; font-weight: 600; color: var(--head); }
.d-friend em { font-style: normal; font-size: 12px; color: var(--dim); }
.d-friend em.play { color: var(--info); }
.d-friend .grow { flex: 1; min-width: 0; }
.d-friend .n { color: var(--accent); font-weight: 600; font-size: 12px; }
.d-friend .dots { color: var(--dim); letter-spacing: 2px; padding: 0 4px; }
.d-friend .dots:hover { color: var(--head); }

/* Chat window */
.d-chat { position: absolute; right: 312px; bottom: 16px; width: 320px; height: 420px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.45); z-index: 4; }
.d-body.nofriends .d-chat { right: 16px; }
.d-chat .h { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--line); }
.d-chat .h i { width: 8px; height: 8px; border-radius: 50%; }
.d-chat .h div { flex: 1; }
.d-chat .h b { display: block; font-size: 16px; color: var(--head); font-weight: 600; }
.d-chat .h em { font-style: normal; font-size: 12px; color: var(--dim); }
.d-chat .h button { width: 32px; height: 32px; color: var(--dim); }
.d-chat .h button:hover { color: var(--head); }
.d-chat .msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.d-chat .msg { max-width: 80%; padding: 8px 12px; border-radius: 8px; background: var(--raised); color: var(--text); align-self: flex-start; }
.d-chat .msg.me { align-self: flex-end; background: var(--line); color: var(--head); }
.d-chat .msg + .msg.me, .d-chat .msg.me + .msg:not(.me) { margin-top: 8px; }
.d-chat .join { align-self: flex-start; height: 36px; padding: 0 16px; border-radius: 3px; background: var(--accent) !important; color: var(--ink) !important; font: 600 12px/1 "Barlow", sans-serif !important; margin: 4px 0 8px; }
.d-chat form { display: flex; gap: 8px; padding: 0 16px 16px; }
.d-chat input { flex: 1; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); color: var(--text); font: 400 14px "Barlow", sans-serif; }
.d-chat input:focus { outline: 1px solid var(--accent); }
.d-chat form button { width: 40px; color: var(--dim); }

/* Menus, dialogs, the note at the foot */
.d-menu { position: absolute; z-index: 6; min-width: 180px; padding: 4px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.d-menu button { display: block; width: 100%; padding: 8px 12px; text-align: left; border-radius: 2px; color: var(--text); }
.d-menu button:hover { background: var(--hover); }
.d-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.d-modal { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.d-modal .card { width: 640px; max-height: 600px; overflow: auto; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.d-modal h3 { margin: 0 0 20px; font: 600 20px/1 "Barlow", sans-serif;  color: var(--head); }
.d-modal .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.d-modal label.chk { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; color: var(--text); cursor: pointer; }
.d-modal label.chk input { accent-color: var(--accent); margin-top: 2px; }
.d-modal .field { display: block; margin-bottom: 14px; }
.d-modal .field span { display: block; margin-bottom: 6px; }
.d-modal .field input, .d-modal select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--raised); color: var(--text); font: 400 14px "Barlow", sans-serif; box-sizing: border-box; }
.d-modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.d-modal .foot button { height: 40px; min-width: 120px; padding: 0 16px; border-radius: 3px; border: 1px solid var(--line) !important; background: var(--raised) !important; font: 600 12px/1 "Barlow", sans-serif !important; }
.d-modal .foot button.go { background: var(--accent) !important; color: var(--ink) !important; border-color: transparent !important; }
.d-modal .note { color: var(--dim); }
.d-modal .ver { margin: 20px 0 6px; font: 600 15px/1 "Barlow", sans-serif; color: var(--head); }
.d-modal ul { margin: 0; padding-left: 18px; color: var(--text); }
.d-modal li { margin-bottom: 6px; }
.d-toast { position: absolute; left: 50%; bottom: 24px; z-index: 9; transform: translate(-50%, 8px); opacity: 0; padding: 12px 20px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; color: var(--text); transition: opacity 160ms, transform 160ms; pointer-events: none; }
.d-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Phones: the still picture instead (the app is a desktop app). */
.demo-still { display: none; width: 100%; height: auto; border: 1px solid rgba(239, 233, 222,.14); border-radius: 8px; }
@media (max-width: 900px) {
  .demo-wrap { display: none; }
  .demo-hint { display: none; }
  .actions a.try { display: none; }
  .demo-still { display: block; margin-top: -48px; }
}
