* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Courier New", monospace;
    font-size: 12px;
    background: #0a0523 url(/bg.png) no-repeat fixed center center / cover;
    color: #5d4037;
    padding: 20px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.3);
    padding: 15px;
    border: 3px solid #8b4513;
    border-radius: 8px;
}

h1 {
    font-size: 24px;
    color: #5d4037;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.header-btn {
    font-family: "Courier New", monospace;
    font-size: 11px;
    padding: 6px 12px;
    background: #d4a574;
    color: #5d4037;
    border: 2px solid #8b4513;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.header-btn:hover {
    background: #c89664;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#bundles-container {
    max-width: 1400px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
}

.room-group {
    margin-bottom: 40px;
}

.room-name,
.room-reward {
    color: palegoldenrod;
    text-align: center;
    margin-bottom: 4px;
    text-shadow: #5d4037 1px 1px 6px;
}

.bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bundle-card {
    background: rgba(244, 227, 179, 0.9);
    border: 3px solid #8b4513;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.bundle-card:hover {
    transform: translateY(-2px);
}

.bundle-card.completed {
    background: rgba(144, 238, 144, 0.3);
}

.bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #8b4513;
}

.bundle-name {
    font-size: 13px;
    font-weight: bold;
    color: #5d4037;
    flex: 1;
}

.bundle-progress {
    font-size: 11px;
    font-weight: bold;
    color: #2e7d32;
    background: rgba(255, 255, 255, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #8b4513;
}

.bundle-reward {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 2px solid #8b4513;
    font-size: 11px;
    color: #5d4037;
    font-style: italic;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 48px);
    gap: 6px;
    justify-content: start;
}

.item {
    width: 48px;
    height: 48px;
    position: relative;
    cursor: pointer;
    border: 2px solid #8b4513;
    background: #c4bcaf;
    border-radius: 4px;
    transition: all 0.2s;
}

.item:hover {
    transform: scale(1.1);
    z-index: 1001;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

.item.available {
    background: #aae4b5;
    border-color: #ffa500;
    box-shadow: 0 0 4px rgba(255, 165, 0, 0.4);
}

.item.available img {
    opacity: 0.9;
}

.item:not(.checked) img {
    filter: grayscale(100%) opacity(0.4);
}

.item.checked img {
    filter: unset;
}

.item.checked {
    background: #ffca9b;
}

.count-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8b4513;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.checkmark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4caf50;
    font-size: 28px;
    font-weight: bold;
    text-shadow:
        -1px -1px 0 white,
        1px -1px 0 white,
        -1px 1px 0 white,
        1px 1px 0 white,
        0 0 3px white;
    pointer-events: none;
}

.item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(30, 25, 20, 0.98);
    color: #fff8dc;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: pre-line;
    text-align: left;
    min-width: 180px;
    max-width: 250px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    border: 2px solid #d2691e;
    line-height: 1.5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.item:hover::before {
    opacity: 1;
}

.item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #5d4037;
    background: linear-gradient(135deg, #ffe4b5 0%, #deb887 100%);
    text-align: center;
    padding: 2px;
}

.room-separator {
    height: 2px;
    background: #8b4513;
    margin: 30px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
