@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'VT323', monospace;
    color: #FFF;
    background-color: #171615;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-bg {
    background-image: url('../img/background.webp');
    background-repeat: repeat;
    background-size: cover;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #262423;
    padding: 15px 0;
    border-bottom: 4px solid #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0; /* Kein extra Padding wie in index-style.css */
}
.logo {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: #FFF;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.nav-logo {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    image-rendering: pixelated;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}
.nav-links a {
    color: #DDD;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}
.nav-links a:hover {
    color: #4ade80;
    border-bottom-color: #4ade80;
}

/* Suchfeld wie index */
.nav-search-desktop, .nav-search-mobile {
    display: flex;
    align-items: center;
    background: #333;
    border: 3px solid #000;
    border-radius: 0;
    padding: 0.2rem 0.5rem;
    margin: 0 1.2rem;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 400px;
    justify-self: center;
}
.nav-search-input {
    background: none;
    border: none;
    color: #fff;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    padding: 0.5rem 0.5rem 0.5rem 0.2rem;
    outline: none;
    flex: 1 1 120px;
    min-width: 0;
}
.nav-search-input::placeholder {
    color: #666;
}
.nav-search-btn {
    background: #4CAF50;
    border: 3px solid #000;
    color: #FFF;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 25px;
    border-radius: 4px;
    box-shadow: 3px 3px 0px #000;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    font-family: 'VT323', monospace;
    font-weight: 400;
    outline: none;
    display: inline-block;
}
.nav-search-btn:hover {
    background: #66BB6A;
}
.nav-search-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 0px 0px 0px #000;
}

/* Desktop-Searchbar nur auf Desktop, Mobile-Searchbar nur auf Mobile anzeigen */
.nav-search-desktop {
    display: flex;
}
.nav-search-mobile {
    display: none;
}
@media (max-width: 900px) {
    nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        padding: 0.7rem 0.7rem;
    }
    .logo {
        align-self: center;
    }
    .nav-search-desktop {
        display: none !important;
    }
    .nav-search-mobile {
        display: flex !important;
        align-items: center;
        background: #333;
        border: 3px solid #000;
        border-radius: 0;
        padding: 0.2rem 0.5rem;
        margin: 0.7rem 1rem 0.7rem 1rem;
        max-width: 100%;
        width: calc(100% - 2rem);
    }
    .nav-links {
        justify-content: center;
        gap: 1.2rem;
    }
}

main {
    margin-top: 32px;
}

.profile-header {
    margin-bottom: 2rem;
    text-align: center;
}

.profile-info {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 2fr;
    gap: 40px;
    margin-bottom: 3rem;
    align-items: flex-start;
}
@media (max-width: 900px) {
    .profile-info {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.skin-viewer-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0;
    padding: 1rem;
    position: relative;
}
.skin-viewer-container, .player-details {
    background-color: rgba(0, 0, 0, 0.3);
    border: 3px solid #000;
    box-shadow: inset 3px 3px 0px rgba(255,255,255,0.1), inset -3px -3px 0px rgba(0,0,0,0.2);
    border-radius: 0;
    padding: 25px;
    text-align: center;
}

#skin-viewer {
    width: 100%;
    height: 400px;
    margin: 0 auto;
}

