:root {
    --goldfish-gold: #c8b472;
    --goldfish-bg: url("../img/playbg1.png");
}

.mtg-card {
    height: 173px;
    width: 125px;
    background-size: cover;
    border-radius: 5px;
    position: relative;
}

.mtg-card:hover {
    box-shadow: 0 0 10px var(--goldfish-gold);
}

.mtg-card-side {
    height: 173px !important;
    width: 125px !important;
    background-size: cover;
    border-radius: 5px;
}

.mtg-card {
    perspective: 1000px;
}

.mtg-card .front,
.mtg-card .back {
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    transition: transform 0.6s;
}

.mtg-card .back {
    transform: rotateY(180deg);
}

.mtg-card.flipped .front {
    transform: rotateY(180deg);
}

.mtg-card.flipped .back {
    transform: rotateY(0deg);
}

#hand-container {
    height: 200px;
    overflow-x: auto;
}

#placeholder-row {
    background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.5));
    color: var(--goldfish-gold);
}

#state-col {
    color: var(--goldfish-gold);
}

.mana-pool-counter {
    position: relative;
    color: white;
    left: 10px;
    top: -25px;
}

#table {
    height: calc(100vh - 228px);
}

#graveyard-placeholder,
#exile-placeholder,
#sideboard-placeholder,
#commander-placeholder,
#library-placeholder {
    width: 125px;
    height: 172px;
}

#graveyard-title,
#exile-title,
#sideboard-title,
#commander-title,
#library-title,
#hand-title,
#custom-counter-label {
    cursor: pointer;
}

.copy-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--goldfish-gold);
    font-size: 14px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    user-select: none;
}

.commander-tax {
    margin-top: 4px;
    font-size: 13px;
    color: var(--goldfish-gold);
    cursor: pointer;
    user-select: none;
}

#hand-placeholder {
    height: 172px;
}

.card-placeholder {
    border: 1px dotted var(--goldfish-gold);
    border-radius: 5px;
}

body {
    background-image: url("../img/playmat.webp");
    background-size: cover;
}

.popover-body {
    overflow-y: auto;
}

.counter {
    color: var(--goldfish-gold);
    cursor: pointer;
    -webkit-text-stroke: 1px black;
}

.row-mana {
	padding-right: 20px;
}

#helpModal .modal-content,
#aboutModal .modal-content,
#zoneModal .modal-content {
    background-image: var(--goldfish-bg);
    color: var(--goldfish-gold);
}

.marked {
    border: 3px solid var(--goldfish-gold);
}

.handle {
    width: 100%;
    height: 50%;
    position: absolute;
    z-index: 10;
    right: 0px;
}

/* ── Dice roller ─────────────────────────────────────── */
.dice-container {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 100;
    display: inline-block;
    width: fit-content;
    height: fit-content;
}
.dice-container:active { cursor: grabbing; }

.dice-inner { display: inline-block; }

/* Right-click context menu */
.dice-context-menu {
    position: fixed;
    background: #1e1e1e;
    border: 1px solid var(--goldfish-gold);
    border-radius: 6px;
    z-index: 9999;
    min-width: 180px;
    padding: 4px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.dice-context-menu-item {
    padding: 8px 16px;
    color: var(--goldfish-gold);
    cursor: pointer;
    font-size: 13px;
}
.dice-context-menu-item:hover {
    background: #333;
}

/* d6 3D cube */
.dice-perspective {
    width: 70px;
    height: 70px;
    perspective: 300px;
}

.dice-d6 {
    width: 70px;
    height: 70px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

.dice-face {
    position: absolute;
    width: 70px;
    height: 70px;
    background: #f8f0d8;
    border: 2px solid #222;
    border-radius: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face-front  { transform: translateZ(35px); }
.face-back   { transform: rotateY(180deg) translateZ(35px); }
.face-right  { transform: rotateY(90deg) translateZ(35px); }
.face-left   { transform: rotateY(-90deg) translateZ(35px); }
.face-top    { transform: rotateX(90deg) translateZ(35px); }
.face-bottom { transform: rotateX(-90deg) translateZ(35px); }

.dice-pip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 54px;
    height: 54px;
}

.dice-pip-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pip {
    width: 11px;
    height: 11px;
    background: #111;
    border-radius: 50%;
}

/* d20 polygon */
.dice-d20 {
    width: 90px;
    height: 90px;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    background: linear-gradient(135deg, #1a1a2e, #2a2a5e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-d20-number {
    font-size: 30px;
    font-weight: bold;
    color: var(--goldfish-gold);
    padding-top: 12px;
}

@keyframes dice-shake {
    0%,100% { transform: rotate(0deg); }
    20%      { transform: rotate(-15deg); }
    40%      { transform: rotate(15deg); }
    60%      { transform: rotate(-10deg); }
    80%      { transform: rotate(10deg); }
}

.dice-d20.rolling {
    animation: dice-shake 0.15s infinite;
}

/* Coin */
.coin-perspective {
    width: 80px;
    height: 80px;
    perspective: 300px;
}

.coin {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease-out;
}

.coin-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    font-weight: bold;
    font-size: 18px;
    color: #1a1a1a;
    user-select: none;
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.3), inset 2px 2px 6px rgba(255,255,255,0.3);
}

.coin-heads {
    background: radial-gradient(circle at 38% 38%, #f5e47e, #c89010, #a07000);
    border: 3px solid #8a6000;
}

.coin-tails {
    background: radial-gradient(circle at 38% 38%, #e0e0e0, #aaaaaa, #888888);
    border: 3px solid #666;
    transform: rotateY(180deg);
}
