/** Reset start **/
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

h3.headline {
  margin-bottom: 2px;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/** Reset end **/


/** View type styling based on body class **/
body.view {
  background-color: rgba(255, 255, 255, 0.6);
}

body.collection {
  background-color: rgba(210, 255, 210, 0.6);
}

body.wishlist {
  background-color: rgba(210, 210, 255, 0.6);
}

body.deckBuilding {
  background-color: rgba(255, 210, 210, 0.6);
}


/** Util **/
.hidden {
  display: none;
  opacity: 0;
}

.disabled {
  opacity: 0.5;
}


/** Layout **/
.area {
  margin: 10px;
}

.italic {
  font-style: italic;
}

.main {
  margin-bottom: 10px;
}


/** Card layout **/
.cardContainer {
  position: relative;
  float: left;
  width: 280px;
  height: 425px;
  margin-right: 10px;
  margin-bottom: 10px;
  filter: saturate(100%);
  transition: filter 0.5s;
}

/* Only grey out unassigned cards in Deck Building mode */
body.deckBuilding .cardContainer.notassigned {
  filter: saturate(0);
  transition: filter 0.5s;
}


/** Card meta **/
.cardMeta {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 25px;
  width: 100%;
  background-color: black;
  z-index: 10;
}

.cardMeta .collection {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 20px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-align: right;
}

.cardMeta .wishlist {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 20px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-align: right;
}

.cardMeta .deck {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 20px;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-align: right;
  display: none;
}

.cardMeta .collection .item {
  float: right;
  margin-left: 4px;
}

.cardMeta .wishlist .item {
  float: left;
  margin-right: 4px;
}

.cardMeta .deck .item {
  float: left;
  margin-right: 4px;
}

.cardMeta .count {
  padding-top: 3px;
}

.cardMeta .label {
  padding-top: 3px;
}

.add {
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url('/graphics/simple-plus.png');
  background-color: #dddddd;
  cursor: pointer;
  z-index: 10;
}

.remove {
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url('/graphics/simple-minus.png');
  background-color: #dddddd;
  cursor: pointer;
  z-index: 10;
}

body.view .cardMeta,
body.deckBuilding.notSelected .cardMeta {
  display: none;
}

body #deckSets {
  display: none;
}

body.deckBuilding #deckSets,
body.deckBuilding .cardMeta .deck {
  display: initial;
}

body.view .cardContainer {
  height: 400px;
}

body.collection .cardMeta .collection .label,
body.wishlist .cardMeta .wishlist .label,
body.wishlist .cardMeta .collection .add,
body.wishlist .cardMeta .collection .remove,
body.collection .cardMeta .wishlist .add,
body.collection .cardMeta .wishlist .remove,
body.deckBuilding .cardMeta .wishlist {
  display: none;
}

.card {
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 100%;
  height: 400px;
  background-size: contain;
}

.card .edition {
  position: absolute;
  top: 6px;
  left: 9px;
  width: 18px;
  height: 25px;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
}

.card .rarity {
  position: absolute;
  top: 16px;
  left: 9px;
  width: 18px;
  height: 20px;
  font-size: 10px;
  font-style: italic;
  font-weight: 700;
}

.card .name {
  position: absolute;
  top: 7px;
  left: 10px;
  width: 258px;
  height: 25px;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 0 1px black;
  text-align: center;
  z-index: 5;
}

.card .image {
  position: absolute;
  top: 40px;
  left: 29px;
  width: 239px;
  height: 162px;
  background-color: black;
}

.card .type {
  position: absolute;
  top: 208px;
  left: 39px;
  width: 204px;
  height: 12px;
  font-size: 12px;
  color: white;
  text-align: center;
}

.card .quote {
  position: absolute;
  top: 207px;
  left: 8px;
  height: 20px;
  width: 20px;
  cursor: pointer;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("/graphics/quote.png")
}

.card .text {
  position: absolute;
  top: 228px;
  left: 15px;
  height: 135px;
  width: 250px;
  text-align: center;
}

.card .text span.boldtext {
  font-weight: 700;
}

.card .diplomacy,
.card .intrigue,
.card .psi,
.card .leadership,
.card .military {
  position: absolute;
  left: 6px;
  width: 35px;
  height: 20px;
  color: white;
  text-shadow: 0 0 2px black;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding-top: 5px;
  background-size: contain;
  background-repeat: no-repeat;
}

.card .diplomacy {
  top: 60px;
  background-image: url("/graphics/diplomacy.png")
}

.card .intrigue {
  top: 92px;
  background-image: url("/graphics/intrigue.png")
}

.card .psi {
  top: 126px;
  background-image: url("/graphics/psi.png")
}

.card .leadership {
  top: 160px;
  background-image: url("/graphics/leadership.png")
}

.card .military {
  top: 160px;
  background-image: url("/graphics/military.png")
}

.card .cost {
  position: absolute;
  bottom: 3px;
  right: 9px;
  height: 26px;
  width: 22px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("/graphics/cost.png");
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding-top: 9px;
}

.card .marks {
  overflow: auto;
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 250px;
  height: 25px;
}

