:root {
  color-scheme: light;
  background: #3a2741;
  color: #30223a;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
#game {
  position: fixed;
  inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  display: grid;
  place-items: center;
  background: #d9a889;
  overflow: hidden;
}
#board { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; opacity: 0; pointer-events: none; }
[data-game="ready"] #board { opacity: 1; pointer-events: auto; }
.felt-card {
  position: relative;
  width: min(88vw, 24rem);
  padding: 1.45rem 1.25rem 1.6rem;
  text-align: center;
  border: 5px solid #e1ac9c;
  border-radius: 26px;
  background: #fff6e1;
  box-shadow: 0 4px 0 #ac7576;
}
.felt-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px dashed #d29a86;
  border-radius: 17px;
  pointer-events: none;
}
.felt-card img { display: block; margin: 0 auto; object-fit: contain; }
.felt-card h1 { margin: .3rem 0; font-size: clamp(1.8rem, 9vw, 2.6rem); }
.felt-card p { margin: .5rem 0 .85rem; }
.felt-card progress {
  display: block;
  width: 100%;
  height: 1.15rem;
  accent-color: #397967;
}
.felt-card button {
  min-height: 44px;
  padding: .55rem 1rem;
  border: 2px solid #a46e48;
  border-radius: .8rem;
  background: #f6d580;
  color: #30223a;
  font: inherit;
  font-weight: 650;
}
#profile-file-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(41 29 42 / 65%);
  z-index: 1;
}

#tester-access {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  background: rgb(49 31 55 / 84%);
}

#tester-update {
  position: absolute;
  z-index: 1;
  top: .5rem;
  right: .5rem;
  min-height: 44px;
  padding: .5rem .8rem;
  border: 2px solid #674246;
  border-radius: .65rem;
  background: #f8d0a1;
  color: #392739;
  font: 700 1rem system-ui, sans-serif;
}

#profile-file-overlay { z-index: 2; }
#tap-test { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#tap-test-dots { position: absolute; inset: 0; overflow: hidden; }
.tap-test-dot {
  position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%);
  background: #eead46; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #30223a;
}
.tap-test-dot.received { background: #28786a; }
.tap-test-note {
  position: absolute; inset: .4rem .4rem auto; min-height: 44px; padding: .3rem .55rem;
  display: flex; gap: .6rem; align-items: center; background: #fff6e1; border: 1px solid #a46e48;
  border-radius: .6rem; font-size: .85rem;
}
#tap-test-result { flex: 1; }
#tap-test-close {
  pointer-events: auto; min-height: 44px; border: 1px solid #a46e48; border-radius: .5rem;
  background: #f6d580; color: #30223a; font: inherit;
}
#profile-file-overlay > .felt-card {
  max-height: calc(100% - 16px);
  overflow-y: auto;
}
#profile-transfer-code {
  width: 100%;
  min-height: 4.5rem;
  margin: 0 0 .75rem;
  padding: .55rem;
  border: 2px solid #a46e48;
  border-radius: .55rem;
  background: #fffdf4;
  color: inherit;
  font: inherit;
}
#profile-transfer-camera {
  display: block;
  width: 100%;
  width: min(100%, 38dvh);
  max-width: 14rem;
  aspect-ratio: 1;
  margin: 0 auto .75rem;
  border: 2px solid #a46e48;
  border-radius: .55rem;
  background: #30223a;
  object-fit: cover;
}
.file-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
}
