/* Picked poster and actions */
.picked-section {
  min-width: 0;
  padding: 28px;
  background: #fff;
}

.picked-heading {
  margin: 0 0 28px;
}

.text-button {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.picked-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
}

.poster-preview-wrap {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nickname-field {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.nickname-field input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.rank-editor, .couple-selection {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.couple-selection-list {
  display: grid;
  gap: 6px;
}

.couple-selection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}

.couple-selection-item button {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.picked-list-heading {
  margin-bottom: 14px;
}

.picked-list-heading,
.nickname-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.rank-editor-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rank-editor-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-size: 12px;
}

.rank-editor-row span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-editor-row select {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 28px 0 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  appearance: none;
  background-position: right 8px center;
  background-size: 10px 7px;
  color: var(--ink);
  font: inherit;
}

.nickname-field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#poster-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
}

.poster-empty[hidden] {
  display: none;
}

#poster-preview > .print-poster {
  transform-origin: top left;
}

.print-poster {
  width: 1200px;
  padding: 64px;
  background: var(--paper);
  color: #22231f;
  font-family: "Wanted Sans Variable", Pretendard, sans-serif;
  word-break: keep-all;
  overflow-wrap: normal;
}

.print-poster-header {
  padding-bottom: 35px;
  border-bottom: 1px solid #e4e2dc;
  text-align: center;
}

.print-poster-header h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: 'Godo';
  font-size: 42px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.print-poster-header h2 > span {
  flex: 0 0 auto;
}

.print-poster-header h2 img {
  display: block;
  flex: 0 0 auto;
  height: 48px;
  object-fit: contain;
  margin-left: 12px;
}

.print-poster-owner {
  color: var(--accent);
}

.print-poster-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.print-poster-podium {
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  align-items: end;
  gap: 18px;
  margin-top: 28px;
}

.print-poster-podium .rank-1 .print-poster-portrait {
  height: 480px;
}

.print-poster-podium .rank-2 .print-poster-portrait {
  height: 440px;
}

.print-poster-podium .rank-3 .print-poster-portrait {
  height: 400px;
}

.print-poster-podium-placeholder {
  visibility: hidden;
}

.print-poster-podium-placeholder.rank-1 {
  height: 522px;
}

.print-poster-podium-placeholder.rank-2 {
  height: 482px;
}

.print-poster-podium-placeholder.rank-3 {
  height: 462px;
}

.print-poster-lower-grid {
  margin-top: 22px;
}

.print-poster-lower-grid > .print-poster-card {
  flex: 0 0 calc((100% - 90px) / 6);
}

.print-poster-band-grid > .print-poster-card {
  flex: 0 0 calc((100% - 54px) / 4);
}

.print-couples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.print-couple {
  flex: 0 0 calc((100% - 18px) / 2);
  min-width: 0;
  padding: 18px;
  border: 1px solid #e4e2dc;
  border-radius: 10px;
  background: #fff;
}

.print-couple-name {
  display: block;
  color: #22231f;
  font-family: 'Godo', sans-serif;
  font-size: 16px;
  text-align: center;
}

.print-couple-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  align-items: center;
}

.print-couple-arrow {
  color: var(--accent);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.print-couple-direction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.print-poster-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e2dc;
  border-radius: 10px;
  background: #fff;
}

.print-poster-portrait {
  position: relative;
  display: grid;
  place-items: center;
  height: 360px;
  overflow: hidden;
  background: var(--character-color);
  color: #fff;
  font-size: 42px;
}

.print-poster-rank {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  font-family: 'Godo';
  line-height: 1;
  white-space: nowrap;
}

.print-poster-card.rank-1 .print-poster-rank {
  background: var(--accent);
}

.print-poster-featured-logo {
  display: grid;
  place-items: center;
  height: 76px;
  padding: 8px 14px;
  background: #fff;
}

.print-poster-featured-logo img {
  display: block;
  width: auto;
  max-width: 86%;
  height: 54px;
  object-fit: contain;
}

.print-poster-portrait img {
  display: block;
  width: 105%;
  height: 105%;
  object-fit: cover;
  object-position: center top;
}

.print-poster-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px;
  background: #fff;
}

.print-poster-card:not(.print-poster-card-band) .print-poster-info {
  padding-top: 12px;
}

.print-poster-band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  color: #777870;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.print-poster-band img {
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  height: 28px;
  object-fit: contain;
}

.print-poster-info .print-poster-name {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  font-size: 20px;
  font-weight: 400;
  font-family: 'Godo';
  white-space: nowrap;
  text-overflow: ellipsis;
}

.print-poster-sub {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #777870;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.print-poster-lower-grid .print-poster-info {
  padding-right: 8px;
  padding-left: 8px;
}

.print-poster-lower-grid .print-poster-sub {
  font-size: 11px;
}

.print-poster-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid #e4e2dc;
  color: #777870;
  font-size: 13px;
}

.print-poster-footer span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.print-poster-export {
  position: fixed;
  top: 0;
  left: -2000px;
  transform: none !important;
}

.poster-empty {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 28px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.image-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.image-button svg {
  display: block;
  width: 16px;
  height: 16px;
}

.image-button:disabled {
  border-color: #d6d5cf;
  background: #e8e7e1;
  color: #8a8b83;
  cursor: not-allowed;
}
