:root {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Malgun Gothic",
    "Noto Sans KR",
    sans-serif;
  color: #332742;
  background: #e8eddc;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  position: fixed;
  inset: 0;
  height: 100dvh;
}
#world {
  display: block;
  width: 100vw;
  height: 100dvh;
  touch-action: none;
}
button,
input {
  font: inherit;
}
button,
a.cta {
  border: 0;
  border-radius: 16px;
  padding: 13px 20px;
  background: #fffaf3;
  color: #493760;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px #30203615;
}
button:hover {
  background: #eee4ff;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
header {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fffdf7ed;
  padding: 18px 23px;
  border-radius: 24px;
  box-shadow: 0 8px 32px #30203612;
}
header strong {
  font-size: 27px;
  color: #7c3aed;
  letter-spacing: -1px;
}
header span,
header small {
  font-size: 12px;
  color: #776487;
}
header small {
  border-left: 1px solid #ddd2e5;
  padding-left: 15px;
}
nav {
  position: absolute;
  right: 24px;
  top: 28px;
  display: flex;
  gap: 8px;
}
#status {
  position: absolute;
  left: 24px;
  bottom: 100px;
  background: #fffdf2ec;
  padding: 18px 22px;
  border-radius: 22px;
  max-width: 350px;
}
#status b {
  font-size: 20px;
}
#status p {
  font-size: 12px;
  margin-bottom: 0;
  color: #776487;
}
footer {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}
footer label {
  padding: 12px;
  background: #fffdf2ed;
  border-radius: 14px;
  font-size: 12px;
}
#notice {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: #332742e8;
  color: white;
  border-radius: 14px;
  padding: 12px 20px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 90%;
  text-align: center;
}
#notice.show {
  opacity: 1;
}
dialog {
  border: 0;
  border-radius: 28px;
  padding: 36px;
  box-shadow: 0 20px 100px #29183e33;
  color: #332742;
  background: #fffdf8;
  max-width: min(600px, 94vw);
  max-height: 85dvh;
}
dialog::backdrop {
  background: #30233c40;
  backdrop-filter: blur(5px);
}
#welcome {
  width: 420px;
  text-align: center;
}
h1 {
  font-size: 34px;
  line-height: 1.4;
  letter-spacing: -2px;
  margin: 12px 0;
}
dialog p {
  color: #7c6c88;
  font-size: 14px;
  line-height: 1.8;
}
.eyebrow {
  font-size: 10px !important;
  letter-spacing: 3px;
  color: #7c3aed !important;
}
form {
  display: grid;
  gap: 10px;
  margin: 25px 0 18px;
}
input:not([type="checkbox"]) {
  border: 1px solid #ddd2e5;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  width: 100%;
}
form button,
.cta {
  background: #7c3aed !important;
  color: white !important;
}
small {
  font-size: 11px;
  color: #8e7f96;
}
.close {
  position: absolute;
  right: 15px;
  top: 15px;
  font-size: 22px;
  padding: 4px 12px;
  box-shadow: none;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #ece4f2;
  border-radius: 18px;
  background: #fff;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.court-no {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: #f1eafa;
  color: #7c3aed;
  font-size: 14px;
}
.card h3 {
  margin: 0;
  font-size: 16px;
  flex: 1;
}
.court-kind {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f5f1f8;
  color: #8a7799;
  font-size: 11px;
  font-weight: 700;
}
.card p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #4b3d5c;
  line-height: 1.4;
}
.card p::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
}
.card[data-status="playing"] p::before {
  background: #f59e0b;
}
.card[data-status="waiting"] p::before {
  background: #8b5cf6;
}
.card .names {
  min-height: 18px;
  font-size: 12px;
  color: #8a7799;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card button {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  background: #f0e9ff;
  color: #7431d7;
  font-size: 13px;
  box-shadow: none;
}
.card[data-status="empty"] button:not(:disabled) {
  background: #7c3aed;
  color: #fff;
}
.cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
}
.ops-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #7c3aed;
  text-decoration: none;
}
@media (max-width: 520px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
#invite {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(380px, calc(100vw - 24px));
  padding: 24px;
  text-align: center;
  background: #fff9e9;
}
#invite h2 {
  margin: 8px 0;
  font-size: 23px;
}
#invite-detail {
  font-size: 14px;
  line-height: 1.6;
}
#invite-countdown {
  display: block;
  color: #77501f;
  margin: 16px 0;
}
.invite-actions {
  display: grid;
  gap: 8px;
}
#invite button {
  min-height: 44px;
}
#accept {
  background: #7c3aed;
  color: white;
}
#hitting {
  position: absolute;
  right: 35px;
  bottom: 40px;
  text-align: center;
}
#hit {
  border: 5px solid #c4b5fd;
  background: #7c3aed;
  color: white;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  font-size: 29px;
  touch-action: none;
  box-shadow: 0 8px 40px #7c3aed44;
}
#hit span {
  display: block;
  font-size: 10px;
  margin-top: 8px;
}
#hit.ready {
  border-color: #facc15;
  background: #3fae6a;
  box-shadow:
    0 0 0 12px #7ee0a155,
    0 0 26px #7ee0a1;
  animation: hit-now 0.32s ease-in-out infinite alternate;
}
/* Glow only: the button itself must not move under the finger. */
@keyframes hit-now {
  to {
    box-shadow:
      0 0 0 18px #7ee0a133,
      0 0 40px #7ee0a1;
  }
}
#hit.charging {
  background: #502098;
  transform: scale(0.96);
}
#timing {
  background: #fffdf2ed;
  border-radius: 12px;
  margin-bottom: 15px;
  padding: 8px;
  font-size: 13px;
}
#joystick {
  display: none;
  position: absolute;
  left: 25px;
  bottom: 100px;
  width: 115px;
  height: 115px;
  border: 2px solid #ffffffbb;
  background: #ffffff44;
  border-radius: 50%;
  touch-action: none;
}
#joystick i {
  position: absolute;
  top: 33px;
  left: 33px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fffdf5;
  pointer-events: none;
}

#reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2px;
  border-radius: 50%;
  background: #fff9;
  box-shadow: 0 0 0 2px #48355830;
  pointer-events: none;
}
#hit span {
  font-size: 9px;
  white-space: nowrap;
  letter-spacing: -0.4px;
}
#world {
  cursor: grab;
}
#world:active {
  cursor: grabbing;
}
@media (pointer: coarse) {
  #camera {
    display: none;
  }
}

#mobile-menu {
  display: none;
}
#hit b {
  font: inherit;
}
header,
nav,
footer,
#status,
#hitting,
#joystick,
#mobile-menu {
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 900px) {
  header {
    top: max(10px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    height: 44px;
    padding: 8px 14px;
    border-radius: 17px;
    gap: 10px;
  }
  header strong {
    font-size: 21px;
  }
  header span {
    display: none;
  }
  header small {
    font-size: 11px;
    padding-left: 10px;
  }
  #mobile-menu {
    display: block;
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 16px;
  }
  nav {
    display: none;
    top: calc(max(10px, env(safe-area-inset-top)) + 52px);
    right: max(12px, env(safe-area-inset-right));
    left: auto;
    z-index: 6;
    width: 188px;
    padding: 8px;
    background: #fffdf8;
    border: 1px solid #eee3f1;
    border-radius: 20px;
    box-shadow: 0 12px 35px #33274230;
  }
  body.menu-open nav {
    display: grid;
    gap: 4px;
  }
  nav button {
    min-height: 48px;
    padding: 12px;
    font-size: 13px;
    text-align: left;
    box-shadow: none;
  }
  #status {
    top: calc(max(10px, env(safe-area-inset-top)) + 53px);
    bottom: auto;
    left: max(12px, env(safe-area-inset-left));
    padding: 8px 12px;
    max-width: calc(100% - 24px);
    border-radius: 13px;
    pointer-events: none;
  }
  #status b {
    display: block;
    font-size: 12px;
    font-weight: 600;
  }
  #status p {
    display: none;
  }
  footer {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    gap: 6px;
  }
  footer button,
  footer label {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 11px;
    border-radius: 14px;
  }
  footer label {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  #camera {
    display: none;
  }
  #leave {
    margin-left: auto;
  }
  #joystick {
    display: block;
    width: 124px;
    height: 124px;
    left: max(20px, env(safe-area-inset-left));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px);
  }
  #joystick i {
    width: 50px;
    height: 50px;
    top: calc(50% - 25px);
    left: calc(50% - 25px);
  }
  #hitting {
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 66px);
    width: 88px;
  }
  #hit {
    width: 88px;
    height: 88px;
    border-width: 3px;
    font-size: 21px;
    padding: 0;
  }
  #hit span {
    font-size: 8px;
    margin-top: 3px;
    letter-spacing: -0.4px;
  }
  #hit.ready {
    box-shadow: 0 0 0 7px #facc1535;
  }
  #timing {
    width: 120px;
    margin: 0 0 10px -16px;
    padding: 6px 4px;
    font-size: 10px;
  }
  body:not(.playing) #timing {
    visibility: hidden;
  }
  #notice {
    top: calc(max(10px, env(safe-area-inset-top)) + 92px);
    width: max-content;
    padding: 8px 12px;
    font-size: 11px;
    max-width: calc(100% - 24px);
  }
  dialog {
    padding: 24px;
    max-height: calc(100dvh - 32px);
    max-width: calc(100vw - 24px);
  }
  #panel {
    width: 420px;
  }
  #panel h2 {
    font-size: 21px;
    padding-right: 16px;
  }
  .close {
    min-width: 44px;
    min-height: 44px;
  }
  .cards {
    gap: 8px;
  }
  .card {
    padding: 12px;
  }
  .card h3 {
    font-size: 14px;
  }
  .card button {
    min-height: 44px;
  }
  #welcome h1 {
    font-size: 28px;
  }
}
@media (max-width: 900px) and (max-height: 500px) {
  #status {
    background: #fffdf2b8;
  }
  footer {
    bottom: max(6px, env(safe-area-inset-bottom));
  }
  footer button,
  footer label {
    min-height: 36px;
    padding: 6px 10px;
  }
  #joystick,
  #hitting {
    bottom: calc(max(6px, env(safe-area-inset-bottom)) + 46px);
  }
  #welcome {
    padding: 16px 24px;
  }
  #welcome img,
  #welcome .eyebrow {
    display: none;
  }
  #welcome h1 {
    font-size: 24px;
    margin: 0;
  }
  #welcome h1 br {
    display: none;
  }
  #welcome form {
    margin: 12px 0;
  }
}
/* Play feedback: readable at a glance, outside the shuttle's flight path. */
#hit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    background 0.1s,
    box-shadow 0.1s;
}
#hit b,
#hit span {
  position: relative;
  z-index: 2;
}
#charge-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(#ffd45a, #c56b28);
  transform: scaleY(0);
  transform-origin: bottom;
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
}
#hit.charged {
  border-color: #ffdf73;
  box-shadow:
    0 0 0 6px #ffd65d30,
    0 0 28px #ffc24b55;
}
#hit.charged #hit-label {
  color: #fff5c8;
}
.beat-track,
.goal-track {
  height: 4px;
  border-radius: 8px;
  background: #d3c4e3;
  overflow: hidden;
  margin-top: 5px;
}
.beat-track i,
.goal-track i {
  display: block;
  height: 100%;
  width: 100%;
  background: #8e5cce;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.04s linear;
}
#hit.ready + * {
  color: #ffe779;
}
#goal-fill {
  transform: none;
  background: #b795d6;
  transition: width 0.2s;
}
#rally-hud {
  position: absolute;
  left: 24px;
  top: 120px;
  padding: 12px 16px;
  border-radius: 20px;
  background: #fffbf1e8;
  min-width: 130px;
  pointer-events: none;
}
.rally-main {
  display: flex;
  gap: 10px;
  align-items: center;
}
.rally-main > b {
  font-size: 38px;
  line-height: 1;
  color: #7943ba;
  font-variant-numeric: tabular-nums;
}
.rally-main > span {
  font-size: 12px;
}
.rally-main small {
  display: block;
  margin-top: 3px;
}
.rally-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #8d759e;
  margin-top: 9px;
}
/* Server's turn: a steady banner until the serve goes (not a flash). */
#serve-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  color: #ffe36b;
  text-shadow:
    0 3px 0 #49345d,
    0 6px 18px #3c244c66;
  white-space: nowrap;
  animation: serve-pulse 1.1s ease-in-out infinite;
}
#serve-banner[hidden] {
  display: none;
}
#serve-banner b {
  display: block;
  font-size: 40px;
  font-weight: 800;
  font-style: italic;
}
#serve-banner span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #fff4cb;
}
@keyframes serve-pulse {
  50% {
    transform: translate(-50%, -50%) scale(1.06);
  }
}
#hit.serve-turn {
  animation: serve-button 1s ease-in-out infinite;
}
@keyframes serve-button {
  50% {
    box-shadow:
      0 0 0 6px #ffd84d99,
      0 0 24px #ffd84d;
  }
}
#impact {
  position: absolute;
  top: 31%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  text-shadow:
    0 3px 0 #49345d,
    0 6px 18px #3c244c55;
  white-space: nowrap;
  color: #fff4cb;
}
#impact b {
  display: block;
  font-size: 44px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -1px;
}
#impact span {
  display: block;
  font-size: 13px;
  margin-top: 4px;
  font-weight: 600;
}
#impact.smash b {
  color: #ffdf61;
  font-size: 54px;
}
#impact.perfect b {
  color: #dfffad;
}
#impact.show {
  animation: impact-pop 0.78s both;
}
@keyframes impact-pop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.92);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
  }
  28%,
  65% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -65%) scale(0.96);
  }
}
#countdown {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff5d8;
  font-size: 80px;
  font-weight: 800;
  text-shadow: 0 4px 0 #765094;
  pointer-events: none;
}
#look-hint {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  background: #352445c9;
  color: #fff3dc;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}
