@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400..900&display=swap');

:root {
  --accent: #d4b37f; /* warm gold-amber accent */
  --accent-hover: #e8c88f;
  --bg-dark: #0e0e10; /* nearly black background */
  --bg-panel: #1b1b1f; /* panel background */
  --border: #2a2a2e;
  --text-main: #f0f0f0;
  --text-muted: #aaa;
  --font-body: "Inter", "Noto Sans JP", sans-serif;
  --font-display: "Cinzel", "Playfair Display", serif;
}


body {
  font-size: 16px;
  background-image:url('https://dismyth.neocities.org/ptnsort/src/assets/bg.3be8dd41.png');
  background-size:cover;
  background-attachment:fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  letter-spacing: 0.03em;
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 0;
  
}

h1 {
  font-size: 30px;
  padding: 30px;
  font-family: var(--font-display);
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.container {
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  margin-top: 1em;
}

.progress {
  margin: 1em auto;
  width: 500px;
  display: none;
}

.progressbar {
  position: relative;
  width: 492px;
  margin: 2px 0px;
}

.progresstext {
  position: absolute;
  width: 492px;
  margin: 3px 0px;
  text-align: center;
  font-size: 0.7em;
}

.progressfill {
  height: 20px;
  background-color: #e69a0b;
  width: 0%;
  box-shadow:0 0 5px #e69a0b;
}

.sorter {
  margin: 0px auto;
  display: grid;
  /* grid-template-columns: 120px 1fr 120px; */
  grid-gap: 15px;
/* width: 420px; */
  grid-gap: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 0 24px rgba(0,0,0,0.6);
}

.sorter > .centered {
  grid-column: 1 / 4;
  grid-row: 8;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.button {
  background: linear-gradient(to bottom, #222, #171717);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6em 1.4em;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: 0 0 10px rgba(212,179,127,0.3);
  transform: translateY(-1px);
}

.starting.start.button {
  grid-row: span 6;
}

.starting.load.button {
  grid-row: span 3;
  display: none;
}

.sorting.button, .finished.button {
  grid-row: span 2;
  display: none;
  background: linear-gradient(to bottom, #202020, #151515);
  color: var(--text-muted);
}

.loading.button {
  grid-row: span 6;
  display: none;
  background: linear-gradient(to bottom, #202020, #151515);
  color: var(--text-muted);
}

.button:active {
  box-shadow: 0 0 14px rgba(212,179,127,0.5);
  transform: translateY(0);
}

.loading.button > div {
  width: 25px;
  height: 25px;
  margin: 50px auto;
  background-color: #333;

  border-radius: 100%;  
  -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
  animation: sk-scaleout 1.0s infinite ease-in-out;
}

/* Animation taken from: http://tobiasahlin.com/spinkit/ */

.loading.button > span {
  margin: auto auto 20%;
  font-size: 0.7em;
}

@-webkit-keyframes sk-scaleout {
  0% { -webkit-transform: scale(0) }
  100% {
    -webkit-transform: scale(1.0);
    opacity: 0;
  }
}

@keyframes sk-scaleout {
  0% { 
    -webkit-transform: scale(0);
    transform: scale(0);
  } 100% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
    opacity: 0;
  }
}

.sorter > .image {
  width: 100%;
  height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center;
  grid-row: 1 / 7;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.sorter > .image:hover {
  transform: scale(1.02);
}

.sorter > .text {
  width: 120px;
  max-height: 60px;
  display: none;
  background: linear-gradient(to right, #19191b, #1f1f22);
  padding: 8px;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  text-shadow: 0 0 4px rgba(212,179,127,0.4);
}

.sorter > .text > p {
  margin: 0.5em 5px 0px;
  width: calc(100%-10px);
  text-align: center;
  font-size: 20px;
  line-height: 40px;
  font-family: var(--font-display);
  font-weight: 500;

}

.sorter > .left {
  grid-column: 1 / 2;
  display:flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 500px;
  overflow: hidden;
  background: #111;
  padding:5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.sorter > .right {
  grid-column: 3 / 4;
  display:flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 500px;
  overflow: hidden;
  background: #111;
  padding:5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.options {
  margin: 1em auto;
  display: grid;
  text-align: left;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 10px;
  width: 450px;
  margin-bottom:-5px;
}

.options > div {
  font-size: 14px;
}

label {
  cursor: pointer;
}

label:hover {
  color: #990000;
}

.options > .large.option, .options > hr {
  grid-column: span 3;
  text-align: center;
  width: 100%;
}

.image.selector {
  margin-top: 0.5em;
  width: 500px;
  display: none;
  text-align: center;
  font-size: 0.75em;
}

.time.taken {
  margin-top: 0.5em;
  width: 500px;
  display: none !important;
  text-align: center;
  font-size: 0.75em;
}


.results {
  display: flex;
  flex-direction: column;
  align-content:center;
  gap: 1em;
  width: 300px;
  max-width: 800px;
  margin: 2em auto;
  padding: 2em;
  color: var(--text-main);
  font-family: var(--font-body);
}

@media all and (min-width: 600px) {
  .results {
  /*  flex-flow: column wrap; */ 
    max-height: calc(5 * (175px + 2px) + 1 * (15px + 2px));
    /* 2px for borders */
  }
}

@media all and (max-width: 600px) {
  .results {
    flex-flow: column nowrap;
  }
}


.result {
  display: grid;
  grid-template-columns: 10% 30% 1fr;
  align-items: center;
  gap: 1em;
  border-radius: 0.75em;
  padding: 0.75em 1em;
  width: 100%;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.result.image {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.result.image img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position:top;
}

.result.name {
  font-size:1.25em;
  font-weight: 600;
  color: var(--accent);
}

.result.spacer {
  height: 1px;
  background-color: #000;
}

.result.head {
  background-color: #000;
  color: #FFF;
}

.result > .left {
  grid-column: 1 / 2;
  font-size: 1.25em;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.result.image .left {
  position: relative;
}

.result.image > .left span {
  position: absolute;
  top: 50%;
  margin-top: -0.375em;
}

.result > .right {
  grid-column: 2 / 3;
  font-size: 1.25em;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.result.head,
.result.spacer {
  display: none;
}

.info {
  margin: 2em auto 3em;
  display: block;
  text-align: center;
  font-size: 0.6875em;
  line-height: 1.2em;
}

a {
  color: #cca181;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  color: #FF6600;
}

a:visited {
  color: #CA0000;
}