/* =========================================================
   MTG Advanced Kingdoms — stylesheet
   Dynamic role colours are injected as CSS custom properties
   via inline style on .role-card elements:
       style="--role-color: #…; --role-border: #…"
   ========================================================= */

/* ----- Reset -------------------------------------------- */

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

/* ----- Base --------------------------------------------- */

body {
    font-family: 'Georgia', serif;
    background: #0d0d0d;
    color: #e8d5a3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ----- Card container ----------------------------------- */

.card {
    background: #1a1208;
    border: 2px solid #5a4010;
    border-radius: 12px;
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 0 40px rgba(180, 120, 0, 0.15);
}

/* ----- Typography --------------------------------------- */

h1 {
    font-size: 1.8rem;
    color: #ffd700;
    margin-bottom: 0.3rem;
    text-align: center;
}

h2 {
    font-size: 1.3rem;
    color: #ffd700;
    margin-bottom: 1rem;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #a08840;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

a {
    color: #ffd700;
}

/* ----- Forms -------------------------------------------- */

label {
    display: block;
    margin-bottom: 0.3rem;
    color: #c9a84c;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    border: 1px solid #5a4010;
    background: #0d0d0d;
    color: #e8d5a3;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: #ffd700;
}

button {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #b8860b, #ffd700);
    color: #0d0d0d;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.03em;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.88;
}

/* ----- Feedback ----------------------------------------- */

.error {
    color: #ef5350;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.divider {
    border: none;
    border-top: 1px solid #3a2a08;
    margin: 1.2rem 0;
}

/* ----- Role card ----------------------------------------
   Expects CSS custom properties on the element:
       --role-color   (text colour for role name)
       --role-border  (border colour)
   -------------------------------------------------------- */

.role-card {
    border-radius: 10px;
    padding: 1.4rem;
    margin-bottom: 1.2rem;
    border: 2px solid var(--role-border, #5a4010);
    background: #0a0a0a;
}

.role-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}

.role-icon {
    font-size: 2rem;
}

.role-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--role-color, #e8d5a3);
}

/* .role-team removed — replaced by .role-type */

.role-type {
    font-size: 0.75rem;
    color: #a08840;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-top: 0.1rem;
}

/* ----- Card sections (victory / defeat / announce / passive) ----------- */

.card-section {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(90, 64, 16, 0.4);
}

.card-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0.5rem;
}

.section-label {
    font-size: 0.78rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.3rem;
}

.victory-label {
    color: #81c784;
}

.defeat-label {
    color: #e57373;
}

.announce-label {
    color: #ffd700;
}

.section-text {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #c9a84c;
}

.section-text.muted {
    color: #8a7050;
}

/* ----- Announce block -------------------------------------------------- */

.announce-section {
    background: rgba(255, 215, 0, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    margin-top: 0.65rem;
}

.announce-header {
    margin-bottom: 0.35rem;
}

.announce-reminder {
    font-size: 0.75rem;
    color: #7a6530;
    font-style: italic;
}

.announce-text {
    color: #dcc070;
}

.announce-timing {
    font-size: 0.78rem;
    color: #8a7050;
    margin-top: 0.3rem;
    font-style: italic;
}

/* ----- Passive block --------------------------------------------------- */

.passive-section {
    background: rgba(144, 202, 249, 0.05);
    border: 1px solid rgba(144, 202, 249, 0.12);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    margin-top: 0.65rem;
}

.passive-text {
    color: #90caf9;
    font-style: italic;
}

/* Legacy aliases (kept for backward compat, now unused by templates) */
.role-desc,
.role-win {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #c9a84c;
}

.role-win {
    margin-top: 0.6rem;
    color: #e8d5a3;
}

.role-life {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #e8d5a3;
}

.badge-public {
    display: inline-block;
    background: #ffd700;
    color: #0d0d0d;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ----- Share page --------------------------------------- */

.share-label {
    font-size: 0.9rem;
    color: #a08840;
    margin-bottom: 0.5rem;
}

.share-box {
    background: #0d0d0d;
    border: 1px dashed #5a4010;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #c9a84c;
    word-break: break-all;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.share-box:hover {
    border-color: #ffd700;
}

.copied-msg {
    display: none;
    color: #66bb6a;
    font-size: 0.85rem;
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 0.8rem;
}

.waiting {
    text-align: center;
    color: #a08840;
    font-size: 0.9rem;
    margin-top: 0.8rem;
}

.waiting strong {
    color: #ffd700;
}

/* ----- Player list (role view) ------------------------- */

.player-name {
    text-align: center;
    color: #a08840;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}

.player-name strong {
    color: #ffd700;
}

.players-list {
    margin-top: 1rem;
}

.players-list h3 {
    font-size: 0.9rem;
    color: #a08840;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #2a1e08;
    color: #c9a84c;
}

.player-item:last-child {
    border-bottom: none;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5a4010;
    flex-shrink: 0;
}

.dot.king {
    background: #ffd700;
}

.status {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #a08840;
}

/* ----- Join page ---------------------------------------- */

.join-count {
    font-size: 0.9rem;
    color: #a08840;
    margin-bottom: 1.2rem;
    text-align: center;
}

/* ----- Bandit crew section ----------------------------- */

.bandit-team {
    border: 1px solid #b71c1c;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
    background: rgba(183, 28, 28, 0.07);
}

.bandit-team h3 {
    font-size: 0.85rem;
    color: #ef9a9a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
    text-align: left;
}

.bandit-team .player-item em {
    color: #8a7050;
    font-style: italic;
}

.bandit-solo {
    font-size: 0.85rem;
    color: #8a7050;
    font-style: italic;
}

/* ----- Rules section ----------------------------------- */

.rules summary {
    cursor: pointer;
    color: #a08840;
    font-size: 0.9rem;
    user-select: none;
    list-style: none;
    text-align: center;
}

.rules summary::-webkit-details-marker {
    display: none;
}

.rules[open] summary {
    color: #ffd700;
    margin-bottom: 0.9rem;
}

.rules-list {
    padding-left: 1.2rem;
    color: #c9a84c;
    font-size: 0.83rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rules-list ul {
    margin-top: 0.35rem;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rules-list strong {
    color: #e8d5a3;
}

.rules-list em {
    color: #8a7050;
}

/* ----- Tips & Clarifications (card-level) ------------------------------ */

.card-tips {
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 0.6rem;
}

.card-tips summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: #9ab8d8;
    user-select: none;
    list-style: none;
    text-align: center;
}

.card-tips summary::-webkit-details-marker {
    display: none;
}

.card-tips[open] summary {
    color: #b8d8f8;
    margin-bottom: 0.6rem;
}

.tips-list {
    padding-left: 1.1rem;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #a0bcd8;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
}

.tips-clarifications-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6a8aaa;
    margin: 0.6rem 0 0.3rem;
    text-align: center;
}

.clarifications-list {
    color: #8aaac8;
    font-style: italic;
}
