* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #0b0f2a 0%, #1a1f4a 50%, #0d1b3d 100%);
  color: white;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.index-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(100, 200, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0b0f2a 0%, #1a1f4a 50%, #0d1b3d 100%);
  z-index: -1;
  animation: bgShift 8s ease-in-out infinite;
}

@keyframes bgShift {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.container {
  margin-top: 40px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 3em;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(100, 200, 255, 0.8);
  animation: glow 2s ease-in-out infinite;
}

.subtitle {
  font-size: 1.2em;
  color: #64c8ff;
  margin-bottom: 30px;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.logo-section {
  margin-bottom: 40px;
}

.form-section {
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
}

.button-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 350px;
  margin: 0 auto;
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 20px rgba(100, 200, 255, 0.8); }
  50% { text-shadow: 0 0 30px rgba(100, 200, 255, 1); }
}

input {
  padding: 12px 20px;
  margin: 15px;
  border: 2px solid #64c8ff;
  background: rgba(10, 80, 150, 0.3);
  color: white;
  font-size: 1em;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
}

input:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  background: rgba(10, 100, 200, 0.5);
}

input::placeholder {
  color: rgba(200, 200, 200, 0.6);
}

button {
  padding: 15px 40px;
  margin: 0;
  border: 2px solid #00ff88;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(100, 200, 255, 0.2) 100%);
  color: #00ff88;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  border-color: #00ff88;
  color: #00ff88;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.25) 0%, rgba(100, 200, 255, 0.15) 100%);
  font-size: 1.2em;
  padding: 18px 50px;
}

.btn-secondary {
  border-color: #64c8ff;
  color: #64c8ff;
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.2) 0%, rgba(0, 150, 200, 0.15) 100%);
  font-size: 1em;
}

button:hover {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.4) 0%, rgba(100, 200, 255, 0.4) 100%);
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.6);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

h2 {
  font-size: 1.8em;
  margin: 30px 0;
  text-shadow: 0 0 15px rgba(100, 200, 255, 0.6);
}

#info {
  color: #64c8ff;
  font-size: 1.4em;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

#timer {
  color: #ff88ff;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 136, 255, 0.8);
}

.game-area {
  position: relative;
  width: 900px;
  height: 450px;
  margin: 30px auto;
  border: 3px solid #00ff88;
  background: linear-gradient(180deg, rgba(10, 80, 150, 0.2) 0%, rgba(20, 100, 200, 0.1) 100%);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3), inset 0 0 20px rgba(100, 200, 255, 0.1);
  overflow: hidden;
}

#sender {
  position: absolute;
  left: 30px;
  top: 180px;
  font-size: 1.5em;
  font-weight: bold;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(255, 100, 100, 0.3) 0%, rgba(255, 150, 100, 0.2) 100%);
  border: 2px solid #ff6464;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 100, 100, 0.4);
  min-width: 120px;
  color: #ffaaaa;
  text-shadow: 0 0 5px rgba(255, 100, 100, 0.5);
}

#receiver {
  position: absolute;
  right: 30px;
  top: 180px;
  font-size: 1.5em;
  font-weight: bold;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(100, 255, 100, 0.3) 0%, rgba(150, 255, 100, 0.2) 100%);
  border: 2px solid #64ff64;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(100, 255, 100, 0.4);
  min-width: 120px;
  color: #aaffaa;
  text-shadow: 0 0 5px rgba(100, 255, 100, 0.5);
}

#message {
  position: absolute;
  left: 150px;
  top: 180px;
  font-size: 50px;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s ease, filter 0.2s ease;
  filter: drop-shadow(0 0 10px rgba(100, 200, 255, 0.6));
  z-index: 10;
}

#message:active {
  cursor: grabbing;
  filter: drop-shadow(0 0 20px rgba(0, 255, 136, 1));
  transform: scale(1.1);
}

#message.dragging {
  filter: drop-shadow(0 0 30px rgba(100, 200, 255, 1));
  opacity: 0.9;
}

.obstacle {
  position: absolute;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 100, 100, 0.8), rgba(200, 50, 50, 0.6));
  border: 2px solid #ff3333;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 50, 50, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
  z-index: 5;
}

.maze-wall {
  position: absolute;
  background: linear-gradient(90deg, rgba(255, 100, 100, 0.9), rgba(255, 150, 100, 0.8));
  border: 2px solid #ff6464;
  box-shadow: 0 0 15px rgba(255, 100, 100, 0.8), inset 0 0 5px rgba(0, 0, 0, 0.3);
  animation: maze-glow 2s ease-in-out infinite;
  z-index: 5;
}

@keyframes maze-glow {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.8), inset 0 0 5px rgba(0, 0, 0, 0.3);
  }
  50% { 
    box-shadow: 0 0 25px rgba(255, 150, 100, 1), inset 0 0 5px rgba(0, 0, 0, 0.3);
  }
}

p {
  margin-top: 30px;
  font-size: 1.3em;
}

#score {
  color: #00ff88;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

ul {
  list-style: none;
  max-width: 500px;
  margin: 30px auto;
}

li {
  padding: 15px 20px;
  margin: 10px 0;
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.2) 0%, rgba(0, 255, 136, 0.2) 100%);
  border: 2px solid #64c8ff;
  border-radius: 8px;
  font-size: 1.2em;
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.3);
  transition: all 0.3s ease;
}

li:hover {
  transform: translateX(10px);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.4) 0%, rgba(0, 255, 136, 0.3) 100%);
}

/* ===== LEADERBOARD TABULKA ===== */

.leaderboard-table-wrapper {
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
  background: linear-gradient(135deg, rgba(10, 80, 150, 0.2) 0%, rgba(20, 100, 200, 0.1) 100%);
  border: 2px solid #00ff88;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.1em;
}

.leaderboard-table thead {
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.3) 0%, rgba(100, 200, 255, 0.3) 100%);
  border-bottom: 2px solid #00ff88;
}

.leaderboard-table th {
  padding: 15px;
  color: #00ff88;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(100, 200, 255, 0.3);
  transition: all 0.3s ease;
}

.leaderboard-table tbody tr:hover {
  background: rgba(0, 255, 136, 0.1);
  box-shadow: inset 0 0 10px rgba(100, 200, 255, 0.2);
  transform: scale(1.02);
}

.leaderboard-table td {
  padding: 12px 15px;
  text-align: center;
  color: #64c8ff;
}

.leaderboard-table .rank {
  font-weight: bold;
  color: #00ff88;
  font-size: 1.2em;
}

.leaderboard-table .name {
  color: #ffff88;
  font-weight: bold;
  text-align: left;
}

.leaderboard-table .score {
  color: #00ff88;
  font-weight: bold;
  font-size: 1.1em;
}

.leaderboard-table .time {
  color: #64c8ff;
}

.leaderboard-table .date {
  color: #888888;
  font-size: 0.95em;
}
#gameCanvas {
  display: block;
  margin: 20px auto;
  border: 3px solid #00ff88;
  background: #111; /* důležité */
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

.modal-content {
  background: #111;
  border: 2px solid #00ff88;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0,255,136,0.5);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #ff4444;
}
#winModal h2 {
  color: #00ff88;
}
.info-box {
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
  border: 2px solid #64c8ff;
  border-radius: 10px;
  background: rgba(10, 80, 150, 0.2);
  box-shadow: 0 0 15px rgba(100, 200, 255, 0.3);
}

.info-box h3 {
  margin-bottom: 10px;
  color: #00ff88;
}

.info-box p {
  margin: 5px 0;
  color: #ddd;
  font-size: 0.95em;
}