/* src/styles/index.css */
*, *:before, *:after {
  box-sizing: border-box;
}

html, body {
  color: #7a8394;
  -webkit-font-smoothing: antialiased;
  background: #0b0e14;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

#root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.app {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex: 1;
}

.top-bar {
  display: flex;
  background: #12151c;
  border-bottom: 1px solid #252a36;
  flex-shrink: 0;
  justify-content: space-between;
  align-items:  center;
  height: 52px;
  padding: 0 16px;
}

.top-bar-title {
  color: #9aa3b4;
  letter-spacing: .04em;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
}

.top-bar-title:hover {
  color: #c0c8d6;
}

.phase-badge {
  display: inline-flex;
  color: #c8d8f0;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: #3d6496;
  border-radius: 999px;
  align-items:  center;
  padding: 4px 12px;
  font-size: .78rem;
  font-weight: 600;
}

.content-area {
  overflow-y: auto;
  flex: 1;
  padding: 16px;
}

.content-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 32px;
}

.card {
  display: flex;
  background: #12151c;
  border: 1px solid #252a36;
  border-radius: 12px;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.section-title {
  color: #9aa3b4;
  display: flex;
  align-items:  center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.results-title {
  justify-content: center;
  font-size: 1.25rem;
}

.btn {
  display: inline-flex;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  border: 1px solid #0000;
  border-radius: 8px;
  justify-content: center;
  align-items:  center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
}

.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: #5082c4;
  border-color: #5082c4;
}

.btn-primary:not(:disabled):hover {
  background: #3d6496;
  border-color: #3d6496;
}

.btn-small {
  padding: .2rem .5rem;
  font-size: .75rem;
}

.btn-danger {
  color: #c45050;
  background: none;
  border-color: #c45050;
}

.btn-danger:not(:disabled):hover, .btn-danger.btn-active {
  color: #fff;
  background: #c45050;
  border-color: #c45050;
}

.btn-success {
  color: #fff;
  background: #50a878;
  border-color: #50a878;
}

.btn-success:not(:disabled):hover {
  background: #3d8a60;
  border-color: #3d8a60;
}

.btn-outline {
  color: #7a8394;
  background: none;
  border-color: #252a36;
}

.btn-outline:not(:disabled):hover {
  color: #9aa3b4;
  border-color: #5082c4;
}

.btn-ghost {
  color: #5082c4;
  background: none;
  border-color: #0000;
}

.btn-ghost:not(:disabled):hover {
  background: #5082c41a;
}

.btn-full {
  width: 100%;
}

.btn-large {
  border-radius: 10px;
  min-height: 52px;
  font-size: 1rem;
}

.btn-icon {
  min-width: 44px;
  padding: 0 10px;
  font-size: 1.1rem;
}

.text-input {
  color: #9aa3b4;
  outline: none;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  transition: border-color .12s;
  font-family: inherit;
  font-size: 1rem;
}

.text-input::placeholder {
  color: #4a5264;
}

.text-input:focus {
  border-color: #5082c4;
}

.input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.input-row .text-input {
  flex: 1;
  min-width: 0;
}

.input-row .btn {
  flex-shrink: 0;
}

.field-label {
  display: block;
  color: #7a8394;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
  font-size: .85rem;
  font-weight: 600;
}

.name-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-display {
  display: flex;
  align-items:  center;
  gap: 10px;
}

.name-display-text {
  color: #9aa3b4;
  flex: 1;
  font-size: 1.15rem;
  font-weight: 600;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.player-item {
  display: flex;
  border-bottom: 1px solid #1a1e28;
  align-items:  center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 0;
}

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

.player-item--disconnected .player-name {
  color: #6b7280;
  font-style: italic;
}

.player-item--disconnected .ready-dot, .player-item--disconnected .connected-dot {
  opacity: .5;
}

.player-name {
  color: #9aa3b4;
  flex: 1;
  font-size: .95rem;
}

.you-label {
  color: #5082c4;
  font-size: .82rem;
  font-weight: 400;
}

.disconnect-timer {
  color: #c45050;
  font-size: .82rem;
  font-weight: 400;
}

.host-crown {
  font-size: 1rem;
}

.connected-dot {
  font-size: .6rem;
  line-height: 1;
}

.connected-dot--on {
  color: #50a878;
}

.connected-dot--off {
  color: #3a3f4e;
}

.ready-dot {
  text-align: center;
  width: 20px;
  font-size: .85rem;
  line-height: 1;
}

.ready-dot--on {
  color: #50a878;
}

.ready-dot--off {
  color: #3a3f4e;
}

.game-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.game-item {
  display: flex;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  transition: border-color .12s, background .12s;
}

.game-item--vetoed {
  background: #c450500f;
  border-color: #c4505059;
}

.game-item--dim {
  opacity: .55;
}

.game-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.game-item-name {
  color: #9aa3b4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .95rem;
  font-weight: 500;
}

.game-item-name--crossed {
  text-decoration: line-through;
  color: #4a5264;
}

.game-item-meta {
  color: #4a5264;
  font-size: .8rem;
}

.veto-count-badge {
  display: inline-flex;
  color: #c45050;
  background: #c450502e;
  border-radius: 999px;
  align-items:  center;
  width: -moz-fit-content;
  width: fit-content;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 600;
}

.count-badge {
  display: inline-flex;
  color: #5082c4;
  background: #252a36;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: .75rem;
  font-weight: 700;
}

.ranking-list {
  list-style: none;
  display: flex;
  counter-reset: ranking;
  -webkit-user-select: none;
  user-select: none;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.ranking-item {
  display: flex;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 12px;
}

.ranking-position {
  color: #5082c4;
  text-align: center;
  min-width: 24px;
  font-size: 1.1rem;
  font-weight: 700;
}

.ranking-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.ranking-controls {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}

.submitted-banner {
  display: flex;
  background: #50a8781f;
  border: 1px solid #50a8784d;
  border-radius: 8px;
  justify-content: center;
  align-items:  center;
  gap: 10px;
  padding: 14px;
}

.submitted-icon {
  color: #50a878;
  font-size: 1.4rem;
}

.submitted-text {
  color: #50a878;
  font-size: 1.1rem;
  font-weight: 600;
}

.results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.results-item {
  display: flex;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 10px;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  transition: border-color .12s;
}

.results-item--first {
  background: #c4a0501a;
  border-color: #c4a050;
  box-shadow: 0 0 16px #c4a05026;
}

.results-item--draw {
  border-color: #5082c4;
}

.results-item--first.results-item--draw {
  border-color: #c4a050;
}

.results-item-header {
  display: flex;
  align-items:  center;
  gap: 14px;
}

.results-rank {
  text-align: center;
  color: #7a8394;
  min-width: 32px;
  font-size: 1.1rem;
  font-weight: 700;
}

.results-item--first .results-rank {
  font-size: 1.4rem;
}

.results-game-name {
  color: #9aa3b4;
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.results-item--first .results-game-name {
  color: #c4a050;
  font-size: 1.15rem;
}

.draw-badge {
  display: inline-block;
  letter-spacing: .05em;
  color: #5082c4;
  vertical-align: middle;
  border: 1px solid #5082c4;
  border-radius: 4px;
  margin-left: 8px;
  padding: 1px 6px;
  font-size: .65rem;
  font-weight: 700;
}

.results-score {
  color: #4a5264;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
}

.results-item--first .results-score {
  color: #c4a050;
  font-weight: 600;
}

.results-bar-track {
  overflow: hidden;
  background: #252a36;
  border-radius: 2px;
  height: 4px;
}

.results-bar-fill {
  background: #5082c4;
  border-radius: 2px;
  height: 100%;
  transition: width .4s;
}

.results-bar-fill--first {
  background: #c4a050;
}

.connecting-screen {
  display: flex;
  text-align: center;
  flex-direction: column;
  justify-content: center;
  align-items:  center;
  gap: 20px;
  height: 100%;
  padding: 40px 20px;
}

.connecting-logo {
  color: #9aa3b4;
  letter-spacing: .06em;
  font-size: 2.5rem;
  font-weight: 800;
}

.connecting-status {
  color: #4a5264;
  font-size: 1rem;
}

.connecting-dots {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.dot-pulse {
  display: inline-block;
  animation: pulse 1.2s ease-in-out infinite;
  background: #3d6496;
  border-radius: 50%;
  width: 8px;
  height: 8px;
}

.dot-pulse:nth-child(2) {
  animation-delay: .2s;
}

.dot-pulse:nth-child(3) {
  animation-delay: .4s;
}

@keyframes pulse {
  0%, 80%, 100% {
    transform: scale(.7);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.hint-text {
  color: #4a5264;
  margin: 0;
  font-size: .88rem;
  line-height: 1.5;
}

.empty-hint {
  color: #3a3f4e;
  text-align: center;
  margin: 0;
  padding: 8px 0;
  font-size: .9rem;
  font-style: italic;
}

.center-text {
  text-align: center;
}

.content-area::-webkit-scrollbar {
  width: 6px;
}

.content-area::-webkit-scrollbar-track {
  background: none;
}

.content-area::-webkit-scrollbar-thumb {
  background: #252a36;
  border-radius: 3px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background: #3a3f4e;
}

.top-bar-right {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.name-chip {
  color: #9aa3b4;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  background: none;
  border: 1px solid #252a36;
  border-radius: 999px;
  align-items:  center;
  max-width: 140px;
  min-height: 32px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
}

.name-chip:hover {
  color: #c8d8f0;
  border-color: #5082c4;
}

.name-edit-input {
  color: #9aa3b4;
  outline: none;
  background: #1a1e28;
  border: 1px solid #5082c4;
  border-radius: 999px;
  width: 140px;
  min-height: 32px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: .85rem;
}

.veto-stepper {
  display: flex;
  align-items:  center;
  gap: 12px;
}

.veto-count {
  color: #9aa3b4;
  text-align: center;
  min-width: 32px;
  font-size: 1.4rem;
  font-weight: 700;
}

.veto-label {
  color: #7a8394;
  flex: 1;
  font-size: .9rem;
}

.drag-handle {
  color: #3a3f4e;
  cursor: grab;
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
  padding: 0 4px;
  font-size: 1.2rem;
  line-height: 1;
}

.drag-handle:hover {
  color: #7a8394;
}

.drag-handle--disabled {
  cursor: default;
  opacity: .3;
}

.ranking-item--dragging {
  opacity: .5;
  border-style: dashed;
  border-color: #5082c4;
}

.lobby-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.lobby-item {
  display: flex;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  align-items:  center;
  gap: 12px;
  padding: 12px 14px;
}

.lobby-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.lobby-item-name {
  color: #c8cdd8;
  font-size: .95rem;
  font-weight: 600;
}

.lobby-lock-icon {
  font-size: .8rem;
}

.lobby-locked-badge {
  display: inline-block;
  color: #c45050;
  vertical-align: middle;
  border: 1px solid #c45050;
  border-radius: 3px;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: .6rem;
  font-weight: 700;
}

.lobby-item-meta {
  color: #4a5264;
  display: flex;
  align-items:  center;
  gap: 8px;
  font-size: .8rem;
}

.phase-badge--small {
  padding: 1px 5px;
  font-size: .65rem;
}

.lobby-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-toggle {
  display: flex;
  color: #c8cdd8;
  cursor: pointer;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
  padding: 8px 12px;
  font-size: .95rem;
}

.lobby-toggle input[type="checkbox"] {
  accent-color: #5082c4;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.lobby-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  color: #fff;
  z-index: 1000;
  cursor: pointer;
  animation: toast-in .2s ease;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 500;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%)translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%)translateY(0);
  }
}

.toast--info {
  background: #5082c4;
}

.toast--error {
  background: #c45050;
}

.toast--warning {
  background: #c4a050;
}

.top-bar-left {
  display: flex;
  align-items:  center;
  gap: 10px;
}

.lobby-name-badge {
  color: #7a8394;
  font-size: .8rem;
  font-weight: 400;
}

.lobby-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-password-row {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.lobby-password-input {
  color: #9aa3b4;
  outline: none;
  background: #1a1e28;
  border: 1px solid #252a36;
  border-radius: 8px;
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: .85rem;
}

.lobby-password-input:focus {
  border-color: #5082c4;
}

.github-link {
  color: #4a5264;
  display: flex;
  align-items:  center;
  transition: color .15s;
}

.github-link:hover {
  color: #9aa3b4;
}

.github-link--hero {
  color: #3a4254;
  margin-top: 8px;
}

.github-link--hero:hover {
  color: #7a8394;
}
