/* =======================
   Global
======================= */
* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* prevents page-wide overflow */
    font-family: Arial, sans-serif;
    background: #07080a;
    color: #fff;
}

/* =======================
   Top Bar
======================= */
.top-bar {
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px; /* less padding so it doesn't overflow */
    background: linear-gradient(90deg, #0b0f1a, #08101f, #0b0f1a);
    border-bottom: 2px solid rgba(0, 255, 0, 0.25);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag {
    color: #00ff00;
    font-weight: 700;
    font-size: 1.6rem;
}

.title {
    font-size: 1.2rem;
    letter-spacing: 1px;
    opacity: 0.85;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.online {
    background: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

/* =======================
   Layout
======================= */
.layout {
    display: flex;
    height: calc(100vh - 80px);
    width: 100%;
}

.left-panel {
    flex: 0 0 40%;
    min-width: 0;   /* prevents overflow */
    background: rgba(10, 10, 15, 0.6);
    padding: 20px;
    overflow-y: auto;
}

.right-panel {
    flex: 0 0 60%;
    min-width: 0;   /* prevents overflow */
    background: rgba(5, 5, 10, 0.9);
    padding: 20px;
    overflow-y: auto;
    border-left: 2px solid rgba(0,255,0,0.18);
}

/* =======================
   Members / Clan
======================= */
.members {
    margin: 20px 0;
    font-size: 1.2rem;
    background: rgba(35, 35, 40, 0.85);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(0, 255, 0, 0.18);
}

.clan-tag {
    color: #00ff00;
}

.members ul {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-left: 20px;
}

.members li {
    margin: 10px 0;
    font-size: 1.1rem;
}

/* =======================
   Forms / Inputs
======================= */
label {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
}

input {
    padding: 10px;
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(0,255,0,0.25);
    background: rgba(0,0,0,0.4);
    color: #fff;
}

/* =======================
   Buttons
======================= */
button,
.btn {
    padding: 10px 16px;
    margin: 5px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #00ff00;
    color: #000;
    font-weight: 700;
}

button:hover,
.btn:hover {
    background: #00cc00;
}

/* =======================
   Player Card
======================= */
.player-card {
    width: 100%;
    background: linear-gradient(145deg, #1c1f26, #12141a);
    border-radius: 14px;
    padding: 20px;
    color: #eaeaf0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
}

.player-card h2 {
    margin: 0 0 16px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-weight: 600;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-grid div {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.stat-grid div span:last-child {
    font-weight: 700;
    color: #4fd1ff;
}

.stat-grid .score {
    grid-column: span 2;
    background: linear-gradient(135deg, #4fd1ff33, #4fd1ff11);
}

.rank-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffd70033, #ffd70011);
    border-radius: 8px;
    font-weight: 700;
    color: #ffd700;
}

.exp-row {
    margin-bottom: 12px;
    font-size: 13px;
    opacity: 0.8;
    text-align: center;
}

/* =======================
   Classes Grid / Cards
======================= */
#classes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    width: 100%;
}

.class-card {
    background: #222;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 15px;
    text-align: left;
    position: relative;
}

.class-card h2 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #00ff00;
}

.class-card p {
    margin: 6px 0;
    font-size: 0.95rem;
    word-break: break-all;
}

.class-card.inactive {
    opacity: 0.45;
    filter: grayscale(100%);
}

.class-card.inactive h2 {
    color: #888;
}

.trash {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
    color: #ff3333;
}

/* =======================
   Helpers
======================= */
.hidden {
    display: none;
}

.version {
    text-align: center;
    margin-top: 20px;
    opacity: 0.6;
}

.error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.error-dialog {
    background: #1e1e1e;
    color: white;
    padding: 25px 30px;
    border-radius: 10px;
    width: 350px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.error-dialog h3 {
    margin-top: 0;
    color: #ff4c4c;
}

.error-dialog button {
    margin-top: 20px;
    padding: 8px 18px;
    border: none;
    background: #ff4c4c;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.error-dialog button:hover {
    background: #ff1f1f;
}

button.locked {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}