@font-face {
  font-family: 'Rodin';
  src: url('rodin.otf') format('opentype');
}

:root {
  /* Theme Colors */
  --theme-top-bg: #adadad; /* Solid primary light grey */
  --theme-border: #adadad; /* Exactly the same grey as the middle */
  
  --panel-bg: rgba(20, 20, 20, 0.45); /* Solid transparent color to ensure identical matching */
  --text-main: #ffffff;
  --text-dim: #b0b0b0;
  --star-color: #ffd700;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  font-family: 'Rodin', sans-serif; /* Fallback for PS3 font */
  color: var(--text-main);
  overflow: hidden;
  cursor: none; /* Hide default cursor */
}

/* Ensure links also hide default cursor */
a, button {
  cursor: none;
}

/* --- Custom Cursor --- */
#cursor-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none; /* Let clicks pass through to elements below */
  z-index: 9999;
  /* Hardware accelerated transform handled by JS */
}

.custom-cursor {
  width: 48px; /* Bigger than default */
  height: auto;
  animation: spin 2s linear infinite; /* Smooth infinite spin */
  transform-origin: center; /* Spin around the center */
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

.ps3-profile {
  width: 740px; /* Made the X axis of the entire box a bit longer */
  border-radius: 14px; /* Scaled up to nest new thicker border */
  overflow: visible;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 10px solid var(--theme-border); /* Thicker matching blue border */
  position: relative;
  background: transparent;
}

/* --- Top Section --- */
.top-section {
  background: var(--theme-top-bg);
  padding: 3px 15px 16px 0px; /* Aligned left edge to 0, reduced top padding to 3px to move avatar up */
  display: flex;
  position: relative;
  z-index: 1; /* Sits behind lower-box */
  border-top-left-radius: 8px; /* Adjusted to nest inside 10px border */
  border-top-right-radius: 8px;
  box-shadow: 0 0 0 2px var(--theme-top-bg); /* Fills in the tiny corner gaps */
}


.avatar-container {
  width: 155px; /* Much larger container */
  height: 155px; /* Much larger container */
  position: relative;
  border-radius: 6px;
  background-color: transparent; /* Removed black outline */
  padding: 0; /* Removed outline padding */
  margin-right: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  flex-shrink: 0; /* PREVENT AVATAR FROM SHRINKING WHEN TEXT IS LONG */
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 6px; /* Matched to corner of blue box on all edges */
  object-fit: cover;
}

.avatar-highlight {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  pointer-events: none;
}

.user-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex-grow: 1;
  min-width: 0; /* CRITICAL: Allows children to truncate properly without stretching the flex container */
}

.speech-bubble {
  width: calc(100% + 15px); /* Overcomes the 15px right padding of top-section to touch the absolute right edge */
  height: 46px; /* Huge chat box */
  background: linear-gradient(to bottom, #ffffff, #e0e0e0); /* Restored gradient design */
  border-radius: 6px;
  margin-bottom: 14px; /* Space for the triangle */
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  
  /* Text Styling */
  display: flex;
  align-items: center;
  padding: 0 12px;
  box-sizing: border-box;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.3s;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px; /* Bigger triangle */
  left: 14px;
  border-width: 10px 10px 0 0;
  border-style: solid;
  border-color: #e0e0e0 transparent transparent transparent;
}

.username-row {
  display: flex;
  align-items: center;
  margin-bottom: 0px; /* Zero gap so game row sits right under */
}

.status-dot {
  width: 26px; /* Increased size */
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #56b3ff, #0076d1); /* Default/Offline blue */
  box-shadow: inset 0 0 2px rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.5);
  margin-left: 5px; /* Shifted to the right */
  margin-right: 9px; /* Mathematically sets text start point to 40px */
  transition: background 0.3s ease;
}

