*{
    box-sizing: border-box;
}
body{
    font-family: monospace;
    margin: 0;
    padding: 0;
    background-color: rgb(104, 104, 104);
    overflow-x: hidden;
}
.dart{
    background-color: red;
    border: 3px black solid;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: block;
    position: absolute;
    color: rgb(255, 145, 0);
    text-shadow: 1px 1px 0px rgb(107, 68, 16);
    font-weight: bold;
    font-size: 2vmin;
    transform: translate(-50%,-50%);
}
#darts{
    position: absolute;
    height: 50vmin;
    width: 50vmin;
    left: 50%;
    transform: translateX(-50%);
}
img{
    width: 50vmin;
}
#container{
    height: 100px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.5;
    box-sizing: content-box;
    align-items: stretch;
}
main{
    text-align: center;
    background-color: rgb(104, 104, 104);
    padding: 10px;
}
header{
    text-align: center;
    font-size: 4vmin;
    height: 100%;
    background-color: rgb(44, 44, 44);
    color: rgb(255, 194, 79);
    text-shadow: 5px 5px 5px rgba(0,0,0,0.2);
}
h1{
    margin: 0;
    padding: 10px;
}
h2{
    color: rgb(255, 194, 79);
    text-shadow: 3px 3px 0px rgb(107, 68, 16);
    font-size: 3vmin;
}
h3{
    color: rgb(255, 194, 79);
    text-shadow: 3px 3px 0px rgb(107, 68, 16);
    font-size: 2vmin;
    margin: 0;
}
button{
    font-family: monospace;
    font-weight: bold;
    background-color: rgb(71, 68, 64);
    color: rgb(255, 210, 127);
    border: rgb(255, 210, 127) 3px outset;
    border-radius: 5px;
    font-size: 2vmin;
    padding: 5px 15px;
    margin: 0 5px;
    cursor: pointer;
    text-shadow: 5px 5px 5px rgba(0,0,0,0.2);
    box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}
button:disabled{
    border: rgb(44, 44, 44) 2px outset;
    color: rgb(161, 161, 161);
    cursor: default;
}
button:hover{
    background-color: rgb(44, 43, 41)
}
.badge{
    width: 40vmin;
    margin: 5px;
    padding: 5px;
    text-align: center;
    border: 0px rgb(44, 44, 44) solid;
    border-radius: 10px;
    background-color: rgb(78, 78, 78);
    color: rgb(255, 210, 127);
    font-weight: bold;
    font-size: 2vmin;
    opacity: 0;
    box-shadow: 10px 10px 10px rgba(0,0,0,0.2);
    align-content: center;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}
h3{
    margin: 0;
}
h4{
    margin: 0;
}
.uncommon{
    border: 5px rgb(0, 173, 9) solid;
    background-color: rgb(68, 78, 71);
}
.rare{
    border: 5px rgb(1, 92, 177) solid;
    background-color: rgb(51, 62, 77);
}
.epic{
    border: 5px rgb(153, 0, 255) solid;
    background-color: rgb(54, 42, 75);
}
.legendary{
    border: 5px rgb(255, 166, 0) solid;
    background-color: rgb(80, 58, 16);
}
.mythic{
    border: 5px rgb(255, 0, 98) solid;
    background-color: rgb(78, 3, 38);
}
.icon{
    font-weight: normal;
}
#shareButton[disabled]{
    display: none;
}
.animatedDart{
    background-color: rgb(99, 99, 99);
    border: 4px rgb(0, 0, 0) solid;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: block;
    position: absolute;
    text-shadow: 1px 1px 0px rgb(107, 68, 16);
    transform: translate(-50%,-50%);
    opacity: 1;
}
/* ---- Unofficial-copy banner ---------------------------------------- */
#unofficialBanner{
    background-color: rgb(28, 28, 28);
    color: rgb(255, 199, 0);
    border-bottom: 4px solid rgb(255, 199, 0);
    font-family: monospace;
    font-weight: bold;
    font-size: 2vmin;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 12px 16px;
    line-height: 1.4;
}

/* ---- Signed-in bar -------------------------------------------------- */
#profileBar{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: rgb(80, 80, 80);
    border-bottom: 3px solid rgb(50, 50, 50);
    padding: 8px 12px;
    font-family: monospace;
    font-size: 1.9vmin;
    color: white;
}
#profileName{
    font-weight: bold;
    font-size: 2.2vmin;
}
#profileStats{
    color: rgb(220, 220, 220);
}
#profileBar button{
    font-family: monospace;
    font-weight: bold;
    font-size: 1.8vmin;
    padding: 6px 12px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(120, 120, 120);
    color: white;
    cursor: pointer;
}
#profileBar button:hover{
    background-color: rgb(140, 140, 140);
}

