/* ==========================================================================
   Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Base
   ========================================================================== */
html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #bfbfbf;
  min-width: 400px;
  position: relative;
  z-index: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/pat-red.webp');
  background-size: 150px 150px;
  background-repeat: repeat;
  opacity: 0.15;
  z-index: -1;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  flex: 1;
  min-width: 400px;
  transition: margin-right 0.3s ease;
}

body.menu-open .side-menu {
  right: 0;
}

.cards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* ==========================================================================
   Header
   ========================================================================== */
.main-header {
  width: 100%;
  text-align: center;
  padding: 20px 0;
  background: black;
  border-bottom: 2px solid #999;
  position: relative;
}

.logo {
  max-width: 270px;
  height: auto;
}

.menu-toggle {
  position: absolute;
  right: 20px;
  top: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: red;
  cursor: pointer;
}

/* ==========================================================================
   Side Menu
   ========================================================================== */
.side-menu {
  position: fixed;
  right: -260px;
  top: 0;
  width: 240px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
  padding: 40px 20px;
  transition: right 0.3s ease;
  z-index: 999;
}

body.menu-open .side-menu {
  right: 0;
}

body {
  overflow-x: hidden;
}

.side-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.side-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
}

.side-menu ul li img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: white;
  border: 3px solid #999;
  border-top: none;
  border-radius: 12px;
  flex: 1 1 400px;
  min-width: 300px;
  max-width: 500px;
  height: auto;
  max-height: 460px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: 8px;
  background-color: red;
  width: 15%;
  margin: 0 auto;
  border-radius: 12px 12px 0 0;
  transition: width 0.4s ease;
}

.card:hover .top-bar,
.card:focus-within .top-bar {
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.card-header .icon {
  font-size: 20px;
}

.card-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  flex-grow: 1;
  margin: 0;
}

.scroll-hint {
  display: flex;
  gap: 4px;
  align-items: center;
  opacity: 0.7;
}

.scroll-hint svg {
  transition: transform 0.2s ease;
}

.card-header:hover .scroll-hint {
  opacity: 1;
}

/* ==========================================================================
   Cosplayer list
   ========================================================================== */
.cosplayer-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow-y: auto;
  max-height: 100%;
  padding: 12px 20px 20px;
  background-color: #f1f1f1;
  border-radius: 0 0 12px 12px;
  scrollbar-width: thin;
}

/* Responsive: 1 columna por cajón en móviles */
@media (max-width: 600px) {
  .cosplayer-list {
    grid-template-columns: 1fr;
  }
}

.cosplayer-list li a {
  display: grid;
  grid-template-columns: auto 30px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background-color: #fff;
  border-radius: 8px;
  transition: background 0.2s ease;
  text-decoration: none;
  color: #333;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.cosplayer-list li a:hover {
  background-color: #e0e0e0;
}

.cosplayer-list li a .link-num {
  color: #999;
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  display: inline-block;
}

.cosplayer-list li a img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.cosplayer-list li a .link-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: block;
  font-weight: 500;
  font-size: 14px;
}

.cosplayer-list li a .verified-icon,
.cosplayer-list li a .external-link {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.cosplayer-list::-webkit-scrollbar {
  width: 6px;
}

.cosplayer-list::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.main-footer {
  width: 100%;
  text-align: center;
  background: #fff;
  border-top: 2px solid #999;
  padding: 16px 20px;
  font-size: 14px;
  color: #444;
}

.main-footer a {
  color: red;
  text-decoration: none;
  font-weight: bold;
}

.main-footer a:hover {
  text-decoration: underline;
}


.cosplayer-list li a span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  vertical-align: middle;
}


