/* ---------- Base ---------- */
@font-face { font-family: "jjannon"; font-style: normal; src: url('../fonts/JJannon-Regular.otf'); }
@font-face { font-family: "jjannon"; font-style: italic; src: url('../fonts/JJannon-Italic.otf'); }
@font-face {
  font-family: "Chinese Heiti";
  src: local("Heiti SC"), local("SimHei"), local("黑体");
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}
:root {
  --page-background: #121211;
  --panel-background: #191918;
  --text: #ffffff;
  --muted-text: #aaa69c;
  --border: #060606;
  --card-border: #77736a;
  --card-height: 110px;
  --label-width: 110px;
}

* {
  box-sizing: border-box;
}

a, p, i, div, summary,th, td, button{
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
  font-size-adjust: none;
  text-decoration: none;
  /*font-family: "jjannon","Songti SC","宋体",STSong, Simsun,"Noto Serif SC", 'Source Han Serif SC', ‘Source Han Serif’, source-han-serif-sc,TimesNewRoman,Times New Roman,Times,Baskerville,Georgia,serif;*/
  font-family: Helvetica, "Helvetica Neue", Arial, "Chinese Heiti", 'Noto Sans CJK SC', 'Source Han Sans SC', ‘Source Han Sans’, source-han-sans-sc, "黑体","Heiti SC",Hei, sans-serif;
  /*font-weight: 400;*/
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  hyphens: auto;
  font-size: 13px;
}


body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background-image: url("RUFF1.jpg");
  background-size: 100%;
}

/* ---------- Page heading ---------- */
.app-shell {
  /*width: min(1180px, calc(100% - 38px));*/
  /*margin: 0 auto;*/
  /*padding: 48px 0 58px;*/
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.eyebrow,
.info-category {
  margin: 0 0 5px;
  color: var(--muted-text);
  /*letter-spacing: 0.13em;*/
  /*font: 500 11px "DM Mono", monospace;*/
}



/*.reset-button {*/
/*  padding: 10px 13px;*/
/*  color: var(--text);*/
/*  border: 1px solid #56564f;*/
/*  border-radius: 2px;*/
/*  background: transparent;*/
/*  cursor: pointer;*/
/*}*/
.reset-button {
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
}

.tier-controls {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /*gap: 7px;*/
}

.uploaded-tierlistings {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /*gap: 7px;*/
}

.uploaded-tierlisting-button {
  max-width: 190px;
  overflow: hidden;
  color: var(--text);
  border: none;
  background: transparent;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.tierlisting-current {
  text-decoration: underline;
}

.uploaded-tierlisting-entry {
  display: flex;
  /*gap: 8px;*/
}

.uploaded-tierlisting-delete {
  color: var(--text);
  border: none;
  background: transparent;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.upload-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
}

.upload-modal[hidden] {
  display: none;
}

.upload-dialog {
  width: 90vw;
  height: 80vh;
  padding: 20px;
  overflow: auto;
  color: var(--text);
  background: #000;
  display: flex;
  flex-direction: column;
  font: inherit;
  line-height: inherit;
}

.upload-dialog label {
  display: block;
  margin: 12px 0;
}

.upload-dialog input,
.upload-dialog textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--text);
  border: 0;
  background: #000;
  font: inherit;
  line-height: inherit;
}

.upload-dialog textarea {
  min-height: 80px;
}

.upload-dialog input:focus,
.upload-dialog textarea:focus {
  outline: none;
}

.tierlisting-comment {
  margin: 14px 0 0;
  white-space: pre-line;
}

