.role-create-page,
.role-rank-page,
.role-my-page {
  position: relative;
  min-height: 100%;
  padding: 24px;
  color: #fff;
}

.role-create-bg,
.role-rank-bg,
.role-my-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%,rgba(133,100,255,.48),transparent 34%),
    radial-gradient(circle at 78% 12%,rgba(84,154,255,.35),transparent 32%),
    linear-gradient(145deg,#151a5c,#090d31 72%);
  background-repeat: no-repeat;
  z-index: 0;
}

.role-create-page > *,
.role-rank-page > *,
.role-my-page > * {
  position: relative;
  z-index: 1;
}

.role-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
}

.role-breadcrumb a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}

.role-breadcrumb a:hover {
  color: #FFD166;
}

.role-breadcrumb .current {
  color: #FFD166;
}

.role-create-header,
.role-rank-header,
.role-my-header {
  margin-bottom: 24px;
}

.role-create-title,
.role-rank-title,
.role-my-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.role-create-subtitle,
.role-rank-subtitle {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
}

.role-create-scroll,
.role-rank-scroll,
.role-my-scroll {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Create page */
.role-create-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.rc-section {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.15);
}

.rc-section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rc-avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rc-avatar-option {
  position: relative;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.rc-avatar-option input {
  position: absolute;
  opacity: 0;
}

.rc-avatar-option img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
}

.rc-avatar-option span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.rc-avatar-option.selected,
.rc-avatar-option:hover {
  border-color: #FFD166;
  background: rgba(255,209,102,0.15);
}

.rc-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.rc-type-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}

.rc-type-option input {
  position: absolute;
  opacity: 0;
}

.rc-type-option:has(input:checked),
.rc-type-option:hover {
  border-color: #9B7BFF;
  background: rgba(155,123,255,0.18);
}

.rc-field {
  margin-bottom: 16px;
}

.rc-field label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.85);
}

.rc-field input,
.rc-field textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.rc-field input::placeholder,
.rc-field textarea::placeholder {
  color: rgba(255,255,255,0.45);
}

.rc-preview-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
}

.rc-preview-avatar img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
}

.rc-preview-info h4 {
  font-size: 22px;
  margin-bottom: 6px;
}

.rc-preview-info p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
}

.rc-preview-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.rc-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 16px 0 32px;
}

.rc-btn {
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}

.rc-btn:hover { transform: translateY(-2px); }

.rc-btn-primary {
  background: linear-gradient(135deg, #FFD166, #F5B65A);
  color: #2d1b4e;
}

.rc-btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Rank page */
.role-rank-top3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.rank-top-card {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.15);
  transition: transform 0.2s;
}

.rank-top-card:hover { transform: translateY(-4px); }

.rank-top-card.rank-1 { background: linear-gradient(180deg, rgba(255,209,102,0.25), rgba(255,255,255,0.1)); }
.rank-top-card.rank-2 { background: linear-gradient(180deg, rgba(192,192,192,0.25), rgba(255,255,255,0.1)); }
.rank-top-card.rank-3 { background: linear-gradient(180deg, rgba(205,127,50,0.25), rgba(255,255,255,0.1)); }

.rank-medal { font-size: 40px; margin-bottom: 8px; }
.rank-top-img { width: 100px; height: 100px; object-fit: contain; }
.rank-top-name { font-size: 20px; margin: 8px 0; }
.rank-top-score { color: #FFD166; font-weight: 600; margin-bottom: 12px; }
.rank-top-btn,
.rank-btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.rank-top-btn:hover,
.rank-btn:hover { background: rgba(255,255,255,0.35); }

.role-rank-list {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  overflow: hidden;
  margin-bottom: 24px;
}

.rank-list-header,
.rank-list-row {
  display: grid;
  grid-template-columns: 80px 1fr 140px 100px;
  align-items: center;
  padding: 14px 20px;
}

.rank-list-header {
  background: rgba(0,0,0,0.2);
  font-weight: 600;
  font-size: 14px;
}

.rank-list-row {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.rank-character {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-character img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
}

.rank-number { font-weight: 700; font-size: 18px; }
.rank-score { color: #FFD166; }

.rank-my-role {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 24px;
}

.rank-my-role h3 { margin-bottom: 16px; }

.rank-my-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rank-my-card img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
}

.rank-my-info { flex: 1; }
.rank-my-info h4 { font-size: 18px; margin-bottom: 4px; }
.rank-my-info p { color: rgba(255,255,255,0.7); }

.rank-actions {
  padding-bottom: 24px;
}

.rank-back-btn {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
}

/* My role page */
.my-role-hero { margin-bottom: 24px; }

.my-role-card {
  display: flex;
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.15);
}

.my-role-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255,255,255,0.1);
}

.my-role-info { flex: 1; }
.my-role-info h2 { font-size: 28px; margin-bottom: 12px; }

.my-role-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.my-role-tag {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,209,102,0.2);
  color: #FFD166;
  font-size: 13px;
}

.my-role-level {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}

.my-role-progress {
  height: 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  overflow: hidden;
}

.my-role-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD166, #F5B65A);
  border-radius: 999px;
}

.my-role-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.my-stat-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.12);
}

.my-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #FFD166;
  margin-bottom: 6px;
}

.my-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.my-role-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.my-action-btn {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.my-action-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.my-action-btn.primary {
  background: linear-gradient(135deg, rgba(255,209,102,0.3), rgba(245,182,90,0.2));
  border-color: rgba(255,209,102,0.4);
}

.my-role-recent {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.15);
  margin-bottom: 24px;
}

.my-role-recent h3 {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-recent-item {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
}

.my-recent-time {
  width: 70px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
}

.my-role-footer-actions {
  padding-bottom: 24px;
}

.my-back-btn {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
}

/* Scrollbar */
.role-create-scroll::-webkit-scrollbar,
.role-rank-scroll::-webkit-scrollbar,
.role-my-scroll::-webkit-scrollbar {
  width: 6px;
}

.role-create-scroll::-webkit-scrollbar-thumb,
.role-rank-scroll::-webkit-scrollbar-thumb,
.role-my-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}

@media (max-width: 1100px) {
  .role-create-form { grid-template-columns: 1fr; }
  .role-rank-top3 { grid-template-columns: 1fr; }
  .role-rank-list .rank-list-header,
  .role-rank-list .rank-list-row { grid-template-columns: 50px 1fr 100px 80px; }
  .my-role-stats { grid-template-columns: repeat(2, 1fr); }
  .my-role-actions { grid-template-columns: 1fr; }
}
