@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

.game-container {
  min-height: 100vh;
  background-image: url("../assets/05_1920.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
}

.background-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.main-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.header {
  position: relative;
  width: 100%;
  max-width: 80rem;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.tippy-box[data-theme~='tomato'] {
    background: rgba(30, 41, 59, 1.0);
    border: 1px solid;
    border-color: #06b6d4;
    border-radius: 4px;
    color: #22d3ee;;
    opacity: 1;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.info-icon {
    margin-left: 6px;
    vertical-align: middle;
    cursor: pointer;
    display: inline-block;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-main {
  text-align: center;
  flex: 1;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #22d3ee, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: "Inter", sans-serif;
}

.subtitle {
  color: rgba(165, 243, 252, 0.9);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.stats-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

.stats-button {
  padding: 0.625rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #22d3ee;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.stats-button:hover {
  border-color: #06b6d4;
}

.stats-icon {
  width: 1rem;
  height: 1rem;
}

.stats-dropdown {
  position: absolute;
  top: 3rem;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.4);
  backdrop-filter: blur(12px);
  min-width: 13rem;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.stats-content {
  padding: 0.75rem;
}

.stats-title {
  color: #06b6d4;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #334155;
  padding-bottom: 0.5rem;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: #cbd5e1;
}

.stat-value {
  color: #22d3ee;
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.search-container {
  width: 100%;
  max-width: 32rem;
  margin-bottom: 1.5rem;
  position: relative;
  justify-self: center;
}

.search-input-container {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(34, 211, 238, 0.7);
  width: 1rem;
  height: 1rem;
}

#search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: #a5f3fc;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  backdrop-filter: blur(12px);
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

#search-input::placeholder {
  color: rgba(34, 211, 238, 0.6);
}

#search-input:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.3);
}

#search-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.3);
  backdrop-filter: blur(12px);
  z-index: 30;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.suggestion-item {
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: #a5f3fc;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.15s;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: rgba(34, 211, 238, 0.15);
}

.suggestion-item:focus {
    outline: none;
    background: rgba(34, 211, 238, 0.15);
}

.game-grid-container {
  width: 100%;
  max-width: 80rem;
  margin-bottom: 1.5rem;
}

.game-grid {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.3);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.grid-header {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}

.header-cell {
  padding: 0.625rem 0.75rem;
  text-align: center;
  color: #06b6d4;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-right: 1px solid rgba(71, 85, 105, 0.4);
}

.header-cell:last-child {
  border-right: none;
}

.game-rows {
  display: flex;
  flex-direction: column;
}

.guess-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  animation: slideInFromTop 0.3s ease-out;
}

.guess-row:nth-child(even) {
  background: rgba(30, 41, 59, 0.2);
}

.guess-row:nth-child(odd) {
  background: rgba(30, 41, 59, 0.4);
}

.empty-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid rgba(51, 65, 85, 0.2);
}

.empty-row:nth-child(even) {
  background: rgba(30, 41, 59, 0.1);
}

.empty-row:nth-child(odd) {
  background: rgba(30, 41, 59, 0.2);
}

.empty-row:last-child {
  border-bottom: none;
}

.guess-cell,
.empty-cell {
  padding: 0.75rem;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  font-weight: 600;
  border-right: 1px solid rgba(71, 85, 105, 0.2);
  transition: all 0.3s;
}

.guess-cell:last-child,
.empty-cell:last-child {
  border-right: none;
}

.empty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
}

.empty-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: rgba(71, 85, 105, 0.2);
  border-radius: 50%;
}

.correct {
  background: rgba(3, 169, 75, 0.85);
  border: 1px solid rgba(50, 205, 50, 0.6);
  color: #fff;
}

.partial {
  background: rgba(255, 175, 28, 0.85);
  border: 1px solid rgba(251, 146, 60, 0.6);
  color: #fff;
}

.incorrect {
  background: rgba(186, 37, 37, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fff;
}

.game-over-panel {
  width: 100%;
  max-width: 80rem;
  margin-bottom: 1.5rem;
  animation: slideInFromBottom 0.5s ease-out;
}

.game-over-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.5);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.game-over-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #06b6d4;
  letter-spacing: 0.05em;
}

