* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #FFFFFF;
  color: #1A1A1A;
  letter-spacing: 0.03em;
}

h1, h2, h3, p {
  margin-top: 0;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid #EDEDEA;
}

.header-inner {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
}

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


.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: #1A1A1A;
  letter-spacing: 0.03em;
}

/* ── Layout ── */
.app {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 80px;
}


.hero-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 28px;
  display: block;
  text-align: center;
  cursor: default;
  transition: transform 0.6s ease;
}

.hero-icon:hover {
  transform: rotate(360deg);
}


/* ── Card/Panel ── */
.panel {
  background: #FFFFFF;
  border-radius: 20px;
}

/* ── Controls ── */
.app-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  flex: 1.2;
}

.board-wrap {
  flex: 2.8;
}

.controls-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}



/* ── Input tabs ── */
.input-tabs {
  display: flex;
  border-bottom: 1.5px solid #EDEDEA;
}

.input-tab {
  min-height: auto;
  padding: 5px 12px 7px;
  border-radius: 0;
  background: transparent;
  color: #9A9A95;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.15s, border-color 0.15s;
}

.input-tab:hover {
  background: transparent;
  color: #0088D9;
}

.input-tab.active {
  background: transparent;
  color: #00A1FF;
  border-bottom-color: #00A1FF;
}

textarea#memberText {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px dashed #C8C7C2;
  border-radius: 12px;
  background: #FAFAF9;
  font-size: 14px;
  font-family: inherit;
  color: #1A1A1A;
  resize: vertical;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.6;
}

textarea#memberText:focus {
  outline: none;
  border-color: #00A1FF;
  border-style: solid;
  background: #FFFFFF;
}

textarea#memberText::placeholder {
  color: #9A9A95;
}

/* Custom file upload */
.file-upload-wrapper {
  position: relative;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-display {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px dashed #C8C7C2;
  border-radius: 12px;
  background: #FAFAF9;
  font-size: 14px;
  color: #9A9A95;
  pointer-events: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.file-upload-wrapper:hover .file-upload-display {
  border-color: #00A1FF;
  background: #F0FAFF;
  color: #0088D9;
}

.file-upload-wrapper.has-file .file-upload-display {
  border-color: #00A1FF;
  background: #F0FAFF;
  color: #0088D9;
  border-style: solid;
}


.file-upload-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Number input */
.mode-select {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #1A1A1A;
  cursor: pointer;
  width: fit-content;
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231A1A1A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

.mode-select:focus {
  outline: none;
}

input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid #DEDED9;
  border-radius: 12px;
  background: #FAFAF9;
  font-size: 15px;
  font-family: inherit;
  color: #1A1A1A;
  transition: border-color 0.15s;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus {
  outline: none;
  border-color: #00A1FF;
  background: #FFFFFF;
}

/* ── Buttons ── */
.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: #00A1FF;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}

button:hover {
  background: #0088D9;
}

button:active {
  transform: scale(0.97);
}

button.secondary {
  background: #F0EFEB;
  color: #1A1A1A;
  font-weight: 600;
}

button.secondary:hover {
  background: #E5E4DF;
}

/* ── Board / Results ── */
.board-wrap {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid #EDEDEA;
  padding: 28px;
}

.board-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

.title-group h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #E6F5FF;
  color: #0088D9;
  font-size: 13px;
  font-weight: 700;
}

.hint {
  margin: 0 0 24px;
  font-size: 15px;
  color: #FF4444;
}

/* ── Team grid ── */
.team-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 36px;
  border: 2px dashed #DEDED9;
  border-radius: 16px;
  text-align: center;
  color: #ADADAD;
  font-size: 14px;
}

.ascii-art {
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  display: inline-block;
  text-align: left;
  margin: 0 0 12px;
  color: #ADADAD;
}

/* ── Team card ── */
.team-row {
  padding: 18px;
  border: 1.5px solid #EDEDEA;
  border-radius: 16px;
  background: #FAFAF9;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.team-row.drag-over {
  border-color: #00A1FF;
  background: #F0FAFF;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 191, 151, 0.14);
}

.team-row.leftover {
  border-style: dashed;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.team-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #00A1FF;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}


.team-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1A1A1A;
}

.team-header > span {
  padding: 3px 10px;
  border-radius: 999px;
  background: #F0EFEB;
  color: #6B6B6B;
  font-size: 12px;
  font-weight: 700;
}

/* ── Member chips ── */
.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
}

.member-card {
  user-select: none;
  padding: 7px 13px;
  border: 1.5px solid #DEDED9;
  border-radius: 999px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}

.member-card:hover {
  border-color: #00A1FF;
  box-shadow: 0 4px 10px rgba(26, 191, 151, 0.12);
  transform: translateY(-1px);
}

.member-card:active {
  cursor: grabbing;
}

.member-card.dragging {
  opacity: 0.35;
  transform: scale(0.94);
}

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: #1A1A1A;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  animation: toast-in 0.2s ease;
}

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

/* ── Mobile ── */
@media (max-width: 760px) {
  .app-body {
    flex-direction: column;
  }

  .controls {
    flex: none;
    width: 100%;
  }

  .board-wrap {
    flex: none;
    width: 100%;
  }

  .team-board {
    grid-template-columns: 1fr;
  }

  .board-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
