:root {
  --background: #202725;
  --background-deep: #171d1b;
  --panel: #303a36;
  --panel-light: #3b4641;
  --outline: #111714;
  --bone: #f0ead9;
  --muted: #a9b0a6;
  --red: #a95150;
  --red-light: #c56a65;
  --blue: #9bbdc7;
  --blue-dark: #587b88;
  --yellow: #e9bd52;
  --yellow-dark: #a77d2c;
  --green: #738b72;
  --font-heading: "Russo One", sans-serif;
  --font-body: "Nunito", sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--background);
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 28px,
      rgba(255,255,255,0.018) 29px,
      rgba(255,255,255,0.018) 30px
    ),
    var(--background);
  color: var(--bone);
  font-family: var(--font-body);
  font-weight: 900;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    18px
    max(14px, env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  justify-content: flex-end;
  min-height: 42px;
}
.help-button {
  width: 38px;
  height: 38px;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: var(--panel-light);
  color: var(--bone);
  font-family: var(--font-heading);
  font-size: 22px;
  box-shadow: 0 4px 0 var(--outline);
}
.help-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--outline);
}
.entry-screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: 28px;
}
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 34px;
}
.main-logo {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 var(--outline));
}
.logo-placeholder {
  width: 150px;
  height: 150px;
  align-content: center;
  text-align: center;
  font-size: 110px;
  filter: drop-shadow(0 5px 0 var(--outline));
}
.logo-word {
  margin-top: 8px;
  color: var(--bone);
  font-family: var(--font-heading);
  font-size: clamp(38px, 11vw, 58px);
  line-height: 1;
  text-shadow:
    -3px -3px 0 var(--outline),
    3px -3px 0 var(--outline),
    -3px 3px 0 var(--outline),
    3px 3px 0 var(--outline),
    0 6px 0 var(--outline);
}
.logo-word span {
  color: var(--yellow);
}
.scan-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}
.wallet-label {
  font-family: var(--font-heading);
  font-size: 15px;
  text-shadow: 2px 2px 0 var(--outline);
}
.wallet-input {
  width: 100%;
  min-height: 62px;
  padding: 14px 16px;
  border: 4px solid var(--outline);
  border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% 82%, 96% 100%, 0 100%);
  background: #e3e1d4;
  color: #202725;
  font-size: 15px;
  font-weight: 900;
}
.wallet-input::placeholder {
  color: #737970;
  opacity: 1;
}
.scan-button,
.sample-button,
.secondary-button,
.share-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 4px solid var(--outline);
  clip-path: polygon(0 0, 100% 0, 100% 84%, 96% 100%, 0 100%);
  font-family: var(--font-heading);
  font-size: 20px;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35);
  transition: transform 100ms ease, filter 100ms ease;
}
.scan-button {
  min-height: 76px;
  background: var(--yellow);
  color: #25251c;
  box-shadow: 0 7px 0 var(--yellow-dark);
  font-size: 30px;
  text-shadow: none;
}
.scan-button:active,
.sample-button:active,
.secondary-button:active,
.share-button:active {
  transform: translateY(5px);
  filter: brightness(0.9);
}
.scan-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.sample-button {
  min-height: 44px;
  border-width: 3px;
  background: var(--panel-light);
  color: var(--bone);
  font-size: 14px;
  box-shadow: 0 4px 0 var(--outline);
}
.privacy-line {
  max-width: 340px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.entry-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #ef9b8e;
  font-size: 14px;
  text-align: center;
}
.history-wrap {
  width: 100%;
  margin-top: 22px;
}
.history-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 12px;
}
.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-chip {
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--outline);
  background: var(--panel);
  color: var(--bone);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.app-footer {
  margin-top: auto;
  padding: 14px 0 2px;
  color: #8e9990;
  font-size: 11px;
  text-align: center;
}
/* Shared angled panel */
.angled-panel {
  border: 4px solid var(--outline);
  clip-path: polygon(0 0, 100% 0, 100% 93%, 96% 100%, 0 100%);
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 18px,
      rgba(255,255,255,0.025) 19px,
      rgba(255,255,255,0.025) 20px
    ),
    var(--panel);
  box-shadow: 0 5px 0 var(--outline);
}
.screen-heading,
.results-screen h2,
.bottom-sheet h2 {
  font-family: var(--font-heading);
  text-shadow:
    -2px -2px 0 var(--outline),
    2px -2px 0 var(--outline),
    -2px 2px 0 var(--outline),
    2px 2px 0 var(--outline);
}
.scan-screen {
  flex: 1;
  padding: 14px 0 28px;
}
.scan-mascot-wrap {
  display: flex;
  justify-content: center;
  height: 112px;
  margin: 0 auto 12px;
}
.scan-mascot {
  width: 110px;
  height: 110px;
  object-fit: contain;
  animation: mascot-bob 1.8s ease-in-out infinite;
}
.mascot-placeholder {
  font-size: 88px;
  animation: mascot-bob 1.8s ease-in-out infinite;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}
