/* Wii U (WebKit 536) friendly stylesheet:
   no flexbox, no grid, no CSS variables, no object-fit. */

* { margin: 0; padding: 0; }

html, body {
  background: #0d0e12;
  color: #e9eaf0;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none; }

#browse {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 14px 48px 14px;
}

/* ---------------- header ---------------- */

#topbar {
  border-bottom: 1px solid #23242d;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

#titlerow { overflow: hidden; }

#topbar h1 {
  float: left;
  font-size: 23px;
  font-weight: bold;
  letter-spacing: 0.4px;
  color: #ffffff;
  margin: 4px 18px 0 2px;
}

#counter {
  float: right;
  color: #8a8c9c;
  font-size: 13px;
  line-height: 20px;
  margin-top: 9px;
  padding: 3px 12px;
  background: #171821;
  border: 1px solid #24252f;
  border-radius: 20px;
}

#tabs {
  clear: both;
  padding-top: 12px;
  white-space: nowrap;
  overflow-x: auto;
}

.tab {
  font-family: inherit;
  font-size: 15px;
  color: #c2c4d2;
  background: #171821;
  border: 1px solid #282a35;
  border-radius: 22px;
  padding: 9px 20px;
  margin: 0 8px 6px 0;
  cursor: pointer;
  -webkit-appearance: none;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.tab.on {
  background: #3568c8;
  border-color: #4b83e8;
  color: #ffffff;
  font-weight: bold;
}

/* ---------------- buttons ---------------- */

.btn {
  font-family: inherit;
  font-size: 16px;
  color: #ffffff;
  background: #22232d;
  border: 1px solid #363845;
  border-radius: 8px;
  padding: 12px 22px;
  cursor: pointer;
  -webkit-appearance: none;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* Touch screens: no hover, no text selection, a visible tap flash. */
.tile, .tab, .btn {
  -webkit-tap-highlight-color: rgba(75, 131, 232, 0.35);
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.btn:active { background: #3568c8; border-color: #4b83e8; }

.btn.off {
  color: #565868;
  background: #14151c;
  border-color: #1f2028;
}

/* ---------------- grid ---------------- */

#grid {
  font-size: 0;
  margin: 0 -7px;
}

.tile {
  display: inline-block;
  vertical-align: top;
  width: 238px;
  margin: 7px;
  background: #16171f;
  border: 1px solid #24252f;
  border-radius: 10px;
  padding: 7px;
  cursor: pointer;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.tile:active {
  border-color: #4b83e8;
  background: #1b1d28;
}

.thumb {
  position: relative;
  width: 100%;
  height: 152px;
  background-color: #08090d;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: 7px;
  overflow: hidden;
}

.thumb-audio {
  background-image: -webkit-linear-gradient(top, #22304d, #111520);
  background-image: linear-gradient(#22304d, #111520);
}

.thumb-audio .glyph {
  display: block;
  color: #7fa9e6;
  font-size: 54px;
  line-height: 152px;
  text-align: center;
}

.badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.66);
  color: #ffffff;
  font-size: 13px;
  line-height: 22px;
  padding: 0 9px;
  border-radius: 11px;
}

.name {
  font-size: 14px;
  color: #f1f2f8;
  margin: 8px 3px 3px 3px;
  height: 19px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.meta {
  font-size: 12px;
  color: #797b8b;
  margin: 0 3px 3px 3px;
  height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------------- footer / status ---------------- */

#sentinel {
  text-align: center;
  padding: 26px 0 8px 0;
}

#sentinel .btn { padding: 14px 34px; font-size: 17px; }

#endmsg {
  color: #6d6f7e;
  font-size: 13px;
  margin-top: 14px;
}

.box {
  display: none;
  background: #16171f;
  border: 1px solid #282a35;
  border-left: 3px solid #d0a03f;
  border-radius: 8px;
  padding: 13px 15px;
  margin: 0 0 16px 0;
  color: #c2c4d2;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}

.box.show { display: block; }

.box code {
  font-family: monospace;
  color: #ffd479;
  background: #0f1015;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ---------------- viewer ---------------- */

#viewer {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 14px 36px 14px;
}

#viewerbar {
  overflow: hidden;
  border-bottom: 1px solid #23242d;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

#viewerbar #back { float: left; }

#viewertitle {
  font-size: 17px;
  font-weight: bold;
  color: #ffffff;
  margin: 13px 150px 0 140px;
  height: 24px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

#viewerpos {
  float: right;
  color: #8a8c9c;
  font-size: 14px;
  margin-top: 14px;
}

#stage {
  text-align: center;
  min-height: 220px;
  background: #06070a;
  border: 1px solid #1e1f27;
  border-radius: 10px;
  padding: 10px;
}

#stage img {
  display: inline-block;
  max-width: 100%;
  max-height: 560px;
  vertical-align: middle;
}

#stage video {
  display: block;
  width: 100%;
  max-height: 560px;
  background: #000000;
}

#stage audio {
  display: inline-block;
  width: 92%;
  margin: 96px 0;
}