.lesson-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.lesson-list button {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 18px;
  background: #f3ecfa;
  border: 1px solid #e6d9f0;
  min-height: 90px;
  box-shadow: none;
}
.lesson-list button[data-lesson="smash"] {
  background: #fff3d9;
  border-color: #f3dfb4;
}
.lesson-list button[data-lesson="footwork"] {
  background: #edf3e6;
  border-color: #d9e4ca;
}
.lesson-icon {
  font-size: 28px;
  color: #8450bd;
  min-width: 32px;
  text-align: center;
}
.lesson-list b {
  display: block;
  font-size: 17px;
}
.lesson-list small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}
.lesson-list em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
  color: #8c7798;
}
#results {
  text-align: center;
  width: 400px;
}
#results h2 {
  margin: 10px 0;
  font-size: 26px;
}
#result-score {
  display: block;
  font-size: 48px;
  color: #7c3aed;
  margin: 18px 0;
}
#result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin: 22px 0 28px;
}
#result-stats .result-breakdown {
  flex-basis: 100%;
  margin: 12px 0 0;
  font-size: 12px;
  color: #6c5a80;
  text-align: center;
}
#result-stats b {
  display: block;
  font-size: 25px;
}
#result-stats span {
  display: block;
  font-size: 12px;
  color: #8b7798;
  margin-top: 5px;
}
#results .result-body > button {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#retry-lesson {
  background: #7c3aed;
  color: white;
}
#finish-lesson {
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}
@media (max-width: 900px) {
  #rally-hud {
    left: 12px;
    top: 104px;
    padding: 9px 12px;
    min-width: 112px;
    border-radius: 15px;
  }
  .rally-main > b {
    font-size: 28px;
  }
  .rally-main > span {
    font-size: 10px;
  }
  .rally-main small {
    font-size: 9px;
  }
  .rally-meta {
    font-size: 10px;
    margin-top: 6px;
  }
  body.playing #notice {
    top: 192px;
  }
  #impact {
    top: 29%;
  }
  #impact b {
    font-size: 32px;
  }
  #impact.smash b {
    font-size: 40px;
  }
  #impact span {
    font-size: 11px;
  }
  #countdown {
    font-size: 64px;
  }
  #look-hint {
    top: 25%;
    font-size: 11px;
  }
  .lesson-list button {
    padding: 14px 12px;
    gap: 9px;
  }
  .lesson-list b {
    font-size: 15px;
  }
  .lesson-list small {
    font-size: 10px;
  }
  .lesson-list em {
    font-size: 10px;
  }
  #face-court {
    margin-left: auto;
  }
  #leave {
    margin-left: 0;
  }
  #timing {
    padding: 6px 7px;
  }
  #result-score {
    font-size: 40px;
  }
}
@media (max-width: 900px) and (max-height: 500px) {
  #rally-hud {
    top: 100px;
    padding: 6px 10px;
    min-width: 100px;
  }
  .rally-main > b {
    font-size: 23px;
  }
  .rally-meta {
    margin-top: 4px;
  }
  #impact {
    top: 35%;
  }
  .lesson-list {
    gap: 8px;
    margin-top: 12px;
  }
  .lesson-list button {
    min-height: 64px;
    padding: 10px;
  }
  #results h2 {
    font-size: 22px;
  }
  #result-score {
    font-size: 30px;
    margin: 8px;
  }
  #result-stats {
    margin: 10px 0;
  }
  #results .result-body > button {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #impact.show {
    animation: none;
    opacity: 1;
  }
  #hit,
  #goal-fill {
    transition: none;
  }
}

