/* The game's own stylesheet (/css/game.css) draws the window; this only places it on a page instead of a game screen. */
html, body { overflow: auto; height: auto; min-height: 100%; }
body { margin: 0; background: #326395; color: var(--white); user-select: text; -webkit-user-select: text; display: flex; align-items: center; justify-content: center; min-height: 100vh; }

/* the game's own leaderboard window (same size, padding, title tag and search placement), just centred on the page */
#leaderboard.popup-box {
  display: block; position: relative; left: auto; top: auto; transform: none; z-index: 1;
  width: 728px; box-sizing: content-box;
  margin: 40px auto; padding: 30px 24px 14px 24px;
}
#leaderboard .pop-title { white-space: nowrap; }
#leaderboard-search { gap: 8px; margin-top: 14px; margin-bottom: 4px; }
#leaderboard-periods { height: 30px; }
#leaderboard-title { margin-bottom: 0; }
/* each player is a pill, like the game's ranking rows */
#leaderboard-ranking .ranking-box { background: var(--brown1); }
#leaderboard-ranking .ranking-box:hover { background: #a85d30; }
#leaderboard-search .input { margin: 0; width: 280px; height: 38px; padding: 0 12px; font-size: 20px; text-align: left; border-width: 5px; box-shadow: inset 0 6px 0 #e0c6a0; }
#leaderboard-search .yellow-button { margin-left: auto; white-space: nowrap; }
#leaderboard-title { font-size: 22px; }
#count { margin: 0 0 4px auto; font-size: 16px; color: var(--beige1); }
#leaderboard-ranking .ldb-row { min-height: 36px; }
#leaderboard-ranking .ldb-name .note { margin-left: 10px; font-size: 13px; color: var(--beige1); }
#leaderboard-ranking .ldb-name { line-height: 22px; }
#leaderboard-ranking .ldb-score { color: var(--yellow0); }
#empty { color: var(--beige1); }
#empty[hidden] { display: none; }
.ldb-badge-title .ldb-badge, .ldb-row .ldb-badge { display: block; margin: -3px auto -3px auto; }
.ldb-cell.ldb-badge-title { display: flex; align-items: center; justify-content: center; }
#addBadge { display: inline-block; margin: 0 0 0 4px; vertical-align: middle; }

/* tier filter chips: the game's own .ldb-chip */
#chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 2px 4px 8px 4px; }
#chips .ldb-chip { border: 0; font-family: inherit; justify-content: center; padding: 2px 4px; }
#chips .ldb-chip img { margin-right: 4px; }

