body {
  background: #222;
  font-family: Arial, sans-serif;
  font-size: 12pt;
  margin: 0px;
  padding-top: 80px;
  padding-bottom: 40px;
}

.button {
  display: inline-block;
  border: 1px #444 solid;
  text-decoration: none;
  color: #ccc;
  padding: 8px 12px;
  background: rgba(25,25,25,.9);
  cursor: pointer;
  margin-top: 5px;
  font-size: 10pt;
}

.button:hover {
  color: #fff;
  border: 1px #666 solid;
}

.mana {
  margin-right: 2px;
  filter: drop-shadow(0 0 1px black);
}

span.mana {
  color: #000;
  background: #ccc;

  display: inline-block;
  text-align: center;
  vertical-align: middle;
  border-radius: 50%;
  padding: 1px;

  font-weight: bold;

  font-size: 12pt;
  width: 18px;
  height: 18px;

  margin-bottom: 12px;
}

img.mana {
  height: 20px;
  width: 20px;
}

div.ability {
  padding: 2px;
  margin: 10px;
  display: flex;
}

div.ability span.ability-icon {
  border: 1px #444 solid;
  border-radius: 5px;
  padding: 5px;
  height: 20px;
  width: 30px;
  min-width: 30px;
  font-size: 10pt;
  font-weight: bold;
  text-align: center;
  color: #fff;
}

div.ability span.ability-text {
  background: #222;
  border-radius: 5px;
  padding: 5px;
  width: 100%;
  margin-left: 10px;
}


/* navigation bar */
#navbar {
  color: #fff;
  position: fixed;
  width: 100%;
  top: 0px;
  background-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,.7));
  border-bottom: 1px #333 solid;
  box-shadow: 0px 0px 10px #000;
  z-index: 3;
}

#navbar #search { width: calc(100% - 1560px); }

#navbar div.barsection {
  display: inline-block;
  font-weight: bold;
  color: #aaa;
  padding: 10px;
  font-size: 10pt;
}

#navbar div.barsection img {
  margin: 5px 5px 0px 0px;
  border: 2px #444 solid;
  border-radius: 50%;
  padding: 1px;
  height: 24px;
}

#navbar div.barsection img:hover {
  border: 2px #aaa solid;
}

#navbar div.barsection input {
  display: inline-block;
  border: 1px #444 solid;
  color: #ccc;
  padding: 8px 12px;
  background: rgba(25,25,25,.9);
  cursor: pointer;
  margin-top: 5px;
  width: calc(100% - 20px);
}

#navbar div.barsection span.filter {
  display: none;
}

#navbar div.barsection span.selected {
  background: rgba(50,50,50,.9);
  border: 1px #3fc solid !important;
}

#navbar div.barsection img.selected {
  border: 2px #3fc solid;
}

/* result count display */
#results {
  z-index: 3;
  position: fixed;
  width: 100%;
  bottom: 0;

  padding: 10px;
  border-top: 1px #444 solid;
  background-image: linear-gradient(to bottom, rgba(0,0,0,.7), rgba(0,0,0,1));
  color: #fff;
  font-size: 12pt;
  text-align: center;
  box-shadow: 0px 0px 10px #000;
  font-size: 10pt;
}

#results span {
  color: #3fc;
  font-weight: bold;
}

/* card overview */
#viewport {
  text-align: center;
  margin: 10px;
  width: calc(100% - 55px);
}

#viewport div.card {
  display: inline-block;
  border: 1px #333 solid;
  background: #000;
  margin: 2px;
  padding: 5px;
}

#viewport div.card:hover {
  border: 1px #aaa solid;
}

#viewport div.card:hover div.card-title {
  color: #fff;
}

#viewport div.card-image {
  width: 126px;
  height: 176px;
  background-size: 131px 183px;
  background-position: center
}

#viewport div.card-title {
  margin-top: 5px;
  color: #ccc;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 126px;
  font-size: 10pt;
  font-weight: 100;
}

/* deck builder */
#deckbuilder {
  z-index: 2;
  position: fixed;
  top: 0;
  right: -50px;
  height: 100%;

  border: 1px #333 solid;
  width: 60px;
  background: #111;
  transition: width .5s;
  color: #fff;
}