.upload-dialog form {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.upload-actions {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
}

.upload-actions button {
  padding: 0;
  color: var(--text);
  border: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.upload-dialog.upload-unavailable label,
.upload-dialog.upload-unavailable #upload-error,
.upload-dialog.upload-unavailable .upload-actions button[type="submit"] {
  opacity: 0.5;
  pointer-events: none;
}

.upload-dialog input:disabled,
.upload-dialog textarea:disabled,
.upload-dialog button:disabled {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

@media (min-width: 601px) {
  .upload-dialog {
    width: min(400px, 90vw);
    height: 60vh;
  }
}

.reset-button:hover {
  color: #151514;
  background: #fff;
}

/* ---------- Tier list ---------- */
.tier-board {
  width: max(90%, var(--tier-required-width, 0px));
  border: 2px solid var(--border);
}

.tier-row {
  position: relative;
  display: flex;
  height: calc(var(--card-height) + 2px);
  max-height: 90px;
  border-bottom: 2px solid var(--border);
  background: var(--panel-background);
}

.tier-row:last-child {
  border-bottom: 0;
}

.tier-label {
  display: flex;
  flex: 0 0 var(--label-width);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #000000;
  border-right: 2px solid var(--border);
}

.tier-label.s { background: #ff7d7f; }
.tier-label.a { background: #ffbd78; }
.tier-label.b { background: #fbdc75; }
.tier-label.c { background: #f5f77a; }
.tier-label.d { background: #acf475; }
.tier-label.e { background: #6eea85; }

.drop-zone {
  position: relative;
  flex: 1;
  height: var(--card-height);
  overflow: visible;
}

.drop-zone.over {
  /*outline: 2px dashed #d8d3ab;*/
  /*outline-offset: -2px;*/
}

/* ---------- Card library and cards ---------- */
.library {
  margin-top: auto;
  padding-top: 35px;
}



.card-pool {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  /*gap: 10px;*/
  min-height: 124px;
}

.tier-card {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: auto;
  height: var(--card-height);
  max-height: 90px;
  overflow: hidden;
  /*border: 1px solid var(--card-border);*/
  background: #fff;
  cursor: grab;
  touch-action: pan-x pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.tier-card,
.tier-card img,
.drag-ghost,
.drag-ghost img {
  -webkit-user-drag: none;
}

html.drag-active,
html.drag-active * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.tier-card.dragging {
  opacity: 0.28;
}

.tier-card img,
.info-art,
.info-art img {
  display: block;
  width: 100%;
  /*height: 100%;*/
  /*object-fit: cover;*/
}

/* Keep every artwork fully visible inside its fixed-size card. */
.tier-card img {
  width: auto;
  height: 100%;
  object-fit: fill;
}

.drop-zone .tier-card {
  position: absolute;
  margin: 0;
}

.card-name {
  display: none;
  position: absolute;
  right: 5px;
  bottom: 7px;
  left: 7px;
  z-index: 1;
  color: #fff;
  line-height: 1.15;
}

.drag-ghost {
  position: fixed;
  z-index: 10;
  margin: 0;
  pointer-events: none;
  cursor: grabbing;
  opacity: 0.92;
}

/* ---------- Information panel ---------- */
.info-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: none;
  width: 35vw;
  max-width: 400px;
  max-height: 80%;
  overflow-y: scroll;
  /*padding: 16px;*/
  /*border: 1px solid #777468;*/
  background: #000000;
}

.info-panel.visible {
  display: block;
}

.info-art {
  /*height: 140px;*/
  margin-bottom: 15px;
}


.info-panel p:not(.info-category) {
  margin: 0;
  color: #fff;
}

.info-hint {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-size: 11px;
}

.close-info {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 25px;
  height: 25px;
  color: #fff;
  background: black;
  border: none;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
}

.scrim {
  display: none;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  body{
    background-size: cover;
  }
  :root {
    --card-height: 80px;
    --label-width: 70px;
  }

  .app-shell {
    width: 100%;
    padding: 0 0 36px;
  }

  .topbar {
    align-items: center;
    padding: 0 16px;
  }

  .tier-row{
    height: 80px;
  }
  .tier-card{
    max-height: 80px;
  }


  .tier-board,
  .tier-row,
  .tier-label {
    border-width: 1px;
  }

  .tier-board {
    width: max(100%, var(--tier-required-width, 0px));
  }

  .tier-label strong {
    /*font-size: 28px;*/
  }

  .tier-label span {
    /*margin-top: 7px;*/
    /*font-size: 11px;*/
  }


  .library {
    margin-top: 25px;
    padding: 0;
  }

  .library-heading small {
    display: none;
  }

  .card-pool {
  }

  .info-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
  }

  .scrim.visible {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: block;
    background: #0008;
  }
}

.info-description,
#info-judgment,
#info-ratings,
#info-year {
  white-space: pre-line;
}

.info-description a,
#info-judgment a {
  color: inherit;
  text-decoration: underline;
}

.info-description iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 12px 0;
  border: 0;
}

#info-judgment,
#info-ratings {
  margin-top: 1em !important;
}

#info-judgment {
  color: lightpink !important;
}

#info-ratings {
  color: #00ff00 !important;
}