/* ---- Leaderboard ---------------------------------------------------- */
#leaderboard{
    background-color: rgb(88, 88, 88);
    border-bottom: 3px solid rgb(50, 50, 50);
    padding: 8px 12px 14px;
    text-align: center;
    color: white;
    font-family: monospace;
}
#leaderboard h3{
    margin: 6px 0;
    font-size: 2.2vmin;
}
#leaderboardList{
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 420px;
    text-align: left;
    font-size: 1.9vmin;
}
#leaderboardList li{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 8px;
    border-bottom: 1px solid rgb(110, 110, 110);
}
#leaderboardList li.me{
    background-color: rgb(120, 120, 120);
    font-weight: bold;
    border-radius: 4px;
}

/* ---- New highscore highlight ---------------------------------------- */
#highscore.newHighscore{
    color: rgb(255, 199, 0);
    text-shadow: 1px 1px 0px rgb(107, 68, 16);
}

/* ---- Sign-in overlay ------------------------------------------------ */
#authOverlay{
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}
#authBox{
    background-color: rgb(104, 104, 104);
    border: 5px solid rgb(40, 40, 40);
    border-radius: 10px;
    padding: 22px 26px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    color: white;
    font-family: monospace;
}
#authBox h2{
    margin: 0 0 6px;
    font-size: 3vmin;
}
#authBox p{
    margin: 0 0 16px;
    font-size: 1.8vmin;
    color: rgb(225, 225, 225);
}
#authBox input{
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    font-family: monospace;
    font-size: 2vmin;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(130, 130, 130);
    color: white;
}
#authBox input::placeholder{
    color: rgb(225, 225, 225);
}
#authButtons{
    display: flex;
    gap: 10px;
    justify-content: center;
}
#authButtons button{
    flex: 1;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.9vmin;
    padding: 10px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(140, 140, 140);
    color: white;
    cursor: pointer;
}
#authButtons button:hover:not(:disabled){
    background-color: rgb(165, 165, 165);
}
#authButtons button:disabled{
    opacity: 0.6;
    cursor: default;
}
#authError{
    margin-top: 14px;
    padding: 8px;
    background-color: rgb(150, 40, 40);
    border-radius: 6px;
    font-size: 1.8vmin;
}

/* ---- Guest / roll status message ------------------------------------ */
#rollMessage{
    max-width: 520px;
    margin: 10px auto 4px;
    padding: 9px 14px;
    background-color: rgb(88, 88, 88);
    border: 3px solid rgb(50, 50, 50);
    border-radius: 8px;
    color: white;
    font-family: monospace;
    font-size: 1.8vmin;
    line-height: 1.45;
}
#rollMessage b{
    color: rgb(255, 199, 0);
}

/* ---- Overlay close button ------------------------------------------- */
#authBox{
    position: relative;
}
#authClose{
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgb(225, 225, 225);
    font-family: monospace;
    font-size: 2.6vmin;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
#authClose:hover{
    color: white;
}

/* ---- Player profile -------------------------------------------------- */
#playerProfile{
    position: relative;
    background-color: rgb(88, 88, 88);
    border-bottom: 3px solid rgb(50, 50, 50);
    padding: 10px 12px 16px;
    text-align: center;
    color: white;
    font-family: monospace;
}
#playerProfileName{
    margin: 4px 0;
    font-size: 2.4vmin;
}
#playerProfileStats{
    font-size: 1.8vmin;
    color: rgb(225, 225, 225);
    margin-bottom: 10px;
}
#closeProfile{
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgb(225, 225, 225);
    font-family: monospace;
    font-size: 2.4vmin;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}
