.ygo-lp {
    max-width: 960px;
    margin: 0 auto;
    font-family: inherit;
}

/* Timer */
.ygo-lp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    width: fit-content;
    margin: 0 auto 12px;
    padding: 4px 6px;
    border: 1px solid #333;
    border-radius: 6px;
}

.ygo-lp-clock {
    font-size: 20px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    min-width: 62px;
    text-align: center;
}

.ygo-lp-clock.ygo-lp-time-out {
    color: #b00;
}

.ygo-lp-minutes-wrap {
    font-size: 12px;
}

.ygo-lp-minutes {
    width: 46px;
    padding: 3px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 3px;
}

.ygo-lp-timer-toggle,
.ygo-lp-timer-reset {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #f2f2f2;
    cursor: pointer;
}

/* Spieler */
.ygo-lp-players {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

/* Mittelspalte: Timer + Wuerfel + Muenze in einer Zeile */
.ygo-lp-center {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    order: 0;
}

.ygo-lp-toolrow {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ygo-lp-toolrow .ygo-lp-dicecoin {
    flex: 0 0 auto;
}

.ygo-lp-toolrow .ygo-lp-timer {
    min-width: 0;
}

.ygo-lp-center .ygo-lp-timer {
    margin: 0;
}

.ygo-lp-dicecoin {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.ygo-lp-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #f2f2f2;
    cursor: pointer;
    color: #222;
}

/* Ergebnis Wuerfel/Muenze: kurz einblenden, dann ausfaden */
.ygo-lp-diceresult {
    min-height: 18px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.5s;
}

.ygo-lp-diceresult.show {
    opacity: 1;
}

.ygo-lp-icon-btn svg {
    display: block;
}

.ygo-lp-svg-coin circle,
.ygo-lp-svg-die rect {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
}

.ygo-lp-coin-txt {
    fill: currentColor;
    font-size: 34px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    stroke: none;
}

.ygo-lp-svg-die .ygo-lp-pip {
    fill: currentColor;
    stroke: none;
    opacity: 0;
}

.ygo-lp-svg-die .ygo-lp-pip.on {
    opacity: 1;
}

@media (max-width: 840px) {
    /* Gestapelt: Mitte bleibt zwischen Spieler 1 und Spieler 2 */
    .ygo-lp-center {
        flex-basis: 100%;
        order: 0;
    }
}

.ygo-lp-player {
    position: relative;
    flex: 1 1 0;
    min-width: 200px;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.ygo-lp-player.ygo-lp-rot {
    transform: rotate(180deg);
}

.ygo-lp-player.ygo-lp-turn {
    border-color: #060;
}

.ygo-lp-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ygo-lp-name {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border: none;
    border-bottom: 1px solid #ccc;
    padding: 4px;
    background: transparent;
}

.ygo-lp-flip {
    font-size: 16px;
    line-height: 1;
    padding: 4px 8px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.ygo-lp-value {
    font-size: 56px;
    font-weight: bold;
    line-height: 1.1;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

.ygo-lp-status {
    min-height: 22px;
    font-weight: bold;
    margin: 2px 0 10px;
}

.ygo-lp-player.ygo-lp-dead {
    border-color: #b00;
}

.ygo-lp-player.ygo-lp-dead .ygo-lp-value {
    color: #b00;
}

.ygo-lp-player.ygo-lp-dead .ygo-lp-status::after {
    content: "Verloren";
    color: #b00;
}

.ygo-lp-input {
    margin-bottom: 8px;
}

.ygo-lp-amount {
    width: 160px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-variant-numeric: tabular-nums;
}

/* Nummernblock (klappt bei + / - auf) */
.ygo-lp-pad-wrap[hidden] {
    display: none;
}

/* Rechner als Modal: mittig im Bildschirm, abgedunkelter Hintergrund */
.ygo-lp-pad-wrap {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

.ygo-lp-pad-box {
    width: 250px;
    max-width: calc(100vw - 24px);
    padding: 14px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 8px;
}

/* Rechner in Ausrichtung des oeffnenden Spielers */
.ygo-lp-pad-box.ygo-lp-rot {
    transform: rotate(180deg);
}

.ygo-lp-pad-target {
    font-weight: bold;
}

.ygo-lp-pad-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ygo-lp-pad-op {
    font-size: 24px;
    font-weight: bold;
    width: 26px;
    text-align: center;
}

.ygo-lp-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 220px;
    margin: 0 auto 10px;
}

.ygo-lp-pad-actions {
    display: flex;
    gap: 8px;
    max-width: 220px;
    margin: 0 auto;
}

.ygo-lp-pad-actions button {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    background: #f2f2f2;
}

.ygo-lp-pad-cancel {
    background: #fff !important;
}

.ygo-lp-key {
    font-size: 20px;
    padding: 12px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.ygo-lp-key-fn {
    background: #f2f2f2;
}

.ygo-lp-key:active {
    background: #e6e6e6;
}

.ygo-lp-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.ygo-lp-btn {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #f2f2f2;
    cursor: pointer;
}

.ygo-lp-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.ygo-lp-q {
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

/* Banner (Sieger / Wuerfel / Muenze) */
.ygo-lp-banner {
    margin: 16px 0;
    padding: 12px;
    border: 2px solid #333;
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

.ygo-lp-banner.ygo-lp-win {
    border-color: #060;
}

/* Werkzeugleiste */
.ygo-lp-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0;
}

.ygo-lp-tools button {
    font-size: 14px;
    padding: 8px 14px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #f2f2f2;
    cursor: pointer;
}

/* Tabellen */
.ygo-lp-history h4,
.ygo-lp-tournament h4 {
    margin: 18px 0 8px;
}

.ygo-lp-history-table,
.ygo-lp-tournament-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ygo-lp-history-table th,
.ygo-lp-history-table td,
.ygo-lp-tournament-table th,
.ygo-lp-tournament-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.ygo-lp-history-table th,
.ygo-lp-tournament-table th {
    background: #f2f2f2;
}

.ygo-lp-h-minus { color: #b00; }
.ygo-lp-h-plus { color: #060; }

.ygo-lp-standings {
    margin-bottom: 8px;
    font-size: 14px;
}

.ygo-lp-standings span {
    display: inline-block;
    margin-right: 12px;
    font-weight: bold;
}

.ygo-lp-tournament-tools {
    margin-top: 8px;
}

.ygo-lp-tourney-clear {
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

@media (max-width: 640px) {
    .ygo-lp-value { font-size: 46px; }
}
