* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border-radius: 0 !important;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: monospace, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.main-title {
    font-size: 26px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 25px;
    letter-spacing: 2px;
    color: #fff;
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    width: 100%;
    max-width: 1200px;
}

.tier-list-container {
    width: 100%;
    max-width: 1200px;
    border: 2px solid #333;
    background-color: #111;
    margin-bottom: 80px;
}

.tier-row {
    display: flex;
    border-bottom: 2px solid #222;
    min-height: 90px;
}

.tier-row:last-child {
    border-bottom: none;
}

.tier-label {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 1px 1px 0px #000;
    border-right: 2px solid #222;
    flex-shrink: 0;
    text-align: center;
    padding: 5px;
}

.tier-s-plus { background-color: #ff4500; color: #000; }
.tier-s      { background-color: #ff0000; color: #fff; }
.tier-a      { background-color: #ffaa00; color: #000; }
.tier-b      { background-color: #ffff00; color: #000; }
.tier-c      { background-color: #00ff00; color: #000; }
.tier-d      { background-color: #00ffff; color: #000; }
.tier-e      { background-color: #0000ff; color: #fff; }
.tier-f      { background-color: #7f00ff; color: #fff; }

.tier-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    flex-grow: 1;
    align-items: center;
    transition: background-color 0.2s;
}

.tier-items.drag-over {
    background-color: #1f1f1f;
    outline: 2px dashed #ff4500;
}

.player-card {
    width: 75px;
    height: 90px;
    background-color: #222;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 4px;
    transition: border-color 0.2s;
}

.player-card[draggable="true"] {
    cursor: grab;
}

.player-card[draggable="true"]:active {
    cursor: grabbing;
}

.player-card:hover {
    border-color: #fff;
}

.player-card img {
    width: 38px;
    height: 65px;
    object-fit: contain;
    image-rendering: pixelated;
}

.player-name {
    font-size: 9px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.login-btn-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 10px 20px;
    font-family: monospace;
    cursor: pointer;
    font-weight: bold;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.login-btn-fixed:hover {
    background-color: #444;
}

.note-drawer {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: #1a1a1a;
    border-top: 3px solid #ff0000;
    padding: 20px;
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.8);
}

.note-drawer.open {
    bottom: 0;
}

.note-drawer-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.note-drawer h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #ff4500;
}

.note-drawer p {
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
    background: #111;
    padding: 12px;
    border: 1px solid #333;
    min-height: 50px;
    word-break: break-word;
}

.close-drawer {
    position: absolute;
    top: 0;
    right: 0;
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
}

.close-drawer:hover {
    background: #555;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #111;
    border: 2px solid #444;
    padding: 25px;
    width: 400px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: #aaa;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    font-family: monospace;
    font-size: 14px;
}

.btn {
    background: #333;
    color: #fff;
    border: 1px solid #666;
    padding: 10px 15px;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
    font-size: 13px;
}

.btn:hover {
    background: #555;
}

.btn-danger {
    background: #500;
    border-color: #800;
}

.btn-danger:hover {
    background: #700;
}

.btn-warning {
    background: #b85d00;
    border-color: #d87d00;
}

.btn-warning:hover {
    background: #d87d00;
}

.admin-controls {
    margin-top: 20px;
    background: #111;
    border: 2px solid #333;
    padding: 20px;
    width: 100%;
    max-width: 1200px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
}

.admin-controls table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.admin-controls th, .admin-controls td {
    border: 1px solid #333;
    padding: 8px;
    text-align: left;
    font-size: 11px;
}

.admin-controls th {
    background: #222;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .main-title {
        font-size: 18px;
        letter-spacing: 1px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    .tier-label {
        width: 70px;
        font-size: 18px;
    }
    .player-card {
        width: 60px;
        height: 78px;
    }
    .player-card img {
        width: 30px;
        height: 52px;
    }
    .player-name {
        font-size: 8px;
    }
    .admin-controls {
        padding: 12px;
    }
    .admin-controls form {
        flex-direction: column !important;
    }
    .admin-controls form > div {
        width: 100% !important;
        min-width: 100% !important;
    }
    .login-btn-fixed {
        bottom: 10px;
        right: 10px;
        padding: 8px 14px;
        font-size: 12px;
    }
}