* {
  box-sizing: border-box;
}

:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #ffe790;
  background: #080302;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.site-header {
  position: relative;
  z-index: 5;
  height: 53px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.header-inner {
  width: min(650px, calc(100% - 24px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  height: 100%;
}

.brand img {
  display: block;
  width: 135px;
  height: auto;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle {
  width: 24px;
  height: 24px;
  padding: 5px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #7a8492;
  background: #f2f3f5;
  cursor: pointer;
}

.sound-toggle:hover {
  color: #4a5565;
  background: #e8ebef;
}

.sound-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sound-on,
.sound-toggle[aria-pressed="true"] .sound-off {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-on {
  display: block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-nav a,
.desktop-nav img {
  display: block;
  width: 97px;
  height: 28px;
}

.desktop-nav a:nth-child(2) {
  width: 95px;
}

.desktop-nav a:nth-child(3) {
  width: 102px;
}

.desktop-nav img {
  object-fit: fill;
  transition: filter 150ms ease, transform 150ms ease;
}

.desktop-nav a:hover img,
.mobile-nav a:hover img {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.mobile-home {
  display: none;
}

.game-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 53px);
  min-height: 500px;
  overflow: hidden;
  isolation: isolate;
  background: #29100e;
}

.stage-background {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-background img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mobile-nav {
  display: none;
}

.main-content {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: min(280px, calc(100vw - 32px));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transform: translate(-50%, -50%);
}

.convert-card {
  width: 280px;
  flex: 0 0 280px;
  padding: 13px 15px 14px;
  border: 2px solid #c99742;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(132, 31, 20, 0.98), rgba(82, 13, 9, 0.99)),
    #68150e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 222, 125, 0.35),
    0 12px 35px rgba(0, 0, 0, 0.4);
}

.outcome-panel {
  position: absolute;
  top: 50%;
  left: calc(100% + 14px);
  transform: translateY(-50%);
  width: 190px;
  flex: 0 0 190px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 2px solid #c99742;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(132, 31, 20, 0.98), rgba(82, 13, 9, 0.99)),
    #68150e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 222, 125, 0.25),
    0 12px 35px rgba(0, 0, 0, 0.4);
}

.outcome-panel legend {
  padding: 0 6px;
  color: #ffdd62;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px #4c0802;
}

.outcome-option {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  padding: 7px 9px;
  border: 1px solid #d5a448;
  border-radius: 7px;
  color: #ffe7a0;
  background: #210805;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.outcome-option:last-child {
  margin-bottom: 0;
}

.outcome-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #ffbd2c;
}

.outcome-option-success:has(input:checked) {
  border-color: #37c96b;
  color: #b6ffca;
  background: #073b25;
}

.outcome-option-failure:has(input:checked) {
  border-color: #e85a4f;
  color: #ffb8ad;
  background: #4a100d;
}

.card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-name {
  height: 23px;
  color: #ffe58b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 23px;
  text-shadow:
    0 1px 0 #9c571b,
    0 2px 3px #280500;
}

.form-title {
  display: block;
  width: 160px;
  height: auto;
  margin-top: -1px;
  filter: drop-shadow(0 2px 2px rgba(30, 0, 0, 0.6));
}

.convert-form {
  margin-top: 15px;
}

.field-group {
  margin: 0 0 9px;
}

.field-group label {
  display: block;
  margin: 0 0 4px;
  color: #ffdd62;
  font-size: 14px;
  font-weight: 800;
  line-height: 16px;
  text-shadow: 0 1px 2px #4c0802;
}

.field-group input {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d5a448;
  border-radius: 999px;
  outline: 0;
  color: #fff0c4;
  background: #210805;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65);
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field-group input::placeholder {
  color: rgba(255, 233, 190, 0.62);
}

.field-group input:focus {
  border-color: #ffe27d;
  box-shadow:
    0 0 0 2px rgba(255, 205, 59, 0.19),
    inset 0 2px 4px rgba(0, 0, 0, 0.65);
}

.human-check {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 1px solid #d5a448;
  border-radius: 6px;
  color: #ffdd62;
  background: #210805;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px #4c0802;
}

.human-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #ffad18;
  cursor: pointer;
}

.human-check label {
  cursor: pointer;
}

.primary-button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid #ffe27d;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ffbd2c 0%, #ff8a00 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 2px 5px rgba(43, 5, 0, 0.45);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(118, 45, 0, 0.6);
  transition: filter 140ms ease, transform 140ms ease;
}

.primary-button:hover {
  filter: brightness(1.08);
}

.primary-button:active {
  transform: scale(0.985);
}

.primary-button:focus-visible {
  outline: 2px solid #fff3bd;
  outline-offset: 3px;
}

.form-message {
  margin: 0;
  color: #ffe7a0;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.form-message:empty {
  display: none;
}

.result h1 {
  margin: 11px 0 14px;
  color: #ffe790;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.convert-card.is-success .result h1 {
  color: #63ed8f;
}

.result h1::before,
.result h1::after {
  color: #35c759;
  content: "✔";
  font-size: 0.9em;
  margin: 0 4px;
  vertical-align: 1px;
}

.convert-card.is-success {
  border-color: #37c96b;
  background:
    linear-gradient(145deg, rgba(9, 83, 43, 0.98), rgba(5, 48, 29, 0.99)),
    #073b25;
  box-shadow:
    inset 0 0 0 1px rgba(128, 255, 165, 0.3),
    0 12px 35px rgba(0, 0, 0, 0.4);
  animation: result-pop-in 2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transform-origin: center;
}

@keyframes result-pop-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.convert-card.is-success .brand-name {
  color: #9affb5;
  text-shadow: 0 2px 3px #032313;
}

.convert-card.is-success .form-title {
  display: none;
}

.transfer-time {
  margin: 0 0 16px;
  color: #ffe7c0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.convert-card.is-success .transfer-time,
.convert-card.is-success .result-message {
  color: #d6ffe1;
}

.result-details {
  margin: 0;
  color: #ffdd62;
  font-size: 13px;
}

.convert-card.is-success .result-details {
  color: #a9f5bf;
}

.result-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 9px 12px;
  border: 1px solid #d5a448;
  border-radius: 999px;
  background: #210805;
}

.convert-card.is-success .result-details div {
  border-color: #36a95c;
  background: #062b1a;
}

.result-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #fff0c4;
  font-weight: 700;
  text-align: right;
}

.convert-card.is-success .result-details dd {
  color: #e2ffea;
}

.result-message {
  margin: 14px 0 0;
  color: #ffe7a0;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.convert-card.is-success .primary-button {
  border-color: #83f6a4;
  background: linear-gradient(180deg, #39d66e 0%, #159447 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 2px 5px rgba(0, 25, 10, 0.45);
  text-shadow: 0 1px 1px rgba(0, 58, 24, 0.65);
}

.convert-card.is-failure {
  border-color: #e85a4f;
  background:
    linear-gradient(145deg, rgba(112, 23, 18, 0.99), rgba(57, 9, 8, 0.99)),
    #390908;
  box-shadow:
    inset 0 0 0 1px rgba(255, 119, 102, 0.25),
    0 12px 35px rgba(0, 0, 0, 0.4);
  animation: result-pop-in 250ms ease-out both;
}

.convert-card.is-failure .result h1 {
  color: #ff7165;
}

.convert-card.is-failure .result h1::before,
.convert-card.is-failure .result h1::after {
  color: #ff7165;
  content: "\2715";
}

.convert-card.is-failure .transfer-time,
.convert-card.is-failure .result-details {
  display: none;
}

.convert-card.is-failure .result-message {
  color: #ffd1c9;
}

.convert-card.is-failure .primary-button {
  border-color: #ff988c;
  background: linear-gradient(180deg, #ed5548 0%, #b92720 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 5px rgba(28, 0, 0, 0.45);
  text-shadow: 0 1px 1px rgba(75, 0, 0, 0.65);
}

.promo-widget {
  position: fixed;
  z-index: 4;
  right: 24px;
  width: 144px;
  height: 144px;
}

.promo-widget-left {
  bottom: 36%;
}

.promo-widget-right {
  bottom: 16%;
}

.promo-widget > a,
.promo-widget > a img {
  display: block;
  width: 100%;
  height: 100%;
}

.promo-widget > a img {
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

.widget-close {
  position: absolute;
  z-index: 1;
  top: -8px;
  right: -7px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d6d6d6;
  border-radius: 50%;
  color: #747474;
  background: #fff;
  font-size: 22px;
  font-weight: 300;
  line-height: 22px;
  cursor: pointer;
}

.widget-close:hover {
  color: #222;
  background: #f2f2f2;
}

@media (max-width: 767px) {
  .site-header {
    height: 37px;
  }

  .header-inner {
    width: calc(100% - 18px);
  }

  .brand img {
    width: 108px;
  }

  .header-actions {
    gap: 7px;
  }

  .sound-toggle {
    width: 18px;
    height: 18px;
    padding: 3px;
  }

  .sound-icon {
    width: 12px;
    height: 12px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-home {
    display: block;
    width: 82px;
    height: 22px;
  }

  .mobile-home img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

  .game-stage {
    height: calc(100vh - 37px);
    height: calc(100svh - 37px);
    min-height: 500px;
  }

  .main-content {
    width: min(280px, calc(100vw - 32px));
    flex-direction: column;
    gap: 10px;
  }

  .convert-card,
  .outcome-panel {
    width: 100%;
    flex: 0 0 auto;
  }

  .outcome-panel {
    position: static;
    transform: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px 10px 9px;
  }

  .outcome-panel legend {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .outcome-option {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    margin: 0;
    padding: 5px;
    font-size: 12px;
  }

  .mobile-nav {
    position: absolute;
    top: 6px;
    left: 50%;
    z-index: 3;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
  }

  .mobile-nav a,
  .mobile-nav img {
    display: block;
    width: 100px;
    height: 26px;
  }

  .mobile-nav img {
    object-fit: fill;
    transition: filter 150ms ease, transform 150ms ease;
  }

  .promo-widget {
    right: 16px;
    width: 96px;
    height: 96px;
  }

  .promo-widget-left {
    bottom: 31%;
  }

  .promo-widget-right {
    bottom: 14%;
  }

  .widget-close {
    top: -5px;
    right: -4px;
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 18px;
  }
}

@media (max-width: 360px) {
  .brand img {
    width: 96px;
  }

  .mobile-nav {
    gap: 4px;
  }

  .mobile-nav a,
  .mobile-nav img {
    width: 92px;
    height: 24px;
  }
}

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