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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
}

/* ---- Start form ---- */
#input-form {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 9999;
}

.formElement {
    width: 260px;
    height: 60px;
    font-family: inherit;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #fff;
    background: rgba(13, 47, 79, 0.9);
    border: 2px solid #fff;
    border-radius: 4px;
    cursor: pointer;
}

input.formElement {
    cursor: text;
}

/* ---- Debug menu ---- */
#debug-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(13, 47, 79, 0.95);
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 12px 16px;
    min-width: 280px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.debug-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.debug-label {
    color: #aad4ff;
    font-size: 12px;
    min-width: 80px;
}

.debug-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
}

.debug-buttons button {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #ffffff55;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
}

.debug-buttons button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.debug-buttons button.active {
    background: royalblue;
    border-color: #fff;
}



#printStatsButton {
    width: 100%;
    background: royalblue;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 3px;
    padding: 6px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
}

#printStatsButton:hover {
    background: deepskyblue;
}

/* ---- Stats overlay ---- */
#stats-overlay {
    display: none;
    position: fixed;
    right: 16px;
    top: 16px;
    z-index: 1000;
    background: rgba(13, 47, 79, 0.92);
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 12px 16px;
    min-width: 200px;
    max-height: 80vh;
    overflow-y: auto;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
    font-size: 13px;
}

.stat-label {
    color: #aad4ff;
}

.stat-value {
    font-weight: bold;
}



.minimap-img,
.minimap-marker-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.minimap-marker-canvas {
    pointer-events: none;
}

.game-stats {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}



/* ---- Interaction prompt ---- */
#interaction-prompt {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(13, 47, 79, 0.85);
    border: 1px solid #ffffff88;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 14px;
    pointer-events: none;
    white-space: nowrap;
}

/* Active Players Panel */
.vt323-regular {
    font-family: "VT323", monospace;
}

#players-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1200;

    width: 220px;
    max-height: 220px;

    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-family: "VT323", monospace;
    /* match your UI */
    font-size: 22px;
    pointer-events: none;
    /* won't block game input */
}

#players-panel .players-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    padding-bottom: 6px;
    text-align: center;
}

/* Use an ordered list for the numbering */
#players-list {
    margin: 0;
    padding-left: 22px;
    /* spacing for 1. 2. 3. */
    list-style-position: outside;
    max-height: 170px;
    overflow: auto;
    /* or auto if you want scroll */
}

#players-list li {
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-panel {
    display:flex;
    flex-direction: column;
}

#minimap-container {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #fff;
    pointer-events: none;
}

#gold-counter {
    position: relative;
    top: 20px;
    left: 20px;
    right: auto;
    z-index: 1300;
    min-width: 140px;
    max-width: 150px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    color: #ffd54a;
    font-family: "VT323", monospace;
    font-size: 28px;
    text-align: center;
    pointer-events: none;
}

#dig-minigame {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 1500;
    width: 360px;
    pointer-events: none;
}

#dig-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid white;
    border-radius: 12px;
    overflow: hidden;
}

#dig-success-zone {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(0, 200, 0, 0.75);
}

#dig-slider {
    position: absolute;
    top: -5px;
    width: 10px;
    height: 34px;
    background: white;
    border-radius: 4px;
    transform: translateX(-50%);
}

#dig-label {
    margin-top: 8px;
    text-align: center;
    color: white;
    font-size: 18px;
    font-family: "VT323", monospace;
}

/* ---- Shop ---- */
#shop-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(13, 47, 79, 0.97);
    border: 1px solid #fff;
    border-radius: 4px;
    padding: 20px;
    min-width: 640px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-title {
    font-size: 18px;
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #ffffff55;
    padding-bottom: 8px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.shop-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid #ffffff44;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shop-card-name {
    font-size: 12px;
    font-weight: bold;
    color: #aad4ff;
}

.shop-card-description {
    font-size: 11px;
    color: #ccc;
    flex: 1;
}

.shop-card-buy,
.shop-close-btn {
    background: royalblue;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
}

.shop-card-level {
    font-size: 11px;
    color: #f5c542;
}

.shop-card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-card-cost {
    font-size: 11px;
    color: #ffd700;
}

.shop-card-max {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    border-color: #555;
    cursor: default;
}

.shop-close-btn {
    width: 100%;
    margin-top: 4px;
}

.shop-card-buy:hover,
.shop-close-btn:hover {
    background: deepskyblue;
}

/* ---- Gold counter ---- */
#gold-counter {
    position: fixed;
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(13, 47, 79, 0.85);
    border: 1px solid #ffd700;
    border-radius: 4px;
    padding: 6px 12px;
    pointer-events: none;
}

.gold-counter-amount {
    font-size: 15px;
    font-weight: bold;
}