#stagenote {
  color: #b3b5c4;
  font-size: 15px;
  padding: 72px 20px;
  line-height: 1.6;
}

#stagenote a { color: #7fb2ff; }

/* Video being prepared by the server. */

.prep { padding: 54px 24px; text-align: center; }

.prep-title {
  color: #e9eaf0;
  font-size: 16px;
  font-weight: bold;
}

.prep .bar {
  width: 62%;
  max-width: 420px;
  height: 10px;
  margin: 16px auto 10px auto;
  background: #1b1d28;
  border: 1px solid #26283a;
  border-radius: 6px;
  overflow: hidden;
}

.prep .fill {
  width: 0;
  height: 10px;
  background: #3568c8;
}

.prep-pct { color: #9fb2d0; font-size: 13px; height: 18px; }

.prep-msg {
  color: #7f8296;
  font-size: 13px;
  line-height: 1.5;
  max-width: 460px;
  margin: 6px auto 0 auto;
}

#viewerfoot {
  margin-top: 16px;
  text-align: center;
}

#viewerfoot #itemprev { float: left; }
#viewerfoot #itemnext { float: right; }

#original {
  display: inline-block;
  color: #7fb2ff;
  font-size: 14px;
  margin-top: 14px;
  text-decoration: none;
}

/* ---------------- Wii U GamePad --------------
   The GamePad screen is 854x480 px (6.2", 16:9, 158 ppi). With the viewport
   meta tag the browser reports the real 854 px, and its URL bar plus toolbar
   eat about 80 px, leaving roughly 400 px of usable height. Everything below
   is sized for that: three tiles per row, tap targets of 44 px or more, and a
   viewer that fits without scrolling. */
@media screen and (max-width: 900px) {
  #browse { padding: 10px 10px 30px 10px; }
  #topbar { padding-bottom: 9px; margin-bottom: 10px; }
  #topbar h1 { font-size: 18px; margin: 9px 8px 0 2px; }
  #counter { font-size: 12px; line-height: 18px; margin-top: 9px; padding: 4px 11px; }
  #tabs { padding-top: 9px; }
  .tab { font-size: 15px; padding: 12px 20px; margin: 0 8px 6px 0; }

  #grid { margin: 0 -6px; }
  .tile { width: 31.5%; margin: 6px; padding: 6px; }
  .thumb { height: 146px; }
  .thumb-audio .glyph { line-height: 146px; font-size: 46px; }
  .name { margin: 7px 2px 2px 2px; height: 18px; }
  .meta { font-size: 11px; height: 15px; }
  .badge { left: 6px; bottom: 6px; }

  #sentinel { padding: 18px 0 6px 0; }

  #viewer { padding: 8px 8px 18px 8px; }
  #viewerbar { padding-bottom: 8px; margin-bottom: 8px; }
  #viewerbar #back { padding: 10px 16px; }
  #viewertitle { display: none; }
  #viewerpos { font-size: 13px; margin-top: 13px; }
  #stage { padding: 5px; min-height: 0; border-radius: 8px; }
  #stage img { max-height: 300px; }
  #stage video { max-height: 300px; }
  #stage audio { width: 88%; margin: 44px 0; }
  #stagenote { padding: 30px 14px; font-size: 14px; }
  .prep { padding: 28px 12px; }
  .prep .bar { width: 82%; margin: 12px auto 8px auto; }
  .prep-msg { font-size: 12px; }
  #viewerfoot { margin-top: 8px; }
  #viewerfoot .btn { font-size: 15px; padding: 11px 16px; }
  #original { font-size: 13px; margin-top: 12px; }
}

/* Very short viewport (browser toolbar visible): buy back vertical room. */
@media screen and (max-height: 470px) {
  #topbar h1 { margin-top: 6px; }
  #tabs { padding-top: 6px; }
  .tab { padding: 10px 16px; }
  #viewer { padding-top: 6px; }
  #stage img, #stage video { max-height: 252px; }
  #viewerfoot { margin-top: 6px; }
}

/* Phones and other narrow screens. */
@media screen and (max-width: 600px) {
  .tile { width: 46%; }
  .thumb { height: 120px; }
  .thumb-audio .glyph { line-height: 120px; font-size: 40px; }
}