.game-over-message {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.game-over-message.success {
  color: #4ade80;
}

.game-over-message.failure {
  color: #f87171;
}

.target-info {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 1rem;
  margin-bottom: 1rem;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.target-vessel {
  color: #a5f3fc;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.target-label {
  color: #06b6d4;
  font-weight: 600;
}

.target-details {
  color: #cbd5e1;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.05em;
}

.new-game-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(to right, #0891b2, #2563eb);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.new-game-button:hover {
  background: linear-gradient(to right, #0e7490, #1d4ed8);
  transform: scale(1.05);
}

.new-game-icon {
  width: 1rem;
  height: 1rem;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  padding-bottom: 1rem;
  text-align: center;
}

.footer p {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.creator {
  color: #22d3ee;
}

.hidden {
  display: none !important;
}

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-section {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
}

.eve-login-button {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.eve-login-button:hover {
  transform: scale(1.05);
}

.eve-login-image {
  height: 2rem;
  width: auto;
  display: block;
}

.login-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border: 1px solid rgba(243, 156, 18, 0.6);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.login-button:hover {
  background: linear-gradient(135deg, #e67e22, #d35400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.eve-logo {
  width: 1.25rem;
  height: 1.25rem;
}

.user-profile {
  position: relative;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.user-info:hover {
  border-color: #06b6d4;
  background: rgba(15, 23, 42, 0.95);
}

.user-portrait {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  border: 2px solid rgba(34, 211, 238, 0.6);
  object-fit: cover;
}

.user-portrait-placeholder {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  border: 2px solid rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(34, 211, 238, 0.8);
}

.user-portrait-placeholder svg {
  width: 1.5rem;
  height: 1.5rem;
}

.user-name {
  color: #22d3ee;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

.user-dropdown-btn {
  background: none;
  border: none;
  color: #22d3ee;
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.2s;
}

.user-dropdown-btn:hover {
  transform: scale(1.1);
}

.dropdown-icon {
  width: 1rem;
  height: 1rem;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.4);
  backdrop-filter: blur(12px);
  min-width: 10rem;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 50;
}

.logout-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: background-color 0.2s;
}

.logout-button:hover {
  background: rgba(248, 113, 113, 0.1);
}

.logout-icon {
  width: 1rem;
  height: 1rem;
}

.share-game-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.share-game-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #22d3ee;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.share-game-button:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(34, 211, 238, 0.3);
    color: #22d3ee;
}

.share-game-button-tab.active {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(34, 211, 238, 0.6);
    color: #22d3ee;
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(71, 85, 105, 0.4);
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: all 0.2s;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  text-decoration: none;
}

.nav-tab:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(34, 211, 238, 0.3);
  color: #cbd5e1;
}

.nav-tab.active {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(34, 211, 238, 0.6);
  color: #22d3ee;
}

.tab-icon {
  width: 1rem;
  height: 1rem;
}

.tab-content {
  display: none;
  width: 100%;
  max-width: 80rem;
}

.tab-content.active {
  display: block;
}

.leaderboard-container {
  width: 100%;
  max-width: 80rem;
  margin-bottom: 1.5rem;
}

.leaderboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.leaderboard-title {
  font-size: 2rem;
  font-weight: 700;
  color: #22d3ee;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.leaderboard-subtitle {
  color: rgba(165, 243, 252, 0.8);
  font-size: 0.875rem;
  font-weight: 400;
}

.leaderboard-grid {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.3);
  backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.leaderboard-grid-header {
  display: grid;
  grid-template-columns: 4rem 1fr 6rem 6rem 6rem;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}

.leaderboard-header-cell {
  padding: 0.75rem;
  text-align: center;
  color: #06b6d4;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-right: 1px solid rgba(71, 85, 105, 0.4);
}

.selected-sort-header {
    background: rgba(34, 211, 238, 0.18);
    color: #22d3ee;
    transition: background-color 0.2s;
}

.leaderboard-header-cell:last-child {
  border-right: none;
}

.leaderboard-header-cell.pilot-col {
  text-align: left;
}

.leaderboard-rows {
  display: flex;
  flex-direction: column;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 4rem 1fr 6rem 6rem 6rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  transition: background-color 0.2s;
}

.leaderboard-row:hover {
  background: rgba(34, 211, 238, 0.05);
}

.leaderboard-row:nth-child(even) {
  background: rgba(30, 41, 59, 0.2);
}

.leaderboard-row:nth-child(odd) {
  background: rgba(30, 41, 59, 0.4);
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-cell {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  border-right: 1px solid rgba(71, 85, 105, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-cell:last-child {
  border-right: none;
}

.leaderboard-cell.pilot-cell {
  justify-content: flex-start;
  gap: 0.75rem;
}

.rank-cell {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  color: #22d3ee;
}

.rank-cell.top-3 {
  color: #fbbf24;
}

.pilot-portrait {
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  object-fit: cover;
  flex-shrink: 0;
}

.pilot-name {
  color: #a5f3fc;
  font-weight: 500;
}

.stat-cell {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  color: #cbd5e1;
}

.winrate-cell {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
}

.winrate-excellent {
  color: #4ade80;
}

.winrate-good {
  color: #22d3ee;
}

.winrate-average {
  color: #fbbf24;
}

.winrate-poor {
  color: #f87171;
}

@media (max-width: 768px) {
  .title {
    font-size: 2rem;
  }

  .header {
    margin-top: 3rem;
  }

  .user-section {
    position: absolute;
    top: -2rem;
    right: 0;
  }

  .eve-login-image {
    height: 1.5rem;
  }

  .nav-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .nav-tab {
    flex: 1;
    min-width: 8rem;
    max-width: 12rem;
    justify-content: center;
  }

  .leaderboard-grid-header,
  .leaderboard-row {
    grid-template-columns: 3rem 1fr 4rem 4rem 4rem;
  }

  .leaderboard-header-cell,
  .leaderboard-cell {
    padding: 0.5rem 0.25rem;
    font-size: 0.625rem;
  }

  .pilot-portrait {
    width: 1.5rem;
    height: 1.5rem;
  }

  .user-info {
    padding: 0.5rem 0.75rem;
  }

  .user-portrait {
    width: 2rem;
    height: 2rem;
  }

  .user-name {
    font-size: 0.75rem;
  }

  .game-grid {
    font-size: 0.75rem;
  }

  .guess-cell,
  .empty-cell {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }

  .header-cell {
    padding: 0.5rem 0.25rem;
    font-size: 0.625rem;
  }
}