#impact {
  z-index: 5;
}
#impact b {
  filter: drop-shadow(0 2px 1px #49345d);
  -webkit-text-stroke: 0.8px #624475;
}
#impact span {
  background: #49345dbd;
  border-radius: 10px;
  padding: 4px 9px;
  text-shadow: none;
  width: fit-content;
  margin: 5px auto 0;
}
#hit {
  -webkit-tap-highlight-color: transparent;
}
button {
  -webkit-tap-highlight-color: transparent;
}

#nearby-action {
  position: absolute;
  left: 50%;
  bottom: 105px;
  transform: translateX(-50%);
  background: #fff7e9ee;
  border: 1px solid #d9c4e9;
  color: #704899;
  font-size: 13px;
  max-width: calc(100% - 32px);
  white-space: nowrap;
}
@media (max-width: 900px) {
  #nearby-action {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 177px);
    font-size: 11px;
    padding: 11px 14px;
  }
}

.hand-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: 14px;
  color: #625070;
}
.hand-choice select {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid #ddd1ed;
  border-radius: 12px;
  background: #fffaf2;
  color: #483258;
}
/* Keep mobile timing feedback next to the control, away from the racket hand. */
@media (max-width: 900px) {
  #timing {
    position: absolute;
    bottom: -12px;
    left: 8px;
    width: 72px;
    margin: 0;
    padding: 0;
    background: transparent;
    pointer-events: none;
  }
  #timing-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  #timing .beat-track {
    margin: 0;
    background: #fff8;
  }
}
#contact-cue {
  position: absolute;
  z-index: 2;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: var(--cue-color, #c5b0f0);
}
#contact-cue svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
#contact-cue circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
#contact-cue .cue-target {
  opacity: 0.8;
  stroke-dasharray: 3 4;
}
#contact-cue .cue-approach {
  transform-origin: 80px 80px;
  transform: scale(var(--cue-scale, 2.5));
  opacity: 0.65;
}
#contact-cue.ready span {
  background: #2f8f57;
  font-size: 15px;
  font-weight: 800;
}
#contact-cue.ready .cue-target {
  stroke-dasharray: none;
  stroke-width: 3;
}
#contact-cue.perfect .cue-approach {
  stroke-width: 3;
  opacity: 1;
}
#contact-cue span {
  position: absolute;
  top: 125px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #fffaf2;
  background: #382746c9;
  padding: 5px 9px;
  border-radius: 12px;
  font-size: 11px;
}
@media (max-width: 900px) {
  #contact-cue {
    width: 120px;
    height: 120px;
  }
  #contact-cue span {
    top: 100px;
    font-size: 10px;
  }
}