/* forms on the admin page */
.background-popupbox form, form.background-popupbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px; width: 100%; box-sizing: border-box; }
form.background-popupbox .input { margin: 0; height: 38px; font-size: 18px; border-width: 5px; width: auto; flex: 1 1 160px; min-width: 0; text-align: left; padding: 0 10px; box-shadow: inset 0 6px 0 #e0c6a0; }
form.background-popupbox select.input { flex: 0 0 150px; }
button.yellow-button { font-family: inherit; font-size: 16px; color: var(--white); }
.error { flex-basis: 100%; min-height: 1.2em; color: var(--yellow0); font-size: 15px; }
.to-public { position: static; width: auto; margin: 12px 0 0; font-size: 15px; }
.to-public a { color: var(--beige1); }

/* admin buttons inside a row */
.actions { display: flex; gap: 6px; padding-right: 4px; }
.actions button { font-family: inherit; font-size: 13px; padding: 0 8px; height: 22px; line-height: 17px; color: var(--white); border: 3px solid var(--black); border-radius: 6px; cursor: pointer; }
.actions .edit-btn { background: var(--yellow1); box-shadow: inset 0 -3px 0 var(--orange0); }
.actions .del-btn { background: #d8402e; box-shadow: inset 0 -3px 0 var(--red2); }
.ldb-row.editing { flex-wrap: wrap; }
.ldb-row .edit { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 6px; }
.ldb-row .edit .input { margin: 0; height: 30px; font-size: 16px; border-width: 4px; box-shadow: inset 0 4px 0 #e0c6a0; flex: 1 1 140px; min-width: 0; text-align: left; padding: 0 8px; }
.ldb-row .edit select.input { flex: 0 0 140px; }
.ldb-row .edit .yellow-button { height: 30px; padding: 0 12px; }

#login.background-popupbox { width: 330px; margin: 10px auto; }
.ldb-row .edit .wide { flex-basis: 100%; display: flex; gap: 6px; align-items: center; }
.ldb-row .edit .wide .input { flex: 1 1 auto; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  #leaderboard.popup-box { zoom: 0.62; }
}
@media (max-width: 480px) {
  #leaderboard.popup-box { zoom: 0.5; }
}

/* moving background (bg.js) */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* the list box spans the whole window and fills it down to the bottom padding (the game's left tab column is not used here) */
#leaderboard-periods { width: 100%; margin-left: 0; }
#main-leaderboard { width: 100%; margin-left: 0; height: 389px; box-sizing: border-box; }
#leaderboard-search { margin-left: 0; width: auto; justify-content: center; }

/* the search bar sits in the "Skill ranking" row, between the title and the player count; the tag at the top left gets its own space */
#leaderboard.popup-box { padding-top: 24px; }
#leaderboard-periods { height: 46px; align-items: center; }
#leaderboard-periods #leaderboard-search { margin: 0 auto; flex: none; }
#leaderboard-periods #count { margin: 0 4px 0 0; }

/* breathing room: nothing sits flush against its neighbour */
#leaderboard-periods { margin-bottom: 8px; }
#chips { padding-bottom: 8px; margin-bottom: 6px; }
#leaderboard-header { margin-top: 2px; margin-bottom: 5px; }

/* grades share one centre line, header included */
#leaderboard .ldb-score { width: 80px; padding: 0; text-align: center; }
#leaderboard-ranking .actions { margin-left: 8px; }
#leaderboard-header { padding-right: 8px; }   /* lines the header up with the rows, which are narrowed by the scrollbar */

/* no "Skill ranking" text; the search bar and player count are the top row */
#leaderboard-title { display: none; }
#leaderboard .pop-title { top: 17px; }   /* the RANKING tag is level with the search bar */
#leaderboard-periods { margin-bottom: 28px; }   /* the top row sits 20px higher, clear of the list box */
#leaderboard-periods { position: relative; top: 5px; }   /* search bar and player count 5px lower */

/* admin: the top row (search, sign out, count) sits level with the tag, the add form comes under it */
.error:empty { display: none; }
#login.background-popupbox { margin-top: 14px; }
#add.background-popupbox { margin: 0 0 10px; }
body[data-page="admin"] #leaderboard-header { padding-right: 145px; }   /* room for each row's Edit / Remove buttons, so "Skill" stays over the grades */

/* disclaimer: its own line directly under the window (the body stacks the window and this notice, centred) */
body { flex-direction: column; }
#leaderboard.popup-box { margin-bottom: 14px; }
#disclaimer { position: static; z-index: 1; width: 788px; max-width: calc(100% - 32px); margin: 0 0 24px; padding: 8px 14px; box-sizing: border-box; text-align: center; font-size: 12px; line-height: 16px; color: #fff; background: none; border-radius: 0; text-shadow: none; }

/* ---- left panel: the game's "Featured Video" box with a tamer chatting under it ---- */
#stage { position: relative; }
#side { position: absolute; left: calc(100% + 48px); top: 100px; display: flex; flex-direction: row; align-items: flex-end; gap: 20px; }
#featured-video { margin: 0; height: auto; padding-bottom: 8px; }
#featured-video a { display: block; }
#featured-video-img { display: block; aspect-ratio: 16 / 9; object-fit: cover; background: var(--black1); }
#featured-video-title { margin: 6px 2px 0; font-size: 12px; line-height: 15px; color: var(--white); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#featured-video-next { margin: 6px 0 0; font-size: 12px; text-align: right; color: var(--yellow0); cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; user-select: none; }
#featured-video-next:hover { color: var(--white); }
#tamer { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 240px; }
/* the chat bubble, measured from the game: solid #3a322b, no outline, small rounded corners, regular cream (#f0e4d0) Rowdies text at about 15px */
#tamer-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -11px; border: 11px solid transparent; border-top-color: #3a322b; border-bottom-width: 0; }
#tamer-bubble { position: relative; flex: none; width: auto; max-width: 100%; min-width: 0; box-sizing: border-box; padding: 11px 14px; background-color: #3a322b; color: #f0e4d0; border: 0; border-radius: 9px; font-weight: 400; letter-spacing: 0; font-size: 20px; line-height: 25px; text-align: center; word-wrap: break-word; }
#tamer-img { flex: none; width: 168px; height: 184px; object-fit: contain; cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; user-select: none; }   /* the same size as the featured-video box */

/* ---- the ? button and the criteria window ---- */
#help-button { flex: none; width: auto; height: auto; box-sizing: border-box; margin: 0 0 4px 10px; padding: 3px 10px 7px; font-size: 14px; line-height: 16px; white-space: nowrap; }
#criteria, #reason { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); }
#criteria-box.popup-box, #reason-box.popup-box { position: relative; left: auto; top: auto; transform: none; width: 560px; max-width: calc(100vw - 48px); box-sizing: border-box; padding: 64px 22px 22px; }
#criteria-box .pop-title, #reason-box .pop-title { top: 10px; left: -34px; }
#criteria-intro { margin: 0 0 10px 6px; font-size: 16px; color: var(--beige1); }
#criteria-list { display: block; height: auto; max-height: min(380px, calc(100vh - 220px)); padding: 6px 5px; width: 100%; box-sizing: border-box; }
.crit-row { align-items: center; }
.crit-row .crit-grade { width: 56px; padding: 0; text-align: center; color: var(--yellow0); }
.crit-row .crit-text { flex: 1; min-width: 0; height: auto; padding: 4px 8px 4px 4px; text-align: left; white-space: normal; overflow: visible; line-height: 18px; }

/* ---- admin: criteria and tamer settings ---- */
#settings { display: block; margin: 0 0 10px; padding: 10px; width: 100%; box-sizing: border-box; }
#settings summary { cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; font-size: 18px; color: var(--white); user-select: none; }
#settings label, #settings .settings-label { display: block; margin: 10px 0 6px 2px; font-size: 15px; color: var(--beige1); }
#tamerText { display: block; width: 100%; height: auto; margin: 0; padding: 8px 10px; font-size: 16px; text-align: left; resize: vertical; box-sizing: border-box; border-width: 5px; box-shadow: inset 0 6px 0 #e0c6a0; }
.crit-edit { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.crit-edit .ldb-badge { width: 28px; margin: 0; flex: none; }
.crit-edit .crit-grade { width: 36px; flex: none; font-size: 16px; color: var(--yellow0); text-align: center; }
.crit-edit .input { margin: 0; flex: 1; min-width: 0; height: 32px; font-size: 15px; border-width: 4px; padding: 0 10px; text-align: left; box-shadow: inset 0 4px 0 #e0c6a0; }
.settings-save { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.settings-save .error { flex: none; }

/* not enough room beside the window: the panel goes inside it, in a row on top */
@media (max-width: 1600px) {
  #side { position: static; width: auto; flex-direction: row; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 14px 18px; margin: 0 0 14px 0; padding-top: 10px; }
  #tamer { margin-top: 0; width: 240px; }
}

/* ---- the ? on a player's row, and the window it opens ---- */
.ldb-cell.why-cell { height: 32px; line-height: 1; overflow: visible; width: 44px; padding: 0 8px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.why-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-width: 0; box-sizing: border-box; margin: 0; padding: 0 0 3px; border-width: 4px; border-radius: 50%; font-size: 17px; line-height: 1; color: var(--white); text-align: center; overflow: visible; }
#reason-box.popup-box { width: 440px; padding: 70px 26px 26px; }
#reason-who { margin: 0 0 10px 4px; font-size: 20px; color: var(--yellow0); }
#reason-text { margin: 0; padding: 12px 14px; background: var(--brown2); border-radius: 8px; font-size: 17px; line-height: 24px; color: var(--white); word-wrap: break-word; white-space: pre-wrap; }
body[data-page="admin"] #search { width: 200px; }   /* the admin row also holds Sign out, the count and Criteria, so the box is shorter and stays clear of the tag */

/* ---- staff: requests, editors, change log, backups ---- */
#queue, #team, #logbox, #backups { display: block; margin: 0 0 10px; padding: 10px; width: 100%; box-sizing: border-box; }
#queue summary, #team summary, #logbox summary, #backups summary { cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; font-size: 18px; color: var(--white); user-select: none; }
.staff-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 320px; overflow-y: auto; }
.staff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 8px; background: var(--brown2); border-radius: 8px; font-size: 15px; color: var(--white); }
.staff-row .staff-info { flex: 1 1 200px; min-width: 0; word-wrap: break-word; }
.staff-row .staff-info span { color: var(--beige1); }
.staff-row .input { margin: 0; height: 30px; font-size: 15px; border-width: 4px; box-shadow: inset 0 4px 0 #e0c6a0; flex: 1 1 140px; min-width: 0; text-align: left; padding: 0 8px; }
.staff-row select.input { flex: 0 0 110px; }
.staff-row .yellow-button { height: 30px; padding: 0 12px; }
.staff-row .tag { padding: 0 6px; border-radius: 6px; background: var(--yellow0); color: var(--black); font-size: 13px; }
.staff-empty { padding: 8px 4px; font-size: 15px; color: var(--beige1); }
.staff-add { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.staff-add .input { margin: 0; height: 34px; flex: 1; min-width: 0; }
.staff-msg { margin-top: 8px; font-size: 15px; color: var(--yellow0); word-wrap: break-word; user-select: text; }
.staff-msg:empty { display: none; }
.staff-msg b { color: var(--white); font-size: 17px; letter-spacing: 1px; }
#whoami { margin-right: 10px; color: var(--yellow0); }
#loginName { margin-bottom: 8px; }

/* ---- "Get ranked" ---- */
#submit-button { flex: none; width: auto; height: auto; box-sizing: border-box; margin: 0 0 4px 10px; padding: 3px 10px 7px; font-size: 14px; line-height: 16px; white-space: nowrap; }
#submit { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); }
#submit-box.popup-box { position: relative; left: auto; top: auto; transform: none; width: 440px; max-width: calc(100vw - 48px); box-sizing: border-box; padding: 70px 26px 26px; }
#submit-box .pop-title { top: 10px; left: -34px; }
#submit-intro { margin: 0 0 10px 6px; font-size: 16px; color: var(--beige1); }
#submit-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
#submit-form .input { margin: 0; width: 100%; box-sizing: border-box; }
#submit-form .error { flex-basis: auto; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* the small staff buttons wear the game's own button look: thick dark outline, a coloured lip along the bottom, upper-case, pressed down on click */
.staff-row button.edit-btn, .staff-row button.del-btn, .staff-row a.edit-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 32px; padding: 0 14px 4px; font-family: inherit; font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--white); text-decoration: none; white-space: nowrap; border: 4px solid var(--black); border-radius: 6px; cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; user-select: none; }
.staff-row .edit-btn { background: var(--yellow1); box-shadow: inset 0 -5px 0 var(--orange0); }
.staff-row .edit-btn:hover { background: var(--yellow0); }
.staff-row .edit-btn:active { background: var(--orange1); box-shadow: inset 0 5px 0 var(--orange2); }
.staff-row .del-btn { background: #d8402e; box-shadow: inset 0 -5px 0 var(--red2); }
.staff-row .del-btn:hover { background: #e2533f; }
.staff-row .del-btn:active { background: var(--red2); box-shadow: inset 0 5px 0 #5e140b; }
.staff-row { gap: 8px 8px; }
#submit-form .input { height: 40px; font-size: 17px; text-align: left; padding: 0 10px; }
#submit-intro { text-align: left; }
#submit-form { height: auto; }
#submit-form > * { flex: none; }
#submit-form button { align-self: center; }

/* keep the search clear of the RANKING / ADMIN tag that sits over the window's left edge */
#leaderboard-periods { box-sizing: border-box; padding-left: 140px; }
body[data-page="public"] #leaderboard-search .input { width: 240px; }
#count { white-space: nowrap; }
#leaderboard-periods { padding-left: 128px; }
body[data-page="public"] #leaderboard-search .input { width: 220px; }

/* wide screens: the featured video stays on the right of the window, the tamer stands on the left, both centred on the window's height */
@media (min-width: 1601px) {
  #side { display: contents; }
  #featured-video { position: absolute; left: calc(100% + 48px); top: calc(50% + 13px); transform: translateY(-50%); }
  #tamer { position: absolute; right: calc(100% + 48px); top: calc(50% + 13px); transform: translateY(-50%); }
  #tamer-bubble { position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; }   /* the bubble floats above him, so it is he who is centred */
}

/* ---- clips ---- */
#subClipLabel { margin: 4px 0 0 2px; font-size: 14px; line-height: 17px; color: var(--beige1); }
#submit-form .file { width: 100%; box-sizing: border-box; padding: 6px; font-family: inherit; font-size: 14px; color: var(--white); background: var(--brown2); border: 4px solid var(--black); border-radius: 6px; }
.clip-holder { flex-basis: 100%; }
.clip-video { display: block; width: 100%; max-width: 560px; border: 4px solid var(--black); border-radius: 6px; background: #000; }
#submit { align-items: flex-start; overflow-y: auto; padding: 24px 0; box-sizing: border-box; }
#submit-box.popup-box { margin: auto; }

/* ---- likely spam ---- */
.spam-box { margin-top: 10px; padding: 8px; background: rgba(0, 0, 0, 0.18); border-radius: 8px; }
.spam-box > summary { cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; font-size: 16px; color: var(--yellow0); user-select: none; }
.spam-box > .staff-row { margin-top: 6px; }
.spam-row { box-shadow: inset 4px 0 0 #d8402e; }
.spam-tag { background: #d8402e !important; color: var(--white) !important; }
.staff-info .tag { margin-left: 8px; display: inline-block; }

/* ---- site activity ---- */
#activity { display: block; margin: 0 0 10px; padding: 10px; width: 100%; box-sizing: border-box; }
#activity summary { cursor: url(/img/interface/cursor-pointer.png) 16 0, pointer; font-size: 18px; color: var(--white); user-select: none; }
.act-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.act-tile { flex: 1 1 100px; padding: 8px 10px; background: var(--brown2); border-radius: 8px; text-align: center; }
.act-big { font-size: 28px; line-height: 32px; color: var(--yellow0); }
.act-title { font-size: 14px; color: var(--white); }
.act-small { font-size: 12px; color: var(--beige1); }
.act-note { margin: 8px 2px 0; font-size: 12px; color: var(--beige1); }
.act-label { margin: 12px 2px 4px; font-size: 14px; color: var(--beige1); }
.act-bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 6px; background: var(--brown2); border-radius: 8px; box-sizing: border-box; }
.act-bar { flex: 1; min-width: 2px; background: var(--yellow1); border-radius: 2px 2px 0 0; }
.act-hours .act-bar { background: var(--orange0); }
.act-cols { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.act-col { flex: 1 1 160px; }
.act-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; margin-bottom: 3px; background: var(--brown2); border-radius: 6px; font-size: 14px; color: var(--white); }
.act-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
