/* Variables */
:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --danger: #e74c3c;
  --white: #fff;
  --text: #333;
  --text-muted: #666;
  --shadow: rgba(0, 0, 0, 0.2);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  text-align: center;
}

.screen.active {
  display: flex;
}

/* Typography */
h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.btn-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

.inline-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  vertical-align: middle;
}

.modal-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: normal;
}

/* Buttons */
.btn {
  background: var(--white);
  color: var(--primary);
  border: none;
  padding: 20px 40px;
  font-size: 1.3rem;
  border-radius: 50px;
  cursor: pointer;
  margin: 10px;
  font-weight: bold;
  box-shadow: 0 4px 15px var(--shadow);
  transition: transform 0.1s;
}

.btn:active {
  transform: scale(0.95);
}

.btn:focus {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

.btn-small {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

/* Player Select */
.player-select {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.player-count {
  font-size: 4rem;
  font-weight: bold;
  width: 100px;
}

.player-btn {
  background: var(--white);
  color: var(--primary);
  border: none;
  width: 60px;
  height: 60px;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}

.player-btn:focus {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  max-width: 400px;
}

.category-btn {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border: 2px solid transparent;
  padding: 15px;
  font-size: 1.1rem;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:focus {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

.category-btn.selected {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}

/* Names Input */
.names-list {
  width: 100%;
  max-width: 350px;
  margin: 20px 0;
}

.name-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.name-input-row span {
  font-size: 1.5rem;
}

.name-input-row img.player-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.name-input {
  flex: 1;
  padding: 15px;
  font-size: 1.2rem;
  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  -webkit-user-select: text;
  user-select: text;
}

.name-input::placeholder {
  color: #999;
}

.name-input:focus {
  outline: 3px solid var(--white);
  background: var(--white);
}

/* Turn Screen */
.player-turn {
  font-size: 1.8rem;
  margin-bottom: 30px;
}

.player-turn .name {
  font-weight: bold;
  font-size: 2.2rem;
}

/* Reveal Button */
.reveal-btn {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 4px dashed rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.reveal-btn:focus {
  outline: 3px solid var(--white);
  outline-offset: 4px;
}

.reveal-btn .icon {
  font-size: 4rem;
  margin-bottom: 10px;
}

.reveal-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 15px;
}

.player-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
}

.player-avatar-large {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.reveal-btn.holding {
  background: var(--white);
  border-style: solid;
  border-color: var(--white);
  transform: scale(1.05);
}

.reveal-btn.holding .word-display {
  display: block;
}

.reveal-btn.holding .hold-text {
  display: none;
}

.word-display {
  display: none;
  color: var(--primary);
  font-size: 2rem;
  font-weight: bold;
  padding: 20px;
}

.word-display.imposter {
  color: var(--danger);
}

.word-display .icon {
  font-size: 3rem;
}

.word-display .word-image {
  width: 180px;
  height: 180px;
  object-fit: contain;
  margin-bottom: 15px;
}

.word-display .word-emoji {
  font-size: 5rem;
  margin-bottom: 15px;
}

.word-display .word-text {
  font-size: 1.8rem;
  font-weight: bold;
}

.word-display .word-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 15px;
}

.imposter-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 10px;
}

.next-player-btn {
  margin-top: 40px;
}

/* Play Screen */
.start-player-card {
  background: var(--white);
  color: var(--text);
  padding: 30px 50px;
  border-radius: 20px;
  margin: 30px 0;
  box-shadow: 0 10px 30px var(--shadow);
}

.start-player-card .label {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.start-player-card .name {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
}

.play-instructions {
  font-size: 1.1rem;
  margin: 20px 0;
  opacity: 0.9;
  line-height: 1.6;
}

/* Result Screen */
.result-card {
  background: var(--white);
  color: var(--text);
  padding: 40px;
  border-radius: 20px;
  margin: 20px 0;
  box-shadow: 0 10px 30px var(--shadow);
}

.result-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.result-word {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  margin: 10px 0;
}

.result-word .result-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 15px;
}

.result-word .result-emoji {
  font-size: 5rem;
}

.result-imposter {
  font-size: 1.5rem;
  color: var(--danger);
  margin-top: 20px;
}

.result-imposter .name {
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  color: var(--text);
  padding: 30px;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  margin: 20px auto;
}

.modal-content h2 {
  color: var(--primary);
  margin-top: 0;
}

.modal-content ol {
  text-align: left;
  padding-left: 20px;
}

.modal-content li {
  margin: 15px 0;
  font-size: 1.1rem;
}

.modal-content p {
  font-size: 1.2rem;
  margin: 20px 0;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.close-btn {
  background: var(--primary);
  color: var(--white);
}