#deckbuilder #decks-toolbar {
  text-align: right;
  margin-top: 68px;
  padding: 5px 10px;
  padding-right: 55px;
  color: #fff;
  background: #0a0a0a;
  display: block;
  border-bottom: 1px #333 dashed;
}

#deckbuilder span.decklist {
  display: inline-block;
  border: 1px #4fc solid;
}

#deckbuilder #deckbuilder-toggle {
  z-index: -2;
  display: block;
  position: relative;
  margin: 40px 0;

  cursor: pointer;

  font-size: 10pt;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #111;
  color: #fff;
  padding: 10px 10px 5px 10px;
  width: 80px;
  text-align: center;

  position: absolute;
  top: 50%;
  left: 0;

  transform-origin:left bottom;
  transform: rotate(-90deg);

  border-top: 1px #333 solid;
  border-left: 1px #333 solid;
  border-right: 1px #333 solid;
  border-bottom: 1px #111 solid;
}

#deckbuilder #deckbuilder-toggle:hover {
  color: #3fc;
}

#deckbuilder div.deck {
  padding: 10px;
  border-bottom: 1px #333 dashed;
  clear: both;
}

#deckbuilder div.deck-drag {
  background: #1a1a1a;
  color: #3fc;
}

#deckbuilder div.deck-header {
  padding: 5px;
  cursor: pointer;
  margin-right: 50px;
}

#deckbuilder div.deck-header:hover > span.deck-title {
  color: #3fc;
}

#deckbuilder span.deck-title {
  font-size: 24pt;
}

#deckbuilder span.deck-rename {
  float: right;
  cursor: pointer;
  margin-left: 10px;
  color: #555;
  font-size: 18pt;
}

#deckbuilder span.deck-rename:hover {
  color: #3fc;
}

#deckbuilder span.deck-delete {
  float: right;
  cursor: pointer;
  margin-left: 10px;
  color: #555;
  font-size: 14pt;
}

#deckbuilder span.deck-delete:hover {
  color: #f55;
}

#deckbuilder div.deck-decksize {
  font-size: 12pt;
  margin: 0px 10px 10px 10px;
}

#deckbuilder div.deck-card {
  padding: 10px;
  margin: 5px 50px 5px 5px;
  clear: both;
  display: flex;
}

#deckbuilder div.deck-card:hover > span.deck-card-remove {
  color: #f55;
}

#deckbuilder span.deck-card-count {
  display: inline-block;
  height: 20px;
  width: 20px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  margin: 0px 5px;
  text-shadow: 0 0 3px black,0 0 3px black,0 0 3px black;
}

#deckbuilder span.deck-card-remove {
  cursor: pointer;
  display: inline-block;
  height: 20px;
  width: 20px;
  font-weight: bold;
  text-align: center;
  color: #555;
  text-shadow: 0px 0px 2px black;
  margin: 0px;
}

#deckbuilder span.deck-card-label {
  display: inline-block;
  color: #fff;
  text-shadow: 0 0 3px black,0 0 3px black,0 0 3px black;
  font-size: 12pt;
  font-weight: bold;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

#deckbuilder span.deck-card-label:hover {
  text-decoration: underline;
  cursor: pointer;
}

#deckbuilder span.deck-card-mana {
  max-height: 20px;
  text-align: right;
  white-space: nowrap;
}

#deckbuilder div.deck-costarea {
  text-align: center;
  padding: 20px;
}

#deckbuilder div.deck-costview {
  display: table;
  margin: auto;
  padding-right: 20px;
}

#deckbuilder div.deck-costrow {
  display: table-row;
}

#deckbuilder span.deck-costlabel {
  display: table-cell;
  width: 25px;
  color: #555;
  text-align: center;
  font-weight: bold;
  font-size: 10pt;
}

#deckbuilder span.deck-costbar {
  display: table-cell;
  vertical-align: bottom;
  text-align: center;
  padding-bottom: 5px;
}

