:root {
  color-scheme:dark;
  --gold:#f5ce83;
  --art:url('./assets/reference-art.png');
  font-family:Arial,'Yu Gothic','Meiryo',sans-serif;
  background:#050504;
  color:#f0e9dc
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button {
  font:inherit;
  cursor:pointer
}

button:focus-visible,a.nav-item:focus-visible {
  outline:3px solid #fff0c4;
  outline-offset:5px
}

button:disabled {
  cursor:default
}

.stage-wrap {
  width:min(100%,1280px);
  aspect-ratio:16/9;
  margin:0 auto;
  overflow:hidden
}

.stage {
  width:1280px;
  height:720px;
  position:relative;
  background:var(--art) center/1280px 720px no-repeat;
  transform:scale(var(--scale,1));
  transform-origin:top left
}

/* The supplied artwork retains the original ornate heading and subtitle. */
.masthead h1,.masthead h2 {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  margin:0
}

.mentors {
  position:absolute;
  left:293px;
  top:153px;
  width:700px;
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:6px
}

.mentor {
  height:70px;
  border:1px solid #59452b;
  border-right-color:#252017;
  border-bottom-color:#332b20;
  border-radius:14px;
  display:grid;
  grid-template-columns:86px 112px 225px 99px 1fr;
  align-items:center;
  background:linear-gradient(104deg,#3b2b18 0%,#2b2218 29%,#1d1912 65%,#100f0b 100%);
  box-shadow:inset 0 1px 1px #c79c6533;
  position:relative;
  padding:0 20px
}

.rank {
  font-size:40px;
  font-weight:700;
  letter-spacing:-1px;
  color:#ffe09a;
  text-shadow:0 1px 2px #a76520
}

.portrait {
  display:block;
  width:72px;
  height:68px;
  background-image:var(--art);
  background-size:1280px 720px;
  background-repeat:no-repeat;
  align-self:end;
  justify-self:start;
  mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent)
}

.portrait-1 {
  background-position:-396px -154px
}

.portrait-2 {
  background-position:-396px -230px
}

.portrait-3 {
  background-position:-396px -306px
}

.portrait-4 {
  background-position:-396px -382px
}

.portrait-5 {
  background-position:-396px -458px
}

.name {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:25px;
  font-weight:400;
  letter-spacing:.3px;
  color:#f4f1e9;
  white-space:nowrap
}

.votes {
  display:flex;
  align-items:baseline;
  justify-content:flex-end;
  gap:7px;
  padding-right:11px;
  color:#ffdfa0;
  white-space:nowrap
}

.votes strong {
  font-size:25px;
  letter-spacing:1px
}

.votes>span {
  font-size:18px
}

.vote {
  justify-self:end;
  width:110px;
  height:40px;
  border-radius:24px;
  border:1px solid #dba756;
  color:#ffe094;
  background:radial-gradient(ellipse at 74% 105%,#e99d284a 0%,transparent 34%),linear-gradient(#201c10,#060706 58%,#110e07);
  box-shadow:inset 0 1px 2px #fff3c5,0 0 1px #a9803d;
  font-size:22px;
  line-height:1;
  font-weight:700;
  transition:filter .15s,box-shadow .15s,transform .15s
}

.vote:hover {
  filter:brightness(1.3);
  box-shadow:inset 0 1px 2px #fff3c5,0 0 14px #e0ab424f
}

.vote:active {
  transform:translateY(1px)
}

.vote:disabled {
  color:#bba577;
  border-color:#877049;
  box-shadow:none
}

.mentor.is-selected {
  border-color:#e0b66b
}

.mentor.is-selected .vote {
  color:#ffe3a5;
  background:#463219;
  font-size:18px
}

.navigation {
  position:absolute;
  left:123px;
  top:545px;
  width:1033px;
  height:138px;
  border-radius:14px;
  background:linear-gradient(110deg,#0d0c08,#090a07 52%,#100e09);
  display:grid;
  grid-template-columns:repeat(4,1fr);
  overflow:hidden
}

.nav-item {
  position:relative;
  padding:9px 3px 5px;
  display:flex;
  flex-direction:column;
  align-items:center;
  border:0;
  background:none;
  color:#edc580;
  transition:background .2s
}

a.nav-item {
  text-decoration:none;
  color:#edc580;
  cursor:pointer;
  font:inherit
}

.nav-item+.nav-item:before {
  content:'';
  position:absolute;
  left:0;
  top:17px;
  height:105px;
  width:1px;
  background:linear-gradient(#8b6632,#bd914f,#654820)
}

.nav-item:hover {
  background:#e4b6680d
}

.nav-icon {
  width:58px;
  height:54px;
  flex:none;
  background-image:var(--art);
  background-size:1280px 720px;
  background-repeat:no-repeat;
  mask-image:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent)
}

.trophy {
  background-position:-225px -554px
}

.gift {
  background-position:-479px -554px
}

.chart {
  background-position:-739px -554px
}

.wheel {
  background-position:-992px -554px
}

.nav-title {
  font-size:28px;
  font-weight:700;
  line-height:36px;
  white-space:nowrap;
  letter-spacing:-.5px
}

.nav-description {
  font-size:15px;
  line-height:16px;
  font-weight:400
}

.preview-note {
  padding:12px 20px 16px;
  text-align:center;
  color:#a89d86;
  font-size:12px;
  line-height:1.8;
  border-top:1px solid #d2a5501a;
  background:#080806
}

.load-error {
  position:fixed;
  inset:0;
  z-index:30;
  display:grid;
  place-items:center;
  align-content:center;
  gap:16px;
  background:#050504f2;
  color:#f2d59e;
  text-align:center;
  padding:24px
}

.load-error p {
  margin:0;
  font-size:16px
}

.load-error button {
  min-height:44px;
  padding:8px 24px;
  border-radius:24px;
  border:1px solid #f3d18a;
  background:linear-gradient(#ffe0a0,#c68d3e);
  color:#261b0c;
  font-weight:700
}

dialog {
  width:min(440px,calc(100% - 32px));
  padding:32px;
  border:1px solid #a87e3e;
  border-radius:16px;
  background:radial-gradient(ellipse at top,#302619,#0e0d0a 80%);
  color:#eee5d5;
  box-shadow:0 20px 100px #000a
}

dialog::backdrop {
  background:#000b;
  backdrop-filter:blur(5px)
}

.close-dialog {
  position:absolute;
  right:12px;
  top:8px;
  background:none;
  color:#b8a683;
  border:0;
  font-size:28px;
  padding:4px 8px
}

.dialog-eyebrow {
  color:#bf9758;
  font-size:11px;
  letter-spacing:3px
}

dialog h2 {
  font-size:24px;
  line-height:1.5;
  color:#f5d092;
  margin:18px 0 12px
}

dialog p {
  font-size:15px;
  line-height:1.9;
  margin:0 0 26px;
  white-space:pre-line;
  color:#cbc1af
}

.dialog-actions {
  display:flex;
  gap:12px;
  justify-content:flex-end
}

.dialog-actions button {
  min-height:44px;
  border-radius:24px;
  padding:9px 24px
}

.secondary-action {
  border:1px solid #6d5838;
  background:transparent;
  color:#dfcba6
}

.primary-action {
  border:1px solid #f3d18a;
  background:linear-gradient(#ffe0a0,#c68d3e);
  color:#261b0c;
  font-weight:700
}

[hidden] {
  display:none!important
}

.toast {
  position:fixed;
  left:50%;
  bottom:25px;
  transform:translate(-50%,15px);
  opacity:0;
  pointer-events:none;
  width:max-content;
  max-width:calc(100% - 32px);
  padding:15px 24px;
  text-align:center;
  line-height:1.5;
  border:1px solid #b98f4a;
  border-radius:12px;
  background:#17130cf5;
  color:#f2d59e;
  font-size:14px;
  box-shadow:0 8px 30px #0008;
  transition:opacity .2s,transform .2s
}

.toast.visible {
  opacity:1;
  transform:translate(-50%,0)
}

@media(min-width:1281px) {
  body {
    min-height:100vh;
    display:flex;
    flex-direction:column;
    justify-content:center
  }

  .stage-wrap {
    flex-shrink:0
  }

  .preview-note {
    border-top:0
  }

}

@media(max-width:700px) {
  .stage-wrap {
    width:100%;
    aspect-ratio:auto;
    overflow:visible
  }

  .stage {
    width:100%;
    height:auto;
    min-height:100svh;
    transform:none;
    background:radial-gradient(ellipse at 50% 0%,#60411e88,transparent 42%),#070806;
    padding:30px 16px 22px
  }

  .masthead {
    position:relative;
    text-align:center;
    margin-bottom:25px
  }

  .masthead:before {
    content:'';
    position:absolute;
    top:-30px;
    left:-16px;
    right:-16px;
    height:5px;
    background:linear-gradient(90deg,#70421b,#ffe8ac,#70421b);
    box-shadow:0 0 28px #efc56670
  }

  .masthead h1,.masthead h2 {
    position:static;
    width:auto;
    height:auto;
    overflow:visible;
    clip-path:none;
    white-space:normal
  }

  .masthead h1 {
    font-size:clamp(21px,5.2vw,33px);
    line-height:1.65;
    font-weight:800;
    color:#f6cf81;
    text-wrap:balance;
    text-shadow:0 2px 14px #bd7a2844
  }

  .masthead h2 {
    display:inline-block;
    margin:18px auto 0;
    font-size:18px;
    font-weight:400;
    padding:8px 25px;
    border:1px solid #96703b;
    border-radius:9px;
    background:linear-gradient(90deg,#302114,#080907,#302114);
    color:#f5d498
  }

  .mentors {
    position:static;
    width:100%;
    gap:10px
  }

  .mentor {
    height:82px;
    padding:0 12px;
    grid-template-columns:34px 56px minmax(0,1fr) 56px;
    grid-template-rows:1fr 1fr;
    column-gap:7px;
    border-radius:12px
  }

  .rank {
    font-size:25px;
    grid-row:1/3
  }

  .portrait {
    grid-row:1/3;
    width:56px;
    height:68px;
    align-self:center;
    background-position-x:-404px
  }

  .name {
    grid-column:3;
    grid-row:1;
    font-size:clamp(16px,4.1vw,22px);
    align-self:end;
    padding-bottom:2px;
    letter-spacing:0
  }

  .votes {
    grid-column:3;
    grid-row:2;
    justify-content:flex-start;
    align-self:start;
    padding:3px 0 0;
    gap:5px
  }

  .votes strong {
    font-size:18px
  }

  .votes>span {
    font-size:13px
  }

  .vote {
    grid-column:4;
    grid-row:1/3;
    width:56px;
    height:36px;
    font-size:16px
  }

  .mentor.is-selected .vote {
    font-size:12px
  }

  .navigation {
    position:static;
    width:100%;
    height:auto;
    margin-top:24px;
    border:1px solid #a07a40;
    grid-template-columns:repeat(2,minmax(0,1fr));
    border-radius:14px;
    background:linear-gradient(110deg,#171109,#090a07)
  }

  .nav-item {
    min-height:137px;
    padding:12px 2px
  }

  .nav-item+.nav-item:before {
    display:none
  }

  .nav-item:nth-child(even) {
    border-left:1px solid #75562f
  }

  .nav-item:nth-child(n+3) {
    border-top:1px solid #75562f
  }

  .nav-title {
    font-size:clamp(16px,4.1vw,23px);
    line-height:32px;
    letter-spacing:-.5px
  }

  .nav-description {
    font-size:12px;
    line-height:16px
  }

  .preview-note {
    font-size:11px;
    padding:12px 22px
  }

  .toast {
    bottom:16px
  }

}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important
  }

}

/* 上传后的独立头像彻底遮住原参考图中的人物。 */
.portrait.custom-portrait  {
  background: #261e14;
  mask-image: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  font-size: 12px;
  color: #c7b58e;
  text-align: center;
}

.custom-portrait img  {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
