*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #050816;
  font-family: Arial, sans-serif;
  color: white;
}

.oyun {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border-radius: 20px;
  background: #0f172a;
  border: 2px solid #00ffff;
  box-shadow:
    0 0 20px #00ffff,
    0 0 40px #00ffff44;
  text-align: center;
}

h1 {
  color: #00ffff;

  text-shadow: 0 0 10px #00ffff;
}

select,
input,
button {
  width: 100%;
  padding: 14px 16px;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
}

input,
select {
  background: #111827;
  color: white;
}

button {
  background: #00ffff;

  color: black;

  font-weight: bold;

  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bilgiler {
  display: flex;

  justify-content: space-between;

  margin-top: 15px;

  font-size: 14px;
}

#bestLine {
  width: 60%;
  text-align: right;
  color: #ffd166;
  font-weight: bold;
}

.score-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.score-actions button {
  flex: 1 1 120px;
  min-width: 120px;
  background: transparent;
  border: 1px solid #00ffff;
  color: #00ffff;
  padding: 10px 12px;
  border-radius: 10px;
}

.score-actions button:hover {
  background: #00ffff11;
}

#sonuc {
  margin-top: 20px;

  font-size: 20px;

  min-height: 50px;
}

/* Visual emphasis for directional hints */
.emph {
  transform: scale(1.12);
  transition:
    transform 140ms ease,
    color 140ms ease,
    text-shadow 140ms ease;
  color: #ff6b6b;
  text-shadow:
    0 0 12px #ff6b6b66,
    0 0 24px #ff6b6b33;
}

#sure {
  margin-top: 10px;
  color: #ffd166;
  font-weight: bold;
}

.skorlar {
  margin-top: 20px;

  text-align: left;
}

.score-table-wrapper {
  overflow-x: auto;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.score-table th,
.score-table td {
  padding: 10px;
  border: 1px solid #00ffff;
}

.score-table th {
  background: rgba(0, 255, 255, 0.08);
  font-weight: bold;
}

.score-table th.rank-column,
.score-table td.medal-cell {
  width: 50px;
  text-align: center;
}

.score-table td.medal-cell {
  font-size: 1.1rem;
}

.score-table tr:nth-child(even) {
  background: rgba(0, 255, 255, 0.04);
}

.score-table tr.top-rank {
  background: transparent;
}

.score-table tr.top-rank td {
  color: #fff6bf;
  font-weight: 700;
  animation: podiumCelebration 1.4s ease-in-out infinite alternate;
}

.score-table tr.rank-1 td {
  background: linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.22),
    rgba(255, 180, 0, 0.12),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.7);
}

.score-table tr.rank-2 td {
  background: linear-gradient(
    90deg,
    rgba(192, 192, 192, 0.2),
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: inset 0 0 0 1px rgba(192, 192, 192, 0.7);
}

.score-table tr.rank-3 td {
  background: linear-gradient(
    90deg,
    rgba(205, 127, 50, 0.18),
    rgba(255, 153, 51, 0.1),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: inset 0 0 0 1px rgba(205, 127, 50, 0.7);
}

@keyframes podiumCelebration {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    filter: brightness(1.09);
    transform: scale(1.005);
  }
  100% {
    filter: brightness(1.14);
    transform: scale(1.01);
  }
}

.score-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.score-filters label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: #ffffff;
  flex: 0 1 auto;
  min-width: 0;
}

.score-filters select,
.score-filters input {
  min-width: 0;
  width: auto;
  max-width: 170px;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .oyun {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
  }

  h1 {
    font-size: 1.6rem;
  }

  select,
  input,
  button {
    font-size: 15px;
    padding: 12px 14px;
  }

  .score-table th,
  .score-table td {
    padding: 8px;
    font-size: 13px;
  }

  .score-filter label {
    flex: 1 1 100%;
  }
}

/* Modal styles */
.modal.hidden {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.modal-content {
  position: relative;
  background: #0f172a;
  border: 2px solid #00ffff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 0 20px #00ffff44;
  color: white;
  z-index: 1;
  text-align: left;
}
.modal-content h2 {
  margin-top: 0;
  color: #ffd166;
}
.modal-content input {
  width: 100%;
  margin-top: 8px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.modal-actions button {
  flex: 1;
}
