@view-transition {
  navigation: auto;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #4c51bf 100%);
  color: #2d3748;
}

#game-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px;
  border-radius: 18px;
  max-width: 600px;
  width: 92%;
  background-color: #ffffff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.screen-title {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.screen-subtitle {
  font-size: 16px;
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.game-button {
  font-size: 16px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  margin: 4px 0;
  background-color: #f6ad55;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.game-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.game-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.game-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.game-button.secondary {
  background-color: #48bb78;
}

.game-button.danger {
  background-color: #f56565;
}

/* Input */
.input-group {
  margin-bottom: 18px;
  width: 100%;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: left;
}

input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 2px solid #f6ad55;
  box-sizing: border-box;
  font-weight: 500;
}

input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.35);
}

/* Host / Room / Player List */
.host-link-box {
  font-size: 14px;
  margin: 10px 0 14px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  width: 100%;
  word-break: break-all;
}

.player-link {
  margin-top: 4px;
  font-family: monospace;
  color: #f6ad55;
}

.players-list {
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  margin: 4px 0 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
}

.player-item {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
}

/* Game Screen */
#game-screen {
  display: none;
  width: 100%;
  height: 100vh;
  position: relative;
}

#game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

#game-area {
  position: relative;
  width: 100%;
  height: calc(100vh - 60px);
  overflow: hidden;
  background: radial-gradient(circle at top, #ffffff 0%, #e2e8f0 40%, #c3dafe 100%);
}

/* Logos */
.logo {
  position: absolute;
  width: 70px;
  height: 70px;
  cursor: pointer;
  transition: transform 0.1s;
  animation: float 2s ease-in-out infinite;
}

.logo:hover {
  transform: scale(1.05);
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.logo.clicked {
  animation: fadeOut 0.25s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Score popup */
.score-popup {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
  animation: scoreFloat 0.7s forwards;
  color: #f56565;
}

@keyframes scoreFloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-32px); }
}

/* Game Over */
#game-over-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

#player-final-name {
  font-size: 18px;
  margin-bottom: 4px;
}

#final-score {
  font-size: 46px;
  font-weight: 700;
  color: #f6ad55;
  margin-bottom: 6px;
}

/* Leaderboard */
.winner-announcement {
  font-size: 18px;
  font-weight: 700;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background-color: #f6ad55;
  color: #ffffff;
}

.leaderboard-list {
  margin: 10px 0 6px;
  width: 100%;
  max-width: 380px;
}

.leaderboard-item {
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.04);
}
