/* ── ALDEAS ───────────────────────────────────────────────────────────────── */
:root {
    --ald-ink:    #2a1a0e;
    --ald-bg:     #f5ede0;
    --ald-bg-dk:  #ede0c8;
    --ald-red:    #8b1a1a;
    --ald-gold:   #c9a84c;
    --ald-green:  #2a7a2a;
    --ald-parch:  #faf5e4;
    --ald-border: rgba(139,26,26,.2);
    --ald-text:   #2a1a0e;
    --ald-text-lt: #7a5a30;
}

.ryou-aldea-wrap { font-family: 'Amaranth', sans-serif; max-width: 960px; margin: 0 auto; }

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.ryou-aldea-header {
    display: flex; align-items: center; gap: 1.2rem;
    background: var(--ald-ink); border: 1px solid var(--ald-border);
    border-radius: 10px; padding: 1.2rem 1.5rem; margin-bottom: 1rem;
    position: relative; overflow: hidden;
}
.ryou-aldea-header::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(201,168,76,.06));
    pointer-events: none;
}
.ryou-aldea-logo {
    width: 80px; height: 80px; object-fit: cover; border-radius: 8px;
    border: 2px solid var(--ald-gold); flex-shrink: 0;
}
.ryou-aldea-nombre {
    font-family: 'Cinzel', serif; font-size: 1.6rem; color: #fff; margin: 0 0 .3rem;
}
.ryou-aldea-pais {
    display: flex; align-items: center; gap: .4rem;
    font-size: 13px; color: rgba(255,255,255,.5);
}
.ryou-aldea-pais-img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; }
.ryou-aldea-rol-badge {
    display: inline-block; font-size: 11px; font-weight: 700;
    padding: .15rem .6rem; border-radius: 20px; margin-top: .4rem;
    text-transform: uppercase; letter-spacing: .06em;
}
.ryou-aldea-rol--lider   { background: rgba(201,168,76,.2); color: var(--ald-gold); border: 1px solid rgba(201,168,76,.4); }
.ryou-aldea-rol--oficial { background: rgba(139,26,26,.2);  color: #e88;            border: 1px solid rgba(139,26,26,.4); }
.ryou-aldea-rol--miembro { background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.1); }