.player-details {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0;
    padding: 2rem;
}
.player-details h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
}
.uuid {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 2rem;
    word-break: break-all;
}
.cape-section {
    margin-top: 2rem;
}
.cape-section h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #4ade80;
    font-family: 'Press Start 2P', cursive;
}
.capes-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-start;
    align-items: stretch;
}
.cape-item {
    flex: 0 1 67px !important;
    max-width: 77px !important;
    min-width: 53px !important;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 3px solid #000 !important;
    box-shadow: inset 3px 3px 0px rgba(255,255,255,0.1), inset -3px -3px 0px rgba(0,0,0,0.2) !important;
    border-radius: 0 !important;
    padding: 0.25rem !important;
    text-align: center !important;
    transition: transform 0.2s !important;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.cape-item:hover {
    background-color: #222 !important;
    transform: translate(2px, 2px) scale(1.00);
    box-shadow: 0px 0px 0px #000 !important;
    /* Kein grüner Schimmer, kein Schatten */
}
.cape-item.selected {
    box-shadow: 0 0 0 2px #5c8a36;
    background: rgba(92, 138, 54, 0.2);
}
.cape-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    pointer-events: none;
}
.cape-name {
    margin-top: 0.3rem;
    font-size: 0.65rem;
    text-align: center;
    color: #ccc;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: keep-all;
    display: block;
}
.cape-name[data-longword="true"] {
    font-size: 0.55rem;
}
.skins-section {
    margin: 3rem 0;
}
.skins-section h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #4ade80;
    font-family: 'Press Start 2P', cursive;
}
.skins-gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.skins-gallery::-webkit-scrollbar {
    display: none;
}
.skin-item {
    background-color: rgba(0, 0, 0, 0.2);
    border: 3px solid #000;
    text-align: center;
    padding: 15px;
    box-shadow: inset 2px 2px 0px rgba(255,255,255,0.1), inset -2px -2px 0px rgba(0,0,0,0.2);
    flex-shrink: 0;
    width: 180px;
    border-radius: 14px;
    margin-bottom: 10px;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.skin-item:hover {
    background-color: #222 !important;
    transform: translate(2px, 2px) scale(1.00);
    box-shadow: 0px 0px 0px #000 !important;
}
/* Angenommen, der 3D-Viewer ist ein <canvas> oder <div> im .skin-item, z.B. mit .skin-viewer oder #skin-viewer */
.skin-item .skin-viewer, 
.skin-item #skin-viewer, 
.skin-item canvas {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    outline: none !important;
    filter: none !important;
}
@media (max-width: 900px) {
    .skins-gallery {
        flex-direction: column;
        gap: 15px;
    }
    .skin-item {
        width: 100%;
        max-width: 100%;
    }
}
.names-section h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #4ade80;
    font-family: 'Press Start 2P', cursive;
}
.name-history {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}
.name-item {
    padding: 1rem;
    border-bottom: 1px solid #333;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
}
.name-item:last-child {
    border-bottom: none;
}
.name-item.current {
    background: rgba(74, 222, 128, 0.1);
}
.name-item.current .name {
    color: #4ade80;
}
.name {
    font-weight: 500;
    color: #fff;
    font-family: 'VT323', monospace;
}
.name-date {
    font-size: 0.8rem;
    color: #888;
}
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}
.loader {
    width: 70px;
    height: 50px;
    box-sizing: border-box;
    background:
        conic-gradient(from 135deg at top,#ffffff00, #fff 1deg 90deg,#0000 91deg) right -20px bottom 8px/18px 9px,
        linear-gradient(#fff 0 0) bottom/100% 8px,
        transparent;
    background-repeat: no-repeat;
    border-bottom: 8px solid transparent;
    position: relative;
    animation: l7-0 2s infinite linear;
    margin-bottom: 1.5rem;
}
.loader::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 14px;
    background: lightblue;
    left: 10px;
    animation: l7-1 2s infinite cubic-bezier(0,200,1,200);
}
@keyframes l7-0{
    100% { background-position: left -20px bottom 8px,bottom}
}
@keyframes l7-1{
    0%,50%   {bottom: 8px}
    90%,100% {bottom: 8.1px}
}
#loading-text {
    font-size: 1.1rem;
    color: #4ade80;
    margin-top: 0.5rem;
    font-weight: 600;
    min-height: 1.5rem;
    font-family: 'VT323', monospace;
}
.error-message {
    background: #2d1b1b;
    border: 1px solid #8b5a5a;
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    margin: 2rem 0;
}
footer {
    background-color: #222;
    padding: 20px 0;
    margin-top: auto;
    border-top: 4px solid #444;
    text-align: center;
}
.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.footer-links a {
    color: #AAA;
    text-decoration: none;
    font-size: 1rem;
}
.footer-links a:hover {
    color: #4ade80;
}
.footer-text {
    color: #888;
    font-size: 1rem;
    margin-top: 10px;
    text-align: center;
}
.hidden {
    display: none !important;
}