/* Short goals and replay cues: keep the court and racket readable. */
#quick-start {
  pointer-events: auto;
  display: block;
  margin-top: 12px;
  padding: 10px 14px;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
}
#lesson-goal {
  margin-top: 7px;
  font-size: 10px;
  color: #76559c;
  max-width: 240px;
}
.lesson-record {
  color: #8462b0 !important;
  margin-top: 7px !important;
}
#result-stars {
  color: #b87812;
  letter-spacing: 8px;
  font-size: 38px;
  line-height: 1.2;
}
#result-record {
  font-size: 12px;
  color: #7c3aed;
  margin: 10px 0 0;
}
#result-tip {
  background: #f2edf7;
  border-radius: 14px;
  padding: 12px;
  font-size: 12px;
}
#result-next {
  font-size: 12px;
  font-weight: 600;
  color: #76559c;
}
#next-lesson {
  background: #eee4ff;
}
#lesson-coach {
  position: absolute;
  left: 50%;
  top: 32%;
  transform: translateX(-50%);
  width: min(360px, 88vw);
  text-align: center;
  padding: 16px 20px;
  border-radius: 20px;
  background: #fffaf3ed;
  color: #493760;
  pointer-events: none;
}
#lesson-coach b,
#lesson-coach span {
  display: block;
}
#lesson-coach b {
  font-size: 18px;
}
#lesson-coach span {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 6px;
}
@media (max-width: 900px) {
  #quick-start {
    font-size: 11px;
    padding: 8px 12px;
    margin-top: 9px;
  }
  #lesson-goal {
    max-width: 180px;
    font-size: 9px;
  }
  #results {
    padding: 24px;
  }
  #result-score {
    font-size: 38px;
    margin: 12px 0;
  }
  #result-stats {
    margin: 16px 0;
  }
  #result-stars {
    font-size: 30px;
  }
  #lesson-coach b {
    font-size: 16px;
  }
}
@media (max-height: 500px) {
  #lesson-coach {
    top: 18%;
    padding: 10px 14px;
    width: 310px;
  }
  #result-stars {
    font-size: 25px;
  }
}

.invite-copy {
  display: block;
  margin-top: 14px;
  width: 100%;
}

@media (max-width: 900px) {
  #quick-start {
    position: fixed;
    top: calc(max(10px, env(safe-area-inset-top)) + 100px);
    bottom: auto;
    left: 12px;
    margin: 0;
  }
}
@media (min-width: 901px) and (max-width: 1250px) {
  header span {
    display: none;
  }
  header {
    gap: 10px;
    padding: 14px 18px;
  }
  nav button {
    padding: 11px 12px;
    font-size: 12px;
  }
}

/* Landscape phones (e.g. 844x390): results as two columns (headline | stats +
   actions) and the lesson picker as a 2x2 grid, so nothing needs scrolling. */
@media (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  #results {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    column-gap: 22px;
    width: min(760px, 94vw);
    max-height: 94dvh;
    padding: 14px 22px;
  }
  #results .result-head .eyebrow {
    margin: 0;
  }
  #results h2 {
    font-size: 21px;
    margin: 4px 0;
  }
  #result-stars {
    font-size: 24px;
  }
  #result-record {
    margin: 2px 0;
    line-height: 1.4;
  }
  #result-score {
    font-size: 34px;
    margin: 4px 0 0;
  }
  #result-stats {
    margin: 0 0 6px;
  }
  #result-stats b {
    font-size: 20px;
  }
  #result-stats span {
    margin-top: 2px;
  }
  #result-tip,
  #result-next {
    margin: 4px 0;
    font-size: 12px;
    line-height: 1.45;
  }
  #results .result-body > button {
    margin-top: 5px;
    padding: 8px 10px;
  }
  #panel {
    width: min(760px, 94vw);
    max-height: 94dvh;
    padding: 16px 22px;
  }
  #panel h2 {
    margin: 0;
  }
  #panel p {
    margin: 4px 0 0;
    line-height: 1.5;
  }
  .lesson-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .lesson-list button {
    min-height: 0;
    padding: 9px 10px;
    gap: 10px;
  }
  .lesson-list b {
    font-size: 15px;
  }
  .lesson-list small {
    margin-top: 2px;
  }
  .lesson-icon {
    font-size: 22px;
    min-width: 24px;
  }
}

#graphics-status {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #f7f3ecf5;
  padding: 24px;
  text-align: center;
}
#graphics-status strong {
  font-size: 20px;
}
#graphics-status p {
  color: #78658a;
}
#reload-graphics {
  background: #7c3aed;
  color: white;
}

/* Results actions: always >= 44 px touch targets (WebKit audit D1/D2), in every
   orientation. On short landscape screens the surrounding spacing tightens instead,
   and the dialog scrolls if the content still does not fit (e.g. 320x568). */
#results {
  overflow-y: auto;
  overscroll-behavior: contain;
}
#results .result-body > button {
  min-height: 44px;
}
@media (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  #results .result-body > button {
    min-height: 44px;
    margin-top: 4px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  #result-tip,
  #result-next {
    margin: 2px 0;
  }
  #result-stats {
    margin: 0 0 4px;
  }
}
/* The results headline is focused programmatically (tabIndex -1) so screen readers
   start there; it is not interactive, so no focus ring (WebKit drew one, D3).
   Interactive buttons keep the browser's visible keyboard focus. */
#result-title:focus {
  outline: none;
}