/* ── RECURSOS BAR ────────────────────────────────────────────────────────── */
.ryou-aldea-recursos-bar {
    display: flex; flex-wrap: wrap; gap: 1px;
    background: var(--ald-border); border: 1px solid var(--ald-border);
    border-radius: 8px; overflow: hidden; margin-bottom: 1rem;
}
.ryou-aldea-recurso {
    flex: 1; min-width: 90px;
    background: var(--ald-parch);
    display: flex; flex-direction: column; align-items: center;
    padding: .7rem .5rem; gap: .25rem;
    transition: background .15s;
}
.ryou-aldea-recurso:hover { background: var(--ald-bg-dk); }
.ryou-aldea-recurso-icon  { width: 25px; height: 25px; object-fit: contain; }
.ryou-aldea-recurso-label { font-size: 11px; color: var(--ald-text-lt); text-transform: uppercase; letter-spacing: .07em; }
.ryou-aldea-recurso-val   { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--ald-red); }
.ryou-aldea-recurso-val.ryou-neg { color: #c00; }
.ryou-aldea-recurso--ryous .ryou-aldea-recurso-val { color: var(--ald-green); }

/* ── TABS ────────────────────────────────────────────────────────────────── */
.ryou-aldea-tabs {
    display: flex; gap: 2px; margin-bottom: 1rem;
    background: var(--ald-border); border: 1px solid var(--ald-border);
    border-radius: 8px; overflow: hidden; padding: 3px;
}
.ryou-aldea-tab {
    flex: 1; padding: .5rem .4rem; font-family: 'Amaranth', sans-serif;
    font-size: 13px; font-weight: 700; color: var(--ald-text-lt);
    background: var(--ald-parch); border: none; border-radius: 5px; cursor: pointer;
    transition: background .15s, color .15s; white-space: nowrap;
}
.ryou-aldea-tab:hover  { background: var(--ald-bg-dk); color: var(--ald-red); }
.ryou-aldea-tab.active { background: var(--ald-ink); color: var(--ald-gold); box-shadow: inset 0 0 0 1px var(--ald-border); }
.ryou-aldea-tab-content { display: none; background: var(--ald-parch); border-radius: 0 0 8px 8px; padding: .8rem; border: 1px solid var(--ald-border); border-top: none; }
.ryou-aldea-tab-content.active { display: block; }

/* ── TERRITORIOS ─────────────────────────────────────────────────────────── */
.ryou-aldea-territorios-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: .8rem;
}
.ryou-aldea-territorio-card {
    background: #fff; border: 1px solid rgba(42,122,42,.35);
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.ryou-aldea-territorio-card img { width:100%; height:120px; object-fit:cover; }
.ryou-aldea-territorio-img-ph  { width:100%; height:120px; display:flex; align-items:center; justify-content:center; font-size:2.5rem; background:rgba(255,255,255,.03); }
.ryou-aldea-territorio-info { padding:.6rem .8rem; display:flex; flex-direction:column; gap:.2rem; }
.ryou-aldea-territorio-info strong { font-size:14px; color:var(--ald-ink); }
.ryou-aldea-territorio-ref  { font-size:11px; color:var(--ald-text-lt); }
.ryou-aldea-territorio-recursos { font-size:12px; color:var(--ald-red); font-weight:600; }
.ryou-aldea-blindado { font-size:11px; color:#7dca7d; }

/* ── EDIFICIOS LIST ──────────────────────────────────────────────────────── */
.ryou-aldea-edificios-list { display:flex; flex-direction:column; gap:2px; }
.ryou-aldea-edificio-row {
    display:flex; align-items:center; gap:.7rem;
    background:#fff; border:1px solid rgba(0,0,0,.08);
    border-radius:6px; padding:.5rem .8rem; border-left:3px solid transparent;
    box-shadow:0 1px 4px rgba(0,0,0,.05);
}
.ryou-aldea-edificio--activo       { border-left-color: var(--ald-green); }
.ryou-aldea-edificio--en_construccion { border-left-color: var(--ald-gold); }
.ryou-aldea-edificio--destruido    { border-left-color: var(--ald-red); }
.ryou-aldea-edificio-img { width:44px; height:44px; object-fit:cover; border-radius:6px; flex-shrink:0; }
.ryou-aldea-edificio-img-ph { width:44px; height:44px; display:flex; align-items:center; justify-content:center; font-size:1.5rem; background:rgba(255,255,255,.04); border-radius:6px; }
.ryou-aldea-edificio-info { flex:1; display:flex; flex-direction:column; gap:.15rem; }
.ryou-aldea-edificio-info strong { font-size:13px; color:var(--ald-ink); }
.ryou-aldea-edificio-nivel { font-size:11px; color:var(--ald-text-lt); }
.ryou-aldea-edificio-status { font-size:12px; }
.ryou-building { color: var(--ald-gold); }

/* ── MISIONES ────────────────────────────────────────────────────────────── */
.ryou-aldea-mision-row {
    display:flex; flex-wrap:wrap; gap:.5rem; align-items:center;
    background:#fff; border:1px solid rgba(0,0,0,.08);
    border-radius:6px; padding:.5rem .8rem; margin-bottom:2px;
}
.ryou-aldea-mision-tipo       { font-weight:700; font-size:13px; color:var(--ald-gold); }
.ryou-aldea-mision-territorio { font-size:13px; color:var(--ald-ink); }
.ryou-aldea-mision-vs         { font-size:12px; color:var(--ald-text-lt); }
.ryou-aldea-mision-caduca     { font-size:11px; color:var(--ald-red); margin-left:auto; }
.ryou-aldea-lanzar-mision h4  { font-size:14px; color:rgba(255,255,255,.7); margin:0 0 .6rem; }
.ryou-aldea-mision-form { display:flex; flex-direction:column; gap:.5rem; max-width:500px; }
.ryou-aldea-mision-form select,
.ryou-aldea-mision-form input,
.ryou-aldea-mision-form textarea {
    background:#fff; border:1px solid rgba(139,26,26,.25);
    color:var(--ald-ink); border-radius:5px; padding:.4rem .6rem;
    font-family:'Amaranth',sans-serif; font-size:13px;
}
.ryou-aldea-mision-msg { font-size:13px; padding:.4rem .6rem; border-radius:4px; display:none; }

/* ── CONSTRUIR GRID ──────────────────────────────────────────────────────── */
.ryou-aldea-construir-grid {
    display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:.8rem;
}
.ryou-aldea-construir-card {
    background:#fff; border:1px solid rgba(0,0,0,.1);
    border-radius:8px; overflow:hidden; display:flex; flex-direction:column;
    transition: border-color .15s, box-shadow .15s;
    box-shadow:0 2px 6px rgba(0,0,0,.05);
}
.ryou-aldea-construir-card:hover { box-shadow:0 4px 12px rgba(139,26,26,.15); border-color:var(--ald-red); }
.ryou-aldea-construir-card--activo   { border-color: rgba(42,122,42,.4); }
.ryou-aldea-construir-card--bloqueado{ opacity:.6; }
.ryou-aldea-construir-img { width:100%; height:100px; object-fit:cover; }
.ryou-aldea-construir-body { padding:.6rem .8rem; flex:1; display:flex; flex-direction:column; gap:.25rem; }
.ryou-aldea-construir-body strong { font-size:13px; color:var(--ald-ink); }
.ryou-aldea-construir-ref  { font-size:11px; color:var(--ald-text-lt); }
.ryou-aldea-construir-costes {
    display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.2rem;
}
.ryou-aldea-construir-costes span { font-size:11px; color:var(--ald-red); font-weight:600; }
.ryou-aldea-construir-costes span.ryou-neg { color:#e55; }
.ryou-aldea-construir-tiempo { color:var(--ald-text-lt) !important; font-style:italic; }
.ryou-aldea-construir-req {
    margin-top:.2rem; font-size:11px; color:var(--ald-text-lt);
}
.ryou-aldea-construir-req summary { cursor:pointer; }
.ryou-aldea-construir-req p { margin:.2rem 0 0; line-height:1.5; }
.ryou-aldea-construir-action { padding:.5rem .8rem; border-top:1px solid rgba(0,0,0,.07); }
.ryou-aldea-construir-status { font-size:12px; }

/* ── DIRECTORIO ──────────────────────────────────────────────────────────── */
.ryou-aldeas-directorio {
    display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem;
}
.ryou-aldea-dir-card {
    background:var(--ald-ink); border:1px solid var(--ald-border);
    border-radius:10px; overflow:hidden;
    transition:transform .2s,box-shadow .2s;
}
.ryou-aldea-dir-card:hover { transform:translateY(-3px); box-shadow:0 6px 20px rgba(139,26,26,.3); }
.ryou-aldea-dir-img { width:100%; height:140px; object-fit:cover; }
.ryou-aldea-dir-info { padding:.8rem; }
.ryou-aldea-dir-nombre { font-family:'Cinzel',serif; font-size:1rem; color:#fff; margin:0 0 .3rem; }
.ryou-aldea-dir-pais   { font-size:12px; color:rgba(255,255,255,.4); margin-bottom:.3rem; }
.ryou-aldea-dir-stats  { font-size:12px; color:var(--ald-gold); }

/* ── TERRITORIOS MAPA ────────────────────────────────────────────────────── */
.ryou-territorios-wrap { font-family:'Amaranth',sans-serif; }
.ryou-territorios-leyenda {
    display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1.2rem;
    padding:.6rem; background:rgba(255,255,255,.04); border-radius:6px;
}
.ryou-territorio-leyenda-item { font-size:12px; padding:.2rem .6rem; border-radius:20px; }
.ryou-territorios-pais-section { margin-bottom:2rem; }
.ryou-territorios-pais-title {
    font-family:'Cinzel',serif; font-size:1.1rem; color:var(--ald-gold);
    border-bottom:1px solid var(--ald-border); padding-bottom:.4rem; margin-bottom:.8rem;
}
.ryou-territorios-grid {
    display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:.7rem;
}
.ryou-territorio-card {
    background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.08);
    border-radius:8px; overflow:hidden; font-size:13px;
}
.ryou-territorio-card img { width:100%; height:100px; object-fit:cover; display:block; }
.ryou-territorio-img-ph { width:100%; height:100px; display:flex; align-items:center; justify-content:center; font-size:2rem; background:rgba(255,255,255,.03); }
.ryou-territorio--neutral     { border-color: rgba(200,200,200,.2); }
.ryou-territorio--reclamado   { border-color: rgba(255,200,0,.35); }
.ryou-territorio--consolidado { border-color: rgba(42,122,42,.4); }
.ryou-territorio--conflicto   { border-color: rgba(139,26,26,.5); }
.ryou-territorio-card-body { padding:.5rem .7rem; display:flex; flex-direction:column; gap:.18rem; }
.ryou-territorio-header { display:flex; justify-content:space-between; align-items:center; }
.ryou-territorio-ref   { font-size:10px; color:rgba(255,255,255,.3); font-weight:700; text-transform:uppercase; }
.ryou-territorio-estado-badge { font-size:11px; }
.ryou-territorio-nombre { font-size:13px; font-weight:700; color:#fff; }
.ryou-territorio-loc    { font-size:11px; color:rgba(255,255,255,.35); }
.ryou-territorio-aldea  { font-size:11px; color:#7dca7d; }
.ryou-territorio-recursos { display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.2rem; }
.ryou-territorio-recursos span { font-size:11px; color:var(--ald-gold); }
.ryou-territorio-blindado { font-size:11px; color:#7dca7d; }

.ryou-territorio-leyenda-item.ryou-territorio--neutral     { background:rgba(200,200,200,.1); color:rgba(255,255,255,.6); }
.ryou-territorio-leyenda-item.ryou-territorio--reclamado   { background:rgba(255,200,0,.1);   color:#ffd700; }
.ryou-territorio-leyenda-item.ryou-territorio--consolidado { background:rgba(42,122,42,.15);  color:#7dca7d; }
.ryou-territorio-leyenda-item.ryou-territorio--conflicto   { background:rgba(139,26,26,.15);  color:#e88; }

@media(max-width:600px){
    .ryou-aldea-recursos-bar { flex-direction:column; }
    .ryou-aldea-tabs { flex-wrap:wrap; }
    .ryou-aldea-tab  { flex:unset; width:48%; }
}

/* Resource icons in construir cards */
.ryou-aldea-construir-costes img.ryou-res-icon {
    width: 16px; height: 16px; object-fit: contain; vertical-align: middle; margin-right: 2px;
}
/* Details summary arrow for desbloquea */
.ryou-aldea-construir-req summary {
    cursor: pointer; font-weight: 700; color: var(--ald-red);
    list-style: none; display: flex; align-items: center; gap: .3rem;
}
.ryou-aldea-construir-req summary::before {
    content: '▶'; font-size: 9px; transition: transform .2s; flex-shrink: 0;
}
.ryou-aldea-construir-req[open] summary::before { transform: rotate(90deg); }
.ryou-aldea-construir-req summary::-webkit-details-marker { display: none; }

/* ── HISTORIAL ────────────────────────────────────────────────────────────── */
.ryou-aldea-historial-list { display:flex; flex-direction:column; gap:2px; }
.ryou-aldea-historial-row {
    display:flex; gap:.7rem; align-items:flex-start;
    background:#fff; border:1px solid rgba(0,0,0,.07); border-radius:6px;
    padding:.5rem .8rem; border-left:3px solid var(--ald-gold);
}
.ryou-aldea-historial-avatar {
    width:36px; height:36px; border-radius:50%; object-fit:cover;
    border:1px solid rgba(0,0,0,.1); flex-shrink:0;
}
.ryou-aldea-historial-avatar-ph {
    width:36px; height:36px; border-radius:50%; background:rgba(0,0,0,.06);
    display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0;
}
.ryou-aldea-historial-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:.15rem; }
.ryou-aldea-historial-tipo { font-size:13px; font-weight:700; color:var(--ald-ink); }
.ryou-aldea-historial-quien { font-size:12px; color:var(--ald-text-lt); }
.ryou-aldea-historial-nota  { font-size:12px; color:var(--ald-text-lt); font-style:italic; }
.ryou-aldea-historial-delta { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.15rem; }
.ryou-aldea-historial-delta span { font-size:12px; font-weight:700; }
.ryou-aldea-historial-fecha {
    font-size:11px; color:var(--ald-text-lt); flex-shrink:0; white-space:nowrap;
}
.ryou-pos { color: var(--ald-green); }
.ryou-neg { color: var(--ald-red); }

/* ── REQUISITOS EN TARJETAS ──────────────────────────────────────────────── */
.ryou-aldea-construir-req-list {
    display: flex; flex-wrap: wrap; gap: .25rem;
    margin-top: .3rem; align-items: center;
}
.ryou-aldea-req-label {
    font-size: 11px; color: var(--ald-text-lt); font-weight: 700;
    white-space: nowrap;
}
.ryou-aldea-req-item {
    font-size: 11px; padding: .1rem .35rem; border-radius: 3px;
    white-space: nowrap;
}
.ryou-req-met      { background: rgba(42,122,42,.1);  color: var(--ald-green); }
.ryou-req-building { background: rgba(201,168,76,.15); color: #8a6800; }
.ryou-req-missing  { background: rgba(139,26,26,.1);  color: var(--ald-red); }

/* ── CATEGORY TITLES IN CONSTRUIR ────────────────────────────────────────── */
.ryou-aldea-construir-categoria { margin-bottom: 1.5rem; }
.ryou-aldea-cat-title {
    font-family: 'Cinzel', serif; font-size: .85rem; font-weight: 700;
    color: var(--ald-red); text-transform: uppercase; letter-spacing: .08em;
    margin: 0 0 .5rem; padding-bottom: .3rem;
    border-bottom: 1px solid rgba(139,26,26,.2);
}

/* ── MISSION LAUNCH BUTTON ───────────────────────────────────────────────── */
.ryou-aldea-lanzar-titulo {
    font-size: 13px; font-weight: 700; color: var(--ald-ink); margin: 0 0 .5rem;
}

/* Own aldea missions highlighted */
.ryou-aldea-mision-row--propia {
    border-left-color: var(--ald-red);
    background: rgba(139,26,26,.04);
}