.card .marks::after {
  content: "";
  clear: both;
  display: table;
}

.card .marks .conspiracy,
.card .marks .destiny,
.card .marks .doom,
.card .marks .strife,
.card .marks .shadow,
.card .marks .vorlon {
  float: left;
  width: 25px;
  height: 25px;
  background-size: contain;
  background-repeat: no-repeat;
}

.card .marks .conspiracy {
  background-image: url("/graphics/conspiracy.png");
}

.card .marks .destiny {
  background-image: url("/graphics/destiny.png");
}

.card .marks .doom {
  background-image: url("/graphics/doom.png");
}

.card .marks .strife {
  background-image: url("/graphics/strife.png");
}

.card .marks .shadow {
  background-image: url("/graphics/shadow.png");
}

.card .marks .vorlon {
  background-image: url("/graphics/vorlon.png");
}

#filters {
  width: 1050px;
  margin: 10px;
}

#filters label,
#filters input {
  cursor: pointer;
}

#filters label.disabled {
  cursor: not-allowed;
}

#filters div {
  margin: 5px;
}

#filters label {
  margin-left: 15px;
}

#filters h4 {
  display: block;
  margin: 5px 0px 5px 0px;
  font-weight: 700;
}

#filters table {
  width: 100%;
}

#filters table th {
  width: 25%;
}

#filterToggles {
  height: 23px;
  border-radius: 5px 0px 0px 5px;
  margin-right: -2px;
}

#searchField {
  width: 300px;
}

#functions {
  position: absolute;
  top: 25px;
  right: 15px;
}

#functions .funcitem {
  margin-right: 5px;
}

#load {
  float: right;
  height: 26px;
  width: 26px;
  background-size: contain;
  background-image: url("/graphics/icons8-load-26.png");
  background-repeat: no-repeat;
  cursor: pointer;
}

#save {
  float: right;
  height: 26px;
  width: 26px;
  background-size: contain;
  background-image: url("/graphics/icons8-save-26.png");
  background-repeat: no-repeat;
  cursor: pointer;
}

#trademark {
  position: absolute;
  top: 5px;
  right: 5px;
  display: block;
  margin: 0px;
  font-style: italic;
  font-size: 0.9rem;
  font-family: inherit;
}

body.view #trademark,
body.collection #trademark,
body.decks #trademark {
    font-style: italic;
    font-size: 0.9rem;
}

.closeButton {
  display: inline-block;
  width: 10px;
  padding-top: 4px;
  text-align: center;
  background-size: contain;
  background-image: url("/graphics/close.png");
  background-repeat: no-repeat;
  background-position-y: 4px;
  cursor: pointer;
}

.searchMatchMarker {
  background-color: rgba(0, 255, 0, 0.5);
}

/** Fix **/
.textFitted {
  width: 100%;
}

/* Deck tree layout */
#decks ul.deckTree {
  margin: 0 0 10px 0;
  padding-left: 0;
  list-style: none;
  /* no bullet on top-level */
}

#decks ul.deckTree>li {
  margin: 2px 0;
}

/* nested ULs (decks & cards) */
#decks ul.deckTree ul {
  margin: 2px 0;
  padding-left: 20px;
  /* indentation */
  list-style: none;
}

/* cards under decks – slightly different bullet */
#decks ul.deckTree ul ul {
  list-style: none;
}

#decks .treeToggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  margin-right: 4px;
  padding: 0;
}

#decks .setLabel,
#decks .deckLabel {
  font-weight: normal;
}

/* Remove bullets and enlarge toggle, if you haven’t done this yet */
#decks .deckTree,
#decks .deckTree ul {
  list-style: none;
  margin: 0;
  padding-left: 0.8em;
}

#decks .treeToggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  /* makes ▾/▸ bigger */
  margin-right: 4px;
}

/* Highlight missing/insufficient cards */
#decks .deckCardRow.shortage {
  color: #c33;
  font-weight: 600;
}

#decks .cardShortageNote {
  margin-left: 4px;
  font-size: 0.9em;
}

#decks .exportSetButton {
  margin-left: 8px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

/* Base mobile friendliness */
html,
body {
  margin: 0;
  padding: 0;
}

body.view {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Ensure areas don’t overflow horizontally */
.area {
  box-sizing: border-box;
  max-width: 100%;
}

@media (max-width: 600px) {

  /* Put zoom icons + view dropdown in their own row under the "Search" title */
  #functions {
    position: static !important;
    /* override absolute from desktop */
    right: auto !important;
    top: auto !important;
    float: none !important;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;

    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 8px 0;
    /* space above filters */
    padding: 0;
  }

  #functions .funcitem {
    flex: 0 0 auto;
    padding: 2px 4px;
  }

  #functions select {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Filters + search stack nicely below */

  #collection .main select#filterToggles,
  #collection .main #searchField,
  #collection .main #searchButton {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 2px 0;
  }

  /* Type checkboxes wrap */
  #types label {
    white-space: normal;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 2px;
  }

  /* Hide long legal text */
  #trademark {
    display: none;
  }
}