:root {
  --bg-light: #d9d9d9;
  --bg-dark: #c3c3c3;
  --panel-light: #f5f5f5;
  --panel-mid: #e0e0e0;
  --panel-dark: #6f6f6f;
  --text: #000000;
  --muted: #333333;
  --highlight: #ffffff;
  --shadow: #7d7d7d;
  --bb-nav-height: 0px;

  /* Design tokens for cards and accents */
  --border-strong: 1px solid #000000;
  --radius-sm: 4px;
  --card-shadow-strong: 2px 2px 0 #000000;
  --card-shadow-medium: 1px 1px 0 #000000;
  --window-padding-y: 16px;

  /* Accent colors for dashboard cards */
  --accent-info: #d4e8ff;
  --accent-success: #d4ffd4;
  --accent-cream: #fffacd;
  --accent-rose: #ffe4e8;
  --accent-blush: #ffd4f4;
  --accent-sun: #ffeb3b;
  --accent-lilac: #e8d4ff;
  --accent-sky: #b3d9ff;
  --accent-mint: #b3ffcc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Chicago", "Geneva", sans-serif;
  background:
    repeating-linear-gradient(90deg, var(--bg-light), var(--bg-light) 4px, var(--bg-dark) 4px, var(--bg-dark) 8px);
  color: var(--text);
  display: block;
  min-height: 100dvh;
  padding-top: calc(var(--bb-nav-height) + 16px);
}

body.no-nav {
  padding-top: 32px;
}

.desktop {
  width: min(820px, 100%);
  margin: 12px auto 24px;
  padding: 0 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 12px;
  background: linear-gradient(#8f8f8f, #6d6d6d);
  color: #ffffff;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  font-size: 14px;
  letter-spacing: 0.3px;
}

.menu-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.menu-apple {
  font-size: 18px;
}

.window {
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

.title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(#898989, #5c5c5c);
  color: #ffffff;
  border-bottom: 1px solid #000000;
  box-shadow: inset 1px 1px #bbbbbb, inset -1px -1px #333333;
}

.window-controls {
  display: inline-flex;
  gap: 4px;
}

.window-controls span {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

.title-text {
  flex: 1;
  text-align: center;
  font-weight: bold;
  letter-spacing: 0.4px;
}

.window-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Waiter home layout */
.waiter-home {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 32px;
  box-sizing: border-box;
}

.waiter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.waiter-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 18px 20px;
  margin-bottom: 12px;
}

.hero-logo {
  width: min(280px, 80vw);
  max-width: 280px;
  height: auto;
  margin: 8px auto 18px;
  display: block;
  image-rendering: pixelated;
}

p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hint,
.hint-inline {
  font-size: 12px;
  color: var(--muted);
}

.hint-inline {
  text-align: center;
}

h1 {
  font-size: 20px;
  margin: 0;
  text-align: center;
  letter-spacing: 0.4px;
}

h2 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 8px;
  color: var(--text);
}

.beta-note,
.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid #000000;
  background: var(--panel-mid);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 12px;
}

.btns,
.btn-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar .logo-text {
  font-size: 2rem;
  margin: 0 auto;
}

.window-body > .logo-text {
  margin: 0 auto 12px;
}

button,
.btn,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid #000000;
  background: var(--panel-light);
  color: #000000;
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 1px 1px var(--highlight),
    inset -1px -1px var(--shadow),
    2px 2px 0 #000000;
  transition: none;
}

button:hover,
.btn:hover,
.btn-link:hover {
  box-shadow:
    inset -1px -1px var(--highlight),
    inset 1px 1px var(--shadow),
    2px 2px 0 #000000;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #000000;
  background: var(--panel-light);
  color: #000000;
  font-family: inherit;
  font-size: 14px;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: inset -1px -1px var(--highlight), inset 1px 1px var(--shadow);
}

.input {
  display: block;
  width: 100%;
}

.panel {
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

.tag-list,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  font-size: 12px;
}

.two-column {
  display: grid;
  gap: 12px;
}

