:root {
    --background: #0f0f0f;
    --text-primary: #dbdbdb;
    --text-secondary: #888888;
    --button-border: #333333;
    --block-size: 170px;
    --block-selection-border: inset 0px 0px 0px 1px rgba(255, 255, 255, 0.0);
    --mdi-party-popper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.53 1.45L13.45 2.53L15.05 4.13C15.27 4.38 15.38 4.67 15.38 5S15.27 5.64 15.05 5.86L11.5 9.47L12.5 10.55L16.13 6.94C16.66 6.35 16.92 5.7 16.92 5C16.92 4.3 16.66 3.64 16.13 3.05L14.53 1.45M10.55 3.47L9.47 4.55L10.08 5.11C10.3 5.33 10.41 5.63 10.41 6S10.3 6.67 10.08 6.89L9.47 7.45L10.55 8.53L11.11 7.92C11.64 7.33 11.91 6.69 11.91 6C11.91 5.28 11.64 4.63 11.11 4.03L10.55 3.47M21 5.06C20.31 5.06 19.67 5.33 19.08 5.86L13.45 11.5L14.53 12.5L20.11 6.94C20.36 6.69 20.66 6.56 21 6.56S21.64 6.69 21.89 6.94L22.5 7.55L23.53 6.47L22.97 5.86C22.38 5.33 21.72 5.06 21 5.06M7 8L2 22L16 17L7 8M19 11.06C18.31 11.06 17.67 11.33 17.08 11.86L15.47 13.47L16.55 14.55L18.11 12.94C18.36 12.69 18.66 12.56 19 12.56S19.64 12.69 19.89 12.94L20.5 13.55L21.53 12.47L20.97 11.86C20.38 11.33 19.72 11.06 19 11.06Z'/%3E%3C/svg%3E");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
}

a {
    color: #dbdbdb;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0;
}

header {
    display: flex;
    align-items: center;
    margin: 20px auto;
    padding: 0 20px;
    max-width: 1200px;
    gap: 10px;
}

header .mdi {
    font-size: 24px;
    color: #FFF;
}

.main-logo {
    width: 40px;
    height: 40px;
}

header h1 {
    margin-right: 10px;
}

header img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.metrics-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.metric {
    padding: 10px;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-icon {
    cursor: help;
    opacity: 0.7;
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
    margin: 5px 0;
}

.metric-value-big {
    font-size: 36px;
    font-weight: 600;
    margin: 5px 0;
}

.metric-secondary {
    color: var(--text-secondary);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--button-border);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.github {
    display: flex;
    align-items: center;
    gap: 5px;
}

.github img {
    width: 16px;
    height: 16px;
}

.button-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
    padding: 8px 16px;
    border: 1px solid var(--button-border);
    border-radius: 4px;
    transition: all 0.2s;
}

.button-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.blocks-section {
    margin-top: 40px;
}

.blocks-section h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.blocks-container {
    position: relative;
    overflow-x: auto;
    padding: 40px 0 30px 0;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-left: 20px;
    user-select: none;
}

.blocks-container::-webkit-scrollbar {
    display: none;
}

.blocks-container.dragging {
    cursor: grabbing;
}

.blocks-scroll {
    display: flex;
    gap: 20px;
    padding: 0 calc(50vw - 600px);
    position: relative;
}

.block {
    min-width: var(--block-size);
    height: var(--block-size);
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin: 20px 10px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0px 0px 0px 1px rgba(255, 255, 255, 0);
    transition: transform 2s ease-out;
}

#pendingBlock {
    background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: var(--fill-percentage);
    transition: top 1s linear;
    content: "";
    width: 100%;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    position: absolute;
    transition: height 1s linear;
}

.block-decoration:before {
    content: "";
    width: calc(.16* var(--block-size));
    height: var(--block-size);
    position: absolute;
    top: calc(-.096* var(--block-size));
    left: calc(-.16* var(--block-size));
    background-color: rgba(255, 255, 255, 0.03);
    transform: skewY(50deg);
    transform-origin: top;
}

.block-decoration:after {
    content: "";
    width: var(--block-size);
    height: calc(.192* var(--block-size));
    position: absolute;
    top: calc(-.192* var(--block-size));
    left: calc(-.16* var(--block-size));
    background-color: rgba(255, 255, 255, 0.05);
    transform: skew(40deg);
    transform-origin: top;
}

.block.active {
    box-shadow: var(--block-selection-border);
    z-index: 2;
    position: relative;
}

.block.active .block-decoration:after {
    box-shadow: var(--block-selection-border);
}

.block.active .block-decoration:before {
    box-shadow: var(--block-selection-border);
}


.block.active::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    z-index: 1;
}



/* Animation for new blocks */
.block.slide-in {
    animation: slideIn 1s ease-out forwards;
}

.block.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-220px);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-220px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.block-number {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(calc(-50% - 20px));
    color: var(--text-secondary);
    font-size: 14px;
}

.block-miner-count, .miner-count {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

.block-winner {
    font-size: 20px;
    text-align: center;
    margin: 5px 0;
}

.block-reward {
    text-align: center;
    font-size: 14px;
    margin: 5px 0;
    color: var(--text-secondary);
}

.block-miner {
    width: 100%;
    position: absolute;
    bottom: -25px;
    transform: translateX(-20px);
    color: var(--text-secondary);
    font-size: 12px;
    word-break: break-all;
    text-align: center;
}

.block-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.block-details.active {
    max-height: none;
    padding: 40px;
}

.miners-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(1, 1fr);
}

.block-head-list {
    display: grid;
    gap: 0px;
    grid-template-columns: repeat(1, 1fr);
}

@media screen and (min-width: 500px) {
    .miners-list, .block-head-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 768px) {
    .miners-list, .metrics-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1220px) {
    .block-head-list, .miners-list, .metrics-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.block-head-item {
    font-size: 16px;
}

.miner-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    text-align: center;
    border-radius: 8px;
    font-size: 20px;
}

.miner-item.loading {
    opacity: 0.5;
    animation: pulse 1.5s infinite;
}

.loading-address {
    color: var(--text-secondary);
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.3; }
    100% { opacity: 0.5; }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: #1a1a1a;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal h2 {
    color: #fff;
    margin-bottom: 15px;
}

.external-url {
    color: #00ff00;
    word-break: break-all;
    margin: 15px 0;
    padding: 10px;
    background-color: #222;
    border-radius: 4px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.modal-button.continue {
    background-color: #00ff00;
    color: #000;
}

.modal-button.cancel {
    background-color: #333;
    color: #fff;
}

.modal-button:hover {
    opacity: 0.9;
}

.bold {
    font-weight: bold;
}

.winner-shadow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.blockie-icon {
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    color: transparent !important;
    -webkit-mask-image: var(--mdi-party-popper);
    mask-image: var(--mdi-party-popper);
    background-size: cover;
    background-position: center;
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

.blockie-icon.mdi::before {
    display: none;
}

.blockie-img {
    vertical-align: middle;
    border-radius: 50%;
}

.progress-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    width: var(--fill-percentage);
    transition: width 1s linear;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    margin-top: 40px;
}

footer p {
    font-size: 14px;
}

/* Make the heart red */
footer p span {
    color: #ff0000;
}