html {
  -ms-touch-action: none;
}

body, canvas, div {
  display: block;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    /* display: none; <- Crashes Chrome on hover */
    -webkit-appearance: none;
    margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;

  cursor: default;
  color: #888;
  background-color: #EAF4E8;

  text-align: center;
  font-family: Helvetica, Verdana, Arial, sans-serif;

  display: flex;
  flex-direction: column;
}

canvas {
  background-color: rgba(0, 0, 0, 0);
}

#GameDiv, #Cocos3dGameContainer, #GameCanvas {
  width: 100%;
  height: 100%;
}

:root {
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#GameCanvas:focus-visible {
  outline: 4px solid #f2b84b;
  outline-offset: -4px;
}

html, body { width: 100%; height: 100%; overflow: hidden; }
#BrandSplash { position:fixed; inset:0; z-index:3; display:flex; align-items:center; justify-content:center; flex-direction:column; box-sizing:border-box; padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left)); background:#fffdf7; }
#BrandSplash img { display:block; width:min(56vw,32vh,224px); aspect-ratio:1; height:auto; object-fit:contain; border-radius:8px; }
#BrandSplash h1 { margin:20px 0 0; color:#214832; font:600 28px/1.3 system-ui,sans-serif; letter-spacing:2px; }
#BrandSplash p { margin:12px 0 0; color:#476c59; font:14px/1.5 system-ui,sans-serif; text-align:center; }
#BrandRetry { margin-top:20px; min-width:132px; min-height:44px; border:0; border-radius:8px; background:#296c55; color:#fff; font:600 16px system-ui,sans-serif; cursor:pointer; }
#BrandRetry[hidden] { display:none; }
#BrandRetry:focus-visible { outline:3px solid #bf8a26; outline-offset:3px; }
#GameDiv { position: fixed; inset: 0; flex: none; }

#WebPlayerAccount {
  box-sizing: border-box;
  width: min(calc(100% - 36px), 380px);
  max-height: calc(100% - 32px);
  padding: 24px;
  border: 1px solid #a9a779;
  border-radius: 16px;
  background: #142d25;
  color: #fcf4dc;
  text-align: left;
  font: 16px/1.5 system-ui, sans-serif;
}
#WebPlayerAccount::backdrop { background: rgba(4, 18, 13, .78); }
#WebPlayerAccount .web-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#WebPlayerAccount h2 { margin: 0; font-size: 24px; }
#WebPlayerAccount p { margin: 0 0 16px; color: #e0e9d5; }
#WebPlayerAccount label { display: block; margin: 0 0 6px; }
#WebPlayerAccount input, #WebPlayerAccount button {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #799485;
  border-radius: 8px;
  font: inherit;
}
#WebPlayerAccount input { background: #f8f4e8; color: #142d25; user-select: text; }
#WebPlayerAccount button { background: #2e5747; color: #fff8e8; cursor: pointer; }
#WebPlayerAccount #WebAccountClose { width: 44px; flex: 0 0 44px; margin: 0; padding: 0; background: transparent; border-color: transparent; font-size: 24px; }
#WebPlayerAccount #WebAccountEnter { border-color: #d8c792; background: #f4e4b7; color: #192d23; margin-bottom: 0; }
#WebPlayerAccount .web-account-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#WebAccountSend { white-space: nowrap; }
#WebPlayerAccount button:disabled { opacity: .65; cursor: default; }
#WebPlayerAccount :focus-visible { outline: 2px solid #f1c767; outline-offset: 2px; }
#WebPlayerAccount #WebAccountNotice { margin: 10px 0 0; }

.sr-only { top: 0; left: 0; clip-path: inset(50%); }
