* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  background: #1c120b;
  background-image: radial-gradient(ellipse at center, #2e1e12 0%, #1c120b 70%, #140c07 100%);
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  touch-action: none;
  outline: none;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
}

/* Native text inputs laid over the canvas (mobile keyboards need a real element). */
.ui-input {
  position: absolute;
  display: block;
  border: 2px solid #8a6a2a;
  border-radius: 8px;
  background: #f6ead0;
  color: #2e1f12;
  font-family: 'Bitter', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  padding: 0 12px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(60, 35, 15, 0.25);
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.ui-input::placeholder {
  color: #9a8462;
  font-weight: 400;
  font-style: italic;
}

.ui-input:focus {
  border-color: #c9a14a;
  box-shadow: inset 0 2px 4px rgba(60, 35, 15, 0.25), 0 0 0 3px rgba(232, 200, 117, 0.35);
}

.ui-input.bad {
  border-color: #a8362a;
}

/* In-game Silver Coins card sheet (js/screens/silver.js): a DOM layer over the canvas, because card fields
   must be real elements and Stripe's card field is its own iframe. */
.coin-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(18, 10, 5, 0.66); font-family: 'Bitter', Georgia, serif; }
.coin-card { position: relative; box-sizing: border-box; width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; border-top: 6px solid #c8962e;
  background: #f4e7c8; color: #2a1d12; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5); }
@media (min-height: 700px) and (min-width: 520px) { .coin-sheet { align-items: center; } .coin-card { border-radius: 16px; } }
.coin-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 10px; border: 1px solid #b9a27a;
  background: #eadbb6; color: #2a1d12; font-size: 22px; line-height: 1; cursor: pointer; }
.coin-title { font-family: 'Rye', Georgia, serif; font-size: 24px; text-align: center; margin: 6px 48px 2px; }
.coin-sub { text-align: center; color: #6b5538; font-weight: 600; margin-bottom: 14px; }
.coin-label { display: block; font-size: 13px; font-weight: 700; color: #5a452c; margin: 12px 0 5px; }
.coin-input, .coin-field { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #b9a27a; border-radius: 10px;
  background: #fffaf0; color: #2a1d12; font: 16px 'Bitter', Georgia, serif; }
.coin-input:focus { outline: 2px solid #c8962e; outline-offset: 1px; }
.coin-error { min-height: 20px; margin: 10px 0 4px; color: #9b2c1f; font-size: 14px; font-weight: 600; text-align: center; }
.coin-pay { width: 100%; padding: 14px; border-radius: 12px; border: 2px solid #6b4a12; cursor: pointer;
  background: linear-gradient(#e6bd62, #c8962e); color: #2a1d12; font: 700 18px 'Bitter', Georgia, serif; }
.coin-pay:disabled { opacity: 0.6; cursor: default; }
.coin-note { margin-top: 10px; font-size: 12px; font-style: italic; color: #6b5538; text-align: center; }

/* "Choose a Payment Method" sheet for app-store builds (js/screens/silver.js, SilverScreen.openChooser; owner
   2026-11-29, modelled on "Last War Pay" in the game Last War). Reuses the .coin-* sheet above: a plain
   outlined store button (only with a native billing shell) and the big "Deadwood Trail Pay +N" button. */
.pay-sheet { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.pay-title { font-size: 21px; line-height: 1.2; margin: 6px 48px 4px; }
.pay-name { margin-bottom: 10px; }
.pay-pack { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid #d3bd8f;
  border-radius: 12px; background: #fbf3df; font-weight: 700; font-size: 16px; }
.pay-coins { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pay-coin { flex: none; }
.pay-price { flex: none; font-weight: 800; }
.pay-store { display: block; width: 100%; min-height: 50px; margin: 0 0 12px; padding: 12px; border-radius: 12px;
  border: 2px solid #6b5538; background: transparent; color: #2a1d12; font: 700 17px 'Bitter', Georgia, serif; cursor: pointer; }
.pay-web { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; min-height: 58px;
  padding: 12px 14px; font-size: 19px; box-shadow: 0 3px 0 #6b4a12; }
.pay-bonus { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 4px; border-radius: 999px;
  background: rgba(42, 29, 18, 0.14); font-weight: 800; }
.pay-spin { display: none; flex: none; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%;
  border: 3px solid rgba(42, 29, 18, 0.25); border-top-color: #2a1d12; animation: pay-spin 0.8s linear infinite; }
.pay-web.is-wait .pay-spin { display: inline-block; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pay-spin { animation-duration: 2.4s; } }
.pay-secure { margin-top: 2px; font-size: 12.5px; color: #6b5538; text-align: center; }
.pay-secure svg { display: inline-block; vertical-align: -1px; margin-right: 5px; }
@media (max-width: 359px) { .pay-web { font-size: 17px; } .pay-secure { font-size: 12px; } }

/* In-game account deletion sheet (js/screens/account.js, AccountScreen.openDeleteSheet; app-store account-deletion
   requirement, 2026-11-28): a DOM layer over the canvas, like the .coin-* card sheet above. */
.acct-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(18, 10, 5, 0.7); font-family: 'Bitter', Georgia, serif; }
.acct-sheet.acct-done { align-items: center; background: rgba(18, 10, 5, 0.94); }
.acct-card { position: relative; box-sizing: border-box; width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; border-top: 6px solid #9b2c1f;
  background: #f4e7c8; color: #2a1d12; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5); }
.acct-done .acct-card { border-radius: 16px; margin: 0 16px; width: calc(100% - 32px); text-align: center; }
@media (min-height: 700px) and (min-width: 520px) { .acct-sheet { align-items: center; } .acct-card { border-radius: 16px; } }
.acct-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 10px; border: 1px solid #b9a27a;
  background: #eadbb6; color: #2a1d12; font-size: 22px; line-height: 1; cursor: pointer; }
.acct-title { font-family: 'Rye', Georgia, serif; font-size: 22px; text-align: center; margin: 6px 48px 2px; }
.acct-done .acct-title { margin: 6px 0 10px; }
.acct-name { text-align: center; color: #6b5538; font-weight: 700; margin-bottom: 10px; overflow-wrap: anywhere; }
.acct-text { font-size: 14px; line-height: 1.4; margin: 8px 0; }
.acct-list { margin: 4px 0 8px; padding-left: 22px; font-size: 14px; line-height: 1.45; }
.acct-warn { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: #f3d2c4; border: 1px solid #c9826d;
  color: #7a1f14; font-size: 14px; font-weight: 700; }
.acct-label { display: block; font-size: 13px; font-weight: 700; color: #5a452c; margin: 12px 0 5px; }
.acct-input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #b9a27a; border-radius: 10px;
  background: #fffaf0; color: #2a1d12; font: 16px 'Bitter', Georgia, serif; letter-spacing: 1px; }
.acct-input:focus { outline: 2px solid #9b2c1f; outline-offset: 1px; }
.acct-error { min-height: 20px; margin: 8px 0 4px; color: #9b2c1f; font-size: 14px; font-weight: 600; text-align: center; }
.acct-delete, .acct-ok { width: 100%; padding: 14px; border-radius: 12px; border: 2px solid #5e150c; cursor: pointer;
  background: linear-gradient(#c0412f, #9b2c1f); color: #fff6e0; font: 700 17px 'Bitter', Georgia, serif; }
.acct-ok { border-color: #6b4a12; background: linear-gradient(#e6bd62, #c8962e); color: #2a1d12; margin-top: 8px; }
.acct-delete:disabled { opacity: 0.45; cursor: default; }
.acct-cancel { width: 100%; margin-top: 8px; padding: 12px; border-radius: 12px; border: 1px solid #b9a27a; cursor: pointer;
  background: #eadbb6; color: #2a1d12; font: 600 15px 'Bitter', Georgia, serif; }