/* Per-feed advice stays away from the hit button and keeps its label fixed. */
#shot-guide {
  position: absolute;
  z-index: 3;
  left: 24px;
  bottom: 150px;
  width: 230px;
  box-sizing: border-box;
  padding: 10px 13px;
  border-radius: 16px;
  background: #fffaf2ed;
  color: #493760;
  pointer-events: none;
}
#shot-guide b,
#shot-guide span {
  display: block;
}
#shot-guide b {
  font-size: 13px;
  line-height: 1.45;
}
#shot-guide span {
  font-size: 11px;
  line-height: 1.5;
  margin-top: 4px;
}
#shot-guide.smash-available {
  box-shadow: inset 0 0 0 2px #e9c66b;
}
#contact-cue.smash-available::before {
  content: "↯ 스매시 가능한 공";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 10px;
  background: #fff1bb;
  color: #60410c;
  font-size: 11px;
  font-weight: 800;
}
@media (max-width: 900px) {
  #shot-guide {
    left: 16px;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 202px);
    width: min(218px, calc(100vw - 140px));
    padding: 8px 10px;
  }
}
@media (max-width: 900px) and (max-height: 500px) {
  #shot-guide {
    left: 164px;
    bottom: 12px;
    width: min(250px, calc(100vw - 430px));
    padding: 6px 9px;
  }
  #shot-guide b {
    font-size: 11px;
  }
  #shot-guide span {
    font-size: 10px;
  }
}

#shot-guide-side {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.4;
  color: #79628f;
}

/* Fixed-position push drill: one tapping control, no movement prompt. */
body.push-practice #joystick {
  display: none;
}

#hit.recovering {
  filter: saturate(0.3);
  opacity: 0.72;
}

#impact.soft b,
#impact.miss b {
  color: #e0dce6;
  font-size: 24px;
  font-style: normal;
}
#impact.soft.show,
#impact.miss.show {
  animation: impact-muted 0.78s both;
}
@keyframes impact-muted {
  0%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Mintontree app promotion: store links on the welcome card, a closable
   plaza card (desktop), a menu entry (phones) and a strip under results.
   The device's own store is shown alone on iOS / Android. */
.stores {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
a.store {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 11px;
  background: #241a30;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
a.store:hover {
  background: #4a3566;
}
body.os-ios a.store.android,
body.os-android a.store.ios {
  display: none;
}
.app-panel-stores {
  margin-top: 14px;
}
.app-panel-stores a.store {
  padding: 12px 20px;
  font-size: 15px;
}
.app-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e1d3ec;
  font-size: 12px;
  color: #6a5680;
  width: 100%;
}
a.store-menu {
  display: none;
}
@media (max-width: 900px) {
  a.store-menu {
    display: block;
    min-height: 48px;
    padding: 14px 12px;
    border-radius: 14px;
    background: #241a30;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
  }
}

/* Plaza quick start: the two things to do, always one tap away. */
#quick-actions {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
#quick-actions button {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 0;
  align-items: center;
  min-width: 168px;
  padding: 12px 20px;
  border-radius: 18px;
  text-align: left;
  box-shadow: 0 8px 24px #30203630;
}
#quick-actions b {
  font-size: 16px;
}
#quick-actions img {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 3px 4px #30203633);
}
#quick-actions small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}
#quick-match {
  background: #7c3aed;
  color: #fff;
}
#quick-match:hover {
  background: #6d28d9;
}
#quick-lesson {
  background: #fffaf3;
  color: #493760;
  border: 1px solid #e4d6f1;
}
/* Phones: the three actions shrink into the bottom row, right of the sound
   button, at the footer's height, so the joystick and hit button stay
   exactly where they are on a court. */
@media (max-width: 900px) {
  #quick-actions {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: calc(100% - 110px);
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 15px;
    background: #fffdf8f2;
    box-shadow: 0 4px 16px #30203622;
  }
  #quick-actions button,
  #quick-match,
  #quick-lesson,
  #quick-board {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 38px;
    padding: 4px 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #5b4a6e;
    box-shadow: none;
  }
  #quick-match {
    background: #7c3aed;
    color: #fff;
  }
  #quick-actions button:active {
    background: #f1e8fb;
  }
  #quick-match:active {
    background: #6d28d9;
  }
  #quick-actions b {
    font-size: 11px;
    white-space: nowrap;
  }
  #quick-actions img {
    width: 22px;
    height: 22px;
  }
  #quick-actions small {
    display: none;
  }
}

/* Operations board (경기 운영 전광판): the Mintontree app's court board, live.
   Phone: 경기 / 레슨 tabs. Tablet and up (>= 900px): two columns, no tabs. */