@media (min-width: 620px) {
  .two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.emoji-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.emoji {
  flex: 1;
  min-width: 80px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  padding: 12px 0;
  font-size: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.emoji:hover {
  box-shadow: inset -1px -1px var(--highlight), inset 1px 1px var(--shadow);
}

.emoji.active {
  background: var(--panel-mid);
  font-weight: bold;
}

.percent-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .percent-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pill {
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.pill:hover {
  box-shadow: inset -1px -1px var(--highlight), inset 1px 1px var(--shadow);
}

.pill.active {
  background: var(--panel-mid);
  font-weight: bold;
}

.summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 540px) {
  .summary {
    grid-template-columns: 1fr;
  }
}

.kpi {
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  padding: 12px 0;
  text-align: center;
}

.kpi b {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.kpi span {
  font-size: 18px;
  font-weight: bold;
}

.qr-wrap {
  display: none;
  margin-top: 16px;
  text-align: center;
}

.qr-box {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border: 1px solid #000000;
  background: #ffffff;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  width: 100% !important;
  height: 100% !important;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.uri-preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.steps {
  border: 1px solid #000000;
  background: var(--panel-mid);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  padding: 12px 14px;
}

.steps strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.steps ol {
  margin: 10px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

footer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

footer a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  text-decoration: underline;
}

.footer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

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

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

.avatar-option input {
  margin: 0;
}

.avatar-option img {
  width: 72px;
  height: 72px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  object-fit: cover;
  image-rendering: pixelated;
}

.avatar-option input:checked + img {
  box-shadow: inset -1px -1px var(--highlight), inset 1px 1px var(--shadow);
  background: var(--panel-mid);
}

.top-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, calc(100% - 24px));
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 999;
}

.top-nav .nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.logo-text {
  font-family: "Chicago", "Geneva", system-ui, sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: repeating-linear-gradient(
    -45deg,
    #000 0,
    #000 2px,
    #fff 2px,
    #fff 4px
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  text-align: center;
}

.top-nav .logo-text {
  flex: 1;
}

.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: var(--panel-light);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
}

.nav-username {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.nav-username span {
  font-size: 14px;
  font-weight: bold;
  text-transform: none;
  letter-spacing: 0.2px;
}

.nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-links a {
  padding: 4px 10px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  text-decoration: none;
  color: inherit;
}

.nav-links a:hover,
.nav-links a.is-active {
  box-shadow: inset -1px -1px var(--highlight), inset 1px 1px var(--shadow);
}

#app {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#leaderboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#leaderboard h2,
#cryptoTip h2 {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: repeating-linear-gradient(
    -45deg,
    #000 0,
    #000 2px,
    #fff 2px,
    #fff 4px
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

#leaderboardTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#leaderboardTable th,
#leaderboardTable td {
  padding: 8px 6px;
  border: 1px solid #000000;
  text-align: left;
}

#leaderboardTable thead {
  background: var(--panel-mid);
}

#refreshLeaderboard {
  align-self: flex-start;
}

#cryptoTip {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#walletInput {
  flex: 1;
  min-width: 220px;
  padding: 9px 10px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
}

#generateQR {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid #000000;
  background: var(--panel-light);
  box-shadow:
    inset 1px 1px var(--highlight),
    inset -1px -1px var(--shadow),
    2px 2px 0 #000000;
  cursor: pointer;
  font-weight: bold;
}

#generateQR:hover {
  box-shadow:
    inset -1px -1px var(--highlight),
    inset 1px 1px var(--shadow),
    2px 2px 0 #000000;
}

#qrCanvas {
  width: 180px;
  height: 180px;
  border: 1px solid #000000;
  box-shadow: inset 1px 1px var(--highlight), inset -1px -1px var(--shadow);
  margin-top: 12px;
}

#qrStatus {
  font-size: 12px;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid #000000;
  margin: 12px 0;
}

@media (max-width: 640px) {
  .desktop {
    margin: 12px auto 24px;
    padding: 0 10px 24px;
    gap: 12px;
  }

  .top-nav {
    width: calc(100% - 16px);
    padding: 8px 10px;
  }

  .top-nav .logo-text {
    font-size: 1.8rem;
  }

  .nav-links {
    justify-content: center;
  }

  body {
    padding-top: calc(var(--bb-nav-height) + 16px);
  }

  .menu-bar {
    font-size: 12px;
    gap: 8px;
  }

  .window-body {
    padding: 14px;
    gap: 10px;
  }

  .waiter-home {
    padding: 16px 16px 28px;
    gap: 18px;
  }

  .waiter-main {
    padding: 14px 16px 20px;
    gap: 14px;
  }

  .toolbar {
    justify-content: center;
  }
}
