:root {
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: #f4f6fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1rem;
  min-height: 100vh;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  max-width: 520px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  background: #3d5afe;
  color: #fff;
}

button.secondary {
  background: #5c6bc0;
}

button.danger {
  background: #c62828;
}

a.button-link {
  display: inline-block;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  background: #00897b;
  color: #fff;
  text-decoration: none;
}

a.button-link:hover {
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #cfd8dc;
  font-size: 1rem;
}

label {
  display: block;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.9rem;
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rank-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  background: #fafafa;
}

.rank-list .controls {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rank-list button {
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem;
  min-width: 2rem;
}

#qr-host {
  text-align: center;
  margin: 0.5rem 0;
}

.reveal-card {
  border-radius: 16px;
  padding: 1.25rem 1rem 1.5rem;
  margin: 0.75rem 0 1rem;
  text-align: center;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.reveal-player {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a;
}

.reveal-ready,
.reveal-instruction {
  margin: 0;
  color: #1a1a1a;
  font-size: 0.95rem;
}

.reveal-ready {
  font-weight: 600;
}

.hold-target {
  margin-top: 0.5rem;
  width: 100%;
  max-width: 260px;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  touch-action: none;
  -webkit-touch-callout: none;
}

.hold-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #1a1a1a;
  position: relative;
  transition: transform 0.15s ease;
}

.hold-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 10px;
  height: 18px;
  margin-left: -5px;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background: transparent;
}

.hold-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1a1a1a;
}

.hold-target.holding .hold-ring {
  transform: scale(0.92);
  border-color: #333;
  animation: hold-pulse 0.65s linear forwards;
}

.hold-target.revealing {
  opacity: 0.6;
}

@keyframes hold-pulse {
  from {
    box-shadow: inset 0 0 0 0 rgba(26, 26, 26, 0.12);
  }
  to {
    box-shadow: inset 0 0 0 26px rgba(26, 26, 26, 0.12);
  }
}

.reveal-word-box {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-align: center;
}

.reveal-main {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}

.reveal-tip {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
}

.score-table th,
.score-table td {
  text-align: left;
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid #eee;
}

@media (max-width: 480px) {
  .card {
    padding: 0.85rem;
  }
}