#board.ops-board {
  width: min(1180px, 100vw);
  max-width: 100vw;
  height: min(100dvh, 860px);
  max-height: 100dvh;
  padding: 0;
  border-radius: 24px;
  background: #f1f5f9;
  color: #0f172a;
  overflow: hidden;
}
#board[open] {
  display: flex;
  flex-direction: column;
}
.ops-head {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  height: auto;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: none;
}
.ops-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  flex: 1;
}
.ops-back {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  box-shadow: none;
  background: transparent;
  color: #0f172a;
}
.ops-live {
  font-size: 11px;
  font-weight: 800;
  color: #e11d48;
  letter-spacing: 1px;
}
.ops-live::before {
  content: "●";
  margin-right: 4px;
  animation: ops-blink 1.4s infinite;
}
@keyframes ops-blink {
  50% {
    opacity: 0.25;
  }
}
.ops-count {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.ops-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 14px 0;
  padding: 4px;
  border-radius: 14px;
  background: #e2e8f0;
}
.ops-tabs button {
  flex: 1;
  padding: 10px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 800;
  color: #64748b;
  background: transparent;
  box-shadow: none;
}
.ops-tabs button.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 4px #0f172a1a;
}
.ops-tabs i {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  border-radius: 11px;
  background: #cbd5e1;
  color: #fff;
  font-size: 12px;
  font-style: normal;
}
.ops-tabs button.active i {
  background: #7c3aed;
}
.ops-cols {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 20px;
}
#board:not(.show-lessons) .ops-lessons,
#board.show-lessons .ops-games {
  display: none;
}
.ops-col section {
  margin-top: 16px;
}
.ops-col h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
}
.ops-col h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c3aed;
}
.ops-pill {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.ops-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.ops-row {
  display: grid;
  grid-template-columns: 26px 1fr 26px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-top: 1px solid #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.ops-row:first-child {
  border-top: 0;
}
.ops-no {
  font-size: 16px;
  font-weight: 800;
  color: #94a3b8;
}
.ops-team {
  display: grid;
  justify-items: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}
.ops-team.a {
  color: #2563eb;
}
.ops-team.b {
  color: #db2777;
}
.ops-team .me {
  color: #a78bfa;
  font-weight: 800;
}
.ops-vs {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}
.ops-time {
  display: grid;
  justify-items: end;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}
.ops-time b {
  font-size: 15px;
  color: #0f172a;
}
.ops-row.empty .ops-span {
  grid-column: 2 / -1;
  font-size: 14px;
  color: #94a3b8;
  opacity: 0.7;
}
.ops-row.waiting .ops-span {
  grid-column: 2 / -1;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f5f3ff;
  color: #7c3aed;
  font-size: 13px;
  font-weight: 700;
}
.ops-row.lesson {
  background: #fffbeb99;
}
.ops-row.lesson .ops-no {
  color: #f59e0b;
}
.ops-row.lesson .ops-span {
  grid-column: 2 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #d97706;
  font-size: 14px;
  font-weight: 700;
}
.ops-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 15px;
}
.ops-line:first-child {
  border-top: 0;
}
.ops-line .ord {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.ops-line .who {
  flex: 1;
  font-weight: 700;
}
.ops-line .tag {
  font-size: 13px;
  font-weight: 800;
  color: #2563eb;
}
.ops-line .wait {
  font-size: 13px;
  font-weight: 800;
  color: #5b6474;
}
.ops-line .wait.long {
  color: #f59e0b;
}
.ops-line .wait.late {
  color: #ef4444;
}
.ops-line.lesson {
  background: #fffbeb80;
}
.ops-line .badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: #fef3c7;
  color: #d97706;
  font-size: 12px;
  font-weight: 800;
}
.ops-line .timer {
  color: #d97706;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ops-empty {
  padding: 22px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.ops-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ops-chips span {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}
.ops-chips span.busy {
  background: #f1f5f9;
  color: #94a3b8;
}
.ops-chips span.me {
  border-color: #a78bfa;
  color: #7c3aed;
}
@media (min-width: 900px) {
  .ops-tabs {
    display: none;
  }
  .ops-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    align-items: start;
    padding: 0 18px 24px;
  }
  #board .ops-games,
  #board .ops-lessons {
    display: block !important;
  }
}
@media (max-width: 899px) {
  #board.ops-board {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}
#quick-board {
  background: #fffaf3;
  color: #493760;
  border: 1px solid #e4d6f1;
}
button.board-open {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  background: #f1eafa;
  color: #6d28d9;
  box-shadow: none;
}
.ops-line .badge.idle {
  background: #f1f5f9;
  color: #94a3b8;
}
.ops-line .wait.playing {
  color: #7c3aed;
}
#waits {
  position: absolute;
  top: 168px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
}
.wait-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 20px #30203620;
  max-width: calc(100% - 24px);
}
.wait-chip button {
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 12px;
  box-shadow: none;
  background: #fff;
  color: #92400e;
  border: 1px solid #fcd34d;
}
@media (max-width: 900px) {
  #waits {
    top: calc(max(10px, env(safe-area-inset-top)) + 150px);
  }
}

/* After a match: result and the next step, over the court (not modal). */
#match-end {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(420px, calc(100% - 24px));
  padding: 22px 22px 18px;
  border-radius: 24px;
  background: #fffdf8f5;
  box-shadow: 0 18px 60px #29183e40;
  text-align: center;
  animation: match-end-in 0.35s ease-out;
}
#match-end b {
  font-size: 26px;
  color: #6d28d9;
}
#match-end strong {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
  color: #332742;
}
#match-end small {
  color: #776487;
  font-size: 13px;
}
.match-end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.match-end-actions button {
  min-height: 46px;
  padding: 10px 16px;
  font-size: 14px;
}
#match-again {
  background: #7c3aed;
  color: #fff;
}
#match-again:disabled {
  opacity: 0.7;
}
@keyframes match-end-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #match-end {
    animation: none;
  }
}

/* A new build is live: offer a refresh (the open page still runs the old one). */
#update-banner {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 10px 10px 10px 18px;
  border-radius: 18px;
  background: #2b2238f2;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 12px 40px #1a102466;
}
#update-banner b {
  color: #ffd43b;
  margin-right: 4px;
}
#update-reload {
  background: #ffd43b;
  color: #2b2238;
  padding: 9px 16px;
  white-space: nowrap;
}
#update-later {
  background: transparent;
  color: #cbbfe0;
  box-shadow: none;
  padding: 9px 10px;
  white-space: nowrap;
}
@media (max-width: 900px) {
  #update-banner {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 260px);
    font-size: 12px;
  }
}
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  /* Landscape phones: the hit button owns the bottom-right; centre the row. */
  #quick-actions {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Phones: the bottom-row buttons (소리, 정면 보기, 나가기) sit on the right;
   the plaza's quick actions take the left. */
