@import url('https://fonts.googleapis.com/css?family=Galdeano');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

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

html {
  min-height: 100%;
}

body {
  font-family: Galdeano, "Helvetica Neue", "Lucida Grande", Helvetica, sans-serif;
  font-size: 14px;
  background: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #fff;
  text-shadow: 0 0 1px transparent, 0 1px 2px rgba(0, 0, 0, 0.8);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 10px 20px;
}

#bg {
  background-image: url('../images/bg.webp');
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  background-color: #333;
}

/* Links */
a,
a:hover,
a:focus,
a:active {
  color: #ff9800;
  text-decoration: none !important;
}

/* Container */
.rpg-container {
  width: 480px;
  max-width: 100%;
  background: #333;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 20px;
  overflow: hidden;
}

.rpg-container::before,
.rpg-container::after {
  content: "";
  position: absolute;
  z-index: -1;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  top: 0;
  bottom: 10px;
  left: 0;
  right: 0;
  border-radius: 100px / 10px;
}

.rpg-container::after {
  right: 10px;
  left: auto;
  transform: skew(8deg) rotate(3deg);
}

/* Header & Logo */
.rpg-header {
  padding: 8px;
  text-align: center;
  width: 100%;
}

.rpg-logo {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* Intro Graphic Banner */
.rpg-intro-art {
  width: 100%;
  text-align: center;
  margin-top: 6px;
}

.rpg-intro-art img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Page Title Bar */
.rpg-title-bar {
  width: 100%;
  background-color: #272727;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  padding: 8px 12px;
  text-align: center;
  color: #f0e29a;
  font-size: 0.9em;
  font-weight: bold;
  letter-spacing: 1px;
}

/* Tagline Slogan */
.rpg-tagline {
  width: 100%;
  background-color: #272727;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  padding: 6px 12px;
  text-align: center;
  color: #736F6E;
  font-size: 0.75em;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* Actions & Content Sections */
.rpg-content-box {
  width: 90%;
  margin: 14px auto 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rpg-actions {
  width: 240px;
  max-width: 90%;
  margin: 20px auto 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rpg-subtext {
  color: #736F6E;
  font-size: 0.75em;
  font-weight: bold;
  text-align: center;
}

.rpg-divider-short {
  width: 120px;
  height: 1px;
  background-color: #373737;
  margin: 4px 0;
}

.rpg-divider-full {
  width: 100%;
  height: 1px;
  background-color: #373737;
  margin: 14px 0;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 14px;
  text-align: center;
  font-weight: bold;
  border-radius: 4px;
  border: none;
  border-bottom: 2px solid #272727;
  text-shadow: none;
  font-size: 0.8em;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-big {
  background: #d35400;
  background: linear-gradient(to bottom, #d35400 0%, #d35400 75%, #a04000 100%);
  color: #e9e9e9;
  font-size: 0.8em;
  letter-spacing: 0.5px;
  padding: 7px 14px;
}

.btn-big:hover {
  background: #c04d01;
  background: linear-gradient(to bottom, #c04d01 0%, #c04d01 75%, #8d3901 100%);
}

.btn-secondary {
  background: #7e8aa2;
  background: linear-gradient(to bottom, #7e8aa2 0%, #7e8aa2 75%, #63708a 100%);
  color: #e9e9e9;
  font-size: 0.8em;
}

.btn-secondary:hover {
  background: #5f739b;
  background: linear-gradient(to bottom, #5f739b 0%, #5f739b 75%, #4c5c7b 100%);
}

.btn-secondary i {
  color: #ff9800;
  font-size: 0.9em;
}

.btn-dark {
  background: #272727;
  background: linear-gradient(to bottom, #272727 0%, #272727 75%, #1a1a1a 100%);
  color: #d1d5db;
}

.btn-dark:hover {
  background: #181818;
}

/* Forms & Inputs */
.rpg-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rpg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.rpg-label {
  font-size: 0.75em;
  color: #d1d5db;
  font-weight: bold;
}

.rpg-input {
  width: 100%;
  background: #B7B7B7;
  border: 1px solid #272727;
  color: #222;
  border-radius: 4px;
  font-size: 0.8em;
  padding: 6px 8px;
  outline: none;
  font-family: inherit;
}

.rpg-input:focus {
  background: #e5e7eb;
  border-color: #ff9800;
}

/* Class Selection Grid */
.rpg-class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.rpg-class-card {
  position: relative;
  background: #272727;
  border: 2px solid #373737;
  border-radius: 6px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rpg-class-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rpg-class-card:hover {
  border-color: #7e8aa2;
  background: #2d2d2d;
}

.rpg-class-card.active,
.rpg-class-card:has(input[type="radio"]:checked) {
  border-color: #ff9800;
  background: #362e24;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
}

.rpg-class-avatar {
  width: 125px;
  height: 220px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s ease;
}

.rpg-class-card:hover .rpg-class-avatar,
.rpg-class-card:has(input[type="radio"]:checked) .rpg-class-avatar {
  transform: scale(1.04);
}

/* 5 Cards Row Layout (Chỉ 5 ảnh card dàn hàng ngang) */
.rpg-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
  padding: 8px 0;
}

.rpg-card-slot {
  aspect-ratio: 9 / 16;
  background: #1a1a1a;
  border: 1.5px solid #d97706;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.rpg-card-slot:hover {
  transform: translateY(-2px);
  border-color: #ff9800;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.rpg-card-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.rpg-alert {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.7em;
  font-weight: bold;
  text-align: center;
}

.rpg-alert-danger {
  background-color: rgba(220, 38, 38, 0.25);
  border: 1px solid #dc2626;
  color: #fca5a5;
}

.rpg-alert-success {
  background-color: rgba(22, 163, 74, 0.25);
  border: 1px solid #16a34a;
  color: #86efac;
}

/* Cards & Articles */
.rpg-card {
  background: #272727;
  border: 1px solid #373737;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpg-card-title {
  color: #f0e29a;
  font-size: 0.85em;
  font-weight: bold;
}

.rpg-card-meta {
  color: #736F6E;
  font-size: 0.65em;
}

.rpg-card-text {
  color: #d1d5db;
  font-size: 0.75em;
  line-height: 1.5;
}

/* Menu Grid */
.rpg-menu-grid {
  width: 240px;
  max-width: 90%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 auto;
}

.rpg-menu-card {
  background-color: #272727;
  background: linear-gradient(to bottom, #272727 0%, #272727 75%, #1a1a1a 100%);
  border-radius: 4px;
  padding: 10px 6px;
  text-align: center;
  color: #736F6E;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.rpg-menu-card:hover {
  background: #181818;
  background: linear-gradient(to bottom, #181818 0%, #181818 75%, #0b0b0b 100%);
}

.menu-icon {
  font-size: 17px;
  margin-bottom: 4px;
  display: inline-block;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.rpg-menu-card span {
  font-size: 0.625em;
  font-weight: bold;
}

/* Card Detail Modal */
.rpg-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.rpg-modal.active {
  display: flex;
}

.rpg-modal-box {
  width: 420px;
  max-width: 96%;
  background: linear-gradient(135deg, #2b2b2b 0%, #1c1c1c 100%);
  border: 2px solid #ff9800;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 0 25px rgba(255, 152, 0, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.rpg-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #a0a0a0;
  font-size: 17px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.rpg-modal-close:hover {
  color: #ff9800;
}

/* Team Formation Layout */
.rpg-team-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #242424;
  border: 1.5px solid #373737;
  border-radius: 6px;
  padding: 8px 10px;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.rpg-team-slot-card.active {
  border-color: #ff9800;
  background: #2e261c;
}

.rpg-pos-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff9800;
  color: #000;
  font-weight: 900;
  font-size: 0.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.btn-arrow {
  width: 28px;
  height: 28px;
  background: #373737;
  color: #f0e29a;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.btn-arrow:hover:not(:disabled) {
  background: #ff9800;
  color: #000;
  border-color: #ff9800;
}

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

/* Navigation Back Bar */
.rpg-back-bar {
  width: 90%;
  margin: 8px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7em;
}

/* Social Icons */
.rpg-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0;
}

.social-icon {
  color: #a0a0a0;
  font-size: 17px;
  transition: color 0.2s ease, transform 0.2s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.social-icon:hover {
  color: #ff9800;
  transform: translateY(-2px);
}

.social-facebook:hover {
  color: #1877f2;
}

.social-discord:hover {
  color: #5865f2;
}

.social-twitter:hover {
  color: #e0e0e0;
}

.social-email:hover {
  color: #ea4335;
}

/* Footer & Legal */
.rpg-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rpg-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.625em;
}

.rpg-legal-links a {
  color: #736F6E;
}

.rpg-legal-links a:hover {
  color: #ff9800;
}

.rpg-copyright {
  color: #736F6E;
  font-size: 0.625em;
  text-align: center;
  margin-top: 4px;
}

/* Class Selection Cards Grid on Register/Join page */
.rpg-class-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.rpg-class-card {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.rpg-class-card input[type="radio"] {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  accent-color: #ff9800;
  cursor: pointer;
}

.rpg-card-content {
  background: #242424;
  border: 1.5px solid #444;
  border-radius: 6px;
  padding: 8px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s ease;
  height: 100%;
}

.rpg-class-card input[type="radio"]:checked + .rpg-card-content {
  border-color: #ff9800;
  background: #2e261a;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
}

.rpg-card-img {
  width: 100%;
  max-width: 85px;
  height: 115px;
  object-fit: contain;
  margin-bottom: 6px;
  display: block;
}

.rpg-card-name {
  font-size: 0.8em;
  font-weight: bold;
  color: #f0e29a;
  margin-bottom: 2px;
}

.rpg-card-desc {
  font-size: 0.65em;
  color: #a0a0a0;
  line-height: 1.2;
}

/* Card Row 5 Slots at Game Hall */
.rpg-card-row-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.rpg-card-slot {
  width: 100%;
  aspect-ratio: 9 / 14;
  min-height: 80px;
  background: #1e1e1e;
  border: 1.5px solid #ff9800;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.rpg-card-slot:hover {
  transform: translateY(-2px);
  border-color: #fde047;
  box-shadow: 0 4px 10px rgba(255, 152, 0, 0.4);
}

.rpg-card-pure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rpg-card-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed #555;
  border-radius: 3px;
  color: #666;
  font-size: 14px;
}

/* Modal Popup Styles */
.rpg-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.rpg-modal-content {
  background: #2a2a2a;
  border: 2px solid #ff9800;
  border-radius: 8px;
  width: 95%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rpg-modal-header {
  background: #1e1e1e;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #444;
}

.rpg-modal-close {
  color: #a0a0a0;
  font-size: 17px;
  cursor: pointer;
  line-height: 1;
}

.rpg-modal-close:hover {
  color: #ef4444;
}

.rpg-modal-body {
  padding: 10px 12px;
}

.rpg-modal-footer {
  background: #1e1e1e;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #444;
}

/* Nút Cài Đặt Game PWA */
.btn-pwa {
  background: #2e7d32;
  background: linear-gradient(to bottom, #2e7d32 0%, #2e7d32 75%, #1b5e20 100%);
  color: #ffffff !important;
  border-bottom: 2px solid #144417;
  font-size: 0.8em;
}

.btn-pwa:hover {
  background: #388e3c;
  background: linear-gradient(to bottom, #388e3c 0%, #388e3c 75%, #2e7d32 100%);
}

.btn-pwa i {
  color: #a5d6a7;
}

/* PWA Instruction Modal */
.pwa-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

.pwa-modal-overlay.show {
  display: flex;
}

.pwa-modal {
  background: #272727;
  border: 2px solid #ff9800;
  border-radius: 8px;
  max-width: 400px;
  width: 100%;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  color: #e9e9e9;
  text-align: left;
  animation: modalFadeIn 0.2s ease-out;
}

.pwa-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #373737;
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.pwa-modal-title {
  font-size: 1.1em;
  font-weight: bold;
  color: #ff9800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.3em;
  cursor: pointer;
  padding: 2px 6px;
}

.pwa-modal-close:hover {
  color: #ef4444;
}

.pwa-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.9em;
  line-height: 1.4;
}

.pwa-step-num {
  background: #ff9800;
  color: #111;
  font-weight: bold;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85em;
}