.screen-heading {
  margin: 0;
  font-size: 25px;
  text-align: center;
}
.scan-wallet {
  max-width: 100%;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow-wrap: anywhere;
}
.scan-status-panel {
  padding: 16px;
}
.scan-status-panel p {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 17px;
}
.progress-track,
.rank-progress-track {
  width: 100%;
  height: 15px;
  overflow: hidden;
  border: 3px solid var(--outline);
  background: var(--background-deep);
}
.progress-fill,
.rank-progress-fill {
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width 200ms ease;
}
.scan-progress-text {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}
.scan-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 17px 0;
}
.counter-box {
  min-height: 76px;
  padding: 10px 5px;
  border: 3px solid var(--outline);
  background: var(--panel);
  text-align: center;
}
.counter-box span {
  display: block;
  min-height: 28px;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 10px;
}
.counter-box strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 25px;
  text-shadow: 2px 2px 0 var(--outline);
}
.live-feed-panel {
  padding: 14px;
}
.live-feed-panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 16px;
}
.live-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.live-feed p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.feed-row {
  padding: 8px 10px;
  border-left: 4px solid var(--muted);
  background: rgba(0,0,0,0.18);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.feed-row.rekt {
  border-color: var(--red-light);
}
.feed-row.dodge {
  border-color: var(--blue);
}
.feed-row.uncertain {
  border-color: var(--yellow);
}
.scan-screen > .secondary-button {
  margin-top: 18px;
}
/* Results */
.results-screen {
  flex: 1;
  padding: 8px 0 28px;
}
.result-topline {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.result-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  border: 4px solid var(--outline);
  box-shadow: 0 6px 0 var(--outline);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 94% 100%, 0 100%);
}
.rekt-stat {
  background: var(--red);
}
.dodge-stat {
  background: var(--blue-dark);
}
.result-stat span {
  font-family: var(--font-heading);
  font-size: 18px;
  text-shadow: 2px 2px 0 var(--outline);
}
.result-stat strong {
  font-family: var(--font-heading);
  font-size: 52px;
  line-height: 1.1;
  text-shadow:
    -3px -3px 0 var(--outline),
    3px -3px 0 var(--outline),
    -3px 3px 0 var(--outline),
    3px 3px 0 var(--outline);
}
.reaction-line {
  margin: 19px 0 8px;
  font-size: 16px;
  line-height: 1.45;
}
.saved-estimate {
  margin: 0 0 15px;
  color: var(--blue);
  font-size: 15px;
}
.result-warning {
  margin: 12px 0;
  padding: 12px;
  border: 3px solid var(--outline);
  background: #5c4930;
  color: #fff1d0;
  font-size: 13px;
}
.earned-section,
.token-section {
  margin-top: 24px;
}
.results-screen h2 {
  margin: 0 0 12px;
  font-size: 17px;
}
.earned-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.badge-card {
  position: relative;
  min-width: 0;
  padding: 12px 8px;
  border: 3px solid var(--outline);
  background: var(--panel);
  text-align: center;
  box-shadow: 0 4px 0 var(--outline);
  cursor: pointer;
  animation: badge-stamp 350ms cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes badge-stamp {
  from { opacity: 0; transform: scale(1.25) rotate(-7deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.badge-card img {
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto 7px;
  object-fit: contain;
}
.badge-placeholder {
  display: grid;
  place-items: center;
  height: 92px;
  font-size: 55px;
}
.badge-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.badge-level {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 5px 7px;
  background: var(--yellow);
  color: #29261c;
  font-family: var(--font-heading);
  font-size: 9px;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
}
.no-badges {
  color: var(--muted);
  font-size: 14px;
}
.rank-section {
  margin-top: 22px;
  padding: 17px;
}
.rank-label {
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 12px;
}
.rank-name {
  margin: 6px 0;
  font-family: var(--font-heading);
  font-size: 27px;
  text-shadow:
    -2px -2px 0 var(--outline),
    2px -2px 0 var(--outline),
    -2px 2px 0 var(--outline),
    2px 2px 0 var(--outline);
}
.rank-score {
  margin-bottom: 12px;
  color: var(--yellow);
  font-family: var(--font-heading);
  font-size: 14px;
}
.rank-progress-fill {
  background: var(--blue);
}
.rank-section p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.token-row {
  margin-bottom: 9px;
  border: 3px solid var(--outline);
  background: var(--panel);
}
.token-row-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px;
  border: 0;
  background: transparent;
  text-align: left;
}
.token-main {
  min-width: 0;
}
.token-symbol {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.token-mint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.token-type {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-family: var(--font-heading);
  font-size: 11px;
}
.token-type.rekt {
  background: var(--red);
}
.token-type.dodge {
  background: var(--blue-dark);
}
.token-details {
  padding: 12px;
  border-top: 2px solid var(--outline);
  background: rgba(0,0,0,0.16);
}
.token-details p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}
.timeline {
  margin-top: 12px;
  padding: 10px;
  border: 2px solid var(--outline);
  background: var(--background-deep);
}
.timeline-title {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 12px;
}
.timeline-gap {
  height: 10px;
  margin: 8px 0;
  border: 2px solid var(--outline);
  background: var(--red);
  overflow: hidden;
}
.timeline-gap span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.section-description {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
.uncertain-row {
  padding: 10px;
  margin-bottom: 8px;
  border: 2px solid var(--outline);
  background: var(--panel);
}
.uncertain-row strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.uncertain-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}
.share-button {
  background: var(--yellow);
  color: #29261c;
  box-shadow: 0 5px 0 var(--yellow-dark);
  text-shadow: none;
}
.secondary-button {
  min-height: 50px;
  background: var(--panel-light);
  color: var(--bone);
  font-size: 14px;
  box-shadow: 0 4px 0 var(--outline);
}
/* Sheets */
.sheet-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(0,0,0,0.72);
}
.bottom-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85svh;
  overflow-y: auto;
  padding: 25px 18px 24px;
  border: 4px solid var(--outline);
  background: var(--panel);
  box-shadow: 0 -5px 0 var(--outline);
  clip-path: polygon(0 0, 100% 0, 100% 96%, 96% 100%, 0 100%);
  animation: sheet-up 180ms ease-out both;
}
@keyframes sheet-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 45px;
  height: 5px;
  margin: -10px auto 20px;
  border-radius: 5px;
  background: var(--muted);
}
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 3px solid var(--outline);
  background: var(--background-deep);
  font-size: 25px;
}
.bottom-sheet h2 {
  margin: 0 0 17px;
  font-size: 22px;
}
.rule-item {
  margin-bottom: 16px;
}
.rule-item h3 {
  margin: 0 0 4px;
  color: var(--yellow);
  font-family: var(--font-heading);
  font-size: 14px;
}
.rule-item p,
.error-sheet p {
  margin: 0;
  color: var(--bone);
  font-size: 14px;
  line-height: 1.55;
}
.badge-sheet-content {
  text-align: center;
}
.badge-sheet-content img {
  display: block;
  width: 130px;
  height: 130px;
  margin: 10px auto;
  object-fit: contain;
}
.badge-sheet-content h3 {
  font-family: var(--font-heading);
  font-size: 22px;
}
.badge-sheet-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.poster-frame {
  width: 100%;
  border: 4px solid var(--outline);
  background: var(--background-deep);
}
.poster-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}
.share-link {
  margin: 12px 0;
  padding: 10px;
  border: 2px solid var(--outline);
  background: var(--background-deep);
  color: var(--blue);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.share-actions {
  display: grid;
  gap: 10px;
}
.share-error {
  color: #ef9b8e;
  font-size: 13px;
}
/* Desktop */
@media (min-width: 700px) {
  .app-shell {
    padding-right: 28px;
    padding-left: 28px;
  }
  .main-logo {
    width: 170px;
    height: 170px;
  }
  .logo-placeholder {
    width: 170px;
    height: 170px;
    font-size: 125px;
  }
}
/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
