:root {
  --ink: #14070b;
  --wine: #2b0a13;
  --wine-2: #4a1220;
  --line: #66293a;
  --gold: #d9b56a;
  --gold-2: #f2dc9e;
  --cream: #f6ecd6;
  --muted: #c3a79a;
  --display: 'Courier New', Courier, monospace;
  --ui: 'Courier New', Courier, monospace;
  color-scheme: dark;
  font-family: var(--ui);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-weight: 900;
  font-family: 'Courier New', Courier, monospace;
}

body {
  background: 
    radial-gradient(900px 520px at 12% -8%, rgba(120,24,44,.55), transparent 65%),
    radial-gradient(700px 500px at 100% 100%, rgba(90,18,34,.45), transparent 60%),
    var(--ink);
  color: var(--cream);
  font-weight: 800;
  font-size: 1.2rem;
  min-height: 100vh;
}

.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding-block: 28px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.top img {
  width: 54px;
  height: 54px;
  flex: none;
}

.top h1 {
  margin: 0;
  font: 700 22px/1.15 var(--display);
  letter-spacing: .08em;
  text-wrap: balance;
}

.top p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.stage {
  position: sticky;
  top: 24px;
  min-width: 0;
}

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.25);
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label {
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  transition: background .15s, color .15s;
}

.seg input:checked + label {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #3a0b17;
}

.seg input:focus-visible + label {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

.stage .seg {
  margin-bottom: 18px;
}

.cardwrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 5.5/8.5;
  margin: 0 auto;
  filter: drop-shadow(0 28px 36px rgba(0,0,0,.6));
}

#card {
  width: 100%;
  height: 100%;
  display: block;
}

.hit {
  position: absolute;
  left: 24.31%;
  top: 23.25%;
  width: 51.39%;
  height: 39%;
  touch-action: none;
  cursor: grab;
  border-radius: 4px;
}

.hit:focus-visible {
  outline: 2px dashed var(--gold-2);
  outline-offset: 3px;
}

.hit.drag {
  cursor: grabbing;
}

.hint {
  margin: 16px auto 0;
  max-width: 400px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

.group {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(74,18,32,.35), rgba(43,10,19,.35));
}

.group h2 {
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field > label, .lab {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
}

input[type=text] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--cream);
  font: inherit;
}

input[type=text]::placeholder {
  color: #8f7469;
}

input[type=text]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 22px 16px;
  border: 1.5px dashed #8a5a4a;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  color: var(--cream);
  cursor: pointer;
  font: inherit;
  width: 100%;
  transition: border-color .15s, background .15s;
}

.drop:hover, .drop.over {
  border-color: var(--gold-2);
  background: rgba(217,181,106,.08);
}

.drop:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

.drop b {
  font-weight: 600;
  font-size: 14px;
  color: var(--gold-2);
}

.drop span {
  color: var(--muted);
  font-size: 13px;
}

.sliders {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.sl {
  display: grid;
  grid-template-columns: 96px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.sl[aria-disabled=true] {
  opacity: .45;
}

input[type=range] {
  width: 100%;
  accent-color: var(--gold);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  font: 600 15px/1 var(--ui);
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  cursor: pointer;
  transition: transform .1s, background .15s, scale .15s;
}

.btn:hover {
  background: rgba(217,181,106,.12);
  scale: 1.05;
}

.btn:active {
  transform: translateY(5px);
}

.btn:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
}

.btn.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #3a0b17;
  border-color: transparent;
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn.small {
  padding: 10px 14px;
  font-size: 13.5px;
}

.btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.seg.wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.seg.wrap label {
  padding: 12px 8px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.25;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.25);
}

.seg.wrap input:checked + label {
  border-color: transparent;
}

.tog {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tog input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--gold);
}

.tog small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

/* --- Bagian Footer & Credit --- */

.footer {
  position: relative;
  bottom: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
  padding-top: 50px;
}

.footer::before {
  position: absolute;
  left: 0;
  margin-bottom: 9.3rem;
  height: 1.5rem;
  width: 100%;
  border-bottom-right-radius: 9999px;
  border-bottom-left-radius: 9999px;
  content: '';
}

.site-footer {
  width: 100%;
  color: #ebdfdf;
  font-weight: 700;
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-content: center;
  align-items: center;
}

.social-parent {
  border-radius: 15px;
  border: 1px solid #66293A;
  background-color: #1E080F;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 30px;
  padding-bottom: 0.25rem;
}

.footer-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social:hover {
  scale: 1.05;
}

.footer-social p {
  font-family: 'Courier New', Courier, monospace;
  color: #EAC679;
}

.footer-social img {
  width: 35px;
  height: 35px;
  border-radius: 5px;
  background-color: #EAC679;
  padding: 0.25rem;
  object-fit: contain;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social img:hover {
  transform: scale(1.1);
}

.footer-copyright-wrapper {
  text-align: center;
  padding: 0.25rem;
}

.footer-copyright-text {
  border: 1px solid #000000;
  padding: 0.25rem 0.5rem;
  margin: 0;
}

.author-link {
  color: #172554;
  text-decoration: none;
}

.author-link:hover {
  text-decoration: underline;
}

.credit h1 {
  background-color: rgb(59, 12, 12);
  justify-content: center;
  width: 100%;
  margin-top: 50px;
  padding: 5px 10px;
  text-align: center;
  position: absolute;
}

.creditName {
  z-index: -9999;
  box-shadow: 0px 0px 100px 0px #eac67935;
  font-family: 'Courier New', Courier, monospace;
  color: #EAC679;
  background-color: rgb(59, 12, 12);
  width: 100%;
  margin-top: 50px;
  padding-top: 5px;
  padding-bottom: 5px;
  text-align: center;
  bottom: 0;
  border-radius: 8px;
  border: 1px solid #CEA95E;
}

.creditName p {
  font-size: 15px;
}

.creditName a {
  font-family: 'Courier New', Courier, monospace;
  color: #DFBD75;
  text-decoration: none;
  transition: transform 150ms ease;
  display: inline-block;
}

.creditName a:hover {
  text-decoration: underline;
  transform: scale(1.05);
}

#status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--gold-2);
}

/* Responsivitas Media Queries */
@media (max-width: 860px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .stage {
    position: static;
  }
  .stage .seg {
    display: flex;
    justify-content: center;
    width: max-content;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