#deckbuilder span.deck-costbarval {
  display: block;
  background: #3fc;
  width: 10px;
  margin:auto;
  vertical-align: bottom;
}

#deckbuilder div.deck-new {
  cursor: pointer;
  border-bottom: 1px #333 dashed;
  color: #aaa;
  padding: 10px;
  font-size: 10pt;
}

#deckbuilder div.deck-new:hover {
  color: #3fc;
  background: #151515;
}

#deckbuilder div.deck-new span {
  margin: 10px;
  display: inline-block;
  border: 1px #333 solid;
  width: 15px;
  height: 15px;
  text-align: center;
  color: #fff;
  font-weight: bold;
}

/* preview window */
#preview {
  z-index: 1;
  visibility: hidden;
  background: rgba(0,0,0,.6);
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
}

#preview-space {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
}

#preview-window {
  display: flex;
  flex-wrap: nowrap;
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  background: rgba(15, 15, 15, .9);

  height: 500px;
  border: 1px #444 solid;
}

#preview-content {
  display: flex;
  flex-wrap: nowrap;
  height: 100%;
  padding: 20px;
  background: #000;
  box-shadow: 0px 0px 10px #000;
  border: 1px #444 solid;
  margin-top: -20px;
}

#preview-image {
  height: calc(100% - 10px);
  background: #fff;
  padding: 5px;
  border-radius: 15px;
}

#preview-text {
  display: inline-block;
  width: 400px;
  height: 100%;
  color: #fff;
  padding: 0px 10px;
}

#preview-text span.title{
  padding: 0 0 10px 10px;
  display: block;
  font-size: 18pt;
  font-weight: bold;
  color: #fff;
}

#preview-text span.title small{
  font-weight: 300;
  color: #fff;
}


#preview-text span.types{
  padding: 10px;
  display: block;
  font-size: 14pt;
}

#preview-text span.text{
  padding: 20px;
  display: block;
  font-size: 12pt;
}

#preview-text span.mana {
  width: 14px;
  height: 14px;
  padding: 1px;
  font-size: 11pt;
  margin-bottom: 8px;
}

#preview-text img.mana {
  height: 16px;
  width: 16px;
}

#preview-lookup a{
  display: inline-block;
  padding: 5px 0px;
  font-size: 12pt;
  color: #3fc;
  text-decoration: none;
}

#preview-lookup a:hover{
  text-decoration: underline;
}

#preview-lookup {
  display: block;
  position: absolute;
  bottom: 0px;
  color: #555;
  padding-top: 10px;
  margin-left: 10px;
  border-top: 1px #222 solid;
  width: 380px;
}

#preview a.btn {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #555;
  cursor: pointer;
}

#preview a.btn:hover {
  color: #fff;
}

#preview a.btn span {
  padding: 15px;
  font-weight: bold;
  font-size: 16pt;
  user-select: none;
}

#preview-prev {
}

#preview-next {
}

/* mobile view */
@media screen and (max-width: 1760px) {
  /* update page padding for double panel */
  body { padding-top: 150px; }

  /* realign elements */
  #search { width: calc(100% - 500px); }
  #colors { float: right !important; }
  #sort { float: right !important; }

  /* make advanced visible and hide button*/
  #types { display: inline-block; }
  #sort { display: inline-block; }
}

@media screen and (max-width: 1090px) {
  /* revert page padding for single panel */
  body { padding-top: 80px; }

  /* show filter button and hide elements */
  #filter { display: inline-block; }
  #types { display: none; }
  #sort { display: none; }

  /* update frame positions */
  #search input { width: calc(100% - 140px); }
  #sort { float: left !important; }
}

@media screen and (max-width: 800px) {
  /* update page padding for double panel */
  body { padding-top: 150px; }

  #deckbuilder { visibility: hidden; display: none; }
  #viewport { width: 100%; }

  /* convert to full width search */
  #search { width: 100%; float: left !important; }
  #search input { width: calc(100% - 160px); }
}

@media screen and (max-width: 460px) {
  div.barsection { padding: 5px 10px; font-size: 8pt;}
  #navbar img { height: 18px; margin: 5px 1px; }
  #logo { height: 45px !important; }
}