.status-dot.online {
  background: radial-gradient(circle at 30% 30%, #5ac8ff, #0078d7); /* Keep PS3 Blue for Online to match theme! */
}

.status-dot.dnd {
  background: radial-gradient(circle at 30% 30%, #ff5e5e, #d70000);
}

.status-dot.idle {
  background: radial-gradient(circle at 30% 30%, #ffda5e, #d7a100);
}

.status-dot.offline {
  background: radial-gradient(circle at 30% 30%, #a0a0a0, #555555);
}

.username {
  font-size: 34px; /* Increased text size */
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  line-height: 1; /* Reduce gap below text */
  transform: translateY(-2px); /* Shifted up slightly to align visually with the circle */
  transition: all 0.2s ease;
}

.game-status-row {
  display: flex;
  align-items: center;
  margin-top: 6px; /* Moved down a bit */
  transition: opacity 0.5s ease; /* Added for JS fade effect */
}

.controller-icon {
  width: 40px; /* Increased icon size */
  height: 30px;
  margin-left: -2px; /* Center mathematically aligns with shifted status dot (Center at 18px) */
  margin-right: 2px; /* Text mathematically starts at 40px, perfectly matching username */
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
  transform: translateX(-3px); /* Visually shifted slightly to the left */
}

.music-icon {
  width: 48px; /* Increased actual width */
  height: 38px; /* Increased actual height */
  object-fit: contain; /* Prevents stretching */
  margin-left: -8px; /* Mathematically centered */
  margin-right: 4px; /* Mathematically adjusted to keep text perfectly aligned */
  filter: brightness(0) drop-shadow(1px 1px 1px rgba(0,0,0,0.8)); /* Turns image completely black and adds shadow */
  transform: scale(1.4); /* Scaled up visually while maintaining exact layout space */
}

.game-name-container {
  overflow: hidden;
  flex: 1;
  white-space: nowrap;
}

.game-name {
  font-size: 26px; /* Increased text size */
  color: #ccc;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
  line-height: 1;
  display: inline-block;
  will-change: transform;
}

/* --- Lower Box Wrapper --- */
.lower-box {
  border-radius: 8px; /* Nested perfectly inside new thicker 10px outer border */
  overflow: hidden; /* Clip children to rounded corners */
  margin: -6px 0 0 0; /* No side margins! Only pulls up over top-section to reveal blue in top corners */
  position: relative;
  z-index: 2; /* Sits on top */
}

/* Inner shadow applied over all children using a pseudo-element */
.lower-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), inset 0 3px 10px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 10;
  border-radius: inherit;
}

/* --- Middle Section --- */
.middle-section {
  background: var(--panel-bg);
  border-top: 1px solid rgba(255,255,255,0.1); /* Subtle top highlight */
  border-bottom: 1px solid rgba(0,0,0,0.8);
}

.pagination-bar {
  display: flex;
  align-items: center;
  position: relative;
  justify-content: flex-end; /* Push R1 to the right */
  padding: 4px 12px;
  background: linear-gradient(to right, #1a1a1a 0%, #3a3a3a 50%, #1a1a1a 100%); /* Softer gradient */
  border-bottom: 1px solid #111;
}

.dots {
  display: flex;
  gap: 16px; /* Spread dots further apart */
  position: absolute;
  left: 50%;
  transform: translateX(-50%); /* Perfectly center in the bar */
}

.dot {
  width: 10px; /* Slightly larger */
  height: 10px;
  border-radius: 50%;
  background: #111; /* Darker dots */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9), 0 1px 1px rgba(255,255,255,0.2);
}

.dot.active {
  background: radial-gradient(circle at 30% 30%, #5ac8ff, #0078d7);
  box-shadow: 0 0 4px rgba(0, 120, 215, 0.8);
}

.r1-button {
  font-size: 11px;
  font-weight: bold;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 2px;
}

.triangle {
  font-size: 8px;
}

.trophy-row-container {
  padding: 14px 12px 18px; /* Increased top and bottom padding to make the box a bit taller */
  background: transparent; /* Removed so it uses the middle-section background */
}

.trophy-row {
  display: flex;
  gap: 14px; /* Spread icons further apart */
  justify-content: center;
  margin: 0 4px;
}

.social-link {
  display: block;
  text-decoration: none;
}

.social-icon {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,0.8);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.social-link:hover .social-icon, .throne-fallback:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.throne-fallback {
  width: 64px;
  height: 64px;
  background: linear-gradient(to bottom, #888, #444);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 2px 5px rgba(0,0,0,0.8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.throne-fallback::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  pointer-events: none;
}

.bottom-section {
  background: var(--panel-bg);
  padding: 0;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.stats-header {
  display: flex;
  background: linear-gradient(to bottom, #eeeeee 0%, #a0a0a0 25%, #4a4a4a 100%); /* More noticeable gradient contrast */
  padding: 4px 15px 6px 15px; /* Extra 2px bottom padding forces the text visually up into the true middle */
  align-items: center;
  border-top: 1px solid #ffffff; /* Brighter top highlight */
  border-bottom: 1px solid #111;
}

.header-level-area {
  width: 55%;
  padding-right: 40px; /* match level-area */
  box-sizing: border-box;
  font-size: 20px; /* Adjusted to match reference */
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8); /* Crisper, cleaner shadow */
  line-height: 1;
}

.header-trophies-area {
  font-size: 20px; /* Adjusted to match reference */
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8); /* Crisper, cleaner shadow */
  line-height: 1;
}

.stats-content {
  display: flex;
  justify-content: flex-start;
  padding: 14px 15px 16px; /* Decreased bottom padding to make the box slightly shorter on the Y axis */
  align-items: flex-start; /* Align to top */
}

.level-area {
  flex-grow: 0;
  width: 55%;
  padding-right: 40px;
  box-sizing: border-box;
}

.level-info {
  display: flex;
  width: 315px; /* Reduced width to stop precisely before the middle gray dot */
  align-items: flex-start; /* Align top of star and number */
  margin-top: -4px; /* Lifted up higher */
  margin-bottom: 4px; /* Reduced margin */
}

.star-icon-img {
  width: 34px; /* Reduced size */
  height: 34px; /* Reduced size */
  margin-right: 8px;
  margin-top: 4px; /* Offset to keep it vertically aligned with the large text */
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.8)); /* Glow removed, standard shadow applied */
}

.level-number {
  font-size: 42px;
  font-weight: 300;
  margin-right: auto;
  line-height: 1;
}

.percentage {
  font-size: 24px; /* Much Bigger text */
  font-weight: 500;
  margin-left: auto; /* Push to right edge of progress bar */
  margin-bottom: -30px; /* Moved up slightly to follow the progress bar */
  align-self: flex-end; /* Pin to bottom to stay directly above progress bar */
  color: #ddd;
}

.progress-bar {
  width: 315px; /* Restrict width to exactly match level-info */
  height: 6px; /* Slightly thicker */
  background: #1a1a1a;
  border-radius: 10px;
  margin-top: 20px; /* Moved back up slightly */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden;
}

.progress-fill {
  width: 33%;
  height: 100%;
  background: linear-gradient(to bottom, #a0d855, #639620); /* Green gradient */
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(130, 200, 60, 0.8);
}

.trophies-area {
  display: flex;
  align-items: flex-start; /* Align to top */
  justify-content: flex-start;
  margin-top: 2px; /* Lowered a small amount */
}

.total-trophies {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -1px;
  line-height: 1; /* Eliminates vertical gap above the number */
}

/* --- Hover Glow Effects --- */
.level-number, .total-trophies, .username {
  transition: all 0.2s ease;
  cursor: default;
}

.level-number:hover, .total-trophies:hover, .username:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5), 1px 1px 2px rgba(0,0,0,0.8);
  color: #ffffff;
}