#closeProfile:hover{
    color: white;
}
#playerRolls{
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 520px;
    text-align: left;
}
#playerRolls li{
    padding: 7px 10px;
    margin-bottom: 6px;
    background-color: rgb(104, 104, 104);
    border: 2px solid rgb(60, 60, 60);
    border-radius: 6px;
}
.rollTop{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    font-size: 1.9vmin;
}
.rollScore{
    font-weight: bold;
    color: rgb(255, 199, 0);
}
.rollFields{
    color: white;
}
.rollMeta{
    font-size: 1.6vmin;
    color: rgb(210, 210, 210);
    margin-top: 3px;
}
#loadMoreRolls{
    margin-top: 8px;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.8vmin;
    padding: 8px 16px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(120, 120, 120);
    color: white;
    cursor: pointer;
}
#loadMoreRolls:hover:not(:disabled){
    background-color: rgb(140, 140, 140);
}
#loadMoreRolls:disabled{
    opacity: 0.6;
    cursor: default;
}

/* Clickable player names */
.playerLink{
    color: rgb(255, 199, 0);
    text-decoration: underline;
    cursor: pointer;
}
.playerLink:hover{
    color: white;
}
#profileBar #profileName.clickable{
    cursor: pointer;
    text-decoration: underline dotted;
}

/* ---- Mode selector --------------------------------------------------- */
#modeSelect{
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.modeButton{
    font-family: monospace;
    font-weight: bold;
    font-size: 1.9vmin;
    padding: 8px 20px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(120, 120, 120);
    color: rgb(230, 230, 230);
    cursor: pointer;
}
.modeButton.selected{
    background-color: rgb(255, 199, 0);
    color: rgb(40, 40, 40);
}
.modeButton:disabled{
    opacity: 0.45;
    cursor: default;
}

/* ---- Tab strips (leaderboard + profile) ------------------------------ */
.tabs{
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 8px 0;
}
.tab{
    font-family: monospace;
    font-weight: bold;
    font-size: 1.7vmin;
    padding: 6px 16px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(110, 110, 110);
    color: rgb(230, 230, 230);
    cursor: pointer;
}
.tab.selected{
    background-color: rgb(255, 199, 0);
    color: rgb(40, 40, 40);
}
#leaderboardCaption{
    font-size: 1.6vmin;
    color: rgb(215, 215, 215);
    margin-bottom: 8px;
}

/* ---- Mini dartboards ------------------------------------------------- */
.miniBoard{
    position: relative;
    width: 96px;
    height: 96px;
    flex: 0 0 auto;
    background-image: url("dart.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;
}
.miniBoard.tiny{
    width: 38px;
    height: 38px;
}
.miniDart{
    position: absolute;
    width: 7px;
    height: 7px;
    background-color: red;
    border: 2px solid black;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.miniBoard.tiny .miniDart{
    width: 5px;
    height: 5px;
    border-width: 1px;
}

/* ---- Leaderboard rows with boards ------------------------------------ */
.lbLeft{
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- Profile roll rows ----------------------------------------------- */
#playerRolls li{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
}
#playerRolls li.emptyRolls{
    display: block;
    text-align: center;
}
.rollDetails{
    flex: 1 1 auto;
    min-width: 0;
}
.rollTop{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.rollFields{
    font-size: 1.8vmin;
    color: white;
    margin-top: 2px;
}
.modeTag{
    font-size: 1.4vmin;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgb(70, 70, 70);
    color: rgb(230, 230, 230);
}
.modeTag.daily{
    background-color: rgb(255, 199, 0);
    color: rgb(40, 40, 40);
}

/* ---- Share link ------------------------------------------------------ */
#shareRow{
    display: flex;
    gap: 8px;
    justify-content: center;
    max-width: 520px;
    margin: 0 auto 4px;
}
#shareLink{
    flex: 1 1 auto;
    font-family: monospace;
    font-size: 1.6vmin;
    padding: 7px 10px;
    border: 3px solid rgb(50, 50, 50);
    border-radius: 6px;
    background-color: rgb(115, 115, 115);
    color: white;
}
#copyShareLink{
    font-family: monospace;
    font-weight: bold;
    font-size: 1.6vmin;
    padding: 7px 14px;
    border: 3px solid rgb(40, 40, 40);
    border-radius: 6px;
    background-color: rgb(120, 120, 120);
    color: white;
    cursor: pointer;
}
#copyShareLink:hover{
    background-color: rgb(140, 140, 140);
}

/* ---- Skip animation toggle (endless only) ---------------------------- */
#skipAnimationRow{
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-family: monospace;
    font-weight: bold;
    font-size: 1.7vmin;
    color: rgb(235, 235, 235);
    cursor: pointer;
    user-select: none;
}
#skipAnimationBox{
    width: 15px;
    height: 15px;
    accent-color: rgb(255, 199, 0);
    cursor: pointer;
}
