@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}

body {
    background-color: #040117;
    color: #F6F6F6;
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    padding: 20px 0;
    text-align: center;
    overflow: auto;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(rgba(4, 1, 23, 0.5), rgba(4, 1, 23, 0.5)),
                repeating-linear-gradient(0deg, transparent, transparent 49.5%, #FF2C65 50%, transparent 50.5%);
    background-size: 100% 4px;
    animation: scanlines 10s linear infinite;
    z-index: -2;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

.glow-square {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 44, 101, 0.1);
    border: 1px solid #FF2C65;
    animation: float 20s linear infinite;
    z-index: -1;
}

.glow-square:nth-child(2) { top: 20%; left: 10%; animation-duration: 25s; }
.glow-square:nth-child(3) { top: 80%; left: 30%; animation-duration: 15s; }
.glow-square:nth-child(4) { top: 50%; left: 70%; animation-duration: 30s; }
.glow-square:nth-child(5) { top: 10%; left: 90%; animation-duration: 18s; }

@keyframes float {
    0% { transform: translateY(120vh) rotate(0deg); }
    100% { transform: translateY(-20vh) rotate(360deg); }
}

.container {
    background-color: rgba(10, 2, 30, 0.8);
    padding: 40px;
    border: 2px solid #FF2C65;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 44, 101, 0.7), inset 0 0 15px rgba(255, 44, 101, 0.5);
    backdrop-filter: blur(5px);
    margin: auto;
    min-height: 90vh;
    width: 95%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    animation: container-glow 4s ease-in-out infinite;
}

@keyframes container-glow {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 44, 101, 0.7), inset 0 0 15px rgba(255, 44, 101, 0.5); }
    50% { box-shadow: 0 0 45px rgba(255, 44, 101, 1), inset 0 0 25px rgba(255, 44, 101, 0.7); }
}

h1 {
    color: #FF2C65;
    text-shadow: 0 0 10px #FF2C65;
    text-transform: uppercase;
    animation: glitch 1.5s linear infinite;
    position: relative;
}

h2 {
    color: #FF2C65;
    text-shadow: 0 0 10px #FF2C65;
    text-transform: uppercase;
}

@keyframes glitch {
  2%,64% { transform: translate(2px,0) skew(0deg); }
  4%,60% { transform: translate(-2px,0) skew(0deg); }
  62% { transform: translate(0,0) skew(5deg); }
}
h1:before, h1:after {
  content: attr(data-text);
  position: absolute;
  left: 0; right: 0;
  top: 0; bottom: 0;
}
h1:before {
  animation: glitch-top 1.5s linear infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
@keyframes glitch-top {
  2%,64% { transform: translate(2px,-2px); }
  4%,60% { transform: translate(-2px,2px); }
  62% { transform: translate(13px,-1px) skew(-13deg); }
}
h1:after {
  animation: glitch-bottom 1.5s linear infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}
@keyframes glitch-bottom {
  2%,64% { transform: translate(-2px,0); }
  4%,60% { transform: translate(-2px,0); }
  62% { transform: translate(-22px,5px) skew(21deg); }
}

.banner {
    width: 80%;
    margin: 0 auto 20px;
    border: 2px solid #FF2C65;
    border-radius: 10px;
    overflow: hidden;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.banner img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.timer {
    color: #FF2C65;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #FF2C65;
}

.view-controls {
    margin: 20px 0;
    font-size: 16px;
}

.view-controls a {
    text-decoration: none;
    color: #FF2C65;
    border: 1px solid #FF2C65;
    padding: 8px 15px;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.view-controls a.active,
.view-controls a:hover {
    background: #FF2C65;
    color: #040117;
    box-shadow: 0 0 10px #FF2C65;
}

.classements-grid-vertical {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 30px;
}

.classements-grid-horizontal {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.classements-grid-horizontal .classement-col {
    flex: 1 0 auto;
}

.classements-grid-horizontal::-webkit-scrollbar {
    height: 8px;
}
.classements-grid-horizontal::-webkit-scrollbar-track {
    background: #040117;
}
.classements-grid-horizontal::-webkit-scrollbar-thumb {
    background-color: #FF2C65;
    border-radius: 4px;
}

.classement-col {
    background: rgba(4, 1, 23, 0.6);
    padding: 20px;
    border: 1px solid #FF2C65;
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 44, 101, 0.3);
}

th {
    background-color: #FF2C65;
    color: #040117;
    text-shadow: none;
}

tbody tr {
    opacity: 0;
    animation: row-fade-in 0.5s ease-out forwards;
}
tbody tr:nth-child(1) { animation-delay: 0.1s; }
tbody tr:nth-child(2) { animation-delay: 0.2s; }
tbody tr:nth-child(3) { animation-delay: 0.3s; }
tbody tr:nth-child(4) { animation-delay: 0.4s; }
tbody tr:nth-child(5) { animation-delay: 0.5s; }

@keyframes row-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

td:nth-child(1) {
    color: #FF2C65;
    font-weight: bold;
}

button, a.button {
    background-color: transparent;
    color: #FF2C65;
    font-family: 'Orbitron', sans-serif;
    border: 2px solid #FF2C65;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover, a.button:hover {
    background-color: #FF2C65;
    color: #040117;
    box-shadow: 0 0 20px #FF2C65;
}

input[type="text"] {
    background-color: rgba(4, 1, 23, 0.6);
    color: #F6F6F6;
    border: 1px solid #FF2C65;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(255, 44, 101, 0.7);
}

.message {
    margin-top: 20px;
    font-weight: bold;
    color: #FF2C65;
}

.challenges-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.challenge-box {
    background: rgba(4, 1, 23, 0.6);
    border: 1px solid #FF2C65;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: #F6F6F6;
    transition: all 0.3s ease;
}

.challenge-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 44, 101, 0.5);
}

.challenge-box h3 {
    margin-top: 0;
    color: #FF2C65;
}

.flag-form {
    margin: 20px 0;
}

#terminal {
    background-color: #000;
    border: 1px solid #FF2C65;
    border-radius: 5px;
    padding: 10px;
    height: 400px;
    overflow-y: scroll;
    font-family: monospace;
    color: #0f0;
    text-align: left;
}

#terminal .prompt-line {
    display: flex;
}

#terminal input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #0f0;
    font-family: monospace;
    font-size: 1em;
    text-align: left;
    padding: 0;
}
#terminal input:focus {
    outline: none;
    box-shadow: none;
}

.sql-form {
    margin: 20px 0;
}
.error-message {
    color: #FF2C65;
    font-weight: bold;
}