* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #2a0066, #d1008f);
  min-height: 100vh;
  color: white;
  padding: 20px;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}

/* Заголовок */
.title {
  font-size: 52px;
  font-weight: 900;
  margin-bottom: 20px;
}

.title .first {
  color: #ffe600;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 35px 0;
}

.tabs {
  display: flex;
  gap: 12px;
}

.tab-btn {
  padding: 11px 26px;
  border-radius: 50px;
  border: none;
  background: rgba(255,255,255,0.16);
  color: white;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: #ff00b7;
  box-shadow: 0 4px 12px rgba(255, 0, 183, 0.45);
}

#downloadBtn {
  padding: 11px 28px;
  border-radius: 50px;
  background: #ff00b7;
  color: white;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 0, 183, 0.45);
}

/* Name box */
.name-box {
  position: absolute;
  top: 25px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  color: #4a004f;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 18px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
}

.name-box input {
  border: none;
  background: transparent;
  font-size: 18px;
  width: 100%;
  outline: none;
  color: #4a004f;
}

/* ==================== ТАБЛИЦЯ ==================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 18px;
}

.table {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  min-width: 1050px;
  width: 100%;
}

/* Header */
.header {
  display: flex;
  background: #e9009f;
  padding: 16px 25px;
  font-weight: 700;
  font-size: 16.5px;
  text-align: center;
  align-items: center;
}

.header > div {
  padding: 0 8px;
}

.header > div:nth-child(1) { flex: 0 0 70px; }           /* Heart */
.header > div:nth-child(2) { flex: 1 1 400px; text-align: left; padding-left: 15px; } /* Country & Song */
.header > div:nth-child(3) { flex: 0 0 135px; }          /* Stage */
.header > div:nth-child(4) { flex: 0 0 135px; }          /* Vocal */
.header > div:nth-child(5) { flex: 0 0 145px; }          /* Song Impression */
.header > div:nth-child(6) { flex: 0 0 135px; }          /* Total */

/* Rows */
.row {
  display: flex;
  align-items: center;
  padding: 10px 25px;
  border-bottom: 1px solid rgba(255,255,255,0.13);
  min-height: 72px;
}

.row:last-child {
  border-bottom: none;
}

/* Heart */
.heart-cell {
  flex: 0 0 70px;
  text-align: center;
}

.custom-heart {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

/* Song */
.country-cell {
  flex: 1 1 400px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.song {
  background: #ffffff;
  color: #3e0048;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Інші колонки */
.stage, .vocal, .impression, .total {
  flex: 0 0 135px;
  text-align: center;
  margin: 0 6px;
}

/* Поля вводу */
.score-input {
  background: #f8e8ff;
  border: none;
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 18px;
  text-align: center;
  color: #3e0048;
  font-weight: 700;
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
  display: block;
}

.total {
  background: #6b1e8c;
  color: white;
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 19px;
  font-weight: bold;
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
}

/* Адаптивність */
@media (max-width: 850px) {
  .app {
    padding: 20px 15px;
  }

  .title {
    font-size: 38px;
    text-align: center;
  }

  .controls {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .name-box {
    position: static;
    margin: 15px auto 0;
    width: fit-content;
  }

  .table {
    min-width: 880px;
  }
}

@media (max-width: 480px) {
  .table {
    min-width: 760px;
  }
}