@media (max-width: 900px) {
  footer {
    justify-content: flex-end;
  }
  #leave {
    margin-left: 0;
  }
  #sound {
    order: 9;
  }
}

/* Game controls are held, not read: no text selection or copy callout when a
   finger rests on them (mobile long-press on the hit button). */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input,
select,
textarea,
dialog p,
.ops-board {
  -webkit-user-select: text;
  user-select: text;
}
#hit,
#hitting,
#joystick,
footer,
#quick-actions {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#court-wait {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}
#court-wait button {
  color: #5b21b6;
  border-color: #c4b5fd;
}
#waits {
  width: max-content;
}
.wait-chip span {
  white-space: nowrap;
}
.wait-chip button {
  white-space: nowrap;
}
@media (max-width: 420px) {
  .wait-chip {
    font-size: 12px;
    padding: 6px 6px 6px 12px;
  }
}

/* 경기 참여 panel and the incoming "같이 치자" card. */
.join-quick {
  display: block;
  width: 100%;
  margin: 6px 0 4px;
  padding: 14px;
  background: #7c3aed;
  color: #fff;
  font-size: 15px;
}
.join-sub {
  margin: 18px 0 8px;
  font-size: 15px;
  color: #4b3d5c;
}
.people {
  display: grid;
  gap: 6px;
}
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ece4f2;
  border-radius: 14px;
  background: #fff;
}
.person .who {
  flex: 1;
  display: grid;
  min-width: 0;
}
.person .who b {
  font-size: 14px;
}
.person .who small {
  font-size: 12px;
  color: #8a7799;
}
.person button {
  padding: 8px 14px;
  font-size: 13px;
  background: #f0e9ff;
  color: #6d28d9;
  box-shadow: none;
  white-space: nowrap;
}
.people-empty {
  margin: 0;
  font-size: 13px;
}
#challenge {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 9;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(380px, calc(100% - 24px));
  padding: 20px;
  border-radius: 22px;
  background: #fffdf8f7;
  box-shadow: 0 18px 60px #29183e40;
  text-align: center;
}
#challenge b {
  font-size: 18px;
  color: #4c1d95;
}
#challenge small {
  color: #776487;
}
#challenge-yes {
  background: #7c3aed;
  color: #fff;
}
#panel a.ad-dm {
  background: linear-gradient(90deg, #f58529, #dd2a7b 50%, #8134af) !important;
  color: #fff;
  font-weight: 800;
}
#panel a.toss-support {
  background: #3182f6 !important;
  color: #fff;
  font-weight: 800;
  margin-top: 12px;
}
.support-account {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #4b3d5c;
}
.support-account button {
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: none;
  background: #f1eafa;
}
.support-hint {
  display: block;
  margin-top: 4px;
  text-align: center;
  color: #8a7799;
  font-size: 11px;
}

/* 벽치기 챌린지 */
.wall-entry {
  display: grid;
  gap: 2px;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  text-align: left;
  background: #2b2238;
  color: #fff;
}
.wall-entry small {
  color: #d9cdea;
  font-size: 12px;
}
.wall-top-title {
  display: block;
  margin: 4px 0 6px;
  font-size: 14px;
}
.wall-top {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: 14px;
}
.wall-top li.me {
  color: #7c3aed;
  font-weight: 800;
}
.wait-chip .wait-wall {
  background: #2b2238;
  color: #fff;
  border-color: #2b2238;
}
.wall-top-box {
  flex-basis: 100%;
  text-align: left;
}
#panel a.kakao-support {
  background: #fee500 !important;
  color: #191919 !important;
  font-weight: 800;
  margin-top: 8px;
}
.person {
  cursor: pointer;
}
.person input {
  width: 20px;
  height: 20px;
  accent-color: #7c3aed;
  flex: none;
}
.person.picked {
  border-color: #a78bfa;
  background: #faf7ff;
}
.person.busy {
  opacity: 0.55;
}
.person .mate {
  padding: 6px 10px;
  font-size: 12px;
  background: #f1eafa;
  color: #6d28d9;
  box-shadow: none;
  white-space: nowrap;
}
.person .mate.on {
  background: #7c3aed;
  color: #fff;
}
.invite-go {
  margin-top: 4px;
  padding: 13px;
  background: #7c3aed;
  color: #fff;
  font-size: 14px;
}
.invite-go:disabled {
  background: #ece4f2;
  color: #8a7799;
  opacity: 1;
}

/* ?dev: local testing panel. */
.dev-panel {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: #1e1b4bdd;
  color: #fff;
  font-size: 11px;
}
.dev-panel button {
  padding: 6px 8px;
  font-size: 11px;
  box-shadow: none;
}

/* A game, not a document: no double-tap or pinch zoom anywhere (menus and
   buttons included), and inputs at 16px so iOS never zooms on focus. */
html,
body,
button,
a,
input,
select,
dialog,
nav {
  touch-action: manipulation;
}
input,
select,
textarea {
  font-size: max(16px, 1em);
}
